It's a bug in web services implementation. There used to be a similar
bug [1] in JAXB which JAXB team fixed. WS team need to do the same.
Try the work around suggested in [2]. File a bug never-the-less.
Sahoo
[1]
http://java.net/jira/browse/GLASSFISH-11748
[2]
http://www.java.net/node/704073#comment-798841
On Monday 04 July 2011 05:12 PM, forums_at_java.net wrote:
>
>
>
> Hi,
>
>
>
>
>
>
> I have an OSGi module which has an embedded library that needs to make
> use of
> secure web-service calls, not something I can change.
> My problem is that at runtime the module uses
> 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.
> I don't understand how this is possible, surely that module must have
> to have
> access to that class? I'm using glassfish 3.1.
>
> Any advice as to how to fix this are appreciated, I'm completely at a
> loss
> for what to try next. I'm more than happy to provide any additional
> information or answer any questions to get to the answer.
> A very easy way to replicate this problem is by simply creating a new
> OSGi
> module with the following Activator:
>
>
> 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 {
> 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); } } }
> .. The result on deployment will be:
>
>
>
>
>
> SEVERE: Exception while loading the app : Activator start error in bundle
> uk.ac.ox.sddag.api.osgi.basicWSBlowupModule [435].
> 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:22)
>
> at
> uk.ac.ox.sddag.api.osgi.basicwsblowupmodule.Activator.start(Activator.java:12)
>
> 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
> For whatever reason, the org.glassfish.metro.webservices-api-osgi
> module does
> not have access to that class. What is the reason for this and how do
> I work
> around it?
>
> It is no different when I try and use
>
> System.setProperty("javax.xml.ws.spi.Provider",
> "com.sun.xml.ws.spi.ProviderImpl"); except it fails to find that provider
> instead.
>
>
>
> --
>
> [Message sent by forum member 'dpwr']
>
> View Post: http://forums.java.net/node/818465
>
>