Most NetBeans APIs belong to group "org.netbeans.api", while nb-javac belongs to "org.netbeans.external". Obviously, nbm-maven-plugin treats ths as a hint to add "Maven-Class-Path: org.netbeans.external:nb-javac-api:RELEASE82 org.netbeans.external:nb-javac-impl:RELEASE82" to the created module's manifest. This seems to cause nb-javac to be loaded as an external library, loaded before module execution and thus with a different module class loader. However, I'm not an expert on this, so I can only guess.  :-/

If I could find a way load the dependency into the same class loader, I'd be fine.

Peter



Am 28.06.2018 um 17:49 schrieb Geertjan Wielenga:
The real question is why the plugin needs to do any of this.

Gj

On Thu, Jun 28, 2018 at 10:59 AM, Peter Nabbefeld <[email protected]>
wrote:

Hello,

I've got a LinkageError when running a NetBeans plugin with a dependency
on nb-javac. The plugin uses Maven, and I've noticed the following entry in
MANIFEST.MF:

Maven-Class-Path: org.netbeans.external:nb-javac-api:RELEASE82
org.netbeans.external:nb-javac-impl:RELEASE82

This obviously results in creating its own ClassLoader (ModuleCL@
...[org.netbeans.modules.java.source.base]) for the compiler libraries -
different from my module's one.  :-(

Both class loaders have the same parent (sun.misc.Launcher$AppClassLoa
der@same_number).

As different classes loaded by different class loaders are different,
assignment results in a LinkageError. The class is in this case
"javax.lang.model.util.Elements".

Is there any chance to convert Objects from 
[email protected]
to [email protected]?

Kind regards

Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists






---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



Reply via email to