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 "Sagara Gunathunga (JIRA)" <ji...@apache.org> on 2013/07/13 08:35:53 UTC

[jira] [Commented] (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:comment-tabpanel&focusedCommentId=13707670#comment-13707670 ] 

Sagara Gunathunga  commented on AXIS2-4900:
-------------------------------------------

Can you please attach your patch as a SVN diff file against Axis2 trunk  ?  
                
> 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
>            Assignee: Sagara Gunathunga 
>         Attachments: RepositoryListener.java
>
>
> 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.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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