Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-dev] NextProtoNego and OSGi

Hi,

On Fri, Jan 25, 2013 at 1:10 PM, Gunnar Wagenknecht
<gunnar@xxxxxxxxxxxxxxx> wrote:
> Greetings Jetty 9 developers,
>
> I recently migrated my code-base to Jetty 9 (M5). The migration went fine
> and HTTP works. However, I'm unable to create any SSL connectivity.

In general, or only with SPDY ?

> As soon as I try to use a HTTPSPDYServerConnector I get a mystical
> NoClassDefFoundError: org/eclipse/jetty/npn/NextProtoNego$ServerProvider.
>
> java.lang.NoClassDefFoundError:
> org/eclipse/jetty/npn/NextProtoNego$ServerProvider
>   at java.lang.ClassLoader.defineClass1(Native Method)
>   at [more classloader stuff]
>   at
> org.eclipse.jetty.spdy.server.http.HTTPSPDYServerConnector.<init>(HTTPSPDYServerConnector.java:63)
>
> It seems to come from NPNServerConnectionFactory which is in bundle
> oej.spdy.server.
>
> While analysing the code involved I found the following code:
>
>   SPDYServerConnectionFactory.checkNPNAvailable()
>   NPNServerConnectionFactory.NPNServerConnectionFactory(String...)
>
> Both lead to the suspicion that something should be on the boot classpath.

Correct.

> I also recognized the following bundle header in oej.spdy.server:
>
>   Ignore-Package: org.eclipse.jetty.npn
>
> That's likely an issue. Even if a package is coming from the boot classpath
> it still needs an Import-Package declaration in the bundle. OSGi only makes
> "java.*" imports implicit.

Ok.

The point is as follows: spdy-server relies on the NPN *API* to compile.
This is an artifact on its own, and it's declared as "provided" so
that it does not end up in the system (or above) classpath.

The "provided" dependency is probably the source of the Ignore-Package
declaration (since these are generated by the Maven plugin) ?

When you actually run the code, the you need to add the NPN *boot* jar
(which is a different artifact) in the bootclasspath, and this jar
embeds also the NPN API (otherwise, obviously, it won't work).

> Anyway, there doesn't seem to be a jar in the Jetty p2 repo.
>
> Where can I find more information about this "NPN" stuff? For example, I'd
> like to understand the requirement regarding the boot classpath in order to
> come up with a solution for OSGi/p2 based deployments.

http://wiki.eclipse.org/Jetty/Feature/NPN

Please file a bugzilla to track this issue, and let us know how would
you best tune the OSGi manifest entries.

Thanks !

--
Simone Bordet
----
http://cometd.org
http://webtide.com
http://intalio.com
Developer advice, training, services and support
from the Jetty & CometD experts.
Intalio, the modern way to build business applications.


Back to the top