Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-30125

JAX-WS 2.0 Webservices can not be called from v2 plugins because of classloader problems

    XMLWordPrintable

Details

    Description

      I have to call a JAX-WS 2.0 Webservice from a v2 plugin post-function. The complete client runtime for JAX-WS 2.0 ist included in the JRE6 which is the basis for JIRA 5.0.7. Calling the Webservice fails with

      2012-10-16 12:59:37,059 http-6080-1 ERROR admin 779x1071x1 164g5xi 10.21.190.45 /secure/QuickCreateIssue.jspa [spu.jira.projektzeit.CreateProjektFunction] RuntimeException
      java.lang.IllegalArgumentException: interface com.sun.xml.internal.ws.developer.WSBindingProvider is not visible from class loader
      	at java.lang.reflect.Proxy.getProxyClass(Proxy.java:353)
      	at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:581)
      	at com.sun.xml.internal.ws.client.WSServiceDelegate.createEndpointIFBaseProxy(WSServiceDelegate.java:630)
      	at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:331)
      	at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:313)
      	at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:295)
      	at javax.xml.ws.Service.getPort(Service.java:92)
      	at de.continentale.vp.webservice.projektzeit.WebService100.getWebService100(ProjektzeitService100.java:58)
      

      Some analysis: I did try to load the Interface com.sun.xml.internal.ws.developer.WSBindingProvider by different Classloaders just before calling the Webservice:

          final Thread currentThread = Thread.currentThread();
          final ClassLoader origCCL = currentThread.getContextClassLoader();
          LOG.error("origccl="
                  + origCCL.loadClass(
                      "com.sun.xml.internal.ws.developer.WSBindingProvider")
                      .toString());
      
          ClassLoader c1 = com.atlassian.jira.issue.Issue.class.getClassLoader();
          LOG.error("System Classloader="
                  + c1.getSystemClassLoader().loadClass(
                      "com.sun.xml.internal.ws.developer.WSBindingProvider")
                      .toString());
          LOG.error("Issueclassloader="
                  + c1.loadClass(
                      "com.sun.xml.internal.ws.developer.WSBindingProvider")
                      .toString());
      

      This gives the following Log:

      2012-10-16 13:09:50,141 http-6080-6 ERROR admin 789x1273x1 164g5xi 10.21.190.45 /secure/QuickCreateIssue.jspa [spu.jira.web.WebClient] origccl=interface com.sun.xml.internal.ws.developer.WSBindingProvider
      2012-10-16 13:09:50,141 http-6080-6 ERROR admin 789x1273x1 164g5xi 10.21.190.45 /secure/QuickCreateIssue.jspa [spu.jira.web.WebClient] System Classloader=interface com.sun.xml.internal.ws.developer.WSBindingProvider
      2012-10-16 13:09:50,141 http-6080-6 ERROR admin 789x1273x1 164g5xi 10.21.190.45 /secure/QuickCreateIssue.jspa [spu.jira.web.WebClient] Issueclassloader=interface com.sun.xml.internal.ws.developer.WSBindingProvider
      

      so, all Classloders (the current ContextClassLoader, the SystemClassLoader and the Classloader of the Class Issue) can lookup the Interface.

      Probably, it is a classloader mixup.

      A support call (JSP-140545) was not really conclusive (out of scope for support, but did try to help, nonetheless). The Classloader workaround shown in JRA-29896 does not work (as you can see above). And there are some questions on answers.atlassian.com concerning this problem, all of them have no real solution:
      https://answers.atlassian.com/questions/44457/implement-jax-ws-in-jira-5-plugin
      https://answers.atlassian.com/questions/94094/jira-consume-soap-wsbindingprovider-not-visible

      Attachments

        Activity

          People

            Unassigned Unassigned
            ee76a1d5b092 Thomas Leineweber
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: