[Logo] Mentawai Forum - Mentawai Web Framework
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 

Forum Read-Only! Check the new site and forum here!

Messages posted by: euclydesmelo  XML
Profile for euclydesmelo -> Messages posted by euclydesmelo [4]
Author Message
Ao baixarmos o mentawai, na pasta lib, encontramos essa dependência: mentacontainer-x.x.x.jar

Acredito que essa refatoração ocorreu na versão 2.0.0.
Pessoal,

Observei que quando usamos o Spring (seja qual for a motivação, JTA no meu caso) e optamos por extender BaseAction nas nossas actions, o mentawai não consegue mais inicializar as Listas Estáticas.

Isso ocorre por conta do Spring, no startup da aplicação, varrer o classpath em busca de classes anotadas com @Controller, @Service, @Repository, @Component etc. Nesse momento, se temos actions anotadas com @Controller, por exemplo, e que extendam BaseAction, as classes referentes a essas actions, a própria classe de BaseAction, bem como as classes de seus import's serão carregadas.

Como BaseAction utiliza org.mentawai.i18n.LocaleManager e este, por sua vez, faz uso de org.mentawai.list.ListManager, nesse momento seus atributos estáticos serão inicializados. O problema:
Code:
private static final String FULLDIR = ApplicationManager.getRealPath();

Nesse momento, realPath ainda não foi setado no ApplicationManager pelo FrontController do menta. Então, o ListManager quando é inicializado Code:
ListManager.init()
não encontra o diretório /lists (default). Retornado, portanto, sem fazer nada.
Code:
 File root = new File(FULLDIR + SEP + listDir);
 if (!root.exists()) return;

Por conseguinte, quando precisamos usar uma lista, um NullPointException é lançado. Por exemplo, quando tentamos popular um radio:
Code:
<mtw:radiobuttons name="dias" list="dias"/>

A seguinte stacktrace é lançada:
Code:
 GRAVE: Servlet.service() for servlet jsp threw exception
 java.lang.NullPointerException
 	at org.mentawai.tag.html.ListRadio.getStringToPrint(ListRadio.java:85)
 	at org.mentawai.tag.util.PrintTag.doEndTag(PrintTag.java:277)
 	at org.apache.jsp.index_jsp._jspx_meth_mtw_005fradiobuttons_005f0(index_jsp.java:132)
 	at org.apache.jsp.index_jsp._jspService(index_jsp.java:80)
 	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
 	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
 	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
 	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 	at org.mentawai.util.DebugServletFilter.doFilter(DebugServletFilter.java:71)
 	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.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
 	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
 	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
 	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
 	at org.mentawai.core.Forward.forward(Forward.java:133)
 	at org.mentawai.core.Forward.execute(Forward.java:116)
 	at org.mentawai.core.Controller.service(Controller.java:736)
 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
 	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
 	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
 	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
 	at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:706)
 	at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:677)
 	at org.apache.jsp.default_jsp._jspService(default_jsp.java:54)
 	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
 	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
 	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
 	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 	at org.mentawai.util.DebugServletFilter.doFilter(DebugServletFilter.java:71)
 	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:852)
 	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:662)

Talvez seria intessante testarmos, no método ListManager.init(), se FULLDIR é null.
Code:
 if (FULLDIR == null) FULLDIR = ApplicationManager.getRealPath();
 
 File root = new File(FULLDIR + SEP + listDir);
 
 if (!root.exists()) return;
Apesar de não ser o mais eficiente ($) para mim tive que continuar usando o Tomcat 6, pois não consegui rodar o minha aplicação no Tomcat 7. Mais alguém já passou por isso?!!
Estou com um problema semenhante!!! Tinha umas aplicações rodando, na boa, no Tomcat 6. Agora, por uma necessidade externa, tive rodá-las no Tomcat 7. Não está dando certo. Aparentemente, parece que é alguma incompatiblidade na versão das taglibs do JSP ou da API servlet.

Segue a stacktrace:

