Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » NoClassDefFoundError
NoClassDefFoundError [message #189556] Sun, 11 March 2007 02:06 Go to next message
Eclipse UserFriend
Originally posted by: ns_dkerber.ns_WarrenRogersAssociates.com

I don't know if you'll be able to help me with this because it's pretty
weird, but I've got to try since I've been messing with it for about 6
hours now.

This is an Eclipse Dynamic web project which references a standard java
project which provides various utility classes, and I'm getting a
NoClassDefFoundError: (one of my classes), which doesn't make any sense.
It's popping up on a function call to a static routine in another class:

nEntityKey = OspConfig.ImportOSPCfgFile( cfgFile.getPath() );

The error is popping up when this statement is first called; it never
gets into OspConfig.ImportOSPCfgFile (I have a method breakpoint set to
see if it was getting there), and neither the calling class nor the
called class uses the class that it says it isn't finding (cfgFile is a
java.io.file), though the called class does use a class that is an
extension of the "missing" class.

And what makes it even worse, even when I include the class it says it
can't find, in both the calling and the called class, it still pops the
error. This is happening both in Eclipse, and in the deployed app and
is driving me nuts. I've tried adding the package that includes this
class in every spot I can think of in the project properties (j2ee
module dependencies, java build path, and project references), and
nothing seems to help.

Has anybody ever seen this kind of weirdness before? I've never before
had a NoClassdefFoundError that I couldn't iron out eventually, but this
one has me stumped.


--
Remove the ns_ from if replying by e-mail (but keep posts in the
newsgroups if possible).
Re: NoClassDefFoundError [message #189590 is a reply to message #189556] Sun, 11 March 2007 19:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ns_dkerber.ns_WarrenRogersAssociates.com

I need to make a major correction: It's working on the deployed system,
just not on my development machine!!!

I'm completely baffled; the class in question (that it says it can't
find) is listed right in the middle of a listing of the package, but it
can't find its definition.


In article <MPG.205d2e2b28ef80629896d5@news.eclipse.org>,
ns_dkerber@ns_WarrenRogersAssociates.com says...
> I don't know if you'll be able to help me with this because it's pretty
> weird, but I've got to try since I've been messing with it for about 6
> hours now.
>
> This is an Eclipse Dynamic web project which references a standard java
> project which provides various utility classes, and I'm getting a
> NoClassDefFoundError: (one of my classes), which doesn't make any sense.
> It's popping up on a function call to a static routine in another class:
>
> nEntityKey = OspConfig.ImportOSPCfgFile( cfgFile.getPath() );
>
> The error is popping up when this statement is first called; it never
> gets into OspConfig.ImportOSPCfgFile (I have a method breakpoint set to
> see if it was getting there), and neither the calling class nor the
> called class uses the class that it says it isn't finding (cfgFile is a
> java.io.file), though the called class does use a class that is an
> extension of the "missing" class.
>
> And what makes it even worse, even when I include the class it says it
> can't find, in both the calling and the called class, it still pops the
> error. This is happening both in Eclipse, and in the deployed app and
> is driving me nuts. I've tried adding the package that includes this
> class in every spot I can think of in the project properties (j2ee
> module dependencies, java build path, and project references), and
> nothing seems to help.
>
> Has anybody ever seen this kind of weirdness before? I've never before
> had a NoClassdefFoundError that I couldn't iron out eventually, but this
> one has me stumped.
>
>
>

--
Remove the ns_ from if replying by e-mail (but keep posts in the
newsgroups if possible).
Re: NoClassDefFoundError [message #189736 is a reply to message #189590] Mon, 12 March 2007 18:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ns_dkerber.ns_WarrenRogersAssociates.com

In article <MPG.205e20a3776455f09896d7@news.eclipse.org>,
ns_dkerber@ns_WarrenRogersAssociates.com says...
> I need to make a major correction: It's working on the deployed system,
> just not on my development machine!!!
>
> I'm completely baffled; the class in question (that it says it can't
> find) is listed right in the middle of a listing of the package, but it
> can't find its definition.

Found it. Yaaaayyyyy!

Took about 24 hours of working time to do so! Booooooooo!

As I figured, I had a well-hidden class what was looking for the
"missing" class. What threw me was that even when I renamed the guilty
..jar file in my /jre/lib/ext folder to something other than .jar, it was
still finding the classes inside it!! It wasn't until I in desperation
deleted that file from the ext folder (rather than just renaming it)
that things started working as I expected.

