You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Sebastien BLANC <se...@wanadoo.fr> on 2004/03/18 14:12:19 UTC

re: Velatg classpath problem

Well Nathan I try your software filemon and that is the result :
13:59:41 javaw.exe:932 QUERY INFORMATION F:\Tomcat\work\Catalina\localhost\veltagTest\org\apache\jsp\GeirBean.class FILE NOT FOUND Attributes: Error 
So He is really looking for that file in the work directory as I thought, so does anyone knows how to tell tomcat to look at web-inf\classes directory ?
Before anybody tells me : "no it's GeirBean but simpleBean" I have fixed that by renaming both my java file and my jsp file to Geirbean.
Thanks,
Seb
Seb
-----Message d'origine-----
De : Nathan Green [mailto:ngreen@inco5.com]
Envoyé : mercredi 17 mars 2004 14:53
À : Velocity Users List
Objet : Re: veltag and class loader problem

I am not at all familiar with Veltag, but I have a suggestion.
Run Filemon (http://www.sysinternals.com/ntw2k/source/filemon.shtml)
_on the server computer_ and filter on *.class. Then, make the
request that causes NoClassDefFoundError and you should see in
Filemon entries GeirBean.class and the result of FILE NOT FOUND
or something. If the class is in a jar file, filter on *.jar or
better yet filter on *jarfilename.jar.
I've used this technique on a number of programs, not just Java,
and I find it works quite well when resolving classloader issues.
It has often helped me look at a situation objectively.
-Nathan

Sebastien BLANC wrote:
> hi,
> I've already written a mail a few days ago but I did not receive any answer so I conclude my problem was maybe to basic and that you were thinking I would find alone the solution quickly.However, it's been now one week that I try to use the simple veltag example. The thing is that there is a problem with the servlet GeirBean.class, i've put in in myapp\WEB-INF\classes\..mypackage..\, when I dot that I obtain this log : 
> exception 
> javax.servlet.ServletException: org/apache/jsp/GeirBean
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:256)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
> 
> cause mère 
> java.lang.NoClassDefFoundError: org/apache/jsp/GeirBean
> java.lang.Class.getDeclaredConstructors0(Native Method)
> java.lang.Class.privateGetDeclaredConstructors(Class.java:1610)
> java.lang.Class.getConstructor0(Class.java:1922)
> java.lang.Class.newInstance0(Class.java:278)
> java.lang.Class.newInstance(Class.java:261)
> org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:178)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:296)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
> 
> but when I put my GeirBean in tomcat\work\.. folder it works perfectly. So I really don't what to do and it will be wonderful if you have any suggestion.
> By the way here is my web.xml file : 
> <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"><web-app id="VelocityExample"> <display-name>VeltagTest</display-name> <servlet> <servlet-name>GeirBean</servlet-name> <servlet-class>org.apache.jsp.GeirBean</servlet-class> </servlet>
> <servlet-mapping> <servlet-name>GeirBean</servlet-name> <url-pattern>/servlet/GeirBean</url-pattern> </servlet-mapping> <taglib> <taglib-uri>http://jakarta.apache.org/taglibs/veltag-1.0</taglib-uri> <taglib-location>/WEB-INF/veltag.tld</taglib-location> </taglib>
> </web-app>
> Thanks for your help,
> Seb, a young develloper who has many things to learn ;-)
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org

Re: Velatg classpath problem

Posted by Mike Kienenberger <mk...@alaska.net>.
> Sebastien BLANC wrote:
> 
> > Well Nathan I try your software filemon and that is the result :
> > 13:59:41 javaw.exe:932 QUERY INFORMATION 
F:\Tomcat\work\Catalina\localhost\veltagTest\org\apache\jsp\GeirBean.class 
FILE NOT FOUND Attributes: Error 
> > So He is really looking for that file in the work directory as I 
thought, so does anyone knows how to tell tomcat to look at web-inf\classes 
directory ?
> > Before anybody tells me : "no it's GeirBean but simpleBean" I have fixed 
that by renaming both my java file and my jsp file to Geirbean.

I'm pretty sure that the "jsp\GeirBean.class" refers to the compiled version 
of your GeirBean.jsp file and not to a GeirBean java class in your path.

Not sure how helpful that was.   Tomcat has always recompiled all jsp files 
on the fly for me.

-Mike

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Velatg classpath problem

Posted by Nathan Green <ng...@inco5.com>.
If FileMon says FILE NOT FOUND, then the file listed does not exist.
You cannot rename .class files and expect things to work.  The name
of the class is embedded in the file, so you would have to modify the
.java file and compile it.  Beyond this, I'm not sure what I can do
to help, sorry.

