opa galera desculpa o incomodo, porem to com uma dificuldade no spring, sera que vocês podem me ajudar?
application-model.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd">
<bean id="categoria" class="model.Categoria" />
<bean id="endereco" class="model.Endereco" />
<bean id="lance" class="model.Lance" />
<bean id="post" class="model.Post" />
<bean id="projeto" class="model.Projeto" />
<bean id="tipolance" class="model.TipoLance" />
<bean id="usuario" class="model.Usuario" />
</beans>
application-factorys.xml
[code]<?xml version="1.0" encoding="UTF-8"?>
application-model.xml [/code]ServiceLocator.java
package utils;
import org.apache.commons.lang.NullArgumentException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.access.BeanFactoryLocator;
import org.springframework.beans.factory.access.BeanFactoryReference;
import org.springframework.context.access.ContextSingletonBeanFactoryLocator;
public class ServiceLocator {
private static final ServiceLocator INSTANCE = new ServiceLocator();
private final BeanFactoryReference factoryReference;
private ServiceLocator() {
BeanFactoryLocator factoryLocator = ContextSingletonBeanFactoryLocator.getInstance();
factoryReference = factoryLocator.useBeanFactory("modelfactory");
}
public static ServiceLocator getInstance() {
return INSTANCE;
}
public Object getObject(String name) {
try {
if (name == null) {
throw new NullArgumentException("name");
}
BeanFactory factory = this.factoryReference.getFactory();
return factory.getBean(name);
} catch (RuntimeException exception) {
throw exception;
}
}
}
Problema: não consigo fazer minha fabrica funcionar gostaria de ajuda para fazer isso.
ultimo erro que obtive :org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named ‘modelfactory’ is defined.
status: atualmente estou acessando a classe via scriplet mesmo só para testes.
desde já muito obrigado a todos
.