users@glassfish.java.net

Re: [glassfish osgi v3 with Web Services]

From: Sahoo <Sahoo_at_Sun.COM>
Date: Wed, 30 Sep 2009 06:19:49 +0530

Can you attach a test case?

Sahoo

Alexander Blotny wrote:
> Hi,
>
> Now it worked. I build a war file and a simple Servlet which initial calls
> my webservice class:
>
> public void init() throws ServletException {
> super.init();
> System.out.println("MESSAGE Test");
> Messaging messaging = null;
> try {
> messaging = new Messaging();
> } catch (MalformedURLException e) {
> e.printStackTrace();
> }
>
> String[] recipients = {"sip:alb_at_fokus.fraunhofer.de"};
> String sender = "sip:alb-test_at_fokus.fraunhofer.de";
> String content = "TEST";
> System.out.println("RESULT: " + messaging.sendMessage(recipients, sender,
> content));
> }
>
> The Messaging class was provided in WEB-INF/lib.
>
> If I do the same in the Activator or in a class called by an osgi event I
> get the mentioned exception.
>
> The output in server.log for the event case:
>
> [#|2009-09-29T19:28:27.617+0200|INFO|glassfish|null|_ThreadID=17;_ThreadName
> =Thread-1;|WARNING: SvcRef [org.osgi.service.event.EventHandler] EventAdmin:
> Exception during event dispatch [org.osgi.service.event.Event
> [topic=Messaging] | [org.osgi.service.event.EventHandler] | Bundle(Messaging
> [215])] (javax.xml.ws.WebServiceException: Provider
> com.sun.xml.ws.spi.ProviderImpl not found)|#]
>
>
> Alex
>
>
> Am 29.09.09 15:00 schrieb "Sahoo" unter <Sahoo_at_Sun.COM>:
>
>
>> Can you provide details after you applied the work around? What changes
>> you made and what behavior you observed? May be you can attach a test
>> case where you have already applied the work around for analysis?
>>
>> Sahoo
>>
>> Alexander Blotny wrote:
>>
>>> Unfortunately my problem is unsolved. The work around does not work.
>>> Also if I am using the javax.xml.ws api outside of the Activator I get the
>>> same error:
>>>
>>> javax.xml.ws.WebServiceException: Provider com.sun.xml.ws.spi.ProviderImpl
>>> not found
>>>
>>> I tried the same stuff in a standalone felix with webservices-api-1.3.1.jar
>>> and webservices-rt-1.3.1.jar and there was no problem.
>>> Then I replaced the webservice-osgi bundle in modules with these jar files
>>> and tried it again with glassfish, but the error stays.
>>>
>>> Maybe someone who has successfully used javax.xml.ws api in glassfish?
>>>
>>> Am 24.09.09 19:28 schrieb "Sahoo" unter <Sahoo_at_Sun.COM>:
>>>
>>>
>>>
>>>> It appears that you are trying to use javax.xml.ws api in the bundle
>>>> activator. Since the activator is running with an undefined thread
>>>> context class loader and the javax.xml.ws API is not really OSGi
>>>> friendly, it is failing to find the provider. I don't see any easier
>>>> work around here. Can you try changing your OSGi bundle to a "Web
>>>> Application Bundle" as described at [1]? You can do something like this:
>>>> 1. Add a manifest header called Web-ContextPath in the OSGi bundle with
>>>> a value like /foo (anything starting with /).
>>>>
>>>> 2. Add a Servlet context listener and call the Web Service in the
>>>> servlet context listener instead of calling the activator.
>>>>
>>>> 3. Now install and start the bundle whichever way you like. Let me know
>>>> if you need further help.
>>>>
>>>> Thanks,
>>>> Sahoo
>>>>
>>>> [1]
>>>> http://weblogs.java.net/blog/ss141213/archive/2009/06/developing_hybr.html
>>>>
>>>> Alexander Blotny wrote:
>>>>
>>>>
>>>>> The stack trace is:
>>>>>
>>>>>
>>>>>
> [#|2009-09-24T17:23:25.391+0200|SEVERE|glassfish|null|_ThreadID=16;_ThreadN>>>>
> a
>
>>>>> me=Thread-1;|org.osgi.framework.BundleException: Activator start error in
>>>>> bundle Messaging [214].|#]
>>>>>
>>>>>
>>>>>
> [#|2009-09-24T17:23:25.391+0200|SEVERE|glassfish|null|_ThreadID=16;_ThreadN>>>>
> a
>
>>>>> me=Thread-1;| at
>>>>> org.apache.felix.framework.Felix.startBundle(Felix.java:1506)|#]
>>>>>
>>>>>
>>>>>
> [#|2009-09-24T17:23:25.392+0200|SEVERE|glassfish|null|_ThreadID=16;_ThreadN>>>>
> a
>
>>>>> me=Thread-1;| at
>>>>> org.apache.felix.framework.BundleImpl.start(BundleImpl.java:779)|#]
>>>>>
>>>>>
>>>>>
> [#|2009-09-24T17:23:25.392+0200|SEVERE|glassfish|null|_ThreadID=16;_ThreadN>>>>
> a
>
>>>>> me=Thread-1;| at
>>>>> org.apache.felix.framework.BundleImpl.start(BundleImpl.java:760)|#]
>>>>>
>>>>>
>>>>>
> [#|2009-09-24T17:23:25.392+0200|SEVERE|glassfish|null|_ThreadID=16;_ThreadN>>>>
> a
>
>>>>> me=Thread-1;| at
>>>>>
>>>>>
> org.apache.felix.shell.impl.StartCommandImpl.execute(StartCommandImpl.java:>>>>
> 8
>
>>>>> 2)|#]
>>>>>
>>>>>
>>>>>
> [#|2009-09-24T17:23:25.393+0200|SEVERE|glassfish|null|_ThreadID=16;_ThreadN>>>>
> a
>
>>>>> me=Thread-1;| at
>>>>>
>>>>>
> org.apache.felix.shell.impl.Activator$ShellServiceImpl.executeCommand(Activ>>>>
> a
>
>>>>> tor.java:276)|#]
>>>>>
>>>>>
>>>>>
> [#|2009-09-24T17:23:25.394+0200|SEVERE|glassfish|null|_ThreadID=16;_ThreadN>>>>
> a
>
>>>>> me=Thread-1;| at
>>>>> org.apache.felix.shell.remote.Shell.run(Shell.java:109)|#]
>>>>>
>>>>>
>>>>>
> [#|2009-09-24T17:23:25.395+0200|SEVERE|glassfish|null|_ThreadID=16;_ThreadN>>>>
> a
>
>>>>> me=Thread-1;| at java.lang.Thread.run(Thread.java:637)|#]
>>>>>
>>>>>
>>>>>
> [#|2009-09-24T17:23:25.395+0200|SEVERE|glassfish|null|_ThreadID=16;_ThreadN>>>>
> a
>
>>>>> me=Thread-1;|Caused by: javax.xml.ws.WebServiceException: Provider
>>>>> com.sun.xml.ws.spi.ProviderImpl not found|#]
>>>>>
>>>>>
>>>>>
> [#|2009-09-24T17:23:25.397+0200|SEVERE|glassfish|null|_ThreadID=16;_ThreadN>>>>
> a
>
>>>>> me=Thread-1;| at
>>>>> javax.xml.ws.spi.FactoryFinder.newInstance(FactoryFinder.java:33)|#]
>>>>>
>>>>>
>>>>>
> [#|2009-09-24T17:23:25.398+0200|SEVERE|glassfish|null|_ThreadID=16;_ThreadN>>>>
> a
>
>>>>> me=Thread-1;| at
>>>>> javax.xml.ws.spi.FactoryFinder.find(FactoryFinder.java:128)|#]
>>>>>
>>>>>
>>>>>
> [#|2009-09-24T17:23:25.398+0200|SEVERE|glassfish|null|_ThreadID=16;_ThreadN>>>>
> a
>
>>>>> me=Thread-1;| at
>>>>> javax.xml.ws.spi.Provider.provider(Provider.java:110)|#]
>>>>>
>>>>>
>>>>>
> [#|2009-09-24T17:23:25.399+0200|SEVERE|glassfish|null|_ThreadID=16;_ThreadN>>>>
> a
>
>>>>> me=Thread-1;| at javax.xml.ws.Service.<init>(Service.java:56)|#]
>>>>>
>>>>>
>>>>>
> [#|2009-09-24T17:23:25.399+0200|SEVERE|glassfish|null|_ThreadID=16;_ThreadN>>>>
> a
>
>>>>> me=Thread-1;| at
>>>>>
>>>>>
> org.csapi.wsdl.parlayx.multimedia_messaging.send.v3_1.service.SendMessageSe>>>>
> r
>
>>>>> vice.<init>(SendMessageService.java:42)|#]
>>>>>
>>>>>
>>>>>
> [#|2009-09-24T17:23:25.399+0200|SEVERE|glassfish|null|_ThreadID=16;_ThreadN>>>>
> a
>
>>>>> me=Thread-1;| at
>>>>>
>>>>>
> de.fhg.fokus.ngni.odysseus.service.messaging.Messaging.sendMessage(Messagin>>>>
> g
>
>>>>> .java:45)|#]
>>>>>
>>>>>
>>>>>
> [#|2009-09-24T17:23:25.400+0200|SEVERE|glassfish|null|_ThreadID=16;_ThreadN>>>>
> a
>
>>>>> me=Thread-1;| at
>>>>>
>>>>>
> de.fhg.fokus.ngni.odysseus.service.messaging.Activator.start(Activator.java>>>>
> :
>
>>>>> 54)|#]
>>>>>
>>>>>
>>>>>
> [#|2009-09-24T17:23:25.400+0200|SEVERE|glassfish|null|_ThreadID=16;_ThreadN>>>>
> a
>
>>>>> me=Thread-1;| at
>>>>>
>>>>>
> org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.ja>>>>
> v
>
>>>>> a:589)|#]
>>>>>
>>>>>
>>>>>
> [#|2009-09-24T17:23:25.400+0200|SEVERE|glassfish|null|_ThreadID=16;_ThreadN>>>>
> a
>
>>>>> me=Thread-1;| at
>>>>> org.apache.felix.framework.Felix.startBundle(Felix.java:1458)|#]
>>>>>
>>>>>
>>>>>
> [#|2009-09-24T17:23:25.401+0200|SEVERE|glassfish|null|_ThreadID=16;_ThreadN>>>>
> a
>
>>>>> me=Thread-1;| ... 6 more|#]
>>>>>
>>>>>
>>>>>
> [#|2009-09-24T17:23:25.401+0200|SEVERE|glassfish|null|_ThreadID=16;_ThreadN>>>>
> a
>
>>>>> me=Thread-1;|Caused by: java.lang.ClassNotFoundException:
>>>>> com.sun.xml.ws.spi.ProviderImpl|#]
>>>>>
>>>>>
>>>>>
> [#|2009-09-24T17:23:25.401+0200|SEVERE|glassfish|null|_ThreadID=16;_ThreadN>>>>
> a
>
>>>>> me=Thread-1;| at
>>>>> java.net.URLClassLoader$1.run(URLClassLoader.java:200)|#]
>>>>>
>>>>>
>>>>>
> [#|2009-09-24T17:23:25.401+0200|SEVERE|glassfish|null|_ThreadID=16;_ThreadN>>>>
> a
>
>>>>> me=Thread-1;| at java.security.AccessController.doPrivileged(Native
>>>>> Method)|#]
>>>>>
>>>>>
>>>>>
> [#|2009-09-24T17:23:25.401+0200|SEVERE|glassfish|null|_ThreadID=16;_ThreadN>>>>
> a
>
>>>>> me=Thread-1;| at
>>>>> java.net.URLClassLoader.findClass(URLClassLoader.java:188)|#]
>>>>>
>>>>>
>>>>>
> [#|2009-09-24T17:23:25.402+0200|SEVERE|glassfish|null|_ThreadID=16;_ThreadN>>>>
> a
>
>>>>> me=Thread-1;| at
>>>>> java.lang.ClassLoader.loadClass(ClassLoader.java:319)|#]
>>>>>
>>>>>
>>>>>
> [#|2009-09-24T17:23:25.402+0200|SEVERE|glassfish|null|_ThreadID=16;_ThreadN>>>>
> a
>
>>>>> me=Thread-1;| at
>>>>> java.lang.ClassLoader.loadClass(ClassLoader.java:254)|#]
>>>>>
>>>>>
>>>>>
> [#|2009-09-24T17:23:25.402+0200|SEVERE|glassfish|null|_ThreadID=16;_ThreadN>>>>
> a
>
>>>>> me=Thread-1;| at
>>>>> javax.xml.ws.spi.FactoryFinder.safeLoadClass(FactoryFinder.java:150)|#]
>>>>>
>>>>>
>>>>>
> [#|2009-09-24T17:23:25.402+0200|SEVERE|glassfish|null|_ThreadID=16;_ThreadN>>>>
> a
>
>>>>> me=Thread-1;| at
>>>>> javax.xml.ws.spi.FactoryFinder.newInstance(FactoryFinder.java:30)|#]
>>>>>
>>>>>
>>>>>
> [#|2009-09-24T17:23:25.402+0200|SEVERE|glassfish|null|_ThreadID=16;_ThreadN>>>>
> a
>
>>>>> me=Thread-1;| ... 14 more|#]
>>>>>
>>>>>
>>>>> Am 24.09.09 17:21 schrieb "Sahoo" unter <Sahoo_at_Sun.COM>:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> Likely a thread context class loader issue. Can you post the complete
>>>>>> stack trace from server.log?
>>>>>>
>>>>>> Sahoo
>>>>>>
>>>>>> Alexander Blotny wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>> Hi all,
>>>>>>>
>>>>>>> I am using GlassFish Server v3 Preview.
>>>>>>>
>>>>>>> When I try to use a Web Service Client created with jax-ws there is an
>>>>>>> exception:
>>>>>>>
>>>>>>> javax.xml.ws.WebServiceException: Provider
>>>>>>> com.sun.xml.ws.spi.ProviderImpl not found
>>>>>>> at javax.xml.ws.spi.FactoryFinder.newInstance(FactoryFinder.java:33)
>>>>>>> at javax.xml.ws.spi.FactoryFinder.find(FactoryFinder.java:128)
>>>>>>> at javax.xml.ws.spi.Provider.provider(Provider.java:110)
>>>>>>> at javax.xml.ws.Service.<init>(Service.java:56)
>>>>>>>
>>>>>>> I have looked in the modules and the webservice-osgi.jar includes this
>>>>>>> class. Furthermore the bundle is resolved in the process of using the
>>>>>>> client. Has anyone an explanation why this class can not be found?
>>>>>>>
>>>>>>> greetings,
>>>>>>> Alex
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>>>>>> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>>>>> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>>>>>
>>>>>
>>>>>
>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>>>> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>>>>
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>>> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>>>
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>