You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Andreas Veithen (JIRA)" <ji...@apache.org> on 2010/12/19 13:45:02 UTC

[jira] Updated: (AXIS2-4900) Modules not getting loaded from classpath in JBoss 5.1

     [ https://issues.apache.org/jira/browse/AXIS2-4900?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Veithen updated AXIS2-4900:
-----------------------------------

    Fix Version/s:     (was: 1.5.4)
                   1.5.5

> Modules not getting loaded from classpath in JBoss 5.1
> ------------------------------------------------------
>
>                 Key: AXIS2-4900
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4900
>             Project: Axis2
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.5.2
>         Environment: axis2 verion 1.5.2 in JBoss 5.1 with jdk 1.6
>            Reporter: Yiming Du
>             Fix For: 1.5.5
>
>
> 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);
>                 }
>             }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org