Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-4900

Modules not getting loaded from classpath in JBoss 5.1

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.5.2
    • None
    • kernel
    • None
    • axis2 verion 1.5.2 in JBoss 5.1 with jdk 1.6

    Description

      Modules not getting loaded from classpath in JBoss 5.1

      I tried to deploy the axis2 verion 1.5.2 in JBoss 5.1 with jdk 1.6 and wanted to load the modules from the classpath., which did not work.

      AXIS2-4528 addresses the similar issue, but on WebSphere with protocal "wsjar".

      In JBoss 5.1:

      • the jar URL's protocal is "vfszip" instead of "jar" or "wsjar"
      • the jar URL's path will be like this
        /C:/jboss-eap-5.1/jboss-as/server/default/deploy/ApproveItWebServer_JBoss.ear/library/axis2/rampart-1.5.jar/META-INF/module.xml

      Thus, in the class org.apache.axis2.deployment.RepositoryListener, method name "loadClassPathModules()", the variable "idx" is always evaluated to be -1, and so addFileToDeploy method will never be called.

      ClassLoader loader = Thread.currentThread().getContextClassLoader();
      try {
      Enumeration moduleURLs = loader.getResources("META-INF/module.xml");
      while (moduleURLs.hasMoreElements()) {
      try {
      URL url = (URL)moduleURLs.nextElement();
      URI moduleURI;
      if (url.getProtocol().equals("file"))

      { String urlString = url.toString(); moduleURI = new URI(urlString.substring(0, urlString.lastIndexOf("/META-INF/module.xml"))); }

      else {
      // Check if the URL refers to an archive (such as
      // jar:file:/dir/some.jar!/META-INF/module.xml) and extract the
      // URL of the archive. In general the protocol will be "jar", but
      // some containers may use other protocols, e.g. WebSphere uses
      // "wsjar" (AXIS2-4258).
      String path = url.getPath();
      int idx = path.lastIndexOf("!/");
      if (idx != -1 && path.substring(idx+2).equals("META-INF/module.xml")) {
      moduleURI = new URI(path.substring(0, idx));
      if (!moduleURI.getScheme().equals("file"))

      { continue; }

      } else

      { // it always goes here. continue; }

      }

      log.debug("Deploying module from classpath at '" + moduleURI + "'");
      File f = new File(moduleURI);
      addFileToDeploy(f, deployer, WSInfo.TYPE_MODULE);

      } catch (URISyntaxException e)

      { log.info(e); }

      }

      Attachments

        1. RepositoryListener.java
          17 kB
          Hugo Mascarenhas

        Issue Links

          Activity

            People

              sagara Sagara Gunathunga
              yimingdu Yiming Du
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: