glassfish
  1. glassfish
  2. GLASSFISH-16970

Web Service Client fails to load ProviderImpl from inside OSGi bundle

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1
    • Fix Version/s: 3.1.2
    • Component/s: web_services
    • Labels:
      None

      Description

      At runtime an OSGi module will use org.glassfish.metro.webservices-api-osgi and that fails to find com.sun.xml.ws.spi.ProviderImpl or com.sun.xml.internal.ws.spi.ProviderImpl (dependent on how the system variable is set).

      In the problem I was actually trying to solve, the service is created deep in the libraries. The easiest way to replicate it though is with the Activator below. I've tried a million different combos of dependancies and embedded libraries, but I run into other problems with that, notably that JAXB seems to not use the bundle's ClassLoader and thus fails to load context. Anyway, my attempted workarounds are besides the point.

      I originally posted here: http://www.java.net/forum/topic/glassfish/glassfish/module-not-able-find-providerimpl
      I got a response, but the workaround posted didn't help me as described there.

      I also attach my test case.

      package uk.ac.ox.sddag.api.osgi.basicwsblowupmodule;

      import java.net.URL;
      import javax.xml.namespace.QName;
      import javax.xml.ws.Service;
      import org.osgi.framework.BundleActivator;
      import org.osgi.framework.BundleContext;

      public class Activator implements BundleActivator {

      public void start(BundleContext context) throws Exception

      { // System.setProperty("javax.xml.ws.spi.Provider", "com.sun.xml.ws.spi.ProviderImpl"); MyService mys = new MyService(null, null); }

      public void stop(BundleContext context) throws Exception

      { // TODO add deactivation code here }

      public class MyService extends Service {

      public MyService(URL url, QName qname)

      { super(url, qname); }

      }
      }

      SEVERE: Exception while invoking class org.glassfish.extras.osgicontainer.OSGiDeployedBundle start method
      org.osgi.framework.BundleException: Activator start error in bundle uk.ac.ox.sddag.api.osgi.basicWSBlowupModule [492].
      at org.apache.felix.framework.Felix.activateBundle(Felix.java:1882)
      at org.apache.felix.framework.Felix.startBundle(Felix.java:1752)
      at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:922)
      at org.glassfish.extras.osgicontainer.OSGiDeployedBundle.resume(OSGiDeployedBundle.java:83)
      at org.glassfish.extras.osgicontainer.OSGiDeployedBundle.start(OSGiDeployedBundle.java:62)
      at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
      at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
      at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:286)
      at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)
      at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:372)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:355)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:370)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1067)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:96)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1247)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)
      at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:465)
      at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:222)
      at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:168)
      at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
      at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:234)
      at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:822)
      at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719)
      at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013)
      at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
      at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
      at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
      at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
      at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
      at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
      at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
      at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
      at java.lang.Thread.run(Thread.java:680)
      Caused by: javax.xml.ws.WebServiceException: Provider com.sun.xml.internal.ws.spi.ProviderImpl not found
      at javax.xml.ws.spi.FactoryFinder.newInstance(FactoryFinder.java:68)
      at javax.xml.ws.spi.FactoryFinder.find(FactoryFinder.java:163)
      at javax.xml.ws.spi.Provider.provider(Provider.java:142)
      at javax.xml.ws.Service.<init>(Service.java:92)
      at uk.ac.ox.sddag.api.osgi.basicwsblowupmodule.Activator$MyService.<init>(Activator.java:24)
      at uk.ac.ox.sddag.api.osgi.basicwsblowupmodule.Activator.start(Activator.java:14)
      at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:629)
      at org.apache.felix.framework.Felix.activateBundle(Felix.java:1835)
      ... 34 more
      Caused by: java.lang.ClassNotFoundException: com.sun.xml.internal.ws.spi.ProviderImpl not found by org.glassfish.metro.webservices-api-osgi [2]
      at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:787)
      at org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:71)
      at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1768)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:169)
      at javax.xml.ws.spi.FactoryFinder.safeLoadClass(FactoryFinder.java:182)
      at javax.xml.ws.spi.FactoryFinder.newInstance(FactoryFinder.java:65)
      ... 41 more

      SEVERE: Exception while loading the app
      INFO: Uninstalled uk.ac.ox.sddag.api.osgi.basicWSBlowupModule [492]
      SEVERE: Exception while loading the app : Activator start error in bundle uk.ac.ox.sddag.api.osgi.basicWSBlowupModule [492].
      javax.xml.ws.WebServiceException: Provider com.sun.xml.internal.ws.spi.ProviderImpl not found
      at javax.xml.ws.spi.FactoryFinder.newInstance(FactoryFinder.java:68)
      at javax.xml.ws.spi.FactoryFinder.find(FactoryFinder.java:163)
      at javax.xml.ws.spi.Provider.provider(Provider.java:142)
      at javax.xml.ws.Service.<init>(Service.java:92)
      at uk.ac.ox.sddag.api.osgi.basicwsblowupmodule.Activator$MyService.<init>(Activator.java:24)
      at uk.ac.ox.sddag.api.osgi.basicwsblowupmodule.Activator.start(Activator.java:14)
      at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:629)
      at org.apache.felix.framework.Felix.activateBundle(Felix.java:1835)
      at org.apache.felix.framework.Felix.startBundle(Felix.java:1752)
      at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:922)
      at org.glassfish.extras.osgicontainer.OSGiDeployedBundle.resume(OSGiDeployedBundle.java:83)
      at org.glassfish.extras.osgicontainer.OSGiDeployedBundle.start(OSGiDeployedBundle.java:62)
      at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
      at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
      at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:286)
      at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)
      at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:372)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:355)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:370)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1067)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:96)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1247)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)
      at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:465)
      at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:222)
      at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:168)
      at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
      at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:234)
      at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:822)
      at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719)
      at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013)
      at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
      at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
      at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
      at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
      at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
      at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
      at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
      at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
      at java.lang.Thread.run(Thread.java:680)
      Caused by: java.lang.ClassNotFoundException: com.sun.xml.internal.ws.spi.ProviderImpl not found by org.glassfish.metro.webservices-api-osgi [2]
      at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:787)
      at org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:71)
      at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1768)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:169)
      at javax.xml.ws.spi.FactoryFinder.safeLoadClass(FactoryFinder.java:182)
      at javax.xml.ws.spi.FactoryFinder.newInstance(FactoryFinder.java:65)
      ... 41 more

        Issue Links

          Activity

          Hide
          Martin Grebac added a comment -

          Also added dynamic import of osgi locator to webservices-api-osgi.jar osgi manifest definition. Will be integrated with next metro integration.

          Show
          Martin Grebac added a comment - Also added dynamic import of osgi locator to webservices-api-osgi.jar osgi manifest definition. Will be integrated with next metro integration.
          Hide
          Martin Grebac added a comment -

          With the latest updates I see this in the log after copying:
          [#|2011-12-13T14:46:13.561+0100|INFO|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=17;_ThreadName=Thread-2;|org.osgi.framework.BundleException: Activator start error in bundle uk.ac.ox.sddag.api.osgi.basicWSBlowupModule [259].
          at org.apache.felix.framework.Felix.activateBundle(Felix.java:2027)
          at org.apache.felix.framework.Felix.startBundle(Felix.java:1895)
          at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:944)
          at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:1175)
          at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:1153)
          at org.apache.felix.fileinstall.internal.DirectoryWatcher.processAllBundles(DirectoryWatcher.java:1146)
          at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:456)
          at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:263)
          Caused by: javax.xml.ws.WebServiceException: Unable to createEndpointReference Provider
          at javax.xml.ws.spi.Provider.provider(Provider.java:160)
          at javax.xml.ws.Service.<init>(Service.java:92)
          at uk.ac.ox.sddag.api.osgi.basicwsblowupmodule.Activator$MyService.<init>(Activator.java:24)
          at uk.ac.ox.sddag.api.osgi.basicwsblowupmodule.Activator.start(Activator.java:14)
          at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:641)
          at org.apache.felix.framework.Felix.activateBundle(Felix.java:1977)
          ... 7 more
          Caused by: java.lang.NullPointerException
          at javax.xml.ws.spi.Provider.provider(Provider.java:152)
          ... 12 more

          #]
          Show
          Martin Grebac added a comment - With the latest updates I see this in the log after copying: [#|2011-12-13T14:46:13.561+0100|INFO|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=17;_ThreadName=Thread-2;|org.osgi.framework.BundleException: Activator start error in bundle uk.ac.ox.sddag.api.osgi.basicWSBlowupModule [259] . at org.apache.felix.framework.Felix.activateBundle(Felix.java:2027) at org.apache.felix.framework.Felix.startBundle(Felix.java:1895) at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:944) at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:1175) at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:1153) at org.apache.felix.fileinstall.internal.DirectoryWatcher.processAllBundles(DirectoryWatcher.java:1146) at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:456) at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:263) Caused by: javax.xml.ws.WebServiceException: Unable to createEndpointReference Provider at javax.xml.ws.spi.Provider.provider(Provider.java:160) at javax.xml.ws.Service.<init>(Service.java:92) at uk.ac.ox.sddag.api.osgi.basicwsblowupmodule.Activator$MyService.<init>(Activator.java:24) at uk.ac.ox.sddag.api.osgi.basicwsblowupmodule.Activator.start(Activator.java:14) at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:641) at org.apache.felix.framework.Felix.activateBundle(Felix.java:1977) ... 7 more Caused by: java.lang.NullPointerException at javax.xml.ws.spi.Provider.provider(Provider.java:152) ... 12 more #]
          Hide
          jitu added a comment -

          Fixing the reflection code that looks up the providers. Need a glassfish integration. Assigning this to MartinG
          ----------------------------
          $ svn ci src/javax/xml/ws/spi/FactoryFinder.java
          Sending src/javax/xml/ws/spi/FactoryFinder.java
          Transmitting file data .
          Committed revision 474.
          ---------------------------------

          Show
          jitu added a comment - Fixing the reflection code that looks up the providers. Need a glassfish integration. Assigning this to MartinG ---------------------------- $ svn ci src/javax/xml/ws/spi/FactoryFinder.java Sending src/javax/xml/ws/spi/FactoryFinder.java Transmitting file data . Committed revision 474. ---------------------------------
          Hide
          Martin Grebac added a comment -

          Pushed jaxws apoi 2.2.8, integrated to RI 2.2.6 and 2.2.x branches,

          Show
          Martin Grebac added a comment - Pushed jaxws apoi 2.2.8, integrated to RI 2.2.6 and 2.2.x branches,
          Hide
          Martin Grebac added a comment -

          Integrated to GF 3.1.2

          Show
          Martin Grebac added a comment - Integrated to GF 3.1.2

            People

            • Assignee:
              Martin Grebac
              Reporter:
              dpwr
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: