Spring Framework
  1. Spring Framework
  2. SPR-5771

SimpleJaxWsServiceExporter on Weblogic 10.3 cause "IllegalArgumentException: Cannot create URL for this address"

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.5.6
    • Fix Version/s: 3.0 M4
    • Component/s: Web
    • Labels:
      None
    • Last commented by a User:
      false

      Description

      When using SimpleJaxWsServiceExporter into a .war application deployed in Weblogic, it never can start-up due to the following exception:

      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.remoting.jaxws.SimpleJaxWsServiceExporter#0' defined in ServletContext resource [/WEB-INF/webmvc-config.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Cannot create URL for this address /MyService.
      [........]
      java.lang.IllegalArgumentException: Cannot create URL for this address /MyService
      at weblogic.wsee.jaxws.spi.WLSEndpoint.publish(WLSEndpoint.java:133)
      at org.springframework.remoting.jaxws.SimpleJaxWsServiceExporter.publishEndpoint(SimpleJaxWsServiceExporter.java:67)
      at org.springframework.remoting.jaxws.AbstractJaxWsServiceExporter.publishEndpoints(AbstractJaxWsServiceExporter.java:125)
      at org.springframework.remoting.jaxws.AbstractJaxWsServiceExporter.afterPropertiesSet(AbstractJaxWsServiceExporter.java:104)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory
      .java:1369)
      Truncated. see log file for complete stacktrace

      The problem is that the Weblogic JAX-WS implementation that is being called by SimpleJaxWsServiceExporter to publish the service doesn't accept URIs without a trailing slash '/'.

      I have found out that patching the following method in SimpleJaxWsServiceExporter by adding the required slash character enables the webservice publication:

      protected void publishEndpoint(Endpoint endpoint, WebService annotation)

      { String fullAddress = this.baseAddress + annotation.serviceName() + '/'; // Added slash for Weblogic 10.3 endpoint.publish(fullAddress); }

      Indeed, I'm not sure is this patch is appliable for different application servers that Weblogic 10.3

        Activity

        Hide
        Juergen Hoeller added a comment -

        Thanks for pointing this out!

        Unfortunately the trailing slash doesn't work with the JAX-WS provider that comes with Sun's JDK 1.6... As a consequence, I had to add a specific workaround check for WebLogic 10.3: detecting an endpoint class in the "weblogic." package in a hard-coded fashion.

        Juergen

        Show
        Juergen Hoeller added a comment - Thanks for pointing this out! Unfortunately the trailing slash doesn't work with the JAX-WS provider that comes with Sun's JDK 1.6... As a consequence, I had to add a specific workaround check for WebLogic 10.3: detecting an endpoint class in the "weblogic." package in a hard-coded fashion. Juergen

          People

          • Assignee:
            Juergen Hoeller
            Reporter:
            F. Daniel Parra Vizcaíno
            Last updater:
            Trevor Marshall
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Days since last comment:
              4 years, 46 weeks, 1 day ago