You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Christoph Nenning <Ch...@lex-com.net> on 2016/09/14 14:01:32 UTC

s2 and jdk9: works with newer snapshot builds

Hi,

I had a look why our builds fail with jdk9. s2 uses log4j2 which uses 
javax.script.ScriptEngineManager. That class is missing in the jdk9 
snapshot build used on ASF jenkins (build 132).

Locally I used latest build of jdk9 (135). With that s2 does build 
successfully.

So we have to wait until infra updates jdk9 on jenkins.


regards,
Christoph

This Email was scanned by Sophos Anti Virus

Re: s2 and jdk9: works with newer snapshot builds

Posted by Christoph Nenning <Ch...@lex-com.net>.
> > Hi,
> >
> > I get different issues :(
> >
> > Here is my setup:
> >
> >
> > Apache Maven 3.3.9 (NON-CANONICAL_2016-07-01T11:53:38Z_mockbuild;
> > 2016-07-01T13:53:38+02:00)
> > Maven home: /usr/share/maven
> > Java version: 9, vendor: Oracle Corporation
> > Java home: /home/test/tools/jdk-9+181
> > Default locale: en_GB, platform encoding: UTF-8
> > OS name: "linux", version: "4.11.12-200.fc25.x86_64", arch: "amd64",
> > family: "unix"
> 
> As far I know Maven 3.5.0 is the one that has to be used with JDK9
> 
> > At first I got weird ClassNotFoundErrors and nearly all tests failed.
> > After updating maven-surefire-plugin to 2.20 many tests are working. 
The
> > ones that still fail try to load resoures by ClassLoader but with java 
9
> > we don't get hold of an URLClassLoader anymore and resources are not
> > found.
> >
> > The ClassLoader type is: 
jdk.internal.loader.ClassLoaders$AppClassLoader
> 
> Please try this (a hint from builds@a.o):
> 
> <profile>
>     <id>jdk9</id>
>     <properties>
>         <addmod>--add-modules java.activation --add-modules
> java.xml.bind</addmod>
>     </properties>
> </profile>
> 


Both make no difference (newer maven was not necessary as I upgraded 
maven-compiler-plugin to 3.6.2). It is like Yasser said: the way struts 
uses URLClassLoader to load resources does not work anymore with java9.


Regards,
Christoph

This Email was scanned by Sophos Anti Virus

Re: s2 and jdk9: works with newer snapshot builds

Posted by Lukasz Lenart <lu...@apache.org>.
2017-08-14 17:04 GMT+02:00 Christoph Nenning <Ch...@lex-com.net>:
> Hi,
>
> I get different issues :(
>
> Here is my setup:
>
>
> Apache Maven 3.3.9 (NON-CANONICAL_2016-07-01T11:53:38Z_mockbuild;
> 2016-07-01T13:53:38+02:00)
> Maven home: /usr/share/maven
> Java version: 9, vendor: Oracle Corporation
> Java home: /home/test/tools/jdk-9+181
> Default locale: en_GB, platform encoding: UTF-8
> OS name: "linux", version: "4.11.12-200.fc25.x86_64", arch: "amd64",
> family: "unix"

As far I know Maven 3.5.0 is the one that has to be used with JDK9

> At first I got weird ClassNotFoundErrors and nearly all tests failed.
> After updating maven-surefire-plugin to 2.20 many tests are working. The
> ones that still fail try to load resoures by ClassLoader but with java 9
> we don't get hold of an URLClassLoader anymore and resources are not
> found.
>
> The ClassLoader type is: jdk.internal.loader.ClassLoaders$AppClassLoader

Please try this (a hint from builds@a.o):

<profile>
    <id>jdk9</id>
    <properties>
        <addmod>--add-modules java.activation --add-modules
java.xml.bind</addmod>
    </properties>
</profile>


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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


Re: s2 and jdk9: works with newer snapshot builds

Posted by Lukasz Lenart <lu...@apache.org>.
2017-08-14 17:18 GMT+02:00 Yasser Zamani <ya...@live.com>:
> Hi there,
>
> Yes, me too passed a lot of tests by upgrading surefire to 2.20 which
> enables class loading from new java module system in jdk-9.
>
> I think the rest of failed tests are about Struts itself and should be
> corrected. For example what you mentioned, is due to the Java 9
> architecture precluding use of URLClassLoader as a superclass for the
> system ClassLoaders. So our test cannot find any URLClassLoader and
> returns null from ClassPathFinder.getURLClassLoader!
>
> Would we need JDK-9 support at now? if so I can work on them one by one
> and prepare a PR :)

We can postpone this, it isn't so important (for now) till the current
build (based on either JDK7 or JDK8) can be run on Java 9.


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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


Re: s2 and jdk9: works with newer snapshot builds

Posted by Yasser Zamani <ya...@live.com>.
Hi there,

Yes, me too passed a lot of tests by upgrading surefire to 2.20 which 
enables class loading from new java module system in jdk-9.

I think the rest of failed tests are about Struts itself and should be 
corrected. For example what you mentioned, is due to the Java 9 
architecture precluding use of URLClassLoader as a superclass for the 
system ClassLoaders. So our test cannot find any URLClassLoader and 
returns null from ClassPathFinder.getURLClassLoader!

Would we need JDK-9 support at now? if so I can work on them one by one 
and prepare a PR :)

