Olá pessoal. Estou usando o VRaptor 3.4.1 e uso o Ognl, e faço exclussão do iogi, que foi uma recomendação do Lucas Cavalcanti no começo do meu desenvolvimento por alguns motivos.
Durante todo o desenv tudo funcionou muito bem, eu estava com problemas e essa substituição o resolveu.
O problema é que agora, depois de muito tempo, e estou recebendo essa exception, e não tenho ideia do que possa ser.
\--------------------------------------/
17:16:03,059 DEBUG [br.com.caelum.vraptor.http.ognl.OgnlParametersProvider] - Applying with []
17:16:03,059 DEBUG [br.com.caelum.vraptor.http.ognl.OgnlFacade] - unable to parse expression ''. Ignoring.
17:16:03,059 TRACE [br.com.caelum.vraptor.http.ognl.OgnlFacade] - Reason:
ognl.ExpressionSyntaxException: Malformed OGNL expression: [ognl.ParseException: Encountered "<EOF>" at line 1, column 0.
Was expecting one of:
":" ...
"not" ...
"+" ...
"-" ...
// e segue um erro gigante
Meu pom.xml
<!-- Outras dependencias -->
<dependency>
<groupId>br.com.caelum</groupId>
<artifactId>vraptor</artifactId>
<version>3.4.1</version>
<exclusions>
<exclusion>
<artifactId>iogi</artifactId>
<groupId>br.com.caelum</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>ognl</groupId>
<artifactId>ognl</artifactId>
<version>3.0.6</version>
</dependency>
<!-- Outras dependencias -->
Tive que fazer essa substituição porque precisava trazer listas aninhadas do html.
Mas quando eu volto a usar só o iogi, ele dá erro em outro lugar, e agora se uso o ognl, dá esse problema…
Alguém sabe me ajudar nessa?
Valeu galera, forte abraço!
Isso é só debug… pode ignorar… acontece quando existem parametros na requisição que o ognl não sabe tratar.
ou está estourando uma exceção mesmo?
Acabei esquecendo de postar a Exception, desculpe Lucas.
Segue o stacktrace todo
\--------------------------------------/
10:22:15,033 DEBUG [br.com.caelum.vraptor.http.ognl.OgnlParametersProvider] - Applying with [10]
10:22:15,034 DEBUG [br.com.caelum.vraptor.http.ognl.OgnlFacade] - unable to parse expression ''. Ignoring.
10:22:15,034 TRACE [br.com.caelum.vraptor.http.ognl.OgnlFacade] - Reason:
ognl.ExpressionSyntaxException: Malformed OGNL expression: [ognl.ParseException: Encountered "<EOF>" at line 1, column 0.
Was expecting one of:
":" ...
"not" ...
"+" ...
"-" ...
"~" ...
"!" ...
"(" ...
"true" ...
"false" ...
"null" ...
"#this" ...
"#root" ...
"#" ...
"[" ...
"{" ...
"@" ...
"new" ...
<IDENT> ...
<DYNAMIC_SUBSCRIPT> ...
"\'" ...
"`" ...
"\"" ...
<INT_LITERAL> ...
<FLT_LITERAL> ...
]
at ognl.Ognl.parseExpression(Ognl.java:112)
at ognl.Ognl.setValue(Ognl.java:783)
at br.com.caelum.vraptor.http.ognl.OgnlFacade.setValue(OgnlFacade.java:100)
at br.com.caelum.vraptor.http.ognl.OgnlParametersProvider.setProperty(OgnlParametersProvider.java:162)
at br.com.caelum.vraptor.http.ognl.OgnlParametersProvider.createParameter(OgnlParametersProvider.java:134)
at br.com.caelum.vraptor.http.ognl.OgnlParametersProvider.getParametersFor(OgnlParametersProvider.java:86)
at br.com.caelum.vraptor.interceptor.ParametersInstantiatorInterceptor.getParametersFor(ParametersInstantiatorInterceptor.java:126)
at br.com.caelum.vraptor.interceptor.ParametersInstantiatorInterceptor.intercept(ParametersInstantiatorInterceptor.java:83)
at br.com.caelum.vraptor.core.LazyInterceptorHandler.execute(LazyInterceptorHandler.java:59)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:54)
at br.com.nextrans.myone.component.interceptor.DataHoraInterceptor.intercept(DataHoraInterceptor.java:34)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:54)
at br.com.caelum.vraptor.core.LazyInterceptorHandler.execute(LazyInterceptorHandler.java:61)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:54)
at br.com.nextrans.myone.component.interceptor.BreadCrumbInterceptor.intercept(BreadCrumbInterceptor.java:40)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:54)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:56)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:54)
at br.com.nextrans.myone.component.interceptor.LoginInterceptor.intercept(LoginInterceptor.java:49)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:54)
at br.com.caelum.vraptor.environment.EnvironmentInterceptor.intercept(EnvironmentInterceptor.java:37)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:54)
at br.com.caelum.vraptor.interceptor.InstantiateInterceptor.intercept(InstantiateInterceptor.java:48)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:54)
at br.com.caelum.vraptor.interceptor.FlashInterceptor.intercept(FlashInterceptor.java:83)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:54)
at br.com.caelum.vraptor.interceptor.ExceptionHandlerInterceptor.intercept(ExceptionHandlerInterceptor.java:71)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:54)
at br.com.caelum.vraptor.interceptor.ResourceLookupInterceptor.intercept(ResourceLookupInterceptor.java:69)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:54)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:56)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:54)
at br.com.caelum.vraptor.core.EnhancedRequestExecution.execute(EnhancedRequestExecution.java:44)
at br.com.caelum.vraptor.VRaptor$1.insideRequest(VRaptor.java:91)
at br.com.caelum.vraptor.ioc.spring.SpringProvider.provideForRequest(SpringProvider.java:58)
at br.com.caelum.vraptor.VRaptor.doFilter(VRaptor.java:88)
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:291)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:662)
Caused by: ognl.ParseException: Encountered "<EOF>" at line 1, column 0.
Was expecting one of:
":" ...
"not" ...
"+" ...
"-" ...
"~" ...
"!" ...
"(" ...
"true" ...
"false" ...
"null" ...
"#this" ...
"#root" ...
"#" ...
"[" ...
"{" ...
"@" ...
"new" ...
<IDENT> ...
<DYNAMIC_SUBSCRIPT> ...
"\'" ...
"`" ...
"\"" ...
<INT_LITERAL> ...
<FLT_LITERAL> ...
at ognl.OgnlParser.generateParseException(OgnlParser.java:3172)
at ognl.OgnlParser.jj_consume_token(OgnlParser.java:3051)
at ognl.OgnlParser.unaryExpression(OgnlParser.java:1236)
at ognl.OgnlParser.multiplicativeExpression(OgnlParser.java:971)
at ognl.OgnlParser.additiveExpression(OgnlParser.java:894)
at ognl.OgnlParser.shiftExpression(OgnlParser.java:750)
at ognl.OgnlParser.relationalExpression(OgnlParser.java:508)
at ognl.OgnlParser.equalityExpression(OgnlParser.java:405)
at ognl.OgnlParser.andExpression(OgnlParser.java:352)
at ognl.OgnlParser.exclusiveOrExpression(OgnlParser.java:299)
at ognl.OgnlParser.inclusiveOrExpression(OgnlParser.java:246)
at ognl.OgnlParser.logicalAndExpression(OgnlParser.java:193)
at ognl.OgnlParser.logicalOrExpression(OgnlParser.java:140)
at ognl.OgnlParser.conditionalTestExpression(OgnlParser.java:101)
at ognl.OgnlParser.assignmentExpression(OgnlParser.java:64)
at ognl.OgnlParser.expression(OgnlParser.java:23)
at ognl.OgnlParser.topLevelExpression(OgnlParser.java:15)
at ognl.Ognl.parseExpression(Ognl.java:110)
... 55 more
/-- Encapsulated exception ------------\
ognl.ParseException: Encountered "<EOF>" at line 1, column 0.
Was expecting one of:
":" ...
"not" ...
"+" ...
"-" ...
"~" ...
"!" ...
"(" ...
"true" ...
"false" ...
"null" ...
"#this" ...
"#root" ...
"#" ...
"[" ...
"{" ...
"@" ...
"new" ...
<IDENT> ...
<DYNAMIC_SUBSCRIPT> ...
"\'" ...
"`" ...
"\"" ...
<INT_LITERAL> ...
<FLT_LITERAL> ...
at ognl.OgnlParser.generateParseException(OgnlParser.java:3172)
at ognl.OgnlParser.jj_consume_token(OgnlParser.java:3051)
at ognl.OgnlParser.unaryExpression(OgnlParser.java:1236)
at ognl.OgnlParser.multiplicativeExpression(OgnlParser.java:971)
at ognl.OgnlParser.additiveExpression(OgnlParser.java:894)
at ognl.OgnlParser.shiftExpression(OgnlParser.java:750)
at ognl.OgnlParser.relationalExpression(OgnlParser.java:508)
at ognl.OgnlParser.equalityExpression(OgnlParser.java:405)
at ognl.OgnlParser.andExpression(OgnlParser.java:352)
at ognl.OgnlParser.exclusiveOrExpression(OgnlParser.java:299)
at ognl.OgnlParser.inclusiveOrExpression(OgnlParser.java:246)
at ognl.OgnlParser.logicalAndExpression(OgnlParser.java:193)
at ognl.OgnlParser.logicalOrExpression(OgnlParser.java:140)
at ognl.OgnlParser.conditionalTestExpression(OgnlParser.java:101)
at ognl.OgnlParser.assignmentExpression(OgnlParser.java:64)
at ognl.OgnlParser.expression(OgnlParser.java:23)
at ognl.OgnlParser.topLevelExpression(OgnlParser.java:15)
at ognl.Ognl.parseExpression(Ognl.java:110)
at ognl.Ognl.setValue(Ognl.java:783)
at br.com.caelum.vraptor.http.ognl.OgnlFacade.setValue(OgnlFacade.java:100)
at br.com.caelum.vraptor.http.ognl.OgnlParametersProvider.setProperty(OgnlParametersProvider.java:162)
at br.com.caelum.vraptor.http.ognl.OgnlParametersProvider.createParameter(OgnlParametersProvider.java:134)
at br.com.caelum.vraptor.http.ognl.OgnlParametersProvider.getParametersFor(OgnlParametersProvider.java:86)
at br.com.caelum.vraptor.interceptor.ParametersInstantiatorInterceptor.getParametersFor(ParametersInstantiatorInterceptor.java:126)
at br.com.caelum.vraptor.interceptor.ParametersInstantiatorInterceptor.intercept(ParametersInstantiatorInterceptor.java:83)
at br.com.caelum.vraptor.core.LazyInterceptorHandler.execute(LazyInterceptorHandler.java:59)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:54)
at br.com.nextrans.myone.component.interceptor.DataHoraInterceptor.intercept(DataHoraInterceptor.java:34)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:54)
at br.com.caelum.vraptor.core.LazyInterceptorHandler.execute(LazyInterceptorHandler.java:61)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:54)
at br.com.nextrans.myone.component.interceptor.BreadCrumbInterceptor.intercept(BreadCrumbInterceptor.java:40)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:54)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:56)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:54)
at br.com.nextrans.myone.component.interceptor.LoginInterceptor.intercept(LoginInterceptor.java:49)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:54)
at br.com.caelum.vraptor.environment.EnvironmentInterceptor.intercept(EnvironmentInterceptor.java:37)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:54)
at br.com.caelum.vraptor.interceptor.InstantiateInterceptor.intercept(InstantiateInterceptor.java:48)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:54)
at br.com.caelum.vraptor.interceptor.FlashInterceptor.intercept(FlashInterceptor.java:83)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:54)
at br.com.caelum.vraptor.interceptor.ExceptionHandlerInterceptor.intercept(ExceptionHandlerInterceptor.java:71)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:54)
at br.com.caelum.vraptor.interceptor.ResourceLookupInterceptor.intercept(ResourceLookupInterceptor.java:69)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:54)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:56)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:54)
at br.com.caelum.vraptor.core.EnhancedRequestExecution.execute(EnhancedRequestExecution.java:44)
at br.com.caelum.vraptor.VRaptor$1.insideRequest(VRaptor.java:91)
at br.com.caelum.vraptor.ioc.spring.SpringProvider.provideForRequest(SpringProvider.java:58)
at br.com.caelum.vraptor.VRaptor.doFilter(VRaptor.java:88)
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:291)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:662)
\--------------------------------------/
Lucas, e essa exception está sendo lançada em vários lugares do sistema.
Acredito que seja quando acesso uma view que tenha parâmetros na url, ou coisa do tipo.
Eu tenho minhas implementações das classes PathAnnotationRoutesParser e DefaultPathResolver.
Será que pode ser algum problema com elas?
Uso essas minhas implementações desde o começo do projeto. Penso que talvez possa ser algo com essa versão do VRaptor, pois antes eu usava o 3.4.0.
Mas já tentei fazer downgrade da versão, e o erro ainda persiste…
se você sobe o nível do log pra debug ou info ao invés de trace, a exception ainda assim aparece?
Resolvido.
Era isso mesmo Lucas. Putz.
Muito obrigado!
Forte abraço.