Plugin classloading?

In the latest EAP (6951) The Orion plugin fails to start up, with this error:

Caused by: java.lang.NoClassDefFoundError: com/intellij/javaee/run/configuration/J2EEConfigurationType
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.lang.ClassLoader.defineClass(ClassLoader.java:465)
at com.intellij.util.lang.UrlClassLoader._defineClass(UrlClassLoader.java:78)
at com.intellij.util.lang.UrlClassLoader.defineClass(UrlClassLoader.java:74)
at com.intellij.util.lang.UrlClassLoader.findClass(UrlClassLoader.java:55)
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:43)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)

The plugin builds and runs fine against the latest devkit, I believe.

It looks like the ee stuff has moved into its own jar and is now a plugin, could this be why I'm getting this error? What can I do to debug further or fix it? Has something changed in the latest EAP?

2 comments

Since recently the JavaEE plugin uses it's own class loader, and therefore you don't have access to those classes for free anymore. To solve the problem you have to make your plugin dependent on the JavaEE plugin (add com.intellij.javaee]]> to your plugin.xml).

0

In the latest EAP (6951) The Orion plugin fails to start up, with this error:

Caused by: java.lang.NoClassDefFoundError: com/intellij/javaee/run/configuration/J2EEConfigurationType
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.lang.ClassLoader.defineClass(ClassLoader.java:465)
at com.intellij.util.lang.UrlClassLoader._defineClass(UrlClassLoader.java:78)
at com.intellij.util.lang.UrlClassLoader.defineClass(UrlClassLoader.java:74)
at com.intellij.util.lang.UrlClassLoader.findClass(UrlClassLoader.java:55)
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:43)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)

The plugin builds and runs fine against the latest devkit, I believe.

It looks like the ee stuff has moved into its own jar and is now a plugin, could this be why I'm getting this error? What can I do to debug further or fix it? Has something changed in the latest EAP?


It has moved to its own jar quite long ago. Since the latest EAP it's
loaded by its own classloader. So if the plugin declares that it depends
on JavaEE plugin (id=com.intellij.javaee) everything should be ok.

0

Please sign in to leave a comment.