Code:
 GRAVE: Error configuring application listener of class 
 			org.mentawai.tag.html.dyntag.inputDate.listener.InputDateListener
 		
 java.lang.ClassNotFoundException: 
 			org.mentawai.tag.html.dyntag.inputDate.listener.InputDateListener
 		
 	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
 	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
 	at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:415)
 	at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:397)
 	at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118)
 	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4537)
 	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5097)
 	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5092)
 	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
 	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
 	at java.lang.Thread.run(Thread.java:662)
 03/06/2011 14:18:37 org.apache.catalina.core.StandardContext listenerStart
 GRAVE: Error configuring application listener of class 
 			org.mentawai.tag.html.dyntag.inputMask.listener.InputMaskListener
 		
 java.lang.ClassNotFoundException: 
 			org.mentawai.tag.html.dyntag.inputMask.listener.InputMaskListener
 		
 	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
 	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
 	at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:415)
 	at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:397)
 	at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118)
 	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4537)
 	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5097)
 	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5092)
 	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
 	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
 	at java.lang.Thread.run(Thread.java:662)
 03/06/2011 14:18:37 org.apache.catalina.core.StandardContext listenerStart
 GRAVE: Error configuring application listener of class 
 			org.mentawai.tag.html.dyntag.inputMoney.listener.InputMoneyListener
 		
 java.lang.ClassNotFoundException: 
 			org.mentawai.tag.html.dyntag.inputMoney.listener.InputMoneyListener
 		
 	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
 	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
 	at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:415)
 	at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:397)
 	at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118)
 	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4537)
 	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5097)
 	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5092)
 	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
 	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
 	at java.lang.Thread.run(Thread.java:662)
 03/06/2011 14:18:37 org.apache.catalina.core.StandardContext listenerStart
 GRAVE: Error configuring application listener of class 
 			org.mentawai.tag.html.dyntag.tabPanel.listener.TabPanelListener
 		
 java.lang.ClassNotFoundException: 
 			org.mentawai.tag.html.dyntag.tabPanel.listener.TabPanelListener
 		
 	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
 	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
 	at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:415)
 	at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:397)
 	at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118)
 	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4537)
 	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5097)
 	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5092)
 	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
 	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
 	at java.lang.Thread.run(Thread.java:662)
 03/06/2011 14:18:37 org.apache.catalina.core.StandardContext listenerStart
 GRAVE: Error configuring application listener of class 
 			org.mentawai.tag.html.dyntag.formSkin.listener.FormSkinListener
 		
 java.lang.ClassNotFoundException: 
 			org.mentawai.tag.html.dyntag.formSkin.listener.FormSkinListener
 		
 	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
 	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
 	at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:415)
 	at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:397)
 	at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118)
 	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4537)
 	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5097)
 	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5092)
 	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
 	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
 	at java.lang.Thread.run(Thread.java:662)
 03/06/2011 14:18:37 org.apache.catalina.core.StandardContext listenerStart
 GRAVE: Error configuring application listener of class 
 			org.mentawai.tag.html.dyntag.selectBox.listener.SelectBoxListener
 		
 java.lang.ClassNotFoundException: 
 			org.mentawai.tag.html.dyntag.selectBox.listener.SelectBoxListener
 		
 	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
 	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
 	at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:415)
 	at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:397)
 	at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118)
 	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4537)
 	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5097)
 	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5092)
 	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
 	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
 	at java.lang.Thread.run(Thread.java:662)
 03/06/2011 14:18:37 org.apache.catalina.core.StandardContext listenerStart
 GRAVE: Error configuring application listener of class 
 			org.mentawai.tag.html.dyntag.stats.listener.StatsListener
 		
 java.lang.ClassNotFoundException: 
 			org.mentawai.tag.html.dyntag.stats.listener.StatsListener
 		
 	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
 	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
 	at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:415)
 	at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:397)
 	at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118)
 	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4537)
 	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5097)
 	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5092)
 	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
 	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
 	at java.lang.Thread.run(Thread.java:662)
 03/06/2011 14:18:37 org.apache.catalina.core.StandardContext listenerStart
 GRAVE: Error configuring application listener of class 
 			org.mentawai.tag.html.dyntag.menu.listener.MenuListener
 		
 java.lang.ClassNotFoundException: 
 			org.mentawai.tag.html.dyntag.menu.listener.MenuListener
 		
 	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
 	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
 	at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:415)
 	at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:397)
 	at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118)
 	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4537)
 	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5097)
 	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5092)
 	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
 	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
 	at java.lang.Thread.run(Thread.java:662)
 03/06/2011 14:18:37 org.apache.catalina.core.StandardContext listenerStart
 GRAVE: Error configuring application listener of class 
 			org.mentawai.tag.html.ajax.listener.AjaxListener
 		
 java.lang.ClassNotFoundException: 
 			org.mentawai.tag.html.ajax.listener.AjaxListener
 		
 	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
 	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
 	at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:415)
 	at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:397)
 	at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118)
 	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4537)
 	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5097)
 	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5092)
 	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
 	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
 	at java.lang.Thread.run(Thread.java:662)
 


---
Att,
Euclydes Melo
MoLeKe DoIdO
 
Profile for euclydesmelo -> Messages posted by euclydesmelo [4]
Go to:   
Powered by JForum 2.1.6 © JForum Team