Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-5793

Various tests fail when Axis2 is built using a path with spaces

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.7.3
    • 1.7.7
    • None
    • None
    • Windows 8.1 x64 Prof., Tomcat 7.0.68, JDK 1.8.0_92 x64

    Description

      DBCwithReduceWSDLMemoryParmsTests fails when Axis2 is build using a path with spaces:

        <testcase time="0.017" classname="org.apache.axis2.jaxws.description.DBCwithReduceWSDLMemoryParmsTests" name="testDBCwithReduceWSDLMemoryParms">
          <failure type="junit.framework.AssertionFailedError:">junit.framework.AssertionFailedError: null
      	at junit.framework.Assert.fail(Assert.java:47)
      	at junit.framework.Assert.assertTrue(Assert.java:20)
      	at junit.framework.Assert.assertTrue(Assert.java:27)
      	at org.apache.axis2.jaxws.description.DBCwithReduceWSDLMemoryParmsTests.testDBCwithReduceWSDLMemoryParms(DBCwithReduceWSDLMemoryParmsTests.java:140)
      </failure>
      

      After enabling logging using log4j the reason is easier to find:

      2016-06-25 11:00:36,857 DEBUG org.apache.axis2.jaxws.util.WSDL4JWrapper.<init>: WSDL4JWrapper(Definition, boolean) entry
      2016-06-25 11:00:36,857 DEBUG org.apache.axis2.wsdl.util.WSDLDefinitionWrapper.<init>: WSDLDefinitionWrapper(Definition,URL,boolean) entry
      2016-06-25 11:00:36,857 DEBUG org.apache.axis2.wsdl.util.WSDLWrapperReloadImpl.isReloadable: Enter WSDLWrapperReloadImpl.isReloadable(): null
      2016-06-25 11:00:36,857 DEBUG org.apache.axis2.wsdl.util.WSDLWrapperReloadImpl.getExplicitURI: WSDLWrapperReloadImpl.getExplicitURI(file:/C:/Users/tschoening/Documents/Eclipse/Java Bug 2187/Libs Java 3rd/Apache/Axis2/1.7.3/src/modules/metadata/test-resources/wsdl/BindingNamespaceDefaults.wsdl) 
      2016-06-25 11:00:36,857 DEBUG org.apache.axis2.wsdl.util.WSDLWrapperReloadImpl.isReloadable: WSDLWrapperReloadImpl.isReloaded(): [javax.wsdl.WSDLException]  error [WSDLException: faultCode=WSDLWrapperReloadImpl : : java.net.URISyntaxException: Illegal character in path at index 48: file:/C:/Users/tschoening/Documents/Eclipse/Java Bug 2187/Libs Java 3rd/Apache/Axis2/1.7.3/src/modules/metadata/test-resources/wsdl/BindingNamespaceDefaults.wsdl]
      javax.wsdl.WSDLException: WSDLException: faultCode=WSDLWrapperReloadImpl : : java.net.URISyntaxException: Illegal character in path at index 48: file:/C:/Users/tschoening/Documents/Eclipse/Java Bug 2187/Libs Java 3rd/Apache/Axis2/1.7.3/src/modules/metadata/test-resources/wsdl/BindingNamespaceDefaults.wsdl
      	at org.apache.axis2.wsdl.util.WSDLWrapperReloadImpl.getExplicitURI(WSDLWrapperReloadImpl.java:1382)
      

      The problem is in DescriptionTestUtils.getWSDLURL:

      wsdlURL = new File(urlString).getAbsoluteFile().toURL();
      

      toURL is kown to fail in situations like these:

      Deprecated. This method does not automatically escape characters that are illegal in URLs. It is recommended that new code convert an abstract pathname into a URL by first converting it into a URI, via the toURI method, and then converting the URI into a URL via the URI.toURL method.

      https://docs.oracle.com/javase/7/docs/api/java/io/File.html#toURL()

      Attachments

        1. TEST-org.apache.axis2.jaxws.description.DBCwithReduceWSDLMemoryParmsTests.xml
          10 kB
          Thorsten Schöning
        2. DescriptionTestUtils.java.patch
          1 kB
          Thorsten Schöning
        3. DescriptionTestUtils2.java.patch
          3 kB
          Thorsten Schöning
        4. AXIS2-5793 all others.patch
          403 kB
          Thorsten Schöning
        5. AXIS2-5793 AdminActions.patch
          0.9 kB
          Thorsten Schöning

        Issue Links

          Activity

            People

              Unassigned Unassigned
              tschoening Thorsten Schöning
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: