Home » Language IDEs » Objectteams » Classpath problems when running OTJ test suite
Classpath problems when running OTJ test suite [message #1847177] |
Mon, 18 October 2021 05:17  |
Eclipse User |
|
|
|
Hi Stephan, hi everyone,
I am trying to execute the OTJ tests with my changes to further explore the implementation of other features. I run AllTests in tests.otjld as JUnit Plugin Tests.
However, I have a problem with class discovery (ClassNotFoundException thrown from BundleLoader.findClass) which often points to problems with visibility of bundles and packages in OSGi.
Caused by: java.lang.ClassNotFoundException: org.eclipse.objectteams.otredyn.runtime.dynamic.linker.TeamsAndCallinIdsBootstrap cannot be found by org.eclipse.ui.workbench_3.119.0.v20200521-1247
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:516)
My code changes directly happened in CreateCallAllBindingsCallInOrgMethod#generateInvocation of OTREDyn where I construct an invokedynamic callsite with ASM.
private static final Handle teamsAndIdsBootstrapHandle = new Handle(Opcodes.H_INVOKESTATIC,
ClassNames.TEAMS_AND_IDS_BOOTSTRAP_SLASH, ConstantMembers.teamsAndCallinIdsBootstrap.getName(),
ConstantMembers.teamsAndCallinIdsBootstrap.getSignature(), false);
and is put as an invokedynamic with
newInstructions.add(new InvokeDynamicInsnNode("getTeamsAndCallinIds",
ConstantMembers.getTeamsAndCallinIds.getSignature(), teamsAndIdsBootstrapHandle, joinpointId));
addLineNumber(newInstructions, SMAPConstants.STEP_OVER_LINENUMBER);
This also works without OSGi when exporting OTJ as JAR files.
So I suspect that either I need to have the OTREDyn packages being imported into base classes (is that done somewhere?) or the ASM library needs to be used differently in OSGi environment?
Do you by chance have an idea? I already looked into the otequinox plugin but could not find something which I would relate to my problems. I also exported the packages I added to otredyn and imported these from otequinox.
Thank you very much!
[Updated on: Mon, 18 October 2021 05:18] by Moderator
|
|
| | | | | | |
Re: Classpath problems when running OTJ test suite [message #1847961 is a reply to message #1847898] |
Mon, 15 November 2021 06:09   |
Eclipse User |
|
|
|
It seems like it currently hangs in the TestVerifier. After calling ::runTest it calls AbstractOTJLDTest$OTTestVerifier.verifyClass and then AbstractOTJLDTest$OTTestVerifier.launchVerifier where it waits for server.accept(). Looks like it stalls there ...
That is the vm arguments it constructed (I changed it to not use JavacTestOptions.DEFAULT but added some necessary module visibility commands):
[-javaagent:/Users/lschuetze/Development/repos/objectteams-poly/plugins/org.eclipse.objectteams.otdt/lib/otredyn_agent.jar, -Xbootclasspath/a:/Users/lschuetze/Development/repos/objectteams-poly/plugins/org.eclipse.objectteams.otdt/lib/otre_min.jar, -Dot.dump=1, -Dobjectteams.otdre.verify=1, --add-reads, java.base=ALL-UNNAMED, --add-reads, jdk.net=ALL-UNNAMED, --add-opens, java.base/java.lang=ALL-UNNAMED]
I am a little bit concerned about the commas between the --add-opens and the declared modules as they go together.
[Updated on: Mon, 15 November 2021 06:13] by Moderator
|
|
|
Re: Classpath problems when running OTJ test suite [message #1848030 is a reply to message #1847961] |
Wed, 17 November 2021 12:40   |
Eclipse User |
|
|
|
Quote: I am a little bit concerned about the commas between the --add-opens and the declared modules as they go together.
Commas are OK, this is just the rendering of a string array, where arguments have been split at what would be whitespace in a regular command line.
Quote:AbstractOTJLDTest$OTTestVerifier.launchVerifier where it waits for server.accept(). Looks like it stalls there ...
This is where it get's tricky to debug, since we are (hopefully) launching a second vm for executing a test program. Some ideas for debugging:
- when it hangs, do you see a new JVM process at the operating system level? If so, can you use jstack to check what it's doing, when it hangs?
- the remote end executes a class generated on the fly from TestVerifier.getVerifyTestsCode(). So if that part doesn't behave, that's where you may want to add some logging, but beware that out and err are redirected: instead of printing on the console any logging will be received in AbstractRegressionTest.runTest(), but then it will be reported as unexpected program output :)
[Updated on: Wed, 17 November 2021 12:50] by Moderator
|
|
|
Re: Classpath problems when running OTJ test suite [message #1848047 is a reply to message #1848030] |
Thu, 18 November 2021 07:55   |
Eclipse User |
|
|
|
Okay, So I do not get to the point where I could attach to the launched VM. In LocalVMLauncher::execCommandLine() it executed the generated command line:
[/Library/Java/JavaVirtualMachines/jdk-14.0.2.jdk/Contents/Home/bin/java, -verify, -javaagent:/Users/lschuetze/Development/repos/objectteams-poly/plugins/org.eclipse.objectteams.otdt/lib/otredyn_agent.jar, -Xbootclasspath/a:/Users/lschuetze/Development/repos/objectteams-poly/plugins/org.eclipse.objectteams.otdt/lib/otre_min.jar, -Dot.dump=1, -Dobjectteams.otdre.verify=1, --add-reads, java.base=ALL-UNNAMED, --add-reads, jdk.net=ALL-UNNAMED, --add-opens, java.base/java.lang=ALL-UNNAMED, --add-reads, jdk.dynalink=ALL-UNNAMED, --add-reads, jdk.localedata=ALL-UNNAMED, -Xverify:all, -XX:+UnlockExperimentalVMOptions, -Xbootclasspath/a:/Library/Java/JavaVirtualMachines/jdk-14.0.2.jdk/Contents/Home/jre/lib/rt.jar:, -classpath, /Library/Java/JavaVirtualMachines/jdk-14.0.2.jdk/Contents/Home/lib/jrt-fs.jar:/private/var/folders/28/fqt91mbn0rs_zf8dxkqw4pbr0000gn/T/comptest/run.1637239763023/regression:/Users/lschuetze/.p2/pool/plugins/org.eclipse.objectteams.runtime_2.8.1.202006091155.jar:/Users/lschuetze/.p2/pool/plugins/org.eclipse.objectteams.otredyn_1.4.1.202006091155.jar:/Users/lschuetze/Development/committers-2020-06/.metadata/.plugins/org.eclipse.pde.core/pde-junit/org.eclipse.osgi/523/0/.cp/:/Users/lschuetze/Development/committers-2020-06/.metadata/.plugins/org.eclipse.pde.core/pde-junit/org.eclipse.osgi/528/0/.cp/:/Users/lschuetze/Development/committers-2020-06/.metadata/.plugins/org.eclipse.pde.core/pde-junit/org.eclipse.osgi/526/0/.cp/:/Users/lschuetze/Development/committers-2020-06/.metadata/.plugins/org.eclipse.pde.core/pde-junit/org.eclipse.osgi/530/0/.cp/:/Users/lschuetze/Development/committers-2020-06/.metadata/.plugins/org.eclipse.pde.core/pde-junit/org.eclipse.osgi/525/0/.cp/:/private/var/folders/28/fqt91mbn0rs_zf8dxkqw4pbr0000gn/T/comptest/run.1637239763023/verifier:, org.eclipse.jdt.core.tests.util.VerifyTests, 52362]
It creates a process which immediately returns with error code 1. Process[pid=44243, exitValue=1]
As you can see from the generated command line I had to programmatically add my extra VM Arguments (i.e., dynalink) that I put into the run configuration inside Eclipse because they had not been taken up. I added them to AbstractOTJLDTest$OTTestVerifier::getOTVMArgs() by hand.
The only thing that I see is that the generated otredyn.jar is not taken up from org.eclipse.objectteams.otdt/lib/otredyn.jar but from the host Eclipse /Users/lschuetze/.p2/pool/plugins/org.eclipse.objectteams.otredyn_1.4.1.202006091155.jar
And then it tries to connect to that process which leads to the deadlock.
Thanks for all your help so far!
[Updated on: Thu, 18 November 2021 08:00] by Moderator
|
|
| | |
Re: Classpath problems when running OTJ test suite [message #1849112 is a reply to message #1849099] |
Tue, 04 January 2022 06:59  |
Eclipse User |
|
|
|
Armen Edvard,
I don't think your question is really connected to this thread. There's a myriad of potential reasons why you may be seeing classpath problems.
I recommend, first you try to identify what is the component you are having problems with. I don't see indications that Object Teams (this forum) is involved. Is the problem specific to TestNG? Do you use a TestNG Eclipse Plug-in? Are you having issues with JDT? If OSGi is involved, perhaps you are struggling with PDE? If you don't know better, you could try the newcomers forum.
Once you found a suitable forum, please really try to explain (a) what you are trying to do and (b) what exactly is the problem you are seeing. Too much is unclear in your post for me to even start asking questions, sorry.
|
|
|
Goto Forum:
Current Time: Tue May 13 08:42:02 EDT 2025
Powered by FUDForum. Page generated in 0.06817 seconds
|