Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-2160

NullPointerException in RepositoryClassLoader.findResources()

    XMLWordPrintable

Details

    Description

      My company is using vanilla Axis 1.2 services in JBoss AS, these libraries are deployed into server/default/lib

      When reloading the .ear file that uses AxisServlet, this occurs:

      2005-08-18 16:01:50,921 INFO [WebappClassLoader] ( ) Illegal access: this web application instance
      has been stopped already. Could not load META-INF/services/org.apache.axis.EngineConfigurationFact
      ory. The eventual following stack trace is caused by an error thrown for debugging purposes as well
      as to attempt to terminate the thread which caused the illegal access, and has no functional impact
      .
      2005-08-18 16:01:50,921 ERROR [[/app]] ( ) StandardWrapper.Throwable
      java.lang.NullPointerException
      at org.jboss.mx.loading.RepositoryClassLoader.findResources(RepositoryClassLoader.java:543)
      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.ja
      va:153)
      at org.apache.commons.discovery.resource.DiscoverResources$1.getNextResource(DiscoverResources.jav
      a:129)
      at org.apache.commons.discovery.resource.DiscoverResources$1.hasNext(DiscoverResources.java:116)
      at org.apache.commons.discovery.resource.names.DiscoverNamesInFile$1.getNextClassNames(DiscoverNam
      esInFile.java:186)
      at org.apache.commons.discovery.resource.names.DiscoverNamesInFile$1.getNextClassName(DiscoverName
      sInFile.java:170)
      at org.apache.commons.discovery.resource.names.DiscoverNamesInFile$1.hasNext(DiscoverNamesInFile.j
      ava:157)
      at org.apache.commons.discovery.resource.names.NameDiscoverers$1.getNextIterator(NameDiscoverers.j
      ava:143)
      at org.apache.commons.discovery.resource.names.NameDiscoverers$1.hasNext(NameDiscoverers.java:126)

      at org.apache.commons.discovery.resource.classes.ResourceClassDiscoverImpl$1.getNextResource(Resou
      rceClassDiscoverImpl.java:159)
      at org.apache.commons.discovery.resource.classes.ResourceClassDiscoverImpl$1.hasNext(ResourceClass
      DiscoverImpl.java:147)
      at org.apache.axis.configuration.EngineConfigurationFactoryFinder$1.run(EngineConfigurationFactory
      Finder.java:120)
      at java.security.AccessController.doPrivileged(Native Method)
      at org.apache.axis.configuration.EngineConfigurationFactoryFinder.newFactory(EngineConfigurationFa
      ctoryFinder.java:113)
      at org.apache.axis.transport.http.AxisServletBase.getEngineEnvironment(AxisServletBase.java:273)
      at org.apache.axis.transport.http.AxisServletBase.getEngine(AxisServletBase.java:172)
      at org.apache.axis.transport.http.AxisServletBase.getOption(AxisServletBase.java:396)
      at org.apache.axis.transport.http.AxisServletBase.init(AxisServletBase.java:112)
      at javax.servlet.GenericServlet.init(GenericServlet.java:211)

      This is because the repository was destroyed.

      Here is a suggested patch:

      Index: src/main/org/jboss/mx/loading/RepositoryClassLoader.java
      ===================================================================
      RCS file: /cvsroot/jboss/jmx/src/main/org/jboss/mx/loading/Attic/RepositoryClassLoader.java,v
      retrieving revision 1.3.4.3
      diff -b -B -U8 -r1.3.4.3 RepositoryClassLoader.java
      — src/main/org/jboss/mx/loading/RepositoryClassLoader.java 27 Jan 2005 04:25:39 -0000 1.3.4.3
      +++ src/main/org/jboss/mx/loading/RepositoryClassLoader.java 25 Aug 2005 01:09:38 -0000
      @@ -535,16 +535,21 @@
      *

      • @param name the name of the resource
      • @return Enumeration<URL>
      • @throws java.io.IOException
        */
        public Enumeration findResources(String name) throws IOException
        Unknown macro: { Vector resURLs = new Vector();+ if( repository == null )+ { + String msg = "Invalid use of destroyed classloader, UCL destroyed at:"; + throw (IOException)(new IOException(msg).initCause(this.unregisterTrace)); + } repository.getResources(name, this, resURLs); return resURLs.elements(); }

      /**

      • Provides the same functionality as {@link java.net.URLClassLoader#findResources}

        .
        */
        public Enumeration findResourcesLocally(String name) throws IOException

      It's also legitimate, perhaps, to do this:

      public Enumeration findResources(String name) throws IOException
      {
      Vector resURLs = new Vector();
      if (repository != null)

      { repository.getResources(name, this, resURLs); }

      return resURLs.elements();
      }

      I can apply this patch myself... Please let me know.

      Attachments

        Activity

          People

            genman_jira Elias Ross (Inactive)
            genman_jira Elias Ross (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: