14 Replies Latest reply on Nov 21, 2003 1:28 PM by tkitchens

    AXIS web service throws NullPointerException when REDEPLOYIN

    pedrosalazar

      Greetings,

      I'm working on a web service built-in with AXIS jars (I mean, it's not using the jboss-net files). However, I upgraded from JBOSS 3.2.1 (here it worked just fine) to 3.2.2, but when I redeploy my web service application, any invocation result in the trace error on server below.

      But this only happens when I redeploy because if I restart jboss it works just fine. The only issue is that I'm using the standard Axis version that it should work just fine in a simple servlet container as TOMCAT server.

      Any ideas why this happen?

      regards,
      Pedro Salazar.

      ERROR TRACE:

      2003-11-13 19:07:16,930 ERROR [org.jboss.web.localhost.Engine]
      StandardWrapperValve[AxisServlet]: Servlet.service() for servlet
      AxisServlet threw exception
      java.lang.NullPointerException
      at
      org.jboss.mx.loading.UnifiedClassLoader.findResources(UnifiedClassLoader.java:361)
      at java.lang.ClassLoader.getResources(ClassLoader.java:825)
      at java.lang.ClassLoader.getResources(ClassLoader.java:821)
      at java.lang.ClassLoader.getResources(ClassLoader.java:821)
      at
      org.apache.commons.discovery.jdk.JDK12Hooks.getResources(JDK12Hooks.java:150)
      at
      org.apache.commons.discovery.resource.DiscoverResources$1.getNextResources(DiscoverResources.java:153)
      at
      org.apache.commons.discovery.resource.DiscoverResources$1.getNextResource(DiscoverResources.java:129)
      at
      org.apache.commons.discovery.resource.DiscoverResources$1.hasNext(DiscoverResources.java:116)
      at
      org.apache.commons.discovery.resource.names.DiscoverNamesInFile$1.getNextClassNames(DiscoverNamesInFile.java:186)
      at
      org.apache.commons.discovery.resource.names.DiscoverNamesInFile$1.getNextClassName(DiscoverNamesInFile.java:170)
      at
      org.apache.commons.discovery.resource.names.DiscoverNamesInFile$1.hasNext(DiscoverNamesInFile.java:157)
      at
      org.apache.commons.discovery.resource.names.NameDiscoverers$1.getNextIterator(NameDiscoverers.java:143)
      at
      org.apache.commons.discovery.resource.names.NameDiscoverers$1.hasNext(NameDiscoverers.java:126)
      at
      org.apache.commons.discovery.resource.classes.ResourceClassDiscoverImpl$1.getNextResource(ResourceClassDiscoverImpl.java:159)
      at
      org.apache.commons.discovery.resource.classes.ResourceClassDiscoverImpl$1.hasNext(ResourceClassDiscoverImpl.java:147)
      at
      org.apache.axis.configuration.EngineConfigurationFactoryFinder$1.run(EngineConfigurationFactoryFinder.java:159)
      at java.security.AccessController.doPrivileged(Native Method)
      at
      org.apache.axis.configuration.EngineConfigurationFactoryFinder.newFactory(EngineConfigurationFactoryFinder.java:152)
      at
      org.apache.axis.transport.http.AxisServletBase.getEngineEnvironment(AxisServletBase.java:285)
      at
      org.apache.axis.transport.http.AxisServletBase.getEngine(AxisServletBase.java:208)
      at
      org.apache.axis.transport.http.AxisServletBase.getEngine(AxisServletBase.java:187)
      at
      org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:785)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
      at
      org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:339)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
      at
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
      at
      org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
      at
      org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at
      org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at
      org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at
      org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at
      org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at
      org.jboss.web.tomcat.security.JBossSecurityMgrRealm.invoke(JBossSecurityMgrRealm.java:220)
      at
      org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at
      org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
      at
      org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at
      org.jboss.web.tomcat.tc4.statistics.ContainerStatsValve.invoke(ContainerStatsValve.java:76)
      at
      org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at
      org.jboss.web.tomcat.session.ClusteredSessionValve.invoke(ClusteredSessionValve.java:78)
      at
      org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at
      org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at
      org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at
      org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416)
      at
      org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
      at
      org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at
      org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
      at
      org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at
      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
      at
      org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at
      org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:65)
      at
      org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at
      org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:577)
      at
      org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at
      org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at
      org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at
      org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
      at
      org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at
      org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      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(Http11Processor.java:601)
      at
      org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
      at
      org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
      at
      org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)

        • 1. Re: AXIS web service throws NullPointerException when REDEPL
          jonlee

          Do you get the same problem if you switch off Java 2 Class Loading Compliance in a jboss-web.xml?

          false

          I haven't got around to trying this yet on 3.2.2 - maybe this weekend.

          • 2. Re: AXIS web service throws NullPointerException when REDEPL
            jonlee

            Also, if you redeploy the Axis WAR does the service work again - as opposed to rebooting JBoss?

            • 3. Re: AXIS web service throws NullPointerException when REDEPL
              pedrosalazar

              I inserted the attribute option as you said, in the file ${JBOSS_HOME}/server/all/deploy/jboss-net.sar/META-INF/jboss-service.xml inside the mbean "AxisService" (is this the correct file?):


              false


              and it stills not working!!

              BTW, the service works always when I start or restart JBOSS. It doesn't work only when I redeploy the service.

              regards,
              Pedro Salazar.

              • 4. Re: AXIS web service throws NullPointerException when REDEPL
                jonlee

                OK. You're using JBoss.NET. I was under the impression that it was just the basic Axis (not JBoss.NET) service.

                Two things to test: -
                Does the service work again if you touch jboss-net.sar/META-INF/jboss-service.xml (when JBoss.NET is redeployed)?
                Does the service work again if you touch jboss-service.xml for your servlet container (Tomcat/Jetty SAR)?

                • 5. Re: AXIS web service throws NullPointerException when REDEPL
                  pedrosalazar

                  > OK. You're using JBoss.NET. I was under the
                  > impression that it was just the basic Axis (not
                  > JBoss.NET) service.

                  There is a misunderstood here. I'm not using jboss-net.

                  I thought that you referred to change the jboss-net configuration because it could be affecting the deploy of my independet web service application (deployed with the AXIS 1.1 final).

                  So, where should I put the following line:

                  false

                  regards,
                  Pedro Salazar

                  • 6. Re: AXIS web service throws NullPointerException when REDEPL
                    jonlee

                    I'm assuming that you have deployed plain old Axis as a WAR, maybe as axis.war? See http://www.amitysolutions.com.au/documents/Axis-technote.pdf as the expected configuration so we are on the same page.

                    So the Class Loading compliance would go in the WEB-INF/jboss-web.xml of the Axis WAR.

                    And if that doesn't work, check if conditions change if you redeploy the Axis WAR or the Tomcat/Jetty SAR or any combinations of these redeployments - rather than rebooting JBoss.

                    • 7. Re: AXIS web service throws NullPointerException when REDEPL
                      pedrosalazar

                      > I'm assuming that you have deployed plain old Axis as
                      > a WAR, maybe as axis.war? See
                      > http://www.amitysolutions.com.au/documents/Axis-techno
                      > e.pdf as the expected configuration so we are on the
                      > same page.
                      >

                      This approach is not the deployment of an Axis WS as a standalone service but yes an Axis WS where you can "attach" web services using the deploy.wsdd file.

                      I'm not following this approach.

                      Instead I'm using one where the Axis WS is deployed inside my ordinary WAR application.

                      I only have to do this steps:

                      -Add the server-config.wsdd with my service deployment inside my WEB-INF
                      -Add the axis library in my WAR's lib.
                      -Add the following lines in my web.xml:

                      <servlet-name>AxisServlet</servlet-name>
                      <display-name>Apache-Axis Servlet</display-name>
                      <servlet-class>
                      org.apache.axis.transport.http.AxisServlet
                      </servlet-class>



                      <servlet-name>AdminServlet</servlet-name>
                      <display-name>Admin Servlet</display-name>
                      <servlet-class>
                      org.apache.axis.transport.http.AdminServlet
                      </servlet-class>
                      <load-on-startup>100</load-on-startup>


                      <servlet-mapping>
                      <servlet-name>AxisServlet</servlet-name>
                      <url-pattern>/axis/*.jws</url-pattern>
                      </servlet-mapping>
                      <servlet-mapping>
                      <servlet-name>AxisServlet</servlet-name>
                      <url-pattern>/servlet/AxisServlet</url-pattern>
                      </servlet-mapping>

                      <servlet-mapping>
                      <servlet-name>AxisServlet</servlet-name>
                      <url-pattern>/services/*</url-pattern>
                      </servlet-mapping>

                      <servlet-mapping>
                      <servlet-name>AdminServlet</servlet-name>
                      <url-pattern>/servlet/AdminServlet</url-pattern>
                      </servlet-mapping>


                      > So the Class Loading compliance would go in the
                      > WEB-INF/jboss-web.xml of the Axis WAR.

                      I already tried but intead using:

                      false

                      I used this one (according the jboss-web-3_2.dtd):

                      <class-loading java2ClassLoadingCompliance='false' />

                      but still not working!
                      regards,
                      Pedro Salazar

                      • 8. Re: AXIS web service throws NullPointerException when REDEPL
                        jonlee

                        The classloading behaviour has changed somewhat in this release. I suspect that something is getting tangled up in the redeploy of the WAR.

                        I guess you can try a few other things:
                        Have you tried putting the Axis library in JBOSS_HOME/server/default/lib? This would stop the system trying to redeploy the Axis classes - I suspect this is probably the thing getting stuck during the deploy/undeploy. Besides, you possibly don't want to redeploy this library all the time - unless there is some purist objection to this restructure.
                        Did causing Tomcat to redeploy (which should cause your WAR to redeploy after it) change anything?
                        Have you tried using the loader repository?
                        Have you tried 3.2.3RC1?

                        I would do these in order, as the amount of work increases as you go along.

                        • 9. Re: AXIS web service throws NullPointerException when REDEPL
                          pedrosalazar

                          > I guess you can try a few other things:
                          > Have you tried putting the Axis library in
                          > JBOSS_HOME/server/default/lib? This would stop the
                          > system trying to redeploy the Axis classes - I
                          > suspect this is probably the thing getting stuck
                          > during the deploy/undeploy. Besides, you possibly
                          > don't want to redeploy this library all the time -
                          > unless there is some purist objection to this
                          > restructure.

                          Done. Still not working.

                          > Did causing Tomcat to redeploy (which should cause
                          > your WAR to redeploy after it) change anything?

                          Redeploy tomcat? ... I "touched" the directory of tomcat (${JBOSS_HOME}/server/all/deploy/jbossweb-tomcat41.sar) but I didn't saw any log of redeployment on server.log ...
                          I even tried but still not working.

                          > Have you tried using the loader repository?

                          How can I do that?

                          > Have you tried 3.2.3RC1?

                          I'm working on the download...

                          BTW, I read a comment about something similar on this url:
                          http://www.mail-archive.com/jboss-development@lists.sourceforge.net/msg38350.html//www.mail-archive.com/jboss-development@lists.sourceforge.net/msg38350.html
                          The difference is that in my case this happens only when I redeploy my web service and has nothing to do about the 2nd client request.

                          Regards,
                          Pedro Salazar.

                          • 10. Re: AXIS web service throws NullPointerException when REDEPL
                            jonlee

                            In order to redeploy the exploded SAR, you need to "touch" the META-INF/jboss-service.xml in the SAR. It would be interesting to see if this has any effect as the breakage in your case seems to be at the servlet container end.

                            There are a few forum postings on setting up the loader repository. Look at the DTD again in the area of the java 2 classloading compliance for a start on the loader repository. Unfortunately, I've got an early start today so I'm signing off. Otherwise if you need help with that and can't get anywhere searching the forums, post it as a different topic and someone should be able to help out.

                            • 11. Re: AXIS web service throws NullPointerException when REDEPL
                              jonlee

                              I should note that I use Axis configured as per the technote, with a Java class and helper deployed in it (not a JWS deployment). I can redeploy the Axis service (by touching the web.xml) and it comes back up fine under JBoss 3.2.2. I'm using Jetty, IBM SDK 1.4.1 and it is running under Slackware Linux 9.1. Fro an operational perspective, it should not be much different from your custom WAR so I'm not quite sure why there is a classloading issue. Since it isn't the Axis library, it may be one of your other libraries in the WAR getting locked nad unable to be properly loaded/unloaded. You could experiment I guess to see which library it is and whether the objects created from the library are being unloaded. You'd need to use some memory profilers for this.

                              • 12. Re: AXIS web service throws NullPointerException when REDEPL
                                pedrosalazar

                                I just tried the jboss 3.2.3RC1 and it works just fine!

                                I tried to find out what could be the problem on the 3.2.2 version since the previous stable release (3.2.1) hadn't this problem. I've posted in jboss-user mailing list and I got something about this issue:

                                "
                                This is a known issue. Axis has made some bug fixing and I know they have been backported in 3.2.3RC1 (if you use JBossNET)
                                "
                                -- replied by Stephane Nicoll

                                Apparently the 3.2.3RC1 was backported to 3.2.1 on this issue.

                                regards,
                                Pedro Salazar.

                                • 13. Re: AXIS web service throws NullPointerException when REDEPL
                                  jonlee

                                  I'm glad it solves it for you. I think there are a few obscure niggling problems in 3.2.2. I also understand via the rumour mill that 3.2.3 final is targeted for a December release.

                                  • 14. Re: AXIS web service throws NullPointerException when REDEPL
                                    tkitchens

                                    I have a similar problem, except that it happens for me with my EntityBeans. With 3.2.2, if I re-deploy my EAR without re-starting the server, I get something like the following each time an EntityBean is referenced:

                                    2003-11-21 14:04:51,605 ERROR [org.jboss.ejb.plugins.LogInterceptor] TransactionRolledbackLocalException in method: public abstract java.lang.Integer com.allegis.ats.entity.user.UserEntity.getUserPositionID(), causedBy:
                                    java.lang.NullPointerException
                                    at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:119)
                                    at org.jboss.mx.loading.UnifiedClassLoader3.loadClassImpl(UnifiedClassLoader3.java:169)
                                    at org.jboss.mx.loading.UnifiedClassLoader3.loadClass(UnifiedClassLoader3.java:123)
                                    at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
                                    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
                                    at oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement.java:2953)
                                    at oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement.java:3107)
                                    at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.setObject(WrappedPreparedStatement.java:620)
                                    at org.jboss.ejb.plugins.cmp.jdbc.JDBCUtil.setParameter(JDBCUtil.java:1278)
                                    at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge.setArgumentParameters(JDBCAbstractCMPFieldBridge.java:338)
                                    at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge.setPrimaryKeyParameters(JDBCAbstractCMPFieldBridge.java:327)
                                    at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCEntityBridge.setPrimaryKeyParameters(JDBCEntityBridge.java:616)
                                    at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:154)
                                    at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:76)
                                    at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadEntity(JDBCStoreManager.java:577)
                                    at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadEntity(JDBCStoreManager.java:559)
                                    at org.jboss.ejb.plugins.CMPPersistenceManager.loadEntity(CMPPersistenceManager.java:381)
                                    ...

                                    By the way, the only reason I'm even looking into migrating from 3.2.1 to 3.2.2 is because with 3.2.1 we frequently, but not always get a NoClassDefFoundError the first time any code attempts to access the Oracle database after a re-deploy. I've never seen any of these problems except in the case of "hot deployment", which has been a highly touted feature of JBoss for years now, but has yet to stabilize, at least for the 3.2 version. Believe me, I understand how difficult it is to get classloading 100% correct, as I've had to write my own classloader hierarchies myself and still have nightmares :-) So, I'm not about to be too critical on this one. I just think this one seems fairly critical to prioritize, as it's made several people here a little uneasy about deploying JBoss with this behavior into production. Not saying we won't, just that I'd feel a lot better if hot deployment worked. I think there may be a bug logged for the 3.2.1 problem, but not sure. If I have time after the upcoming holiday week, I'll try to get more detail and log a bug, if one isn't already logged.

                                    Thanks