Class Loader problem while debugging 18.1 in eclipse

Having trouble installing Oxygen? Got a bug to report? Post it all here.
nicomi
Posts: 6
Joined: Fri Oct 26, 2018 1:38 pm

Class Loader problem while debugging 18.1 in eclipse

Post by nicomi »

Hello everyone,

I'm currently developing a CustomWorkspaceAccessPluginExtension for our 18.1 XMLEditor.
While trying to debug (following these instructions: https://www.oxygenxml.com/doc/versions/ ... lugin.html), I ran into a missing LateDelegateClassloader.
Following the fix in this thread (topic17592.html) I now get the following error message:

Code: Select all

java.lang.IncompatibleClassChangeError: Implementing class
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1007)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:801)
...
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:550)
at ro.sync.basic.classloader.LateDelegationClassLoader.loadClass(LateDelegationClassLoader.java:214)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496)
at ro.sync.basic.classloader.ContextFinder.loadClass(ContextFinder.java:196)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496)
at ro.sync.exml.Oxygen.main(Unknown Source)
I took the oxygen-basic-utilities.jar from the 20.1 version (didn't find one in ealier versions) but I am currently using 18.1 for development at our institution. Does this error come from the version discrepancy or is there another reason?
If it is impossible to debug my code this way, how should I debug in earlier versions of OxygenXMLEditor without the basic-utilities?
Radu
Posts: 9418
Joined: Fri Jul 09, 2004 5:18 pm

Re: Class Loader problem while debugging 18.1 in eclipse

Post by Radu »

Hi,

I think that right now the problem is that "oxygen-basic-utilities.jar" (like all other JAR libraries from Oxygen 20.1) is compiled with Java 1.8 compatibility but you are running the debug Java process with Java 1.7 or 1.6.
Oxygen 18.1 was compiled with Java 1.6 and can be run using Java 1.6 or newer but Oxygen 20.1 is compiled with Java 1.8 compatibility so it can no longer be run with Java 1.6 or 1.7.

In general you should use for debugging the same Oxygen version that you want as a target platform (Oxygen 18.1).

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
nicomi
Posts: 6
Joined: Fri Oct 26, 2018 1:38 pm

Re: Class Loader problem while debugging 18.1 in eclipse

Post by nicomi »

Hi Radu,

yeah, that is what I thought.
But version 18.1 does not have basic-utilities.jar, so I run into a ClassNotFoundException when trying to debug my project because there is no LateDelegationClassLoader (basic-utilities.jar) in 18.1 libs.

Regards,
Nico
Radu
Posts: 9418
Joined: Fri Jul 09, 2004 5:18 pm

Re: Class Loader problem while debugging 18.1 in eclipse

Post by Radu »

Hi Nico,

With Oxygen 18.1, the "LateDelegationClassLoader" is inside the main "oxygen.jar" but it's probably obfuscated.
Can you give me the entire exception stack trace you obtain now?
Are you using our Maven-based SDK to develop your plugin? I'm assuming it's the SDK for Oxygen 18.1, right?
https://www.oxygenxml.com/oxygen_sdk/ox ... _18_1.html

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
nicomi
Posts: 6
Joined: Fri Oct 26, 2018 1:38 pm

Re: Class Loader problem while debugging 18.1 in eclipse

Post by nicomi »

Hey Radu,

well...
Found out that something in the project setup must have gone badly wrong. Found a mayhem of jars from 20.0.1 and 19.1 in my project dependencies...
That might explain a few errors along the way :lol:

But there is just another error:

While setting up the original 18.1-SDK from your maven archetype I get the error message that the archetype cannot be found in any repository and that the catalog under http://www.oxygenxml.com/maven/ is empty. Proxies are not used here, so that should not be the problem.
Radu
Posts: 9418
Joined: Fri Jul 09, 2004 5:18 pm

Re: Class Loader problem while debugging 18.1 in eclipse

Post by Radu »

Hi Nico,

What archetype version are you using?
Using this command line:

Code: Select all

mvn archetype:generate -DarchetypeGroupId=com.oxygenxml.samples -DarchetypeArtifactId=oxygen-sdk-samples-archetype -DarchetypeVersion=18.1.0.3 -DgroupId=myGroup -DartifactId=mySample  -Dversion=1.0-SNAPSHOT -DarchetypeRepository=http://oxygenxml.com/maven/
works for me. Does it work for you?

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
nicomi
Posts: 6
Joined: Fri Oct 26, 2018 1:38 pm

Re: Class Loader problem while debugging 18.1 in eclipse

Post by nicomi »

Hey Radu,

I used 18.1.0.3, just as you. When executing your command line I get the following error:

Code: Select all

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.0.1:generate (default-cli) on project standalone-pom: The desired archetype does not exist (com.oxygenxml.samples:oxygen-sdk-samples-archetype:18.1.0.3) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
The complete stack trace:

Code: Select all

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.0.1:generate (default-cli) on project standalone-pom: The desired archetype does not exist (com.oxygenxml.samples:oxygen-sdk-samples-archetype:18.1.0.3) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.0.1:generate (default-cli) on project standalone-pom: The desired archetype does not exist (com.oxygenxml.samples:oxygen-sdk-samples-archetype:18.1.0.3)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:564)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoFailureException: The desired archetype does not exist (com.oxygenxml.samples:oxygen-sdk-samples-archetype:18.1.0.3)
at org.apache.maven.archetype.mojos.CreateProjectFromArchetypeMojo.execute (CreateProjectFromArchetypeMojo.java:216)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:564)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: org.apache.maven.archetype.exception.UnknownArchetype: The desired archetype does not exist (com.oxygenxml.samples:oxygen-sdk-samples-archetype:18.1.0.3)
at org.apache.maven.archetype.ui.generation.DefaultArchetypeGenerationConfigurator.configureArchetype (DefaultArchetypeGenerationConfigurator.java:125)
at org.apache.maven.archetype.mojos.CreateProjectFromArchetypeMojo.execute (CreateProjectFromArchetypeMojo.java:200)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:564)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Radu
Posts: 9418
Joined: Fri Jul 09, 2004 5:18 pm

