Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jakartaee-tck-dev] Unable to run Servlet TCK on Java 11



On 6/19/20 9:07 AM, Mark Thomas wrote:
Hi,

I am currently working the Servlet TCK and have hit an issue when
running on Java 11.

The Servlet TCK tests HTTP/2 functionality. To do this is uses an HTTP/2
client provided by http.jar. This appears the Java 9 module
jdk.incubator.http ported to Java 8. I can't find the source code for
ported version anywhere. The issue is that the ported code references
sun.misc.InnocuousThread which isn't present in Java 11.

I have looked at several potential solutions:

1. Avoid the code that triggers loading of InnocuousThread
This isn't possible.

2. Switch to a different HTTP/2 client. Apache HttpClient 5.0 supports
HTTP/2 but that would require an upgrade to HttpClient 5.0 for at least
all of the Servlet 5.0 TCK. It should be a safe upgrade but there are
risks attached to an upgrade. I dismissed this option due to the risks.

Perhaps for EE10, although I don't think we have much TCK code that directly uses the jdk.incubator.http code (just src/com/sun/ts/tests/servlet/spec/serverpush/Client.java). Did I miss a reference?


3. Provide a Java 11 version of these TCK tests that uses the
java.net.http API. This should be fairly easy to write but it would then
require the Servlet TCK to be compiled with Java 11. I am assuming that
a change to compiling with Java 11 is not an option at this stage.

As others said, this could work.


4. Use reflection to provide a Java 8 compilable solution that uses Java
11 features when running on Java 11. This looks possible but is a lot of
work. It appears to be made more complex by changes in the API between
the incubator stage in Java 9 and the final version in Java 11.

This could also work.


5. Use BCEL to remove the references to InnocuousThread in http.jar.
This looks doable at this stage. There may be further complications once
the InnocuousThread issues are fixed.

My current thinking is:
- explore option 5
- if it works, provide the code I use to 'patch' http.jar in a text file
   along side the HTTP/2 tests along with the patched JAR in a PR

If we could find the jdk.incubator.http source, would it make sense to request transferring the source to Eclipse so that it could be maintained via source level changes? Not much time left for that, but if that is what we want for the future, we should get that started. Or is it more likely that we would just switch to Apache HttpClient 5.0 for EE 10?

Scott


Thoughts on my proposed solution? Suggestions of a better solution?

Thanks,

Mark
_______________________________________________
jakartaee-tck-dev mailing list
jakartaee-tck-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jakartaee-tck-dev




Back to the top