KwonNam Son | 19 Jan 17:04 2011
Picon

JSP ClassNotFoundException on Tomcat 6.0.29/30 Eclipse Helios WTP

I'm developing an web application on Eclipse Helios, WTP, Tomcat 
6.0.29(and just upgraded to 6.0.30).

I suffer from ClassNotFoundException a lot of times on both 6.0.29/30.
It's not about usual classes or jar. It's about JSP generated java class.

For example, when I request /jsps/test.jsp, the stack trace looks like 
the following.

java.lang.ClassNotFoundException: org.apache.jsp.jsps.test_blahblah.class

But org.apache.jsp.jspa.test_blahblah.class surely exists in the work 
directory.

When this happens, I just shutdown the tomcat on eclipse and start it 
again. That's all. Then the jsp works fine. But after a few minutes it 
happens again.

What's the problem??
It does not happen on Jetty 7.

Thanks,
KwonNam.
David Fisher | 19 Jan 17:21 2011

Re: JSP ClassNotFoundException on Tomcat 6.0.29/30 Eclipse Helios WTP

> I'm developing an web application on Eclipse Helios, WTP, Tomcat 6.0.29(and just upgraded to 6.0.30).
> 
> I suffer from ClassNotFoundException a lot of times on both 6.0.29/30.
> It's not about usual classes or jar. It's about JSP generated java class.
> 
> For example, when I request /jsps/test.jsp, the stack trace looks like the following.
> 
> java.lang.ClassNotFoundException: org.apache.jsp.jsps.test_blahblah.class
> 
> But org.apache.jsp.jspa.test_blahblah.class surely exists in the work directory.
> 
> When this happens, I just shutdown the tomcat on eclipse and start it again. That's all. Then the jsp works
fine. But after a few minutes it happens again.

This happens to us under Tomcat 6.0.29 if we rebuild a jar file that is in the ${CATALINA_HOME}/lib
directory. Could this be your issue?

Regards,
Dave

> 
> What's the problem??
> It does not happen on Jetty 7.
> 
> Thanks,
> KwonNam.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe <at> tomcat.apache.org
(Continue reading)

David Fisher | 19 Jan 17:25 2011

Re: JSP ClassNotFoundException on Tomcat 6.0.29/30 Eclipse Helios WTP

>> I'm developing an web application on Eclipse Helios, WTP, Tomcat 6.0.29(and just upgraded to 6.0.30).
>> 
>> I suffer from ClassNotFoundException a lot of times on both 6.0.29/30.
>> It's not about usual classes or jar. It's about JSP generated java class.
>> 
>> For example, when I request /jsps/test.jsp, the stack trace looks like the following.
>> 
>> java.lang.ClassNotFoundException: org.apache.jsp.jsps.test_blahblah.class
>> 
>> But org.apache.jsp.jspa.test_blahblah.class surely exists in the work directory.
>> 
>> When this happens, I just shutdown the tomcat on eclipse and start it again. That's all. Then the jsp works
fine. But after a few minutes it happens again.
> 
> This happens to us under Tomcat 6.0.29 if we rebuild a jar file that is in the ${CATALINA_HOME}/lib
directory. Could this be your issue?

Sorry, please ignore, I didn't fully read your post, still drinking my morning coffee.

Regards,
Dave

> 
> Regards,
> Dave
> 
> 
>> 
>> What's the problem??
>> It does not happen on Jetty 7.
(Continue reading)

Mark Thomas | 19 Jan 18:21 2011
Picon

Re: JSP ClassNotFoundException on Tomcat 6.0.29/30 Eclipse Helios WTP

On 19/01/2011 16:04, KwonNam Son wrote:
> I'm developing an web application on Eclipse Helios, WTP, Tomcat
> 6.0.29(and just upgraded to 6.0.30).
> 
> I suffer from ClassNotFoundException a lot of times on both 6.0.29/30.
> It's not about usual classes or jar. It's about JSP generated java class.
> 
> For example, when I request /jsps/test.jsp, the stack trace looks like
> the following.
> 
> java.lang.ClassNotFoundException: org.apache.jsp.jsps.test_blahblah.class
> 
> But org.apache.jsp.jspa.test_blahblah.class surely exists in the work
> directory.
> 
> When this happens, I just shutdown the tomcat on eclipse and start it
> again. That's all. Then the jsp works fine. But after a few minutes it
> happens again.
> 
> What's the problem??