Is that the way it's supposed to work?? Seems pretty suspect to me...

.....

--
Remove the ns_ from if replying by e-mail (but keep posts in the
newsgroups if possible).
Re: NoClassDefFoundError [message #189757 is a reply to message #189736] Tue, 13 March 2007 14:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse5.rizzoweb.com

David Kerber wrote:
> In article <MPG.205e20a3776455f09896d7@news.eclipse.org>,
> ns_dkerber@ns_WarrenRogersAssociates.com says...
>> I need to make a major correction: It's working on the deployed system,
>> just not on my development machine!!!
>>
>> I'm completely baffled; the class in question (that it says it can't
>> find) is listed right in the middle of a listing of the package, but it
>> can't find its definition.
>
> Found it. Yaaaayyyyy!
>
> Took about 24 hours of working time to do so! Booooooooo!
>
> As I figured, I had a well-hidden class what was looking for the
> "missing" class. What threw me was that even when I renamed the guilty
> .jar file in my /jre/lib/ext folder to something other than .jar, it was
> still finding the classes inside it!! It wasn't until I in desperation
> deleted that file from the ext folder (rather than just renaming it)
> that things started working as I expected.
>
> Is that the way it's supposed to work?? Seems pretty suspect to me...

If you are saying that a file with a name other than *.jar in the ext
directory was still being treated as a JAR, then that IS weird.
I will note, however, that using /jre/lib/ext is not generally the right
way to get things on to an application's classpath. It is dangerous, as
you have discovered, and pretty naive (it means ALL apps using that JRE
will automatically get those classes, even if they don't want them and
don't know about it). Bottom line: avoid using /lib/ext whenever
possible (hint: I have NEVER had to use it in almost 10 years of Java
development).

Hope this helps,
Eric
Re: NoClassDefFoundError [message #189765 is a reply to message #189757] Tue, 13 March 2007 17:13 Go to previous message
Eclipse UserFriend
Originally posted by: ns_dkerber.ns_WarrenRogersAssociates.com

In article <et6ddd$ato$1@utils.eclipse.org>, eclipse5@rizzoweb.com
says...
> David Kerber wrote:
> > In article <MPG.205e20a3776455f09896d7@news.eclipse.org>,
> > ns_dkerber@ns_WarrenRogersAssociates.com says...
> >> I need to make a major correction: It's working on the deployed system,
> >> just not on my development machine!!!
> >>
> >> I'm completely baffled; the class in question (that it says it can't
> >> find) is listed right in the middle of a listing of the package, but it
> >> can't find its definition.
> >
> > Found it. Yaaaayyyyy!
> >
> > Took about 24 hours of working time to do so! Booooooooo!
> >
> > As I figured, I had a well-hidden class what was looking for the
> > "missing" class. What threw me was that even when I renamed the guilty
> > .jar file in my /jre/lib/ext folder to something other than .jar, it was
> > still finding the classes inside it!! It wasn't until I in desperation
> > deleted that file from the ext folder (rather than just renaming it)
> > that things started working as I expected.
> >
> > Is that the way it's supposed to work?? Seems pretty suspect to me...
>
> If you are saying that a file with a name other than *.jar in the ext
> directory was still being treated as a JAR, then that IS weird.

Sort of: I renamed OspCfgDb.jar to OspCfgDb.jar.hide, and it still
loaded classes from it. I confirmed that by looking at the -verbose
output from a command-line java compilation; it said "Loading <myclass>
from OspCfgDb.jar.hide".


> I will note, however, that using /jre/lib/ext is not generally the right
> way to get things on to an application's classpath. It is dangerous, as
> you have discovered, and pretty naive (it means ALL apps using that JRE
> will automatically get those classes, even if they don't want them and
> don't know about it). Bottom line: avoid using /lib/ext whenever
> possible (hint: I have NEVER had to use it in almost 10 years of Java
> development).

A 3rd party tool I use said to put it there. I eventually found that it
worked just as well when I put it in my WEB-INF/lib directory, so that's
what I'm doing now.

....

--
Remove the ns_ from if replying by e-mail (but keep posts in the
newsgroups if possible).
Previous Topic:Problem creating simple Session Bean under Eclipse 3.2.2
Next Topic:refactoring a project
Goto Forum:
  


Current Time: Thu Mar 28 15:00:18 GMT 2024

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

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

Back to the top