struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "apachep2" <apach...@hotmail.com>
Subject RE: isEmpty() Method Not Working?
Date Mon, 03 Mar 2003 22:18:18 GMT
isEmpty only came out with b3.

-----Original Message-----
From: Ditlinger, Steve [mailto:SDitlinger@ebuilt.com] 
Sent: March 3, 2003 5:03 PM
To: 'Struts Users Mailing List'
Subject: RE: isEmpty() Method Not Working?


NoSuchMethodError does not extend Exception, so if you are catching
Exception, the catch block will not be entered.  

However, your real problem is that you are compiling against a current
version of Struts and then running against an obsolete version of
Struts.

HTH,
Steve

 -----Original Message-----
 From: Mervin Williams [mailto:mwilliams@innovasolutions.net]
 Sent: Monday, March 03, 2003 1:58 PM
 To: 'Struts Users Mailing List'
 Subject: RE: isEmpty() Method Not Working?
 
 
 I put a try/catch block around the "if(!errors.isEmpty())" 
 call, but the
 catch block was never entered, and the exception occurred.  
 Below is the
 stack trace for the error.  
 
 I do notice something strange in the stack tracke: in the "Root Cause"
 portion of the stack trace, the NoSuchMethodError refers to a method
 named "ActionMessages.isEmpty()Z".  Where is the "Z" coming from - I do
 not have a "Z" at the end of my method call.
 
 --------------------------------------
 2003-03-03 15:48:18,909 ERROR [org.jboss.web.localhost.Engine]
 StandardWrapperValve[action]: Servlet.service() for servlet 
 action threw
 exception
 javax.servlet.ServletException: Servlet execution threw an exception
 	at
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilte
 r(Applica
 tionFilterChain.java:269)
 	at
 org.apache.catalina.core.ApplicationFilterChain.doFilter(Applic
 ationFilt
 erChain.java:193)
 	at
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWr
 apperValv
 e.java:260)
 	at
 org.apache.catalina.core.StandardPipeline$StandardPipelineValve
 Context.i
 nvokeNext(StandardPipeline.java:643)
 	at
 org.apache.catalina.core.StandardPipeline.invoke(StandardPipeli
 ne.java:4
 80)
 	at
 org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
 	at
 org.apache.catalina.core.StandardContextValve.invoke(StandardCo
 ntextValv
 e.java:191)
 	at
 org.apache.catalina.core.StandardPipeline$StandardPipelineValve
 Context.i
 nvokeNext(StandardPipeline.java:643)
 	at
 org.apache.catalina.authenticator.AuthenticatorBase.invoke(Auth
 enticator
 Base.java:550)
 	at
 org.apache.catalina.core.StandardPipeline$StandardPipelineValve
 Context.i
 nvokeNext(StandardPipeline.java:641)
 	at
 org.apache.catalina.valves.CertificatesValve.invoke(Certificate
 sValve.ja
 va:246)
 	at
 org.apache.catalina.core.StandardPipeline$StandardPipelineValve
 Context.i
 nvokeNext(StandardPipeline.java:641)
 	at
 org.apache.catalina.core.StandardPipeline.invoke(StandardPipeli
 ne.java:4
 80)
 	at
 org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
 	at
 org.apache.catalina.core.StandardContext.invoke(StandardContext
 .java:241
 5)
 	at
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostV
 alve.java
 :180)
 	at
 org.apache.catalina.core.StandardPipeline$StandardPipelineValve
 Context.i
 nvokeNext(StandardPipeline.java:643)
 	at
 org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDis
 patcherVa
 lve.java:170)
 	at
 org.apache.catalina.core.StandardPipeline$StandardPipelineValve
 Context.i
 nvokeNext(StandardPipeline.java:641)
 	at
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportV
 alve.java
 :172)
 	at
 org.apache.catalina.core.StandardPipeline$StandardPipelineValve
 Context.i
 nvokeNext(StandardPipeline.java:641)
 	at
 org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve
 .java:509
 )
 	at
 org.apache.catalina.core.StandardPipeline$StandardPipelineValve
 Context.i
 nvokeNext(StandardPipeline.java:641)
 	at
 org.apache.catalina.core.StandardPipeline.invoke(StandardPipeli
 ne.java:4
 80)
 	at
 org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
 	at
 org.apache.catalina.core.StandardEngineValve.invoke(StandardEng
 ineValve.
 java:174)
 	at
 org.apache.catalina.core.StandardPipeline$StandardPipelineValve
 Context.i
 nvokeNext(StandardPipeline.java:643)
 	at
 org.apache.catalina.core.StandardPipeline.invoke(StandardPipeli
 ne.java:4
 80)
 	at
 org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
 	at
 org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
 	at
 org.apache.coyote.http11.Http11Processor.process(Http11Processo
 r.java:43
 2)
 	at
 org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler
 .processC
 onnection(Http11Protocol.java:386)
 	at
 org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoin
 t.java:53
 4)
 	at
 org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(T
 hreadPool
 .java:530)
 	at java.lang.Thread.run(Thread.java:536)
 2003-03-03 15:48:19,620 ERROR [org.jboss.web.localhost.Engine] -----
 Root Cause -----
 java.lang.NoSuchMethodError:
 org.apache.struts.action.ActionMessages.isEmpty()Z
 	at prototype_1.SearchAction.execute(SearchAction.java:272)
 	at
 org.apache.struts.action.RequestProcessor.processActionPerform(
 RequestPr
 ocessor.java:446)
 	at
 org.apache.struts.action.RequestProcessor.process(RequestProces
 sor.java:
 266)
 	at
 org.apache.struts.action.ActionServlet.process(ActionServlet.java:1292)
 	at
 org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510)
 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 	at
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilte
 r(Applica
 tionFilterChain.java:247)
 	at
 org.apache.catalina.core.ApplicationFilterChain.doFilter(Applic
 ationFilt
 erChain.java:193)
 	at
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWr
 apperValv
 e.java:260)
 	at
 org.apache.catalina.core.StandardPipeline$StandardPipelineValve
 Context.i
 nvokeNext(StandardPipeline.java:643)
 	at
 org.apache.catalina.core.StandardPipeline.invoke(StandardPipeli
 ne.java:4
 80)
 	at
 org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
 	at
 org.apache.catalina.core.StandardContextValve.invoke(StandardCo
 ntextValv
 e.java:191)
 	at
 org.apache.catalina.core.StandardPipeline$StandardPipelineValve
 Context.i
 nvokeNext(StandardPipeline.java:643)
 	at
 org.apache.catalina.authenticator.AuthenticatorBase.invoke(Auth
 enticator
 Base.java:550)
 	at
 org.apache.catalina.core.StandardPipeline$StandardPipelineValve
 Context.i
 nvokeNext(StandardPipeline.java:641)
 	at
 org.apache.catalina.valves.CertificatesValve.invoke(Certificate
 sValve.ja
 va:246)
 	at
 org.apache.catalina.core.StandardPipeline$StandardPipelineValve
 Context.i
 nvokeNext(StandardPipeline.java:641)
 	at
 org.apache.catalina.core.StandardPipeline.invoke(StandardPipeli
 ne.java:4
 80)
 	at
 org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
 	at
 org.apache.catalina.core.StandardContext.invoke(StandardContext
 .java:241
 5)
 	at
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostV
 alve.java
 :180)
 	at
 org.apache.catalina.core.StandardPipeline$StandardPipelineValve
 Context.i
 nvokeNext(StandardPipeline.java:643)
 	at
 org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDis
 patcherVa
 lve.java:170)
 	at
 org.apache.catalina.core.StandardPipeline$StandardPipelineValve
 Context.i
 nvokeNext(StandardPipeline.java:641)
 	at
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportV
 alve.java
 :172)
 	at
 org.apache.catalina.core.StandardPipeline$StandardPipelineValve
 Context.i
 nvokeNext(StandardPipeline.java:641)
 	at
 org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve
 .java:509
 )
 	at
 org.apache.catalina.core.StandardPipeline$StandardPipelineValve
 Context.i
 nvokeNext(StandardPipeline.java:641)
 	at
 org.apache.catalina.core.StandardPipeline.invoke(StandardPipeli
 ne.java:4
 80)
 	at
 org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
 	at
 org.apache.catalina.core.StandardEngineValve.invoke(StandardEng
 ineValve.
 java:174)
 	at
 org.apache.catalina.core.StandardPipeline$StandardPipelineValve
 Context.i
 nvokeNext(StandardPipeline.java:643)
 	at
 org.apache.catalina.core.StandardPipeline.invoke(StandardPipeli
 ne.java:4
 80)
 	at
 org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
 	at
 org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
 	at
 org.apache.coyote.http11.Http11Processor.process(Http11Processo
 r.java:43
 2)
 	at
 org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler
 .processC
 onnection(Http11Protocol.java:386)
 	at
 org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoin
 t.java:53
 4)
 	at
 org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(T
 hreadPool
 .java:530)
 	at java.lang.Thread.run(Thread.java:536)
 
 -----Original Message-----
 From: p2 - apache [mailto:apachep2@hotmail.com] 
 Sent: Monday, March 03, 2003 3:01 PM
 To: 'Struts Users Mailing List'
 Subject: RE: isEmpty() Method Not Working?
 
 
 Can you put a try/catch block around your if (!errors... Let's see if
 this is where the exception is thrown.
 
 -----Original Message-----
 From: Mervin Williams [mailto:mwilliams@innovasolutions.net] 
 Sent: March 3, 2003 3:45 PM
 To: struts-user@jakarta.apache.org
 Subject: FW: isEmpty() Method Not Working?
 
 Every time my application encounters the ActionErrors 
 isEmpty() message,
 a Servlet Exception occurs.  I simply replaced the old call from
 "errors.empty()" to "errors.isEmpty()".  If anyone has ideas as to
 what's going on, please help!
 
 Here is my code:
 --------------------------------------
            try
            {
                 if (stmt != null)
                 {
                   stmt.close();
                 }
                 if (conn != null)
                 {
                   conn.close();
                 }
            }
            catch(Exception e)
            {
              target = "error";
              ActionErrors errors = new ActionErrors();
              errors.add(ActionErrors.GLOBAL_ERROR, new
 ActionError("errors.database.error", e.getMessage()));
 
              // Report any errors
               if(!errors.isEmpty())
               {
                saveErrors(req, errors);
               }
            }
 
 
 ---------------------------------------------------------------------
 To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
 For additional commands, e-mail: struts-user-help@jakarta.apache.org
 
 ---------------------------------------------------------------------
 To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
 For additional commands, e-mail: struts-user-help@jakarta.apache.org
 
 
 ---------------------------------------------------------------------
 To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
 For additional commands, e-mail: struts-user-help@jakarta.apache.org
 


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message