Home » Language IDEs » ServerTools (WTP) » NoClassDefFoundError when deploying with
NoClassDefFoundError when deploying with [message #177287] |
Thu, 17 August 2006 21:27  |
Eclipse User |
|
|
|
Originally posted by: craig.haenterprises.com.au
I have a J2EE Project (lets call it XXX) that depends on three other
normal Java projects (A, B, and C). I go into my XXX's J2EE Module
Depencencies tab and select A, B, and C (as well as adding a couple of
other JAR libraries that those guys are dependent on).
When I click on publish, and check the .../tmp0/webapps/XXX/WEB-INF/lib
directory, I see that jars have been dynamically created for A/B/C and the
other dependent jars have been added. Love your work! I start Tomcat
(5.0) in Eclipse and everything looks OK at this point.
However, when I try to browse to a page in my Struts application, I get a
NoClassDefFoundError. In project XXX, I have a class called
XXXActionServlet that subclasses CCCActionServlet (which is in project C).
The error message is saying that it can't find CCCActionServlet - which I
can see has been successfully included in C.jar in WEB-INF/lib.
Any thoughts? I saw in other threads that if I add the dependent projects
to the J2EE Modules tab, then they should be removed from the Java Build
Path, but if I do that, then my project doesn't compile... and in any
case, the jars for the dependent projects seem to be successfully created
and published. Tomcat just doesn't seem to pick them up properly...
Do projects A,B,C have to be J2EE projects as well, or can they be Java
projects?
Running Eclipse 3.2 on Ubuntu Drake with WST 1.5.0.v200606092300. Any
advice would be much appreciated. Thanks a lot.
--
Craig
|
|
| | |
Re: NoClassDefFoundError when deploying with [message #177820 is a reply to message #177287] |
Thu, 24 August 2006 15:51   |
Eclipse User |
|
|
|
Craig,
What you describe should work, implying there is a missing piece to this
puzzle. Is this still not working?
Cheers,
Larry
Craig Edwards wrote:
> I have a J2EE Project (lets call it XXX) that depends on three other
> normal Java projects (A, B, and C). I go into my XXX's J2EE Module
> Depencencies tab and select A, B, and C (as well as adding a couple of
> other JAR libraries that those guys are dependent on).
>
> When I click on publish, and check the .../tmp0/webapps/XXX/WEB-INF/lib
> directory, I see that jars have been dynamically created for A/B/C and
> the other dependent jars have been added. Love your work! I start
> Tomcat (5.0) in Eclipse and everything looks OK at this point.
>
> However, when I try to browse to a page in my Struts application, I get
> a NoClassDefFoundError. In project XXX, I have a class called
> XXXActionServlet that subclasses CCCActionServlet (which is in project
> C). The error message is saying that it can't find CCCActionServlet -
> which I can see has been successfully included in C.jar in WEB-INF/lib.
>
> Any thoughts? I saw in other threads that if I add the dependent
> projects to the J2EE Modules tab, then they should be removed from the
> Java Build Path, but if I do that, then my project doesn't compile...
> and in any case, the jars for the dependent projects seem to be
> successfully created and published. Tomcat just doesn't seem to pick
> them up properly...
>
> Do projects A,B,C have to be J2EE projects as well, or can they be Java
> projects?
>
> Running Eclipse 3.2 on Ubuntu Drake with WST 1.5.0.v200606092300. Any
> advice would be much appreciated. Thanks a lot.
>
> --
> Craig
>
|
|
|
Re: NoClassDefFoundError when deploying with [message #185316 is a reply to message #177820] |
Wed, 20 December 2006 12:24   |
Eclipse User |
|
|
|
Originally posted by: kenk.agitar.com
Craig,
Did you get resolution on your NoClassDefFoundError?
I've experienced a similar problem. When my tomcat instance tries to
load a struts class from a jar (and I've verified that the jar is in
WEB-INF/lib and that the class is in the jar), tomcat reports a
NoClassDefFoundError. I stepping through the tomcat classloading code
and noticed that it got an IOException when trying to get the manifest
of the jar file that contained the class in question. The IOException
reported that there was a bad header.
Manually unjarring and rejarring the jar file fixed the
NoClassDefFoundError.
Interestingly this happened on my windows install, but not my linux install.
Has anyone else seen this or does anyone know how to prevent it?
Thanks,
Ken
Larry Isaacs wrote:
> Craig,
>
> What you describe should work, implying there is a missing piece to this
> puzzle. Is this still not working?
>
> Cheers,
> Larry
>
> Craig Edwards wrote:
>> I have a J2EE Project (lets call it XXX) that depends on three other
>> normal Java projects (A, B, and C). I go into my XXX's J2EE Module
>> Depencencies tab and select A, B, and C (as well as adding a couple of
>> other JAR libraries that those guys are dependent on).
>>
>> When I click on publish, and check the
>> .../tmp0/webapps/XXX/WEB-INF/lib directory, I see that jars have been
>> dynamically created for A/B/C and the other dependent jars have been
>> added. Love your work! I start Tomcat (5.0) in Eclipse and
>> everything looks OK at this point.
>>
>> However, when I try to browse to a page in my Struts application, I
>> get a NoClassDefFoundError. In project XXX, I have a class called
>> XXXActionServlet that subclasses CCCActionServlet (which is in project
>> C). The error message is saying that it can't find CCCActionServlet -
>> which I can see has been successfully included in C.jar in WEB-INF/lib.
>>
>> Any thoughts? I saw in other threads that if I add the dependent
>> projects to the J2EE Modules tab, then they should be removed from the
>> Java Build Path, but if I do that, then my project doesn't compile...
>> and in any case, the jars for the dependent projects seem to be
>> successfully created and published. Tomcat just doesn't seem to pick
>> them up properly...
>>
>> Do projects A,B,C have to be J2EE projects as well, or can they be
>> Java projects?
>>
>> Running Eclipse 3.2 on Ubuntu Drake with WST 1.5.0.v200606092300. Any
>> advice would be much appreciated. Thanks a lot.
>>
>> --
>> Craig
>>
|
|
|
Re: NoClassDefFoundError when deploying with [message #185349 is a reply to message #185316] |
Wed, 20 December 2006 16:19   |
Eclipse User |
|
|
|
Originally posted by: kenk.agitar.com
I found out what my problem was. The auto-generated manifest.mf file
had been incorrectly checked out by a windows client. The resulting
manifest had windows line-separators in it, which was causing tomcat to
get those IOExceptions when reading out the jar's manifest. Removing
the checked in manifest caused it to get properly regenerated and fixed
the problem.
--Ken
Ken Koster wrote:
> Craig,
>
> Did you get resolution on your NoClassDefFoundError?
>
> I've experienced a similar problem. When my tomcat instance tries to
> load a struts class from a jar (and I've verified that the jar is in
> WEB-INF/lib and that the class is in the jar), tomcat reports a
> NoClassDefFoundError. I stepping through the tomcat classloading code
> and noticed that it got an IOException when trying to get the manifest
> of the jar file that contained the class in question. The IOException
> reported that there was a bad header.
>
> Manually unjarring and rejarring the jar file fixed the
> NoClassDefFoundError.
>
> Interestingly this happened on my windows install, but not my linux
> install.
>
> Has anyone else seen this or does anyone know how to prevent it?
>
> Thanks,
> Ken
>
>
> Larry Isaacs wrote:
>> Craig,
>>
>> What you describe should work, implying there is a missing piece to
>> this puzzle. Is this still not working?
>>
>> Cheers,
>> Larry
>>
>> Craig Edwards wrote:
>>> I have a J2EE Project (lets call it XXX) that depends on three other
>>> normal Java projects (A, B, and C). I go into my XXX's J2EE Module
>>> Depencencies tab and select A, B, and C (as well as adding a couple
>>> of other JAR libraries that those guys are dependent on).
>>>
>>> When I click on publish, and check the
>>> .../tmp0/webapps/XXX/WEB-INF/lib directory, I see that jars have been
>>> dynamically created for A/B/C and the other dependent jars have been
>>> added. Love your work! I start Tomcat (5.0) in Eclipse and
>>> everything looks OK at this point.
>>>
>>> However, when I try to browse to a page in my Struts application, I
>>> get a NoClassDefFoundError. In project XXX, I have a class called
>>> XXXActionServlet that subclasses CCCActionServlet (which is in
>>> project C). The error message is saying that it can't find
>>> CCCActionServlet - which I can see has been successfully included in
>>> C.jar in WEB-INF/lib.
>>>
>>> Any thoughts? I saw in other threads that if I add the dependent
>>> projects to the J2EE Modules tab, then they should be removed from
>>> the Java Build Path, but if I do that, then my project doesn't
>>> compile... and in any case, the jars for the dependent projects seem
>>> to be successfully created and published. Tomcat just doesn't seem
>>> to pick them up properly...
>>>
>>> Do projects A,B,C have to be J2EE projects as well, or can they be
>>> Java projects?
>>>
>>> Running Eclipse 3.2 on Ubuntu Drake with WST 1.5.0.v200606092300.
>>> Any advice would be much appreciated. Thanks a lot.
>>>
>>> --
>>> Craig
>>>
|
|
| |
Goto Forum:
Current Time: Mon May 12 18:30:21 EDT 2025
Powered by FUDForum. Page generated in 0.04538 seconds
|