Re: Class Loader problem while debugging 18.1 in eclipse

Post by Radu »

Hi,

I managed to reproduce the same problem when I modified my Maven "settings.xml" to its default content. We'll look into updating the steps in our SDK web site page.
In the meantime, in your user's home there should be a .m2 folder (for example on my machine it's located in C:\Users\radu_coravu\.m2).
The "settings.xml" file from it should contain the following content:

Code: Select all

<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
<activeProfiles>
<activeProfile>maven.sync.ro</activeProfile>
</activeProfiles>
<profiles>
<profile>
<id>maven.sync.ro</id>

<repositories>

<repository>
<id>public-oxygen</id>
<name>oXygen public artifacts</name>
<url>http://www.oxygenxml.com/maven</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>

</repositories>
</profile>
</profiles>
</settings>
after this running the command line should work.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
nicomi
Posts: 6
Joined: Fri Oct 26, 2018 1:38 pm

Re: Class Loader problem while debugging 18.1 in eclipse

Post by nicomi »

Hello Radu,

thank you for looking further into the problem!
I updated the settings.xml and it worked fine.
Thank you very much for your help!

Regards,
Nico
nicomi
Posts: 6
Joined: Fri Oct 26, 2018 1:38 pm

Re: Class Loader problem while debugging 18.1 in eclipse

Post by nicomi »

Hello again,

setup is now clean 18.1 and I've setup my environment like described here (https://www.oxygenxml.com/doc/versions/ ... lugin.html. Now I run again into an error when klicking on "debug":

Code: Select all

java.awt.AWTError: Assistive Technology not found: 
at java.desktop/java.awt.Toolkit.newAWTError(Toolkit.java:457)
at java.desktop/java.awt.Toolkit.fallbackToLoadClassForAT(Toolkit.java:473)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
at java.base/java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1604)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:430)
at java.desktop/java.awt.Toolkit.loadAssistiveTechnologies(Toolkit.java:517)
at java.desktop/java.awt.Toolkit.getDefaultToolkit(Toolkit.java:598)
at java.desktop/java.awt.EventQueue.invokeAndWait(EventQueue.java:1303)
at java.desktop/javax.swing.SwingUtilities.invokeAndWait(SwingUtilities.java:1475)
at ro.sync.exml.Oxygen.main(Unknown Source)
Caused by: java.lang.ClassNotFoundException:
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:375)
at java.desktop/java.awt.Toolkit.fallbackToLoadClassForAT(Toolkit.java:470)
... 14 more
java.awt.AWTError: Assistive Technology not found:
at java.desktop/java.awt.Toolkit.newAWTError(Toolkit.java:457)
at java.desktop/java.awt.Toolkit.fallbackToLoadClassForAT(Toolkit.java:473)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
at java.base/java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1604)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:430)
at java.desktop/java.awt.Toolkit.loadAssistiveTechnologies(Toolkit.java:517)
at java.desktop/java.awt.Toolkit.getDefaultToolkit(Toolkit.java:598)
at java.desktop/java.awt.EventQueue.invokeAndWait(EventQueue.java:1303)
at java.desktop/javax.swing.SwingUtilities.invokeAndWait(SwingUtilities.java:1475)
at ro.sync.exml.Oxygen.main(Unknown Source)
Caused by: java.lang.ClassNotFoundException:
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:375)
at java.desktop/java.awt.Toolkit.fallbackToLoadClassForAT(Toolkit.java:470)
... 14 more
I really do not know how to handle this one.
Radu
Posts: 9418
Joined: Fri Jul 09, 2004 5:18 pm

Re: Class Loader problem while debugging 18.1 in eclipse

Post by Radu »

Hi,

Are you working on Linux? You could try to google for "Assistive Technology not found". If you are using the Java Open JDK from Eclipse, you may consider to download and use instead an equivalent Java JDK from Oracle.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply