Unable to launch AUT with OpenJDK17 [message #1848174] |
Tue, 23 November 2021 13:10  |
Eclipse User |
|
|
|
Hi,
I am testing a Swing-application and have run into a problem. A couple a weeks ago we changed java version from Java 8 to OpenJDK17 and now I can't start our AUT anymore. I get an exception when starting the AUT. Se exception from client.log below. As you can see in the log I tried to add parameter --illegal-access=permit but that was ignored. It seems as XStream serialization uses reflection which is not allowed anymore.
Is there any simple work-around to fix the problem? Does Jubula have to be updated since reflection is blocked in OpenJDK17?
Are you working on such an update? When can such an update be ready for release?
Kind regards,
Martin
__________________________
Setup
* Swing application
* Jubula version 8.8.0.034
* OpenJDK17
__________________________
2021-11-23 13:46:19.175 [Connection.ReaderThread:Socket[addr=localhost/127.0.0.1,port=60001,localport=60034]] ERROR o.e.j.c.i.c.StartAUTServerStateCommand - AUTServer could not start: Unknown AUTServer exit code: 31.
Picked up _JAVA_OPTIONS: "-javaagent:C:\dev\tools\jubula\jubula_8.8.0.034\ite\plugins\org.eclipse.jubula.rc.common.agent_8.0.3.202007131040.jar"
OpenJDK 64-Bit Server VM warning: Ignoring option --illegal-access=permit; support was removed in 17.0
WARNING: A command line option has enabled the Security Manager
WARNING: The Security Manager is deprecated and will be removed in a future release
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.eclipse.jubula.rc.common.AutServerLauncher.main(AutServerLauncher.java:97)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.eclipse.jubula.rc.common.agent.RCAgent.premain(RCAgent.java:108)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:491)
at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:503)
Caused by: java.lang.ExceptionInInitializerError: Cannot access defaults field of Properties
at com.thoughtworks.xstream.converters.collections.PropertiesConverter.<clinit>(PropertiesConverter.java:46)
at com.thoughtworks.xstream.XStream.setupConverters(XStream.java:647)
at com.thoughtworks.xstream.XStream.<init>(XStream.java:445)
at com.thoughtworks.xstream.XStream.<init>(XStream.java:385)
at com.thoughtworks.xstream.XStream.<init>(XStream.java:352)
at org.eclipse.jubula.tools.internal.serialisation.XStreamXmlSerializer.<init>(XStreamXmlSerializer.java:47)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:128)
at java.base/jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:347)
at java.base/java.lang.Class.newInstance(Class.java:645)
at org.eclipse.jubula.tools.internal.serialisation.IXmlSerializer$Factory.create(IXmlSerializer.java:47)
at org.eclipse.jubula.communication.internal.parser.MessageSerializer.<init>(MessageSerializer.java:41)
at org.eclipse.jubula.communication.internal.Communicator.init(Communicator.java:272)
at org.eclipse.jubula.communication.internal.Communicator.<init>(Communicator.java:204)
at org.eclipse.jubula.rc.common.AUTServer.initAutAgentCommunicator(AUTServer.java:827)
at org.eclipse.jubula.rc.common.registration.AgentRegisterAut.register(AgentRegisterAut.java:128)
at org.eclipse.jubula.rc.common.AUTServer.registerAutinAgent(AUTServer.java:548)
at org.eclipse.jubula.rc.common.AUTServer.start(AUTServer.java:511)
at org.eclipse.jubula.rc.common.AUTServer.main(AUTServer.java:385)
... 16 more
|
|
|
|
Re: Unable to launch AUT with OpenJDK17 [message #1848507 is a reply to message #1848379] |
Mon, 06 December 2021 09:42   |
Eclipse User |
|
|
|
Hello,
There is one thing that must be done that Jubula(and its Xstream serializer) works with Java 17 and above.
--add-opens java.base/java.util=ALL-UNNAMED must be added to the start java parameters of the Application. I am unsure if more has to be opend for Jubula.
best regards
Marvin Mueller
|
|
|
Re: Unable to launch AUT with OpenJDK17 [message #1848541 is a reply to message #1848507] |
Tue, 07 December 2021 09:57   |
Eclipse User |
|
|
|
Hi Marvin,
Thanks for the reply. I was working along these lines and it feel good to get a confirmation that I am on the right path.
I have added the following arguments to my application.
--add-opens java.base/java.util=ALL-UNNAMED
--add-opens java.base/java.text=ALL-UNNAMED
--add-opens java.desktop/java.awt.font=ALL-UNNAMED
With the addition of the above I am now able to launch my application in the Jubula ITE and through the client API.
Kind regards,
Martin
|
|
|
Re: Unable to launch AUT with OpenJDK17 [message #1848567 is a reply to message #1848541] |
Wed, 08 December 2021 09:24   |
Eclipse User |
|
|
|
HI all,
Just wanted to say that I had to add more modules/packages to get the actual tests to work.
For instance the following had to be added to execute selectMenuEntryByTextPath:
--add-opens java.desktop/sun.awt=ALL-UNNAMED
Which modules/packages to open can be seen in the rc_swing.log file
2021-12-08 09:39:55.639 [Connection.ReaderThread:Socket[addr=compute.example.com/127.0.0.1,port=64254,localport=64258]] ERROR o.e.j.r.c.commands.CapTestCommand - TargetException:
java.lang.reflect.InaccessibleObjectException: Unable to make protected abstract boolean sun.awt.SunToolkit.syncNativeQueue(long) accessible: module java.desktop does not "opens sun.awt" to unnamed module @15aab8c6
Kind regards,
Martin
|
|
|
Re: Unable to launch AUT with OpenJDK17 [message #1849178 is a reply to message #1848567] |
Thu, 06 January 2022 12:03   |
Eclipse User |
|
|
|
Thanks for all your effort! Good to see that it is working now, i think this is the only way at the moment to get Jubula AUTs run with the new versions of Java. We cannot add these commands to the start of each AUT since we support also Java 7 AUTs which than does not start at all...
best regards
Marvin
|
|
|
Re: Unable to launch AUT with OpenJDK17 [message #1854984 is a reply to message #1849178] |
Wed, 21 September 2022 22:08   |
Eclipse User |
|
|
|
Hello Jubula team,
I am running into the same issue with Jubula not able to start AUT running under OpenJDK 17.0.4.8.
Here are the details:
OS - Windows Server 2016
Jubula 8.8.0.034
JDK - (adoptium) openJDK 17.4.0.8
I have followed the same instructions as noted in this post but am still getting the same error. I start test using testexec.exe
I have tried adding more javargs such as
-J--add-opens com.thoughtworks.xtream=ALL-UNNAMED as well as
-J--add-opens org.xmlpull=ALL-UNNAMED
to no avail - meaning still see the same error as before
The error seems to come from the same spot in com.throughworks.xstream.converts.collections.PropertiesConverted.<clinit> but I can't seem to figure out what else is missing - the client.log did not contain any more info than the missing 'bundles'
This goes away as soon as I set jdk to 11 instead of 17.
Any assistance would be greatly appreciated!
Lynette
P.S. By the way the link to bredex.de for migration notes is broken.
http://testing.bredex.de/migration-information.html
|
|
|
Re: Unable to launch AUT with OpenJDK17 [message #1855275 is a reply to message #1854984] |
Thu, 06 October 2022 03:48   |
Eclipse User |
|
|
|
It took me a while to figure this out so I am posting what I did here, in this post, in case someone come across this same issue later on.
First off, all the 'add-opens' option is to be added to the actual command that starts the AUT, not in the Jubula IDE (project setup page) or when starting Jubula. Let me repeat - The actual command that starts the AUT - that was my first mistake.
Options that doesn't work:
- Jubula IDE AUT configure page
- AUT Arguments
- JRE Arguments
Second, I found that when running Jubula via the IDE, the client and agent logs are not very detailed and not very helpful in trying to figure out what is missing. What helped me ultimately in figuring out what is missing and getting past this issue with serialization, i.e. what needs to 'open' when starting the AUT, is to use the command line option
<Juluba_install>/ite/testexec.exe
to start the Jubula tests/AUT. The data that appears in the console log (command line or terminal) provides much more information - actual exception and call stack - which helped in figuring out what is missing.
The bottom line is if you are running into same issue with serialization when starting your application using JDK 17 (and it works with other JDK versions - 8 or 11), you need to add the '--add-opens' line into the command that starts the AUT.
For me the call to start AUT is a batch (or sh) file, so I added all the missing '--add-opens' into the same line that starts the AUT.
Here is a snippet of what my command eventually looks like:
"%JAVA_PATH%" --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.util.concurrent=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED --add-opens java.base/java.text=ALL-UNNAMED --add-opens java.desktop/java.awt.font=ALL-UNNAMED --add-opens java.rmi/sun.rmi.transport=ALL-UNNAMED ... (other parameters that starts the AUT)
At minimum, as mentioned in previous comments, you need to add the following line
--add-opens java.base/java.util=ALL-UNNAMED
to the starting command for your AUT. You can also add the
when running in OpenJDK 17 (or above) just so you can see that this option is now deprecated in the (same) console log when starting AUT
Once you are successful - meaning you can see the line for deprecated option illegal-access AND see the add-opens line in your AUT start-up, you will now be able to see what else is missing.
Hint:
Start with the keyword "InvocationTargetException" in the console log. Look down from there until you see the 'InaccessibleObjectException" or any other exceptions that points to the exact issue that is causing the Exception - those at the items that needs to be 'opened'. A sample of what I mean is attached to this post under the file name "missingAddOpensOptionsWithJDK17.png"
Start adding those missing items, one at a time, to the same command that starts the AUT and run the testexec.exe command again. Repat until you no longer see any issues and finally see that AUT starting up.
|
|
|
Re: Unable to launch AUT with OpenJDK17 [message #1855931 is a reply to message #1855275] |
Thu, 10 November 2022 08:49  |
Eclipse User |
|
|
|
Hi Jubula Team,
i'd the same problem as Martin and Lynette described. With their tips it was possible to start the Java17 swift-app with Jubula 8.6.
These additional parameters will be used with the app:
--add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.text=ALL-UNNAMED --add-opens java.desktop/java.awt.font=ALL-UNNAMED
but.....
The methods "ub_cti_inputText / input text" and„ub_grc_click / click" doesn't work any more. Jubula stated "Configuration Error".
Other methods like "store value" or "Button exists" works fine. Also all objects are recognized in the object mapper
Do you haveany hints where to search for the origin of the "Configuration Error" ?
Additional:
- Same Problem with latest Jubula-Version 8.8.1
- ObjectMapper works fine. New Objects can be added
- right and left Mouseclick, Input Text doesn't work
- "ub_ctx_storeValue" works fine
Problem solved!
Solution: adding a fourth "add-opens" when starting AUT:
--add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.text=ALL-UNNAMED --add-opens java.desktop/java.awt.font=ALL-UNNAMED --add-opens java.desktop/sun.awt=ALL-UNNAMED
But now mouse is moving veeeery slow. This Problem exist since JDK 11.0.12.x in Windows (see: https://www.eclipse.org/forums/index.php/t/1109633/)
Workaround: (with Jubula 8.8.1, doesn't work with 8.6.0)
add
TEST_DISABLE_MOUSE_MOVEMENT=true
to AUT-Agents "System Environment Variables"
How to do:
Click in Jubula on menu "Test" -> "Properties" -> "AUTs" -> choose your "AUT" -> "Edit" -> choose your "AUT configurations" -> "Edit" -> "Expert" -> Enter "TEST_DISABLE_MOUSE_MOVEMENT=true" (without ") in "System Environment Variables" -> "ok" -> "ok" -> "Apply and Close"
Thanks to Martin J ! :-)
[Updated on: Fri, 18 November 2022 16:28] by Moderator Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.04546 seconds