Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 402848

Summary: Eclipse Juno SR2 HTTP Preview server does not start
Product: [WebTools] WTP ServerTools Reporter: Dev Deviskec <deviskec>
Component: wst.serverAssignee: Steven Hung <sghung>
Status: CLOSED FIXED QA Contact: Elson Yuen <eyuen7>
Severity: normal    
Priority: P3 CC: amirco, leo, mike, sghung
Version: 3.4.2Flags: eyuen7: review+
Target Milestone: 3.4.2 P   
Hardware: PC   
OS: Linux   
See Also: https://git.eclipse.org/r/109159
Whiteboard:
Attachments:
Description Flags
Patch v1.0
none
Patch v1.0 for 3.4.2p eyuen7: review+

Description Dev Deviskec CLA 2013-03-10 18:41:24 EDT
Eclipse JUNO SR2 release broke the HTTP Preview server. It worked until now (i was working on SR1). 

I'm running on Ubuntu 12.10 64.bit java version "1.7.0_15", OpenJDK Runtime Environment (IcedTea7 2.3.7) (7u15-2.3.7-0ubuntu1~12.10.1), OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode))

and

Eclipse Java EE IDE for Web Developers, Version: Juno Service Release 2 Build id: 20130225-0426)

The error I get is as follow (the jetty server does not start at all):

Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/jetty/webapp/WebAppContext
	at java.lang.Class.getDeclaredMethods0(Native Method)
	at java.lang.Class.privateGetDeclaredMethods(Class.java:2451)
	at java.lang.Class.getMethod0(Class.java:2694)
	at java.lang.Class.getMethod(Class.java:1622)
	at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:494)
	at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:486)
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.webapp.WebAppContext
	at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
	... 6 more
Comment 1 Steven Hung CLA 2013-03-11 17:29:18 EDT
Created attachment 228229 [details]
Patch v1.0

In org.eclipse.wst.server.preview.adapter.internal.core.PreviewLaunchConfigurationDelegate, the REQUIRED_BUNDLE_IDS list is missing "org.eclipse.jetty.webapp" and "org.eclipse.jetty.servlet"

After adding these two plug-ins to the REQUIRED_BUNDLE_IDS, the Preview Server can be started properly and I can run a static web page.
Comment 2 Steven Hung CLA 2013-03-11 17:50:52 EDT
Committed to Master
Comment 3 Dev Deviskec CLA 2013-03-14 05:12:32 EDT
Thank you very much for the fix! Will test as soon as I can, think I need to recompile the module though and I don't have the source code checked out currently.
Comment 4 Mirco Attocchi CLA 2013-04-17 02:03:23 EDT
*** Bug 402364 has been marked as a duplicate of this bug. ***
Comment 5 Steven Hung CLA 2013-04-17 15:18:32 EDT
Created attachment 229828 [details]
Patch v1.0 for 3.4.2p

I have created a patch based on 3.4.2p

I ran the following test:
1. Ensured the HTTP Preview server can be started successfully
2. Ensured that my static web project can be published and the HTML file can be run
Comment 6 Steven Hung CLA 2013-04-30 11:18:31 EDT
Resolving, committed changes to 3.4.2p.
Comment 7 Steven Hung CLA 2013-05-08 13:42:14 EDT
Verified with patch build: http://download.eclipse.org/webtools/patches/drops/R3.4.2/P-3.4.2-20130506185528/patches32x-P-3.4.2-20130506185528.zip

The HTTP Preview server now starts successfully
Comment 8 Leo Romero CLA 2014-02-20 10:26:54 EST
(In reply to Steven Hung from comment #7)
> Verified with patch build:
> http://download.eclipse.org/webtools/patches/drops/R3.4.2/P-3.4.2-
> 20130506185528/patches32x-P-3.4.2-20130506185528.zip

The HTTP Preview
> server now starts successfully

Hello Steven, thank you for this patch.
Could you please direct me to instructions on how to apply patches to my eclipse?

Thanks in advance.
Leo.
Comment 9 Steven Hung CLA 2014-02-27 10:21:51 EST
Leo, which Eclipse are you using? Is it Juno SR2?

If you are using Juno SR2, you apply the patch by extracting the contents of the zip into your eclipse directory. You want the plugins and features in the zip to add to the plugins and features in your eclipse directory.
Comment 10 Eclipse Genie CLA 2017-10-11 16:39:46 EDT
New Gerrit change created: https://git.eclipse.org/r/109159