2 Replies Latest reply on Jul 11, 2005 3:16 AM by glacier

    NullPointerException in UnifiedClassLoader with JBoss applic

    glacier

      Hi,

      I have the wierdest error. it goes as follows:

      1) I'm using JBoss 3.2.6 (Tomcat 5)
      2) I deploy my application in ear format.
      3) I login to our central web page and click on a link to my web page.
      4) My login is authenticated thru JAAS and I'm allowed access to my web page.
      5) I redeploy my application in ear format (hot deploy)
      6) close my browser, (so that there is no session pollution)
      7) I login to our central web page and click on a link to my web page.
      8) Then I get the following error:

      WARN [FailoverUtil] The current resource caused a system exception. Will try failover resource 2
      java.lang.NullPointerException
      at org.jboss.mx.loading.UnifiedClassLoader.findResources(UnifiedClassLoader.java:397)
      at java.lang.ClassLoader.getResources(ClassLoader.java:851)
      at java.lang.ClassLoader.getResources(ClassLoader.java:847)
      at java.lang.ClassLoader.getResources(ClassLoader.java:847)
      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.configuration.EngineConfigurationFactoryFinder.newFactory(EngineConfigurationFactoryFinder.java:199)
      at org.apache.axis.client.Service.getEngineConfiguration(Service.java:801)
      at org.apache.axis.client.Service.getAxisClient(Service.java:143)
      at org.apache.axis.client.Service.(Service.java:152)
      at santam.commons.util.WebServiceClientUtil.executeWebMethod(WebServiceClientUtil.java:65)
      at santam.commons.security.securityds.User.testPassword(User.java:102)
      at santam.commons.security.securityds.User_TestPassword.execute(User.java:272)
      at santam.commons.util.FailoverUtil.execute(FailoverUtil.java:124)
      at santam.commons.security.securityds.User.checkPassword(User.java:152)
      at santam.commons.security.jaas.auth.spi.SecurityDSLoginModule.login(SecurityDSLoginModule.java:183)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at javax.security.auth.login.LoginContext.invoke(LoginContext.java:675)
      at javax.security.auth.login.LoginContext.access$000(LoginContext.java:129)
      at javax.security.auth.login.LoginContext$4.run(LoginContext.java:610)
      at java.security.AccessController.doPrivileged(Native Method)
      at javax.security.auth.login.LoginContext.invokeModule(LoginContext.java:607)
      at javax.security.auth.login.LoginContext.login(LoginContext.java:534)
      at org.apache.catalina.realm.JAASRealm.authenticate(JAASRealm.java:316)
      at org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:235)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:446)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
      at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:417)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
      at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
      at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
      at java.lang.Thread.run(Thread.java:534)


      Upon seing it had to do with the UnifiedClassLoader, I configured my jboss-app.xml file to look as follows:

      <?xml version="1.0"?>
      <jboss-app>
      <class-loading java2ClassLoadingCompliance="false">
      <loader-repository>
      za.co.santam.RISplitterWeb:loader=RISplitterWeb.ear
      <loader-repository-config>
      java2ParentDelegation=false
      </loader-repository-config>
      </loader-repository>
      </class-loading>
      </jboss-app>

      However, even with this change this still seems to be a problem.

      Does anyone have any suggestions or a possible solution for me?

      Thanks,
      Grant

        • 1. Re: NullPointerException in UnifiedClassLoader with JBoss ap
          starksm64

          The apache classes in this trace are holding onto the stale class loader and producing the NPE.

          • 2. Re: NullPointerException in UnifiedClassLoader with JBoss ap
            glacier

            Thanks for the reply Scott,

            Sorry for the delay, I have been on leave and only just got back today.

            I'm very new to JBoss and don't know what to make of the stale class loader? What would cause JBoss to hold onto the stale class loader? Any ideas?

            Don't know if it's relavent or not, but the 'problem' only seems to occur when I use the Axis libs? I would very much like to find a solution to the problem, as it will not be feasable to have to stop and start JBoss in our production environment each time we redeploy changes to our applications.

            Any help you could give would be greaty appreciated!

            Thanks,
            Grant