An integration issue in WTP maybe? I've never really got to the bottom
of exactly how that plug-in worked. Copying across the new JSP - or just
editing it directly should work.

Next time it happens check the timestamps on the JSP and the class file.

Mark
Son KwonNam | 21 Jan 07:27 2011
Picon

Re: JSP ClassNotFoundException on Tomcat 6.0.29/30 Eclipse Helios WTP

I checked the timestamp of JSP and class/java file.

When I edited JSP in Eclipse editor and saved the file, it was published 
to 
workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/myweb/... 
directory.

I checked the contends and times stamp of jsp file, it was proper.

Also checked 
workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/work/Catalina/localhost/_/org/apache/jsp/...
The class and java file was properly generated and compiled after the 
jsp is published.

The thing I found strange is, when a jsp is published to 
wtpwebapps/myweb/... directory, the counterpart class directory is 
removed and remade, then java source is generated and compiled.

Actually when I checked deeply, not just jsp counterpart class 
directory, the root class

directory(workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/work/Catalina/localhost/_) 
is removed when a jsp is edited and published then if I request the JSP 
on a web browser, the class directory and java/class files are regenerated.

I use Tomcat 6.0.30.

Our whole team members suffer from this problem.
We use JDK 6. Most of us use Windows 7 64Bit, but I use Ubuntu 10.10 
32bit. So I think it's not a problem of OS.
(Continue reading)

Son KwonNam | 21 Jan 07:58 2011
Picon

Re: JSP ClassNotFoundException on Tomcat 6.0.29/30 Eclipse Helios WTP

I told when a jsp file is edited on Eclipse WTP, and published, the 
tomcat work directory is removed and regenerated.

I checked more and more and finally found out that this happens only 
when the project web context root is "/" in Eclipse Project properties.

When a project has other context root (except "/"), this 
phenomenon(removing tomcat work directory) does not happen.

Thanks,
KwonNam.

2011년 01월 21일 15:27, Son KwonNam 쓴 글:
> I checked the timestamp of JSP and class/java file.
>
> When I edited JSP in Eclipse editor and saved the file, it was published
> to
> workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/myweb/...
> directory.
>
> I checked the contends and times stamp of jsp file, it was proper.
>
> Also checked
> workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/work/Catalina/localhost/_/org/apache/jsp/...
>
> The class and java file was properly generated and compiled after the
> jsp is published.
>
> The thing I found strange is, when a jsp is published to
> wtpwebapps/myweb/... directory, the counterpart class directory is
(Continue reading)

Mark Thomas | 21 Jan 12:04 2011
Picon

Re: JSP ClassNotFoundException on Tomcat 6.0.29/30 Eclipse Helios WTP

On 21/01/2011 06:58, Son KwonNam wrote:
> I told when a jsp file is edited on Eclipse WTP, and published, the
> tomcat work directory is removed and regenerated.
> 
> I checked more and more and finally found out that this happens only
> when the project web context root is "/" in Eclipse Project properties.
> 
> When a project has other context root (except "/"), this
> phenomenon(removing tomcat work directory) does not happen.

That looks like the source of the problem. Tomcat doesn't expect some
external process to remove the work directory. That is almost certainly
what is at the root of the ClassNotFoundExceptions.

Thanks for digging in to this. I'll do some tests today and see if I can
figure out exactly what is going wrong.

Mark
Mark Thomas | 21 Jan 14:13 2011
Picon

Re: JSP ClassNotFoundException on Tomcat 6.0.29/30 Eclipse Helios WTP

On 21/01/2011 11:04, Mark Thomas wrote:
> On 21/01/2011 06:58, Son KwonNam wrote:
>> I told when a jsp file is edited on Eclipse WTP, and published, the
>> tomcat work directory is removed and regenerated.
>>
>> I checked more and more and finally found out that this happens only
>> when the project web context root is "/" in Eclipse Project properties.
>>
>> When a project has other context root (except "/"), this
>> phenomenon(removing tomcat work directory) does not happen.
> 
> That looks like the source of the problem. Tomcat doesn't expect some
> external process to remove the work directory. That is almost certainly
> what is at the root of the ClassNotFoundExceptions.
> 
> Thanks for digging in to this. I'll do some tests today and see if I can
> figure out exactly what is going wrong.

I can't repeat this on a standard Tomcat 6.0.x or 7.0.x install.

If you have a test case that demonstrates this issue that doesn't
involve WTP then I'll happily take a look. In the meantime, this looks
like an issue for WTP.

Mark

Gmane