|
|
|
|
|
|
|
Re: Unable to launch AUT with OpenJDK17 [message #1855275 is a reply to message #1854984] |
Thu, 06 October 2022 03:48 |
Lynette Hsieh Messages: 9 Registered: February 2016 |
Junior Member |
|
|
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 |
Wolfgang Krechtig Messages: 1 Registered: November 2022 |
Junior Member |
|
|
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] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.04724 seconds