Nathan


Sebastien BLANC wrote:

> Well Nathan I try your software filemon and that is the result :
> 13:59:41 javaw.exe:932 QUERY INFORMATION F:\Tomcat\work\Catalina\localhost\veltagTest\org\apache\jsp\GeirBean.class FILE NOT FOUND Attributes: Error 
> So He is really looking for that file in the work directory as I thought, so does anyone knows how to tell tomcat to look at web-inf\classes directory ?
> Before anybody tells me : "no it's GeirBean but simpleBean" I have fixed that by renaming both my java file and my jsp file to Geirbean.
> Thanks,
> Seb
> Seb
> -----Message d'origine-----
> De : Nathan Green [mailto:ngreen@inco5.com]
> Envoyé : mercredi 17 mars 2004 14:53
> À : Velocity Users List
> Objet : Re: veltag and class loader problem
> 
> I am not at all familiar with Veltag, but I have a suggestion.
> Run Filemon (http://www.sysinternals.com/ntw2k/source/filemon.shtml)
> _on the server computer_ and filter on *.class. Then, make the
> request that causes NoClassDefFoundError and you should see in
> Filemon entries GeirBean.class and the result of FILE NOT FOUND
> or something. If the class is in a jar file, filter on *.jar or
> better yet filter on *jarfilename.jar.
> I've used this technique on a number of programs, not just Java,
> and I find it works quite well when resolving classloader issues.
> It has often helped me look at a situation objectively.
> -Nathan
> 
> Sebastien BLANC wrote:
> 
>>hi,
>>I've already written a mail a few days ago but I did not receive any answer so I conclude my problem was maybe to basic and that you were thinking I would find alone the solution quickly.However, it's been now one week that I try to use the simple veltag example. The thing is that there is a problem with the servlet GeirBean.class, i've put in in myapp\WEB-INF\classes\..mypackage..\, when I dot that I obtain this log : 
>>exception 
>>javax.servlet.ServletException: org/apache/jsp/GeirBean
>>org.apache.jasper.servlet.JspServlet.service(JspServlet.java:256)
>>javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>>
>>cause mère 
>>java.lang.NoClassDefFoundError: org/apache/jsp/GeirBean
>>java.lang.Class.getDeclaredConstructors0(Native Method)
>>java.lang.Class.privateGetDeclaredConstructors(Class.java:1610)
>>java.lang.Class.getConstructor0(Class.java:1922)
>>java.lang.Class.newInstance0(Class.java:278)
>>java.lang.Class.newInstance(Class.java:261)
>>org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:178)
>>org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:296)
>>org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
>>org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
>>javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>>
>>but when I put my GeirBean in tomcat\work\.. folder it works perfectly. So I really don't what to do and it will be wonderful if you have any suggestion.
>>By the way here is my web.xml file : 
>><?xml version="1.0" encoding="UTF-8"?><!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"><web-app id="VelocityExample"> <display-name>VeltagTest</display-name> <servlet> <servlet-name>GeirBean</servlet-name> <servlet-class>org.apache.jsp.GeirBean</servlet-class> </servlet>
>><servlet-mapping> <servlet-name>GeirBean</servlet-name> <url-pattern>/servlet/GeirBean</url-pattern> </servlet-mapping> <taglib> <taglib-uri>http://jakarta.apache.org/taglibs/veltag-1.0</taglib-uri> <taglib-location>/WEB-INF/veltag.tld</taglib-location> </taglib>
>></web-app>
>>Thanks for your help,
>>Seb, a young develloper who has many things to learn ;-)
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Velatg classpath problem

Posted by Geir Magnusson Jr <ge...@4quarters.com>.
On Mar 18, 2004, at 10:31 AM, Tim Colson wrote:

>> Before anybody tells me : "no it's GeirBean but simpleBean" I
>> have fixed that by renaming both my java file and my jsp file
>> to Geirbean.
>
> That was not the solution I gave. Please go re-read the email. Rename
> GeirBean TO SimpleBean.java and remove the entries you had in web.xml 
> to
> GeirBean.

Or update from CVS.  It should be fixed there...

>
> Tim
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>
-- 
Geir Magnusson Jr                                   203-247-1713(m)
geir@4quarters.com


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


RE: Velatg classpath problem

Posted by Tim Colson <tc...@cisco.com>.
> Before anybody tells me : "no it's GeirBean but simpleBean" I 
> have fixed that by renaming both my java file and my jsp file 
> to Geirbean.

That was not the solution I gave. Please go re-read the email. Rename
GeirBean TO SimpleBean.java and remove the entries you had in web.xml to
GeirBean.

Tim


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org