On 8/14/2017 7:34 PM, Christoph Nenning wrote:
> Hi,
>
> I get different issues :(
>
> Here is my setup:
>
>
> Apache Maven 3.3.9 (NON-CANONICAL_2016-07-01T11:53:38Z_mockbuild;
> 2016-07-01T13:53:38+02:00)
> Maven home: /usr/share/maven
> Java version: 9, vendor: Oracle Corporation
> Java home: /home/test/tools/jdk-9+181
> Default locale: en_GB, platform encoding: UTF-8
> OS name: "linux", version: "4.11.12-200.fc25.x86_64", arch: "amd64",
> family: "unix"
>
>
> At first I got weird ClassNotFoundErrors and nearly all tests failed.
> After updating maven-surefire-plugin to 2.20 many tests are working. The
> ones that still fail try to load resoures by ClassLoader but with java 9
> we don't get hold of an URLClassLoader anymore and resources are not
> found.
>
> The ClassLoader type is: jdk.internal.loader.ClassLoaders$AppClassLoader
>
>
> HTH
> Christoph
>
>
>
>
>> From: Yasser Zamani <ya...@live.com>
>> To: "dev@struts.apache.org" <de...@struts.apache.org>,
>> Date: 11.08.2017 14:52
>> Subject: Re: s2 and jdk9: works with newer snapshot builds
>>
>> So far I found out IntelliJ IDEA can load
>> javax.script.ScriptEngineManager from a jrt file system at
>> jrt:/java.scripting but command line can not.
>>
>> ...now working to find out how to enable command line also...
>>
>> On 8/11/2017 1:40 AM, Yasser Zamani wrote:
>>> You are right! I get same result with last jdk9. i.e. a lot of tests
>>> fail in windows cmd and also IntelliJ IDEA's maven run but IntelliJ
>>> IDEA's debug passes that test ! (I tested first one reported i.e.
>>> org.apache.struts2.components.ComponentTest).
>>>
>>> ...still working to find out why!...
>>>
>>> On 8/11/2017 12:21 AM, Lukasz Lenart wrote:
>>>> 2017-08-10 21:48 GMT+02:00 Yasser Zamani <ya...@live.com>:
>>>>> With pleasure...
>>>>>
>>>>> C:\Users\user>java -version
>>>>> java version "1.9.0-ea"
>>>>> Java(TM) SE Runtime Environment (build 1.9.0-ea-b52)
>>>>> Java HotSpot(TM) 64-Bit Server VM (build 1.9.0-ea-b52, mixed mode)
>>>>
>>>> This an old build ... maybe that's why
>>>>
>>>>> However, now, as you use latest jdk, I'm going to download and try
> [1]
>>>>> to see it's result if is like your.
>>>>
>>>> Yeah, please let me know
>>>>
>>>>> and did you mean 2.5.13-SNAPSHOT or 2.3.33-SNAPSHOT? my result is
> for
>>>>> first one with goal clean install -DskipAssembly.
>>>>
>>>> 2.5.x only, we do not plan to support 2.3.x on Java 9
>>>>
>>>>
>>>> Regards
>>>>
>>>
>>
> B�KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKCB��
>>
> [��X��ܚX�KK[XZ[�]�][��X��ܚX�P��]˘\X�K�ܙ�B��܈Y][ۘ[��
>> [X[��K[XZ[�]�Z[��]˘\X�K�ܙ�B�B
>>>
>
>
> This Email was scanned by Sophos Anti Virus
>

Re: s2 and jdk9: works with newer snapshot builds

Posted by Christoph Nenning <Ch...@lex-com.net>.
Hi,

I get different issues :(

Here is my setup:


Apache Maven 3.3.9 (NON-CANONICAL_2016-07-01T11:53:38Z_mockbuild; 
2016-07-01T13:53:38+02:00)
Maven home: /usr/share/maven
Java version: 9, vendor: Oracle Corporation
Java home: /home/test/tools/jdk-9+181
Default locale: en_GB, platform encoding: UTF-8
OS name: "linux", version: "4.11.12-200.fc25.x86_64", arch: "amd64", 
family: "unix"


At first I got weird ClassNotFoundErrors and nearly all tests failed. 
After updating maven-surefire-plugin to 2.20 many tests are working. The 
ones that still fail try to load resoures by ClassLoader but with java 9 
we don't get hold of an URLClassLoader anymore and resources are not 
found.

The ClassLoader type is: jdk.internal.loader.ClassLoaders$AppClassLoader


HTH
Christoph




> From: Yasser Zamani <ya...@live.com>
> To: "dev@struts.apache.org" <de...@struts.apache.org>, 
> Date: 11.08.2017 14:52
> Subject: Re: s2 and jdk9: works with newer snapshot builds
> 
> So far I found out IntelliJ IDEA can load 
> javax.script.ScriptEngineManager from a jrt file system at 
> jrt:/java.scripting but command line can not.
> 
> ...now working to find out how to enable command line also...
> 
> On 8/11/2017 1:40 AM, Yasser Zamani wrote:
> > You are right! I get same result with last jdk9. i.e. a lot of tests
> > fail in windows cmd and also IntelliJ IDEA's maven run but IntelliJ
> > IDEA's debug passes that test ! (I tested first one reported i.e.
> > org.apache.struts2.components.ComponentTest).
> >
> > ...still working to find out why!...
> >
> > On 8/11/2017 12:21 AM, Lukasz Lenart wrote:
> >> 2017-08-10 21:48 GMT+02:00 Yasser Zamani <ya...@live.com>:
> >>> With pleasure...
> >>>
> >>> C:\Users\user>java -version
> >>> java version "1.9.0-ea"
> >>> Java(TM) SE Runtime Environment (build 1.9.0-ea-b52)
> >>> Java HotSpot(TM) 64-Bit Server VM (build 1.9.0-ea-b52, mixed mode)
> >>
> >> This an old build ... maybe that's why
> >>
> >>> However, now, as you use latest jdk, I'm going to download and try 
[1]
> >>> to see it's result if is like your.
> >>
> >> Yeah, please let me know
> >>
> >>> and did you mean 2.5.13-SNAPSHOT or 2.3.33-SNAPSHOT? my result is 
for
> >>> first one with goal clean install -DskipAssembly.
> >>
> >> 2.5.x only, we do not plan to support 2.3.x on Java 9
> >>
> >>
> >> Regards
> >>
> > 
> 
B�KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKCB��
> 
[��X��ܚX�KK[XZ[�]�][��X��ܚX�P��]˘\X�K�ܙ�B��܈Y][ۘ[��
> [X[��K[XZ[�]�Z[��]˘\X�K�ܙ�B�B
> >


This Email was scanned by Sophos Anti Virus

Re: s2 and jdk9: works with newer snapshot builds

Posted by Yasser Zamani <ya...@live.com>.
So far I found out IntelliJ IDEA can load 
javax.script.ScriptEngineManager from a jrt file system at 
jrt:/java.scripting but command line can not.

...now working to find out how to enable command line also...

On 8/11/2017 1:40 AM, Yasser Zamani wrote:
> You are right! I get same result with last jdk9. i.e. a lot of tests
> fail in windows cmd and also IntelliJ IDEA's maven run but IntelliJ
> IDEA's debug passes that test ! (I tested first one reported i.e.
> org.apache.struts2.components.ComponentTest).
>
> ...still working to find out why!...
>
> On 8/11/2017 12:21 AM, Lukasz Lenart wrote:
>> 2017-08-10 21:48 GMT+02:00 Yasser Zamani <ya...@live.com>:
>>> With pleasure...
>>>
>>> C:\Users\user>java -version
>>> java version "1.9.0-ea"
>>> Java(TM) SE Runtime Environment (build 1.9.0-ea-b52)
>>> Java HotSpot(TM) 64-Bit Server VM (build 1.9.0-ea-b52, mixed mode)
>>
>> This an old build ... maybe that's why
>>
>>> However, now, as you use latest jdk, I'm going to download and try [1]
>>> to see it's result if is like your.
>>
>> Yeah, please let me know
>>
>>> and did you mean 2.5.13-SNAPSHOT or 2.3.33-SNAPSHOT? my result is for
>>> first one with goal clean install -DskipAssembly.
>>
>> 2.5.x only, we do not plan to support 2.3.x on Java 9
>>
>>
>> Regards
>>
> B�KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKCB��[��X��ܚX�KK[XZ[�]�][��X��ܚX�P��]˘\X�K�ܙ�B��܈Y][ۘ[��[X[��K[XZ[�]�Z[��]˘\X�K�ܙ�B�B
>

Re: s2 and jdk9: works with newer snapshot builds

Posted by Yasser Zamani <ya...@live.com>.
You are right! I get same result with last jdk9. i.e. a lot of tests 
fail in windows cmd and also IntelliJ IDEA's maven run but IntelliJ 
IDEA's debug passes that test ! (I tested first one reported i.e. 
org.apache.struts2.components.ComponentTest).

...still working to find out why!...

On 8/11/2017 12:21 AM, Lukasz Lenart wrote:
> 2017-08-10 21:48 GMT+02:00 Yasser Zamani <ya...@live.com>:
>> With pleasure...
>>
>> C:\Users\user>java -version
>> java version "1.9.0-ea"
>> Java(TM) SE Runtime Environment (build 1.9.0-ea-b52)
>> Java HotSpot(TM) 64-Bit Server VM (build 1.9.0-ea-b52, mixed mode)
>
> This an old build ... maybe that's why
>
>> However, now, as you use latest jdk, I'm going to download and try [1]
>> to see it's result if is like your.
>
> Yeah, please let me know
>
>> and did you mean 2.5.13-SNAPSHOT or 2.3.33-SNAPSHOT? my result is for
>> first one with goal clean install -DskipAssembly.
>
> 2.5.x only, we do not plan to support 2.3.x on Java 9
>
>
> Regards
>

Re: s2 and jdk9: works with newer snapshot builds

Posted by Lukasz Lenart <lu...@apache.org>.
2017-08-10 21:48 GMT+02:00 Yasser Zamani <ya...@live.com>:
> With pleasure...
>
> C:\Users\user>java -version
> java version "1.9.0-ea"
> Java(TM) SE Runtime Environment (build 1.9.0-ea-b52)
> Java HotSpot(TM) 64-Bit Server VM (build 1.9.0-ea-b52, mixed mode)

This an old build ... maybe that's why

> However, now, as you use latest jdk, I'm going to download and try [1]
> to see it's result if is like your.

Yeah, please let me know

> and did you mean 2.5.13-SNAPSHOT or 2.3.33-SNAPSHOT? my result is for
> first one with goal clean install -DskipAssembly.

2.5.x only, we do not plan to support 2.3.x on Java 9


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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


Re: s2 and jdk9: works with newer snapshot builds

Posted by Yasser Zamani <ya...@live.com>.
With pleasure...

C:\Users\user>java -version
java version "1.9.0-ea"
Java(TM) SE Runtime Environment (build 1.9.0-ea-b52)
Java HotSpot(TM) 64-Bit Server VM (build 1.9.0-ea-b52, mixed mode)

C:\Users\user>javac -version
javac 1.9.0-ea

However, now, as you use latest jdk, I'm going to download and try [1] 
to see it's result if is like your.

and did you mean 2.5.13-SNAPSHOT or 2.3.33-SNAPSHOT? my result is for 
first one with goal clean install -DskipAssembly.

[1] 
http://download.java.net/java/jdk9/archive/181/binaries/jdk-9+181_windows-x64_bin.exe

On 8/11/2017 12:02 AM, Lukasz Lenart wrote:
> 2017-08-10 8:17 GMT+02:00 Yasser Zamani <ya...@live.com>:
>> Does not fail in my windows cmd.
>>
>> C:\Users\user\IdeaProjects\struts>C:\Users\user\Downloads\apache-maven-3.5.0-bin
>> \apache-maven-3.5.0\bin\mvn -version
>> Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426;
>> 2017-04-04T00:09:0
>> 6+04:30)
>> Maven home:
>> C:\Users\user\Downloads\apache-maven-3.5.0-bin\apache-maven-3.5.0\bi
>> n\..
>> Java version: 1.9.0-ea, vendor: Oracle Corporation
>> Java home: C:\Program Files\Java\jdk1.9.0
>> Default locale: en_US, platform encoding: Cp1252
>> OS name: "windows 8.1", version: "6.3", arch: "amd64", family: "windows"
>
> Strange ... can you post output of "java -version" and "javac -version"?
>
>
> Thanks in advance
>

Re: s2 and jdk9: works with newer snapshot builds

Posted by Lukasz Lenart <lu...@apache.org>.
2017-08-10 8:17 GMT+02:00 Yasser Zamani <ya...@live.com>:
> Does not fail in my windows cmd.
>
> C:\Users\user\IdeaProjects\struts>C:\Users\user\Downloads\apache-maven-3.5.0-bin
> \apache-maven-3.5.0\bin\mvn -version
> Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426;
> 2017-04-04T00:09:0
> 6+04:30)
> Maven home:
> C:\Users\user\Downloads\apache-maven-3.5.0-bin\apache-maven-3.5.0\bi
> n\..
> Java version: 1.9.0-ea, vendor: Oracle Corporation
> Java home: C:\Program Files\Java\jdk1.9.0
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows 8.1", version: "6.3", arch: "amd64", family: "windows"

Strange ... can you post output of "java -version" and "javac -version"?


Thanks in advance
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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


Re: s2 and jdk9: works with newer snapshot builds

Posted by Yasser Zamani <ya...@live.com>.
Does not fail in my windows cmd.

C:\Users\user\IdeaProjects\struts>C:\Users\user\Downloads\apache-maven-3.5.0-bin
\apache-maven-3.5.0\bin\mvn -version
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 
2017-04-04T00:09:0
6+04:30)
Maven home: 
C:\Users\user\Downloads\apache-maven-3.5.0-bin\apache-maven-3.5.0\bi
n\..
Java version: 1.9.0-ea, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.9.0
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 8.1", version: "6.3", arch: "amd64", family: "windows"

***

[INFO] BUILD SUCCESS
[INFO] 
------------------------------------------------------------------------
[INFO] Total time: 03:19 min
[INFO] Finished at: 2017-08-10T10:29:18+04:30
[INFO] Final Memory: 93M/803M
[INFO] 
------------------------------------------------------------------------

On 8/9/2017 7:13 PM, Lukasz Lenart wrote:
> Any idea why the tests fails when launching them from a command line
> but the same tes passes when launched from IntelliJ IDEA?
>
> I'm using the latest JDK9 and Maven 3.5.0
>
> 2016-09-14 20:33 GMT+02:00 Lukasz Lenart <lu...@apache.org>:
>> Cool! Thanks a lot!
>>
>> 2016-09-14 16:01 GMT+02:00 Christoph Nenning <Ch...@lex-com.net>:
>>> Hi,
>>>
>>> I had a look why our builds fail with jdk9. s2 uses log4j2 which uses
>>> javax.script.ScriptEngineManager. That class is missing in the jdk9
>>> snapshot build used on ASF jenkins (build 132).
>>>
>>> Locally I used latest build of jdk9 (135). With that s2 does build
>>> successfully.
>>>
>>> So we have to wait until infra updates jdk9 on jenkins.
>>>
>>>
>>> regards,
>>> Christoph
>>>
>>> This Email was scanned by Sophos Anti Virus
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>

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


Re: s2 and jdk9: works with newer snapshot builds

Posted by Lukasz Lenart <lu...@apache.org>.
Any idea why the tests fails when launching them from a command line
but the same tes passes when launched from IntelliJ IDEA?

I'm using the latest JDK9 and Maven 3.5.0

2016-09-14 20:33 GMT+02:00 Lukasz Lenart <lu...@apache.org>:
> Cool! Thanks a lot!
>
> 2016-09-14 16:01 GMT+02:00 Christoph Nenning <Ch...@lex-com.net>:
>> Hi,
>>
>> I had a look why our builds fail with jdk9. s2 uses log4j2 which uses
>> javax.script.ScriptEngineManager. That class is missing in the jdk9
>> snapshot build used on ASF jenkins (build 132).
>>
>> Locally I used latest build of jdk9 (135). With that s2 does build
>> successfully.
>>
>> So we have to wait until infra updates jdk9 on jenkins.
>>
>>
>> regards,
>> Christoph
>>
>> This Email was scanned by Sophos Anti Virus

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


Re: s2 and jdk9: works with newer snapshot builds

Posted by Lukasz Lenart <lu...@apache.org>.
Cool! Thanks a lot!

2016-09-14 16:01 GMT+02:00 Christoph Nenning <Ch...@lex-com.net>:
> Hi,
>
> I had a look why our builds fail with jdk9. s2 uses log4j2 which uses
> javax.script.ScriptEngineManager. That class is missing in the jdk9
> snapshot build used on ASF jenkins (build 132).
>
> Locally I used latest build of jdk9 (135). With that s2 does build
> successfully.
>
> So we have to wait until infra updates jdk9 on jenkins.
>
>
> regards,
> Christoph
>
> This Email was scanned by Sophos Anti Virus

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