Estou trabalho com GenericController nos meus controladores so que nos metodos adiciona tenho que fazer override em meu controlador alguem poderia me explicar como poderia manipular isso vi que no meu console imprimi isso quando eu nao sobrescrevo o metodo no controlador:
INFO: /cadindexador [POST] -> GenericoController.adiciona(Object)
E tambem acho eu quem monta isso e o DefaultRouteBuilder e extendi a classe PathAnnotationRoutesParser e fiz algumas customizacao se alguem puder me ajudar
@Component
@ApplicationScoped
public class CustomPathAnotationRoutes extends PathAnnotationRoutesParser {
private final Router router;
public CustomPathAnotationRoutes(Router router) {
super(router);
// TODO Auto-generated constructor stub
this.router = router;
}
@Override
protected String defaultUriFor(String controllerName, String methodName) {
// TODO Auto-generated method stub
if ((methodName.equals("adiciona")) || (methodName.equals("deletar")) || (methodName.equals("formulario"))) {
return controllerName.toLowerCase();
} else {
if ((methodName.equals("localizar")) || (methodName.equals("lista"))) {
return super.defaultUriFor(controllerName, methodName).toLowerCase();
} else {
return super.defaultUriFor(controllerName, methodName);
}
}
}
@Override
protected List<Route> registerRulesFor(Class<?> baseType) {
// TODO Auto-generated method stub
// TESTE
ParameterizedType parameterizedType = (ParameterizedType)baseType.getGenericSuperclass();
System.out.println((Class)parameterizedType.getActualTypeArguments()[0]);
System.out.println(baseType.getName());
List<Route> routes = new ArrayList<Route>();
for (Method javaMethod : baseType.getMethods()) {
if (isEligible(javaMethod)) {
System.out.println(baseType.getName());
String[] uris = getURIsFor(javaMethod, baseType);
for (String uri : uris) {
RouteBuilder rule = this.router.builderFor(uri);
Boolean ruleWith = false;
for (HttpMethod m : HttpMethod.values()) {
if (javaMethod.isAnnotationPresent(m.getAnnotation())) {
rule.with(m);
ruleWith = true;
}
}
//CODIFICACAO JVDS
if ((!ruleWith) && baseType.getSuperclass().getSimpleName().equals("GenericoController")) {
for (Method m : baseType.getSuperclass().getMethods()) {
if (m.getName().equals(javaMethod.getName())) {
for (HttpMethod j : HttpMethod.values()) {
if (m.isAnnotationPresent(j.getAnnotation())) {
rule.with(j);
}
}
}
}
}
//
if (javaMethod.isAnnotationPresent(Path.class)) {
rule.withPriority(javaMethod.getAnnotation(Path.class).priority());
}
rule.is(baseType, javaMethod);
rule.build();
routes.add(rule.build());
}
}
}
return routes;
}
}
qual é o erro que dá se vc não sobrescreve o método adiciona?
de qqer forma, baseType.getMethods() já inclui o GenericController.class.getMethods() (qdo existe a herança), vc não precisava ter customizado o método registerRulesFor.
qual é o erro que dá se vc não sobrescreve o método adiciona?
de qqer forma, baseType.getMethods() já inclui o GenericController.class.getMethods() (qdo existe a herança), vc não precisava ter customizado o método registerRulesFor.[/quote]
A exception que tomo e esta quando nao sobrescrevo o metodo adiciona no controlador.
br.com.caelum.vraptor.InterceptionException: exception raised, check root cause for details: java.lang.IllegalArgumentException: attempt to create saveOrUpdate event with null entity
at br.com.caelum.vraptor.interceptor.ExecuteMethodInterceptor.intercept(ExecuteMethodInterceptor.java:86)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:53)
at br.com.caelum.vraptor.interceptor.ExceptionHandlerInterceptor.intercept(ExceptionHandlerInterceptor.java:69)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:53)
at br.com.caelum.vraptor.core.LazyInterceptorHandler.execute(LazyInterceptorHandler.java:61)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:53)
at br.com.caelum.vraptor.interceptor.ParametersInstantiatorInterceptor.intercept(ParametersInstantiatorInterceptor.java:90)
at br.com.caelum.vraptor.core.LazyInterceptorHandler.execute(LazyInterceptorHandler.java:59)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:53)
at br.com.caelum.vraptor.interceptor.InstantiateInterceptor.intercept(InstantiateInterceptor.java:42)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:53)
at br.com.caelum.vraptor.interceptor.InterceptorListPriorToExecutionExtractor.intercept(InterceptorListPriorToExecutionExtractor.java:44)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:53)
at br.com.caelum.vraptor.interceptor.FlashInterceptor.intercept(FlashInterceptor.java:81)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:53)
at br.com.caelum.vraptor.interceptor.ResourceLookupInterceptor.intercept(ResourceLookupInterceptor.java:67)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:53)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:56)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:53)
at br.com.caelum.vraptor.core.DefaultRequestExecution.execute(DefaultRequestExecution.java:70)
at br.com.caelum.vraptor.VRaptor$1.insideRequest(VRaptor.java:92)
at br.com.caelum.vraptor.ioc.spring.SpringProvider.provideForRequest(SpringProvider.java:56)
at br.com.caelum.vraptor.VRaptor.doFilter(VRaptor.java:89)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:637)
Caused by: java.lang.IllegalArgumentException: attempt to create saveOrUpdate event with null entity
at org.hibernate.event.SaveOrUpdateEvent.<init>(SaveOrUpdateEvent.java:63)
at org.hibernate.event.SaveOrUpdateEvent.<init>(SaveOrUpdateEvent.java:46)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:701)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:697)
at org.springframework.orm.hibernate3.HibernateTemplate$12.doInHibernate(HibernateTemplate.java:686)
at org.springframework.orm.hibernate3.HibernateTemplate$12.doInHibernate(HibernateTemplate.java:1)
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:406)
at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)
at org.springframework.orm.hibernate3.HibernateTemplate.save(HibernateTemplate.java:683)
at br.com.jvds.telecon.spring.dao.DaoHibernateSpring.adiciona(DaoHibernateSpring.java:32)
at br.com.jvds.telecon.controller.GenericoController.adiciona(GenericoController.java:43)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at br.com.caelum.vraptor.interceptor.ExecuteMethodInterceptor.intercept(ExecuteMethodInterceptor.java:57)
... 40 more
certo, isso quer dizer que o VRaptor tá passando null pro método adiciona…
como vc está passando os parâmetros na requisição?
produto.nome=Banana
ou
object.nome=Banana
(onde object é o nome do parametro do metodo adiciona no GenericController)
[quote=Lucas Cavalcanti]certo, isso quer dizer que o VRaptor tá passando null pro método adiciona…
como vc está passando os parâmetros na requisição?
produto.nome=Banana
ou
object.nome=Banana
(onde object é o nome do parametro do metodo adiciona no GenericController)[/quote]
Nos jsp meus estao com o nome real das entidades ou seja na input name=“produto.nome”
o VRaptor só vai conseguir popular usando o nome do parametro do GenericController…
mas vc pode hackear isso
crie uma classe igual a essa:
e na linha 94 vc vê se é a lógica adiciona (ou atualiza) do
GenericController, e nesse caso use o nome da classe (method.getResource().getType().getSimpleName() - “Controller”, primeira minuscula)
[quote=Lucas Cavalcanti]o VRaptor só vai conseguir popular usando o nome do parametro do GenericController…
mas vc pode hackear isso
crie uma classe igual a essa:
e na linha 94 vc vê se é a lógica adiciona (ou atualiza) do
GenericController, e nesse caso use o nome da classe (method.getResource().getType().getSimpleName() - “Controller”, primeira minuscula)
[/quote]
Fiz o que voce me falou e estou recebendo esta exception aqui
br.com.caelum.vraptor.http.InvalidParameterException: unable to retrieve values to invoke method
at br.com.jvds.vraptor.custom.CustomOgnlParametersProvider.getParametersFor(CustomOgnlParametersProvider.java:102)
at br.com.caelum.vraptor.interceptor.ParametersInstantiatorInterceptor.getParametersFor(ParametersInstantiatorInterceptor.java:108)
at br.com.caelum.vraptor.interceptor.ParametersInstantiatorInterceptor.intercept(ParametersInstantiatorInterceptor.java:78)
at br.com.caelum.vraptor.core.LazyInterceptorHandler.execute(LazyInterceptorHandler.java:59)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:53)
at br.com.caelum.vraptor.interceptor.InstantiateInterceptor.intercept(InstantiateInterceptor.java:42)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:53)
at br.com.caelum.vraptor.interceptor.InterceptorListPriorToExecutionExtractor.intercept(InterceptorListPriorToExecutionExtractor.java:44)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:53)
at br.com.caelum.vraptor.interceptor.FlashInterceptor.intercept(FlashInterceptor.java:81)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:53)
at br.com.caelum.vraptor.interceptor.ResourceLookupInterceptor.intercept(ResourceLookupInterceptor.java:67)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:53)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:56)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:53)
at br.com.caelum.vraptor.core.DefaultRequestExecution.execute(DefaultRequestExecution.java:70)
at br.com.caelum.vraptor.VRaptor$1.insideRequest(VRaptor.java:92)
at br.com.caelum.vraptor.ioc.spring.SpringProvider.provideForRequest(SpringProvider.java:56)
at br.com.caelum.vraptor.VRaptor.doFilter(VRaptor.java:89)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:637)
Caused by: java.lang.NoSuchMethodException: GenericoController$adiciona$1904627582$2.getCadindexador()
at java.lang.Class.getMethod(Class.java:1605)
at br.com.jvds.vraptor.custom.CustomOgnlParametersProvider.getParametersFor(CustomOgnlParametersProvider.java:98)
... 34 more
[quote=Lucas Cavalcanti]é um dos componentes que deve estar fazendo cache erradamente…
só pra confirmar, crie a classe:
@Component
@ApplicationScoped
public class CustomTypeCreator extends AsmBasedTypeCreator{...}
[/quote]
Criei a classe na hora que subo a aplicacao ja da exception no console.
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'stereotypedBeansRegistrar': Unsatisfied dependency expressed through constructor argument with index 0 of type [java.util.List]: : Error creating bean with name 'stereotypeHandler': Unsatisfied dependency expressed through constructor argument with index 0 of type [br.com.caelum.vraptor.http.route.Router]: : Error creating bean with name 'defaultRouter': Unsatisfied dependency expressed through constructor argument with index 2 of type [br.com.caelum.vraptor.http.TypeCreator]: : No unique bean of type [br.com.caelum.vraptor.http.TypeCreator] is defined: more than one 'primary' bean found among candidates: [asmBasedTypeCreator, customTypeCreator, cacheBasedTypeCreator]; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [br.com.caelum.vraptor.http.TypeCreator] is defined: more than one 'primary' bean found among candidates: [asmBasedTypeCreator, customTypeCreator, cacheBasedTypeCreator]; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'defaultRouter': Unsatisfied dependency expressed through constructor argument with index 2 of type [br.com.caelum.vraptor.http.TypeCreator]: : No unique bean of type [br.com.caelum.vraptor.http.TypeCreator] is defined: more than one 'primary' bean found among candidates: [asmBasedTypeCreator, customTypeCreator, cacheBasedTypeCreator]; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [br.com.caelum.vraptor.http.TypeCreator] is defined: more than one 'primary' bean found among candidates: [asmBasedTypeCreator, customTypeCreator, cacheBasedTypeCreator]; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'stereotypeHandler': Unsatisfied dependency expressed through constructor argument with index 0 of type [br.com.caelum.vraptor.http.route.Router]: : Error creating bean with name 'defaultRouter': Unsatisfied dependency expressed through constructor argument with index 2 of type [br.com.caelum.vraptor.http.TypeCreator]: : No unique bean of type [br.com.caelum.vraptor.http.TypeCreator] is defined: more than one 'primary' bean found among candidates: [asmBasedTypeCreator, customTypeCreator, cacheBasedTypeCreator]; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [br.com.caelum.vraptor.http.TypeCreator] is defined: more than one 'primary' bean found among candidates: [asmBasedTypeCreator, customTypeCreator, cacheBasedTypeCreator]; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'defaultRouter': Unsatisfied dependency expressed through constructor argument with index 2 of type [br.com.caelum.vraptor.http.TypeCreator]: : No unique bean of type [br.com.caelum.vraptor.http.TypeCreator] is defined: more than one 'primary' bean found among candidates: [asmBasedTypeCreator, customTypeCreator, cacheBasedTypeCreator]; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [br.com.caelum.vraptor.http.TypeCreator] is defined: more than one 'primary' bean found among candidates: [asmBasedTypeCreator, customTypeCreator, cacheBasedTypeCreator]
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:730)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:196)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1003)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:907)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.context.event.AbstractApplicationEventMulticaster.getApplicationListeners(AbstractApplicationEventMulticaster.java:148)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:86)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:303)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:911)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:428)
at br.com.caelum.vraptor.ioc.spring.SpringBasedContainer.start(SpringBasedContainer.java:68)
at br.com.caelum.vraptor.ioc.spring.SpringProvider.start(SpringProvider.java:82)
at br.com.caelum.vraptor.VRaptor.init(VRaptor.java:110)
at br.com.caelum.vraptor.VRaptor.init(VRaptor.java:103)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4001)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4651)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
at org.apache.catalina.core.StandardService.start(StandardService.java:519)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'stereotypeHandler': Unsatisfied dependency expressed through constructor argument with index 0 of type [br.com.caelum.vraptor.http.route.Router]: : Error creating bean with name 'defaultRouter': Unsatisfied dependency expressed through constructor argument with index 2 of type [br.com.caelum.vraptor.http.TypeCreator]: : No unique bean of type [br.com.caelum.vraptor.http.TypeCreator] is defined: more than one 'primary' bean found among candidates: [asmBasedTypeCreator, customTypeCreator, cacheBasedTypeCreator]; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [br.com.caelum.vraptor.http.TypeCreator] is defined: more than one 'primary' bean found among candidates: [asmBasedTypeCreator, customTypeCreator, cacheBasedTypeCreator]; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'defaultRouter': Unsatisfied dependency expressed through constructor argument with index 2 of type [br.com.caelum.vraptor.http.TypeCreator]: : No unique bean of type [br.com.caelum.vraptor.http.TypeCreator] is defined: more than one 'primary' bean found among candidates: [asmBasedTypeCreator, customTypeCreator, cacheBasedTypeCreator]; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [br.com.caelum.vraptor.http.TypeCreator] is defined: more than one 'primary' bean found among candidates: [asmBasedTypeCreator, customTypeCreator, cacheBasedTypeCreator]
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:730)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:196)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1003)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:907)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:844)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:744)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:703)
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:795)
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:723)
... 36 more
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'defaultRouter': Unsatisfied dependency expressed through constructor argument with index 2 of type [br.com.caelum.vraptor.http.TypeCreator]: : No unique bean of type [br.com.caelum.vraptor.http.TypeCreator] is defined: more than one 'primary' bean found among candidates: [asmBasedTypeCreator, customTypeCreator, cacheBasedTypeCreator]; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [br.com.caelum.vraptor.http.TypeCreator] is defined: more than one 'primary' bean found among candidates: [asmBasedTypeCreator, customTypeCreator, cacheBasedTypeCreator]
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:730)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:196)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1003)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:907)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:844)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:786)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:703)
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:795)
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:723)
... 50 more
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [br.com.caelum.vraptor.http.TypeCreator] is defined: more than one 'primary' bean found among candidates: [asmBasedTypeCreator, customTypeCreator, cacheBasedTypeCreator]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.determinePrimaryCandidate(DefaultListableBeanFactory.java:868)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:794)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:703)
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:795)
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:723)
... 64 more
acho que ele resolve o problema de caching
[]'s[/quote]
Lucas, agora coloquei esse novo jar la na aplicacao desabilitei public class CustomTypeCreator extends AsmBasedTypeCreator {}, mas agora subi a aplicacao quando mando abrir um formulario.
java.lang.NullPointerException
at br.com.jvds.vraptor.custom.CustomOgnlParametersProvider.createViaOgnl(CustomOgnlParametersProvider.java:135)
at br.com.jvds.vraptor.custom.CustomOgnlParametersProvider.createRoot(CustomOgnlParametersProvider.java:109)
at br.com.jvds.vraptor.custom.CustomOgnlParametersProvider.getParametersFor(CustomOgnlParametersProvider.java:85)
at br.com.caelum.vraptor.interceptor.ParametersInstantiatorInterceptor.getParametersFor(ParametersInstantiatorInterceptor.java:108)
at br.com.caelum.vraptor.interceptor.ParametersInstantiatorInterceptor.intercept(ParametersInstantiatorInterceptor.java:78)
at br.com.caelum.vraptor.core.LazyInterceptorHandler.execute(LazyInterceptorHandler.java:59)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:53)
at br.com.caelum.vraptor.interceptor.InstantiateInterceptor.intercept(InstantiateInterceptor.java:42)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:53)
at br.com.caelum.vraptor.interceptor.InterceptorListPriorToExecutionExtractor.intercept(InterceptorListPriorToExecutionExtractor.java:44)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:53)
at br.com.caelum.vraptor.interceptor.FlashInterceptor.intercept(FlashInterceptor.java:81)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:53)
at br.com.caelum.vraptor.interceptor.ResourceLookupInterceptor.intercept(ResourceLookupInterceptor.java:67)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:53)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:56)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:53)
at br.com.caelum.vraptor.core.DefaultRequestExecution.execute(DefaultRequestExecution.java:70)
at br.com.caelum.vraptor.VRaptor$1.insideRequest(VRaptor.java:92)
at br.com.caelum.vraptor.ioc.spring.SpringProvider.provideForRequest(SpringProvider.java:56)
at br.com.caelum.vraptor.VRaptor.doFilter(VRaptor.java:89)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:637)
java.lang.NullPointerException
at br.com.jvds.vraptor.custom.CustomOgnlParametersProvider.createViaOgnl(CustomOgnlParametersProvider.java:135)
at br.com.jvds.vraptor.custom.CustomOgnlParametersProvider.createRoot(CustomOgnlParametersProvider.java:109)
qual é a linha 135 da classe CustomOgnlParametersProvider?
[quote=Lucas Cavalcanti]
java.lang.NullPointerException
at br.com.jvds.vraptor.custom.CustomOgnlParametersProvider.createViaOgnl(CustomOgnlParametersProvider.java:135)
at br.com.jvds.vraptor.custom.CustomOgnlParametersProvider.createRoot(CustomOgnlParametersProvider.java:109)
qual é a linha 135 da classe CustomOgnlParametersProvider?[/quote]
esse snapshot está funcionando, pelo menos pra esse nullpointer…
desculpe pela confusão =S[/quote]
olha lucas beleza parou de dar o NullPointer mas continua dando a mesma exception de antes.
br.com.caelum.vraptor.http.InvalidParameterException: unable to retrieve values to invoke method
at br.com.jvds.vraptor.custom.CustomOgnlParametersProvider.getParametersFor(CustomOgnlParametersProvider.java:102)
at br.com.caelum.vraptor.interceptor.ParametersInstantiatorInterceptor.getParametersFor(ParametersInstantiatorInterceptor.java:108)
at br.com.caelum.vraptor.interceptor.ParametersInstantiatorInterceptor.intercept(ParametersInstantiatorInterceptor.java:78)
at br.com.caelum.vraptor.core.LazyInterceptorHandler.execute(LazyInterceptorHandler.java:59)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:53)
at br.com.caelum.vraptor.interceptor.InstantiateInterceptor.intercept(InstantiateInterceptor.java:42)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:53)
at br.com.caelum.vraptor.interceptor.InterceptorListPriorToExecutionExtractor.intercept(InterceptorListPriorToExecutionExtractor.java:44)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:53)
at br.com.caelum.vraptor.interceptor.FlashInterceptor.intercept(FlashInterceptor.java:81)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:53)
at br.com.caelum.vraptor.interceptor.ResourceLookupInterceptor.intercept(ResourceLookupInterceptor.java:67)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:53)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:56)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:53)
at br.com.caelum.vraptor.core.DefaultRequestExecution.execute(DefaultRequestExecution.java:70)
at br.com.caelum.vraptor.VRaptor$1.insideRequest(VRaptor.java:92)
at br.com.caelum.vraptor.ioc.spring.SpringProvider.provideForRequest(SpringProvider.java:56)
at br.com.caelum.vraptor.VRaptor.doFilter(VRaptor.java:89)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:637)
Caused by: java.lang.NoSuchMethodException: GenericoController$adiciona$1904627582$1.getCadindexador()
at java.lang.Class.getMethod(Class.java:1605)
at br.com.jvds.vraptor.custom.CustomOgnlParametersProvider.getParametersFor(CustomOgnlParametersProvider.java:98)
... 34 more