Reputation: 318
I keep getting NoClassDefFoundError: org/eclipse/jetty/webapp/WebAppContext
when trying to launch HTTP Preview in Eclipse Juno with Web Tools Platform.
Steps to reproduce:
At this point I keep getting NoClassDefFoundError no matter what I do.
What I already tried:
Similar questions I found:
My main environment is:
Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/jetty/webapp/WebAppContext
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.getMethod0(Unknown Source)
at java.lang.Class.getMethod(Unknown Source)
at sun.launcher.LauncherHelper.getMainMethod(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.webapp.WebAppContext
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 6 more
Upvotes: 4
Views: 4187
Reputation: 51
Thanks nitind,
Just download the patch;
Then;
copy files to eclipse directory
Upvotes: 0
Reputation: 356
You can create the patch and make it work for you in the following four phases:
Phase 1: Create a plug-in project for the plug-in you need to patch.
File
-> Import
Plug-in Development
, select Plug-ins and Fragments
, then click Next
Import As
section, select Projects with source folders
and then click Next
.org.eclipse.wst.server.preview.adapter
into ID
field at the top and
click Add All
. This should move this one plug-in to the right pane.Finish
to import the "org.eclipse.wst.server.preview.adapter"
plug-in source into a project.Phase 2: Apply the changes needed to update the plug-in. Since there is a bug with a patch attached that can be used to apply the changes, the following steps will take advantage of that
.
Patch v1.0 for 3.4.2p
attachment link to open the patch.---
,
select this line through the end of the text and copy it to the clipboard. This contains the changes to the PreviewLaunchConfigurationDelegate.java file which is where the fix is
needed. You don't want the upper portion of the patch as that would change the version of the plug-in, and that would complicate things.Team
and click on Apply Patch
.Next
.Next
.Ignore leading path name segments
to 3. The "Patch
Contents" window should change to have a blue left pointing arrow
instead of red x indicators.Finish
to apply the changes.Phase 3: Create the replacement jar. Due to the approach in Phase 1, the name of this jar will be identical to your current jar, which simplifies updating the Eclipse installation.
org.eclipse.wst.server.preview.adapter
project in the Project Explorer or other navigator view and select Export
Plug-in Development
, select Deployable plug-ins and
fragments
, then click Next
Browse
button next to the Directory selection in the Destination tab followed by OK. This will set the output directory to be the same as your workspace.Finish
to build the replacement plug-in jar. It will appear in
a "plugins" folder under the root of your workspace.Phase 4: Replace the installed plug-in jar with the fixed version.
You should be able to run Eclipse now with the fixed plug-in. Because the patched jar had the same version number, no additional changes are needed.
Hope it helps !
Upvotes: 2
Reputation: 20003
Likely fixed in the upcoming Kepler release in June.
http://bugs.eclipse.org/402848
Upvotes: 0