axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sagara Gunathunga (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (AXIS2-4900) Modules not getting loaded from classpath in JBoss 5.1
Date Sat, 13 Jul 2013 06:35:50 GMT

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

Sagara Gunathunga  updated AXIS2-4900:
--------------------------------------

    Assignee: Sagara Gunathunga 
    
> 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


Mime
View raw message