Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Starting HTTP Preview Java exception
Starting HTTP Preview Java exception [message #1018214] Wed, 13 March 2013 12:20 Go to next message
Klaus L. is currently offline Klaus L.Friend
Messages: 1
Registered: March 2013
Junior Member
Hello,
when I try to start the HTTP preview server, I always get a Java exception:

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

Environment:
Eclipse Java EE IDE for Web Developers.
Version: Juno Service Release 2
Build id: 20130225-0426
Win7-64Bit, JDK 64-Bit,
eclipse.ini
-vm
C:\Prg\Dev\Java64\jdk1.7.0_15\bin\javaw.exe


Also tried with 32-bit versions and same errors.
I don't know, how to get it work.
Someone to help ?
Thanks
Klaus


Re: Starting HTTP Preview Java exception [message #1018786 is a reply to message #1018214] Thu, 14 March 2013 13:16 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
On 3/13/2013 8:44 AM, Klaus L. wrote:
> Hello,
> when I try to start the HTTP preview server, I always get a Java exception:
>
> 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
>
> Environment:
> Eclipse Java EE IDE for Web Developers.
> Version: Juno Service Release 2
> Build id: 20130225-0426
> Win7-64Bit, JDK 64-Bit,
> eclipse.ini -vm
> C:\Prg\Dev\Java64\jdk1.7.0_15\bin\javaw.exe
>
>
> Also tried with 32-bit versions and same errors.
> I don't know, how to get it work.
> Someone to help ?
> Thanks
> Klaus
>
>
>

This is Bug 402848 [1] that was only recently fixed [2].

Cheers,
Larry

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=402848
[2]
http://git.eclipse.org/c/servertools/webtools.servertools.git/commit/?id=96172e91638fb5b1204a9497609f58f1aa09f5f7
Re: Starting HTTP Preview Java exception [message #1020519 is a reply to message #1018786] Mon, 18 March 2013 11:10 Go to previous messageGo to next message
Roma Maleev is currently offline Roma MaleevFriend
Messages: 1
Registered: March 2013
Junior Member
Beautiful!
But how can I make it work on my eclipse?
I have "No updates were found".
I've got this problem after recent update.
Re: Starting HTTP Preview Java exception [message #1021874 is a reply to message #1020519] Wed, 20 March 2013 20:53 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
On 3/18/2013 3:23 PM, Roma Maleev wrote:
> Beautiful!
> But how can I make it work on my eclipse?
> I have "No updates were found".
> I've got this problem after recent update.
>

If you want it sooner than WTP 3.5, or WTP 3.4.3 assuming there will be
one, then you could build a fixed version of the required plug-in.
While not trivial, it is pretty straightforward. If you want to pursue
this, you would begin by installing in your current Java EE SR2, or in a
temporary installation, the "WST Server Adapter Plug-in Develop
Resources" item, i.e.:

1. Execute Help -> Install New Software...
2. Select "The Eclipse Web Tools Platform (WTP) software repository"
3. Expand "Web Tools Platform SDK (WTP SDK) 3.4.2"
4. Select "WST Server Adapter Plug-in Develop Resources" and proceed
with finishing the installation.

Once you have this source installed it's straightforward to import a
project for the needed plugin, make the small change needed to fix the
issue, and build a drop-in replacement for the plug-in. I can provide
the details if you want to pursue this.

Cheers,
Larry
Re: Starting HTTP Preview Java exception [message #1033484 is a reply to message #1021874] Thu, 04 April 2013 09:20 Go to previous messageGo to next message
Manuel Vega is currently offline Manuel VegaFriend
Messages: 1
Registered: April 2013
Junior Member
Larry Isaacs wrote on Wed, 20 March 2013 16:53
On 3/18/2013 3:23 PM, Roma Maleev wrote:
> Beautiful!
> But how can I make it work on my eclipse?
> I have "No updates were found".
> I've got this problem after recent update.
>

If you want it sooner than WTP 3.5, or WTP 3.4.3 assuming there will be
one, then you could build a fixed version of the required plug-in.
While not trivial, it is pretty straightforward. If you want to pursue
this, you would begin by installing in your current Java EE SR2, or in a
temporary installation, the "WST Server Adapter Plug-in Develop
Resources" item, i.e.:

1. Execute Help -> Install New Software...
2. Select "The Eclipse Web Tools Platform (WTP) software repository"
3. Expand "Web Tools Platform SDK (WTP SDK) 3.4.2"
4. Select "WST Server Adapter Plug-in Develop Resources" and proceed
with finishing the installation.

Once you have this source installed it's straightforward to import a
project for the needed plugin, make the small change needed to fix the
issue, and build a drop-in replacement for the plug-in. I can provide
the details if you want to pursue this.

Cheers,
Larry


Would you mind to explain more details? I have the same issue and i want to solve it. Actually, i use the browser separately.

Somebody know if the new release will take much time?

Regards,
MV.
Re: Starting HTTP Preview Java exception [message #1036886 is a reply to message #1033484] Mon, 08 April 2013 23:54 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
On 4/5/2013 3:19 PM, Manuel Vega wrote:
> Larry Isaacs wrote on Wed, 20 March 2013 16:53
>> On 3/18/2013 3:23 PM, Roma Maleev wrote:
>> > Beautiful!
>> > But how can I make it work on my eclipse?
>> > I have "No updates were found".
>> > I've got this problem after recent update.
>> >
>>
>> If you want it sooner than WTP 3.5, or WTP 3.4.3 assuming there will
>> be one, then you could build a fixed version of the required plug-in.
>> While not trivial, it is pretty straightforward. If you want to
>> pursue this, you would begin by installing in your current Java EE
>> SR2, or in a temporary installation, the "WST Server Adapter Plug-in
>> Develop Resources" item, i.e.:
>>
>> 1. Execute Help -> Install New Software...
>> 2. Select "The Eclipse Web Tools Platform (WTP) software repository"
>> 3. Expand "Web Tools Platform SDK (WTP SDK) 3.4.2"
>> 4. Select "WST Server Adapter Plug-in Develop Resources" and proceed
>> with finishing the installation.
>>
>> Once you have this source installed it's straightforward to import a
>> project for the needed plugin, make the small change needed to fix the
>> issue, and build a drop-in replacement for the plug-in. I can provide
>> the details if you want to pursue this.
>>
>> Cheers,
>> Larry
>
>
> Would you mind to explain more details? I have the same issue and i want
> to solve it. Actually, i use the browser separately.
>
> Somebody know if the new release will take much time?
> Regards,
> MV.

The WTP 3.5.0 release is due out near the end of June. I'm not aware
that any WTP 3.4.3 release is planned at this time. It is a fair number
of steps, but they are all straightforward, including the edit to fix
the bug. Once you have completed the four steps above, let me know and
I'll give you the remaining steps.

The general process will be to create plug-in project with the
appropriate source, make the edit to fix the bug, and then build the
plug-in. If done with the appropriate steps, you get a replacement
plug-in jar with the same version as the one it replaces. You switch
the jars, and you have the bug fix.

Cheers,
Larry
Re: Starting HTTP Preview Java exception [message #1058613 is a reply to message #1018214] Tue, 14 May 2013 14:43 Go to previous messageGo to next message
Pete Juliana is currently offline Pete JulianaFriend
Messages: 1
Registered: May 2013
Junior Member
I just recently came across this issue and I'm attempting your fix. I followed the four steps above and was wondering if you could provide me with some details about what the next steps should be.

Thanks

EDIT - I was able to get everything working

I grabbed the patch from this link:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=402848

Then I just replaced all the files in my eclipse folder with the files from the patch.

[Updated on: Tue, 14 May 2013 16:18]

Report message to a moderator

Re: Starting HTTP Preview Java exception [message #1059266 is a reply to message #1058613] Thu, 16 May 2013 23:12 Go to previous message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
On 5/14/2013 11:05 AM, Pete Juliana wrote:
> I just recently came across this issue and I'm attempting your fix. I
> followed the four steps above and was wondering if you could provide me
> with some details about what the next steps should be.
>
> Thanks

Sorry for the delay. Here are the steps:

Phase 1: Create a plug-in project for the plug-in you need to patch.

1. Create a new workspace (recommended) or open an existing one.
2. Select File -> Import...
3. Expand "Plug-in Development", select "Plug-ins and Fragments", then
click Next>.
4. In the "Import As" section, select "Projects with source folders",
then click Next>.
5. Enter (or copy & paste, no quotes)
"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.
6. Click Finish to import the "org.eclipse.wst.server.preview.adapter"
plug-in source into a project.
7. Expand the root of the project and ensure it contains a folder named
"src". You will only get the "src" folder if you have the "WST Server
Adapter Plug-in Developer Resources" installed.

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.

1. Open Bug 402848[1] in a browser.
2. Click on the "Patch v1.0 for 3.4.2p" attachment link to open the patch.
3. Starting with the second occurrence of a line starting with "---",
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.
4. Back in Eclipse, right-click on the
"org.eclipse.wst.server.preview.adapter" project and select Team and
"Apply Patch...".
5. Leave Clipboard selected and click Next>.
6. Ensure the "org.eclipse.wst.server.preview.adapter" project is
selected, and click Next>.
7. Set the "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.
8. Click 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.

1. Right-click on the "org.eclipse.wst.server.preview.adapter" project
in the Project Explorer or other navigator view and select Export...
2. Expand "Plug-in Development", select "Deployable plug-ins and
fragments", then click Next>
3. Click the 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.
4. Click 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.

1. Exit Eclipse if it is running.
2. Under the "plugins" folder of your Eclipse installation, move or
rename the
org.eclipse.wst.server.preview.adapter_1.1.101.v20121107_1651.jar if you
don't want to overwrite it with the patched version. If you have a
different version, it means you aren't using Juno SR2 and hopefully you
installed the "WST Server Adapter Plug-in Developer Resources" that
matched your version.
3. Copy the
org.eclipse.wst.server.preview.adapter_1.1.101.v20121107_1651.jar from
the "plugins" folder under your workspace and paste it to the "plugins"
folder of your Eclipse installation.

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. The steps above are pretty brief. If your environment diverges
from what these steps are expecting, let me know.

Cheers,
Larry

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=402848
Previous Topic:Eclipse/Tomcat7: application context root reloading returns 404
Next Topic:IWAB0523E Error moving resource: null
Goto Forum:
  


Current Time: Thu Apr 25 17:57:20 GMT 2024

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

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

Back to the top