users@tyrus.java.net

Re: Tyrus Websocket Client Endpoints and OSGI bundle

From: Michał Ćmil <cmilmichal_at_gmail.com>
Date: Mon, 20 Apr 2015 14:04:58 +0000

Hi Paul,

I'm using Tyrus in Equinox. My gradle dependency signature is:
compile 'org.glassfish.tyrus.bundles:tyrus-standalone-client:1.8.2'

It works without any problems - what artifact and version do you use?

Best Regards,
Michal

On Mon, Apr 20, 2015 at 3:27 PM Pavel Bucek <pavel.bucek_at_oracle.com> wrote:

>
> Hi Paul,
>
> can you please share reproducible testcase? (preferably: minimal, github
> hosted, maven project).
>
> We do test this only on Glassfish, which is OSGi container, but from what
> I recall, there are some internal inconsistencies when compared to plan
> Felix / other containers.
>
> Thanks,
> Pavel
>
>
> On 20/04/15 15:08, Beaulieu, Paul wrote:
>
> Hi,
>
>
>
> I have an OSGI bundle in which I am trying to start a Websocket client.
> The problem is that the
> org.glassfish.tyrus.container.grizzly.client.GrizzlyClientContainer cannot
> be found. The issue is that the bundle classloader for the tyrus-core
> cannot find this class. If everything is placed into a normal jar file,
> then it all works. The problem is with the classloaders being able to find
> the tyrus classes that are required.
>
>
>
> The code snippet that I have is below
>
>
>
> ClientEndpointConfig cec = ClientEndpointConfig.Builder.
> *create*().build();
>
> ClientManager client = ClientManager.*createClient*();
>
>
>
> client.connectToServer(*this*, cec, *new* URI(endpoint));
>
>
>
> The problem is at the ClientManager.createClient() where the
> GrizzlyClientContainer cannot be found with the following exception:
>
> java.lang.ClassNotFoundException:
> org.glassfish.tyrus.container.grizzly.client.GrizzlyClientContainer not
> found by org.glassfish.tyrus.core [30]
>
>
>
> Is there anything special that needs to be done in order for this to work
> in an OSGI bundle?
>
>
>
> I am using an apache Felix framework for loading the OSGI bundles.
>
>
>
> Thanks for any help you can provide.
>
>
>
> Paul Beaulieu
>
>
>