Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » classloader being flaky with JDT classes
classloader being flaky with JDT classes [message #210802] Mon, 25 July 2005 17:48 Go to next message
Eclipse UserFriend
Originally posted by: nothanks.spammedalot.net

Hi there -

Last week I posted a couple times about a ClassDefNotFoundError I keep
getting while calling JDT core classes in a plugin that *does not* extend
JDT. Someone asked me to post and include the stack trace, and when I ran
it again to get the trace, the error magically went away. However, it
still happens regularly with our QA machine, and I really don't know why.

My plugin extends IStartup only. I make use of JavaCore get information
from Java projects loaded in the user's workspace, and JavaUI to perform
other tasks. So, my plugin.xml has the following lines:

<requires>
...
<import plugin="org.eclipse.jdt"/>
<import plugin="org.eclipse.jdt.core"/>
<import plugin="org.eclipse.jdt.ui"/>
</requires>

The first time my plugin calls any of these classes (I call
JavaCore.getJavaCore in startup) Eclipse throws a ClassDefNotFoundError on
JavaCore. Since the call occurs in startup, my plugin fails to load at
all.

Ideally, I don't want to take the JDT loadup hit when Eclipse is starting
up, so I've tried delaying the call to getJavaCore until it is actually
needed, but Eclipse throws there as well.

I have two Eclipse installs on my test computer - one where the plugin
works (and JavaCore resolves without an error) and one where the
ClassDefNotFoundError is thrown. I'm working on figuring out the
differences between the two installs. In the meantime, I'm curious if
there's something I need to do in my plugin code besides requiring those
jdt imports? I don't know the Eclipse API all that well - I was merely
assigned a bug to fix.

Thanks for any help,
- Chris

Here's the .log entry:

!ENTRY com.mycompany.myproduct.plugins.eclipse 4 0 Jul 25, 2005
13:30:35.383
!MESSAGE startup class must implement org.eclipse.ui.IStartup
!SESSION Jul 25, 2005 13:32:05.695
---------------------------------------------
eclipse.buildId=M200503110845
java.version=1.4.2_04
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US

!ENTRY org.eclipse.core.runtime 4 2 Jul 25, 2005 13:32:05.758
!MESSAGE Problems encountered starting up plug-in:
"org.osgi.framework.BundleException: Exception in
com.mycompany.myproduct.plugins.eclipse.EclipseLauncherPlugi n.start() of
bundle com.mycompany.myproduct.plugins.eclipse.".
!STACK 0
org.osgi.framework.BundleException: Exception in
com.mycompany.myproduct.plugins.eclipse.EclipseLauncherPlugi n.start() of
bundle com.mycompany.myproduct.plugins.eclipse.
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:975)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:937)
at
org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:421)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:293)
at
org.eclipse.core.internal.plugins.PluginDescriptor.doPluginA ctivation(PluginDescriptor.java:349)
at
org.eclipse.core.internal.plugins.PluginDescriptor.getPlugin (PluginDescriptor.java:328)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.eclipse.ui.internal.EarlyStartupRunnable.getPluginForCom patibility(EarlyStartupRunnable.java:140)
at
org.eclipse.ui.internal.EarlyStartupRunnable.run(EarlyStartu pRunnable.java:68)
at
org.eclipse.core.internal.runtime.InternalPlatform.run(Inter nalPlatform.java:616)
at org.eclipse.core.runtime.Platform.run(Platform.java:747)
at org.eclipse.ui.internal.Workbench$15.run(Workbench.java:1283 )
at java.lang.Thread.run(Thread.java:534)
Caused by: java.lang.NoClassDefFoundError: org/eclipse/jdt/core/JavaCore
at
com.mycompany.myproduct.plugins.eclipse.EclipseLauncherPlugi n.start(EclipseLauncherPlugin.java:51)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl$1 .run(BundleContextImpl.java:958)
at java.security.AccessController.doPrivileged(Native Method)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:954)
... 15 more
Root exception:
java.lang.NoClassDefFoundError: org/eclipse/jdt/core/JavaCore
at
com.mycompany.myproduct.plugins.eclipse.EclipseLauncherPlugi n.start(EclipseLauncherPlugin.java:51)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl$1 .run(BundleContextImpl.java:958)
at java.security.AccessController.doPrivileged(Native Method)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:954)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:937)
at
org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:421)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:293)
at
org.eclipse.core.internal.plugins.PluginDescriptor.doPluginA ctivation(PluginDescriptor.java:349)
at
org.eclipse.core.internal.plugins.PluginDescriptor.getPlugin (PluginDescriptor.java:328)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.eclipse.ui.internal.EarlyStartupRunnable.getPluginForCom patibility(EarlyStartupRunnable.java:140)
at
org.eclipse.ui.internal.EarlyStartupRunnable.run(EarlyStartu pRunnable.java:68)
at
org.eclipse.core.internal.runtime.InternalPlatform.run(Inter nalPlatform.java:616)
at org.eclipse.core.runtime.Platform.run(Platform.java:747)
at org.eclipse.ui.internal.Workbench$15.run(Workbench.java:1283 )
at java.lang.Thread.run(Thread.java:534)

!ENTRY org.eclipse.ui 4 4 Jul 25, 2005 13:32:05.773
!MESSAGE Unhandled Exception
Re: classloader being flaky with JDT classes [message #210938 is a reply to message #210802] Tue, 26 July 2005 17:54 Go to previous message
Eclipse UserFriend
Originally posted by: nothanks.spammedalot.net

Ok, problem finally solved. It was a cacheing issue. Sorry to waste 4
posts to this group when R'ingTFM would have solved my problem.
Previous Topic:Custom debug view problems
Next Topic:Any way to export only compiler prefs?
Goto Forum:
  


Current Time: Wed Jul 31 01:38:29 GMT 2024

Powered by FUDForum. Page generated in 0.03018 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top