Description
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".
Attachments
Issue Links
- is duplicated by
-
AXIS2-5795 Failing tests because of SNAPSHOT vs. release changes in pom.xml
- Resolved