jetty-project / jetty-alpn

Implementation of ALPN (Application Layer Protocol Negotiation) Specification for OpenJDK 7 or greater
48 stars 27 forks source link

Xbootclasspath/p question #1

Closed Scottmitch closed 10 years ago

Scottmitch commented 10 years ago

I am attempting to use alpn-boot and npn-boot in the same project by including multiple entries in -Xbootclasspath/p. The oracle docs (http://docs.oracle.com/javase/7/docs/technotes/tools/windows/java.html) say to separate multiple entries with a semi-colon. I have done this and am able to get a successful build (which runs test cases that run npn and alpn scenarios) on linux (open-jdk7, oracle-jdk7) but not on windows (oracle-jdk7). Can you advise if this is a supported use case and see if my scenarios below reveal anything problematic?

Here are some scenarios and observations (again only on windows...see version information below)

  1. Only list ALPN jar on -Xbootclasspath/p -> ALPN tests pass (npn tests are skipped because classes not loaded)
  2. Only list NPN jar on -Xbootclasspath/p -> NPN tests pass (alpn tests are skipped because classes not loaded)
  3. List ALPN then NPN on -Xbootclasspath/p -> ALPN tests pass, but NPN tests are run and fail. The NPN classes appear to be loaded but none of the methods NPN methods are invoked. I am using the NextProtoNego.put(engine, new ServerProvider/ClientProvider() ...).
  4. List NPN then ALPN on -Xbootclasspath/p -> NPN tests pass, but ALPN test run and fail. It seems as though some of the ALPN classes/types fail to load and I get the below exception. It seems as though my checks to detect if alpn-boot and npn-boot are on the classpath need some work (see https://github.com/netty/netty/pull/2835)

java.lang.NoSuchFieldError: EXT_ALPN at sun.security.ssl.ALPNExtension.(ALPNExtension.java:29) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:270)

version information

mvn --version Apache Maven 3.2.2 (45f7c06d68e745d05611f7fd14efb6594181933e; 2014-06-17T09:51:42-04:00) Maven home: C:\apache-maven-3.2.2\bin.. Java version: 1.7.0_45, vendor: Oracle Corporation Java home: C:\Program Files\Java\jdk1.7.0_45\jre Default locale: en_US, platform encoding: Cp1252 OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"

Scottmitch commented 10 years ago

I think @joakime addressed my concerns here https://github.com/netty/netty/pull/2835#issuecomment-53920088. In summary ALPN and NPN can not both be loaded onto the classpath at the same time.

sbordet commented 10 years ago

@Scottmitch I confirm that NPN and ALPN are not meant to be used together: either one or the other.

Scottmitch commented 10 years ago

@sbordet - Thanks for the confirmation!