You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Mark Thomas <ma...@apache.org> on 2016/05/17 22:58:09 UTC

Compiling JSPs with Jigsaw enabled Java 9

TL;DR. It doesn't work right now and that is probably OK.

During my testing of the RMI leak detection changes and Java 9, I
realised that JSP compilation was badly broken - none of the JRE
provided classes were visible to the class loader.

A little research turned up that Jigsaw effectively hides the JRE class
files from the getResourceAsStream() based mechanism that JDT currently
uses to load JRE classes. There are patched versions of the JDT compiler
available that use jrt-fs to access those classes and we should be able
to take advantage of this for JSP compilation.

My current thinking is that we wait for these Java 9 patches to make
their way into the standard JDT compiler builds and then investigate
what - if anything - we need to do get things working with Java 9. The
alternative is we figure out how to use the patched JAR and get that
working. It might be that getting things working with the patch JAR is
simpler than I think it is going to be. If someone wants to take a look...

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: Compiling JSPs with Jigsaw enabled Java 9

Posted by Mark Thomas <ma...@apache.org>.
For the record, this remains broken in 4.6 (as expected).

Mark


On 18/05/2016 12:37, Mark Thomas wrote:
> On 18/05/2016 12:22, Konstantin Kolinko wrote:
>> 2016-05-18 1:58 GMT+03:00 Mark Thomas <ma...@apache.org>:
>>> TL;DR. It doesn't work right now and that is probably OK.
>>>
>>> During my testing of the RMI leak detection changes and Java 9, I
>>> realised that JSP compilation was badly broken - none of the JRE
>>> provided classes were visible to the class loader.
>>>
>>> A little research turned up that Jigsaw effectively hides the JRE class
>>> files from the getResourceAsStream() based mechanism that JDT currently
>>> uses to load JRE classes. There are patched versions of the JDT compiler
>>> available that use jrt-fs to access those classes and we should be able
>>> to take advantage of this for JSP compilation.
>>
>> What is "jrt-fs" ?
> 
> http://openjdk.java.net/jeps/220
> 
> Look for NIO FileSystem provider.
> 
>>> My current thinking is that we wait for these Java 9 patches to make
>>> their way into the standard JDT compiler builds and then investigate
>>> what - if anything - we need to do get things working with Java 9. The
>>> alternative is we figure out how to use the patched JAR and get that
>>> working. It might be that getting things working with the patch JAR is
>>> simpler than I think it is going to be. If someone wants to take a look...
>>
>> Is it a feature? It sounds like a bug in JRE 9.
> 
> It is a feature.
> 
>> I think we use getResource() in Tomcat code to test existence of
>> classes before trying to load them.
> 
> We do. And it fails.
> 
>> Is evaluation of static methods / static fields working in EL  (e.g.
>> ${Integer.MAX_VALUE}
> 
> Haven't tested it.
> 
> Mark
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: Compiling JSPs with Jigsaw enabled Java 9

Posted by Mark Thomas <ma...@apache.org>.
On 18/05/2016 12:22, Konstantin Kolinko wrote:
> 2016-05-18 1:58 GMT+03:00 Mark Thomas <ma...@apache.org>:
>> TL;DR. It doesn't work right now and that is probably OK.
>>
>> During my testing of the RMI leak detection changes and Java 9, I
>> realised that JSP compilation was badly broken - none of the JRE
>> provided classes were visible to the class loader.
>>
>> A little research turned up that Jigsaw effectively hides the JRE class
>> files from the getResourceAsStream() based mechanism that JDT currently
>> uses to load JRE classes. There are patched versions of the JDT compiler
>> available that use jrt-fs to access those classes and we should be able
>> to take advantage of this for JSP compilation.
> 
> What is "jrt-fs" ?

http://openjdk.java.net/jeps/220

Look for NIO FileSystem provider.

>> My current thinking is that we wait for these Java 9 patches to make
>> their way into the standard JDT compiler builds and then investigate
>> what - if anything - we need to do get things working with Java 9. The
>> alternative is we figure out how to use the patched JAR and get that
>> working. It might be that getting things working with the patch JAR is
>> simpler than I think it is going to be. If someone wants to take a look...
> 
> Is it a feature? It sounds like a bug in JRE 9.

It is a feature.

> I think we use getResource() in Tomcat code to test existence of
> classes before trying to load them.

We do. And it fails.

> Is evaluation of static methods / static fields working in EL  (e.g.
> ${Integer.MAX_VALUE}

Haven't tested it.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: Compiling JSPs with Jigsaw enabled Java 9

Posted by Konstantin Kolinko <kn...@gmail.com>.
2016-05-18 1:58 GMT+03:00 Mark Thomas <ma...@apache.org>:
> TL;DR. It doesn't work right now and that is probably OK.
>
> During my testing of the RMI leak detection changes and Java 9, I
> realised that JSP compilation was badly broken - none of the JRE
> provided classes were visible to the class loader.
>
> A little research turned up that Jigsaw effectively hides the JRE class
> files from the getResourceAsStream() based mechanism that JDT currently
> uses to load JRE classes. There are patched versions of the JDT compiler
> available that use jrt-fs to access those classes and we should be able
> to take advantage of this for JSP compilation.

What is "jrt-fs" ?

> My current thinking is that we wait for these Java 9 patches to make
> their way into the standard JDT compiler builds and then investigate
> what - if anything - we need to do get things working with Java 9. The
> alternative is we figure out how to use the patched JAR and get that
> working. It might be that getting things working with the patch JAR is
> simpler than I think it is going to be. If someone wants to take a look...

Is it a feature? It sounds like a bug in JRE 9.

I think we use getResource() in Tomcat code to test existence of
classes before trying to load them.

Is evaluation of static methods / static fields working in EL  (e.g.
${Integer.MAX_VALUE}

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org