You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by John Baker <jb...@teamenergy.com> on 2001/07/12 13:19:42 UTC
Fwd: NoClassDefFound
[Argh! I cant get a single mail to go to the mailing list, I wonder if this
one does!:) ]
Hello.
Anyone ever experiences a problem where by if you try to run a Thread from an
object implementing ServletContextListener (ie it's used to perform 'startup'
stuff), the Thread is unable to find classes (complains of NoClassDefFound).
Yet if the Thread is just run using the current Thread (ie call run, not
start), the classes are magically found.
John Baker
Re: Fwd: NoClassDefFound
Posted by John Baker <jb...@teamenergy.com>.
On Friday 13 July 2001 23:30 pm, you wrote:
> Sorry, you're right about that! stop(), suspend(),
> resume() and countStackFrames() are deprecated.
Well now we've cleared that one up, let's get back to topic. Why is this
happening? It looks like a pretty serious bug.
> --- John Baker <jb...@teamenergy.com> wrote:
> > On Friday 13 July 2001 12:23 pm, you wrote:
> > > --- John Baker <jb...@teamenergy.com> wrote:
> > > > On Thursday 12 July 2001 23:04 pm, you wrote:
> > > >
> > > > MyThread t = new MyThread(); // MyThread extends
> > > > Thread
> > > > t.start(); // fails
> > >
> > > Aren't t.start() and t.stop() deprecated?
> >
> > Err, stop is, but if start was deprecated then
> > threads would be a little
> > difficult to run!
>
> =====
> -
> rascharles@yahoo.com
> Hacking is a "Good Thing!"
> See http://www.tuxedo.org/~esr/faqs/hacker-howto.html
>
> __________________________________________________
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail
> http://personal.mail.yahoo.com/
Re: Fwd: NoClassDefFound
Posted by Charles Baker <ra...@yahoo.com>.
Sorry, you're right about that! stop(), suspend(),
resume() and countStackFrames() are deprecated.
--- John Baker <jb...@teamenergy.com> wrote:
> On Friday 13 July 2001 12:23 pm, you wrote:
> > --- John Baker <jb...@teamenergy.com> wrote:
> > > On Thursday 12 July 2001 23:04 pm, you wrote:
>
> > > MyThread t = new MyThread(); // MyThread extends
> > > Thread
> > > t.start(); // fails
> >
> > Aren't t.start() and t.stop() deprecated?
>
> Err, stop is, but if start was deprecated then
> threads would be a little
> difficult to run!
=====
-
rascharles@yahoo.com
Hacking is a "Good Thing!"
See http://www.tuxedo.org/~esr/faqs/hacker-howto.html
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/
Re: Fwd: NoClassDefFound
Posted by John Baker <jb...@teamenergy.com>.
On Friday 13 July 2001 12:23 pm, you wrote:
> --- John Baker <jb...@teamenergy.com> wrote:
> > On Thursday 12 July 2001 23:04 pm, you wrote:
> > MyThread t = new MyThread(); // MyThread extends
> > Thread
> > t.start(); // fails
>
> Aren't t.start() and t.stop() deprecated?
Err, stop is, but if start was deprecated then threads would be a little
difficult to run!
Re: Fwd: NoClassDefFound
Posted by Charles Baker <ra...@yahoo.com>.
--- John Baker <jb...@teamenergy.com> wrote:
> On Thursday 12 July 2001 23:04 pm, you wrote:
> > Hi,
> >
> > Weird!!!
> >
> > You can always use the Class class'
> getInstance(String className) method to
> > get a copy of your class.
> >
> You mean Class.newInstance(className) ? :-)
>
> Well I'd rather know why Tomcat does this. It's
> silly. Also, I get problems
> when Tomcat shuts down, ie another
> NoClassDefFoundException when the Class is
> clearly there. There must be some bug that needs
> solving here :-) And it's
> only /some/ Classes it can't find, others it can.
> I've tried changing
> compilers, trying the code outside of Tomcat (works
> fine), chainging VM's.
> Nothing makes a difference.
>
> It was only when I noticed that:
>
> MyThread t = new MyThread(); // MyThread extends
> Thread
> t.start(); // fails
>
Aren't t.start() and t.stop() deprecated?
> but
>
> t.run(); // works
>
> that I became very suspucious and decided this
> wasn't my fault.
>
<<SNIP>>
=====
-
rascharles@yahoo.com
Hacking is a "Good Thing!"
See http://www.tuxedo.org/~esr/faqs/hacker-howto.html
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/
Re: Fwd: NoClassDefFound
Posted by John Baker <jb...@teamenergy.com>.
On Thursday 12 July 2001 23:04 pm, you wrote:
> Hi,
>
> Weird!!!
>
> You can always use the Class class' getInstance(String className) method to
> get a copy of your class.
>
You mean Class.newInstance(className) ? :-)
Well I'd rather know why Tomcat does this. It's silly. Also, I get problems
when Tomcat shuts down, ie another NoClassDefFoundException when the Class is
clearly there. There must be some bug that needs solving here :-) And it's
only /some/ Classes it can't find, others it can. I've tried changing
compilers, trying the code outside of Tomcat (works fine), chainging VM's.
Nothing makes a difference.
It was only when I noticed that:
MyThread t = new MyThread(); // MyThread extends Thread
t.start(); // fails
but
t.run(); // works
that I became very suspucious and decided this wasn't my fault.
When I say I have problems when shutting down, well I use the
contextDestroyed method in ServletContextListener to shut database
connections when the 'web application' is killed as tomcat shuts down - and
this also fails to find classes.
It might be worth pointing out that I'm using 4.0beta5, but have seen this
problem on other 4.0 builds (I dont think it happened on beta1, now I think
about it).
John Baker
> Adam.
>
> On Thursday 12 July 2001 11:19, you wrote:
> > [Argh! I cant get a single mail to go to the mailing list, I wonder if
> > this one does!:) ]
> >
> >
> > Hello.
> >
> > Anyone ever experiences a problem where by if you try to run a Thread
> > from an object implementing ServletContextListener (ie it's used to
> > perform 'startup' stuff), the Thread is unable to find classes (complains
> > of NoClassDefFound). Yet if the Thread is just run using the current
> > Thread (ie call run, not start), the classes are magically found.
> >
> >
> >
> > John Baker
Re: Fwd: NoClassDefFound
Posted by Adam Fowler <af...@aber.ac.uk>.
Hi,
Weird!!!
You can always use the Class class' getInstance(String className) method to
get a copy of your class.
Adam.
On Thursday 12 July 2001 11:19, you wrote:
> [Argh! I cant get a single mail to go to the mailing list, I wonder if this
> one does!:) ]
>
>
> Hello.
>
> Anyone ever experiences a problem where by if you try to run a Thread from
> an object implementing ServletContextListener (ie it's used to perform
> 'startup' stuff), the Thread is unable to find classes (complains of
> NoClassDefFound). Yet if the Thread is just run using the current Thread
> (ie call run, not start), the classes are magically found.
>
>
>
> John Baker