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

Reply via email to