axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Thomas (JIRA)" <>
Subject [jira] [Created] (AXIS2-5778) Module Deployer incorrectly invalidates MAR due to invalid filename recognition in ModuleDeployer
Date Wed, 08 Jun 2016 06:55:20 GMT
Jeff Thomas created AXIS2-5778:

             Summary: Module Deployer incorrectly invalidates MAR due to invalid filename
recognition in ModuleDeployer
                 Key: AXIS2-5778
             Project: Axis2
          Issue Type: Bug
          Components: kernel
    Affects Versions: 1.7.3
         Environment: Windows
            Reporter: Jeff Thomas
             Fix For: 1.7.4, 1.8.0

When performing full build on windows, the axis2-transport-udp module fails build in the unit
test: UDPTest:testSoapOverUdpWithEchoService

It fails because it is unable to load the 'addressing.mar' Module.  The module (in my workspace)
is at:


The failure seems to occur in org.apache.axis2.deployment.ModuleDeployer within the following
code from method "deoloyFromUrl(...)"  [side note: maybe fix the method name to 'deployFromUrl(...)]:

int index = fileUrl.getPath().lastIndexOf(File.separator);
if(index > 0) {
  moduleFile = fileUrl.getPath().substring(index);
} else {
  moduleFile = fileUrl.getPath();                
On Windows the File.separator is "\" (backslash) and a URL/URI the separator is always "/"
(forward slash).  The effect is, that on windows the index will always be -1 and on unix it
would correctly be 113 in my case.

The result is that the module name on windows is not "addressing.mar" but the full file URL.
 Because my path also has the Axis version in  it, the version recognition in AxisModule.setModuleName(...)
throws an error (NumberFormatException) and flags the module as faulty.

I believe the correct implementation is:
int index = fileUrl.getPath().lastIndexOf('/');
String moduleFile;
if(index > 0){
  moduleFile = fileUrl.getPath().substring(index + 1);
} else {
  moduleFile = fileUrl.getPath();
I made the following changes:
1. Changed {{File.separator}} to {{'/'}}
2. Changed {{.substring(index)}} to {{.substring(index + 1)}} so that it returns "{{addressing.mar}}"
instead of "{{/addressing.mar}}".

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message