Estou recebendo um erro ao tentar salvar uma entidade. O trace não me informa nada que eu possa tentar resolver.
Acredito que este erro se dá quando o vraptor tenta resolver o nome dos atributos de uma das entidades envolvidas (ou alguma dependencia desta)
stack
[code]Caused by: ognl.ParseException: Encountered “” at line 1, column 0.
Was expecting one of:
":" …
“not” …
"+" …
"-" …
"~" …
"!" …
"(" …
“true” …
“false” …
“null” …
"#this" …
"#root" …
"#" …
"[" …
"{" …
"@" …
“new” …
…
<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)
... 46 more
/-- Encapsulated exception ------------
ognl.ParseException: Encountered “” at line 1, column 0.
Was expecting one of:
":" …
“not” …
"+" …
"-" …
"~" …
"!" …
"(" …
“true” …
“false” …
“null” …
"#this" …
"#root" …
"#" …
"[" …
"{" …
"@" …
“new” …
…
<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.OgnlParametersProvider.createViaOgnl(OgnlParametersProvider.java:133)
at br.com.caelum.vraptor.http.ognl.OgnlParametersProvider.createRoot(OgnlParametersProvider.java:108)
at br.com.caelum.vraptor.http.ognl.OgnlParametersProvider.getParametersFor(OgnlParametersProvider.java:90)
at br.com.caelum.vraptor.interceptor.ParametersInstantiatorInterceptor.getParametersFor(ParametersInstantiatorInterceptor.java:83)
at br.com.caelum.vraptor.interceptor.ParametersInstantiatorInterceptor.intercept(ParametersInstantiatorInterceptor.java:68)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:46)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:59)
at br.com.caelum.vraptor.interceptor.InstantiateInterceptor.intercept(InstantiateInterceptor.java:42)
at br.com.caelum.vraptor.core.InstantiatedInterceptorHandler.execute(InstantiatedInterceptorHandler.java:41)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:59)
at br.com.caelum.vraptor.util.jpa.JPATransactionInterceptor.intercept(JPATransactionInterceptor.java:46)
at br.com.caelum.vraptor.core.InstantiatedInterceptorHandler.execute(InstantiatedInterceptorHandler.java:41)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:59)
at br.com.caelum.vraptor.interceptor.InterceptorListPriorToExecutionExtractor.intercept(InterceptorListPriorToExecutionExtractor.java:46)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:46)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:59)
at br.com.caelum.vraptor.interceptor.FlashInterceptor.intercept(FlashInterceptor.java:80)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:46)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:59)
at br.com.caelum.vraptor.interceptor.ResourceLookupInterceptor.intercept(ResourceLookupInterceptor.java:67)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:46)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:59)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:48)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:59)
at br.com.caelum.vraptor.core.DefaultRequestExecution.execute(DefaultRequestExecution.java:62)
at br.com.caelum.vraptor.VRaptor$1.insideRequest(VRaptor.java:91)
at br.com.caelum.vraptor.ioc.spring.SpringProvider.provideForRequest(SpringProvider.java:55)
at br.com.caelum.vraptor.VRaptor.doFilter(VRaptor.java:88)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1089)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:211)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
at org.mortbay.jetty.Server.handle(Server.java:285)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:502)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:835)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:641)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:208)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:378)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:368)
at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)
--------------------------------------/
00:29:04,536 DEBUG [ParanamerNameProvider] Found parameter names with paranamer for public void br.com.atttecnologia.juriprev.web.controller.AdvogadoController.save(br.com.atttecnologia.juriprev.model.Advogado) as [advogado]
00:29:04,536 DEBUG [ParametersInstantiatorInterceptor] Parameter values for {DefaultResourceMethod: br.com.atttecnologia.juriprev.web.controller.AdvogadoController.save} are [br.com.atttecnologia.juriprev.model.Advogado@1dfb148]
00:29:04,536 DEBUG [DefaultListableBeanFactory] Creating instance of bean 'deserializingInterceptor’
00:29:04,536 DEBUG [DefaultListableBeanFactory] Returning cached instance of singleton bean 'httpServletRequestProvider’
00:29:04,536 DEBUG [DefaultListableBeanFactory] Creating instance of bean 'defaultHttpResult’
00:29:04,536 DEBUG [DefaultListableBeanFactory] Returning cached instance of singleton bean 'httpServletResponseProvider’
00:29:04,536 DEBUG [DefaultListableBeanFactory] Creating instance of bean 'defaultStatus’
00:29:04,536 DEBUG [DefaultListableBeanFactory] Returning cached instance of singleton bean 'httpServletResponseProvider’
00:29:04,536 DEBUG [DefaultListableBeanFactory] Creating instance of bean 'applicationConfiguration’
00:29:04,536 DEBUG [DefaultListableBeanFactory] Returning cached instance of singleton bean 'httpServletRequestProvider’
00:29:04,536 DEBUG [DefaultListableBeanFactory] Finished creating instance of bean 'applicationConfiguration’
00:29:04,536 DEBUG [DefaultListableBeanFactory] Returning cached instance of singleton bean 'objenesisProxifier’
00:29:04,536 DEBUG [DefaultListableBeanFactory] Returning cached instance of singleton bean 'defaultRouter’
00:29:04,536 DEBUG [DefaultListableBeanFactory] Finished creating instance of bean 'defaultStatus’
00:29:04,536 DEBUG [DefaultListableBeanFactory] Finished creating instance of bean 'defaultHttpResult’
00:29:04,536 DEBUG [DefaultListableBeanFactory] Returning cached instance of singleton bean 'defaultDeserializers’
00:29:04,552 DEBUG [DefaultListableBeanFactory] Returning cached instance of singleton bean 'br.com.caelum.vraptor.ioc.spring.SpringBasedContainer’
00:29:04,552 DEBUG [DefaultListableBeanFactory] Finished creating instance of bean 'deserializingInterceptor’
00:29:04,552 DEBUG [DefaultListableBeanFactory] Creating instance of bean 'executeMethodInterceptor’
00:29:04,552 DEBUG [DefaultListableBeanFactory] Finished creating instance of bean 'executeMethodInterceptor’
00:29:04,755 DEBUG [CommonAnnotationBeanPostProcessor] Invoking destroy method on bean ‘entityManagerCreator’: public void br.com.caelum.vraptor.util.jpa.EntityManagerCreator.destroy()
2010-02-04 00:29:04.755::WARN: /juriprev/advogado/save
br.com.caelum.vraptor.InterceptionException: java.lang.StackOverflowError
at br.com.caelum.vraptor.interceptor.ExecuteMethodInterceptor.intercept(ExecuteMethodInterceptor.java:77)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:46)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:59)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:48)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:59)
at br.com.caelum.vraptor.interceptor.ParametersInstantiatorInterceptor.intercept(ParametersInstantiatorInterceptor.java:77)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:46)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:59)
at br.com.caelum.vraptor.interceptor.InstantiateInterceptor.intercept(InstantiateInterceptor.java:42)
at br.com.caelum.vraptor.core.InstantiatedInterceptorHandler.execute(InstantiatedInterceptorHandler.java:41)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:59)
at br.com.caelum.vraptor.util.jpa.JPATransactionInterceptor.intercept(JPATransactionInterceptor.java:46)
at br.com.caelum.vraptor.core.InstantiatedInterceptorHandler.execute(InstantiatedInterceptorHandler.java:41)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:59)
at br.com.caelum.vraptor.interceptor.InterceptorListPriorToExecutionExtractor.intercept(InterceptorListPriorToExecutionExtractor.java:46)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:46)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:59)
at br.com.caelum.vraptor.interceptor.FlashInterceptor.intercept(FlashInterceptor.java:80)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:46)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:59)
at br.com.caelum.vraptor.interceptor.ResourceLookupInterceptor.intercept(ResourceLookupInterceptor.java:67)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:46)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:59)
at br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:48)
at br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:59)
at br.com.caelum.vraptor.core.DefaultRequestExecution.execute(DefaultRequestExecution.java:62)
at br.com.caelum.vraptor.VRaptor$1.insideRequest(VRaptor.java:91)
at br.com.caelum.vraptor.ioc.spring.SpringProvider.provideForRequest(SpringProvider.java:55)
at br.com.caelum.vraptor.VRaptor.doFilter(VRaptor.java:88)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1089)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:211)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
at org.mortbay.jetty.Server.handle(Server.java:285)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:502)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:835)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:641)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:208)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:378)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:368)
at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)[/code]
controller
/**
* @author fagnermoura@gmail.com
*
*/
@Resource
public class AdvogadoController extends CommonController {
private Advogado advogado;
private final AdvogadoDao advogadoDao;
private final Result result;
private final Validator validator;
public AdvogadoController(AdvogadoDao advogadoDao, Result result, Validator validator) {
this.advogadoDao = advogadoDao;
this.result = result;
this.validator = validator;
}
public List<Advogado> list() {
List<Advogado> lista = this.advogadoDao.getAll();
return lista;
}
@Path("/advogado/")
public void home() {
this.result.redirectTo(AdvogadoController.class).list();
}
public void save(final Advogado advogado) {
this.validator.checking(new Validations() {
{
that(StringUtils.isBlank(advogado.getRegistroOAB()), "advogado.registrooab", "advogado.numero.registrooab.invalido");
that(StringUtils.isBlank(advogado.getNome()), "advogado.nome", "advogado.nome.invalido");
that(advogado.getCpf() <= 0, "advogado.cpf", "advogado.cpf.invalido");
// TODO COlocar todas as validacoes
}
});
this.validator.onErrorUse(Results.page()).of(AdvogadoController.class).form();
this.advogado = this.advogadoDao.insert(advogado);
this.result.redirectTo(AdvogadoController.class).list();
}
public void form() {
this.result.include("listUF", UnidadeFederacao.values());
this.result.include("listEstadoCivil", EstadoCivil.values());
}
public void remove(final Advogado advogado) {
this.advogadoDao.delete(advogado);
this.result.redirectTo(AdvogadoController.class).list();
}
/**
* @return advogado
*/
public Advogado getAdvogado() {
return this.advogado;
}
/**
* @param advogado
* >> advogado
*/
public void setAdvogado(Advogado advogado) {
this.advogado = advogado;
}
}