Re: Fixed - RE: RE: Catalina Beans - Class Path Problem
I have found that it does not pick up changes to WEB-INF/classes, though it does recognise changes to WEB-INF/lib. My solution is to update the jar (jar -uvf) whenever I change a class. My build script (run from WEB-INF/src dev directory) goes something like this: #!/bin/bash export CLASSPATH=$CLASSPATH:.:/usr/local/catalina/classes/:/usr/local/j2sdkee1.2.1/lib/j2ee.jar echo $CLASSPATH FILE=$1 if [ $1 = ]; then echo building all java files FILE=* fi find . -name $FILE.java -exec javac {} \; -print find . -name $FILE.class -exec jar -uvf ../lib/myWebapp.jar {} \; --- Jon Shoberg [EMAIL PROTECTED] wrote: All fixed :) Can tomcat/catalina check the classes directory to make sure none of them have been modified. Obviosuly it will check my JSPs but apparently not so when I have to change a class. Currently I have to reload the applciation. Any thoughts? Thanks for the help. -Original Message- From: Pavel Brun [mailto:[EMAIL PROTECTED]] Sent: Sunday, February 03, 2002 9:10 AM To: Tomcat Users List Subject: RE: RE: Catalina Beans - Class Path Problem I am not sure if you are running this in Windows but if you go to something equivalent to starting this at the command line, type startup debug in the %CATALINA_HOME%\bin directory and see if your classes or jars are loaded? Paul -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Sunday, February 03, 2002 8:29 AM To: Tomcat Users List Subject: Re: RE: Catalina Beans - Class Path Problem I am having the same problem only my clases ARE directly in the classes folder. Also, my utility classes, which are neither servlets nor Beans, are also giving me the same problem. Please help!!! I have tried packaging them and then without packaging. I am not sure what to do now. I am not using any IDE nor am I using a deployment tool. Tomcat Users List [EMAIL PROTECTED] wrote: Please see my comments below: All your classes and/or beans should go into: ./webapps/gateway/WEB-INF/classes, or ./webapps/gateway/WEB-INF/lib This should help you out. :-) Paul -Original Message- From: Jon Shoberg [mailto:[EMAIL PROTECTED]] Sent: Saturday, February 02, 2002 8:12 PM To: Tomcat Users List Subject: Catalina Beans - Class Path Problem Short Version: For some reason, I can not get my JSP pages to compile when loading a little bean ... It is not reading web-inf/classes. Although, it is reading web-inf/web.xml Long Version: A)Installed tomcat, got it running, all of the example programs work. B)I am building an application called Gateway I created ./webapps/gateway ./webapps/gateway/index.jsp ./webapps/gateway/WEB-INF/ ./webapps/gatewayWEB-INF/web.xml So I understand this to be creating a bean with id Words from the class ./webapps/gateway/classes/gwclasses/words.class in the kw.jsp. However, I am getting a compiler error saying C:\apache\Tomcat4\work\localhost\gateway\kw$jsp.java:63: Class gwclasses.words not found Any thoughts ? Thanks -- To unsubscribe: For additional commands: Troubles with the list: -- To unsubscribe: For additional commands: Troubles with the list: -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Great stuff seeking new owners in Yahoo! Auctions! http://auctions.yahoo.com -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Fixed - RE: RE: Catalina Beans - Class Path Problem
I would have assumed that once you load a JAR into the ClassLoader, that any changes will not be taken into account unless you reload the application (Tomcat). However, I took the approach of replacing the JAR's, not really updating them. I will have to give that a try to see if that works. :-) Thanks for the update. Paul -Original Message- From: August Detlefsen [mailto:[EMAIL PROTECTED]] Sent: Monday, February 04, 2002 4:20 PM To: Tomcat Users List Subject: Re: Fixed - RE: RE: Catalina Beans - Class Path Problem I have found that it does not pick up changes to WEB-INF/classes, though it does recognise changes to WEB-INF/lib. My solution is to update the jar (jar -uvf) whenever I change a class. My build script (run from WEB-INF/src dev directory) goes something like this: #!/bin/bash export CLASSPATH=$CLASSPATH:.:/usr/local/catalina/classes/:/usr/local/j2sdkee1.2.1/ lib/j2ee.jar echo $CLASSPATH FILE=$1 if [ $1 = ]; then echo building all java files FILE=* fi find . -name $FILE.java -exec javac {} \; -print find . -name $FILE.class -exec jar -uvf ../lib/myWebapp.jar {} \; --- Jon Shoberg [EMAIL PROTECTED] wrote: All fixed :) Can tomcat/catalina check the classes directory to make sure none of them have been modified. Obviosuly it will check my JSPs but apparently not so when I have to change a class. Currently I have to reload the applciation. Any thoughts? Thanks for the help. -Original Message- From: Pavel Brun [mailto:[EMAIL PROTECTED]] Sent: Sunday, February 03, 2002 9:10 AM To: Tomcat Users List Subject: RE: RE: Catalina Beans - Class Path Problem I am not sure if you are running this in Windows but if you go to something equivalent to starting this at the command line, type startup debug in the %CATALINA_HOME%\bin directory and see if your classes or jars are loaded? Paul -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Sunday, February 03, 2002 8:29 AM To: Tomcat Users List Subject: Re: RE: Catalina Beans - Class Path Problem I am having the same problem only my clases ARE directly in the classes folder. Also, my utility classes, which are neither servlets nor Beans, are also giving me the same problem. Please help!!! I have tried packaging them and then without packaging. I am not sure what to do now. I am not using any IDE nor am I using a deployment tool. Tomcat Users List [EMAIL PROTECTED] wrote: Please see my comments below: All your classes and/or beans should go into: ./webapps/gateway/WEB-INF/classes, or ./webapps/gateway/WEB-INF/lib This should help you out. :-) Paul -Original Message- From: Jon Shoberg [mailto:[EMAIL PROTECTED]] Sent: Saturday, February 02, 2002 8:12 PM To: Tomcat Users List Subject: Catalina Beans - Class Path Problem Short Version: For some reason, I can not get my JSP pages to compile when loading a little bean ... It is not reading web-inf/classes. Although, it is reading web-inf/web.xml Long Version: A)Installed tomcat, got it running, all of the example programs work. B)I am building an application called Gateway I created ./webapps/gateway ./webapps/gateway/index.jsp ./webapps/gateway/WEB-INF/ ./webapps/gatewayWEB-INF/web.xml So I understand this to be creating a bean with id Words from the class ./webapps/gateway/classes/gwclasses/words.class in the kw.jsp. However, I am getting a compiler error saying C:\apache\Tomcat4\work\localhost\gateway\kw$jsp.java:63: Class gwclasses.words not found Any thoughts ? Thanks -- To unsubscribe: For additional commands: Troubles with the list: -- To unsubscribe: For additional commands: Troubles with the list: -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Great stuff seeking new owners in Yahoo! Auctions! http://auctions.yahoo.com -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Catalina Beans - Class Path Problem -- workaround solution found
Thank you very much for your reply, Paul. I managed to get it working once I put the classes folder in my classpath. But I realize this is a workaround as I think it may limit my ability to run any other applications that are within contexts other than the classwork context I have set up. Here is a rundown of my directory structure: my application is called bookstore. it is in the context directory called classwork saved directly within %tomcat_home%\webapps (I am running Tomcat 4.0.1 on win2k and using TextPad as a text editor along with the JSDK1.3.2 - I will eventually integrate Apache and JBoss once I get a sufficient handle on the vagaries of Tomcat 4.0). The directory is as such: webapps\classwork\images webapps\classwork\jsp webapps\classwork\servlets webapps\classwork\WEB-INF webapps\classwork\WEB-INF\classes webapps\classwork\WEB-INF\lib //is currently empty as I have not jarred any of my app yet. webapps\classwork\WEB-INF\classes\bookstore webapps\classwork\WEB-INF\classes\bookstore\utils webapps\classwork\WEB-INF\classes\bookstore\javabeans webapps\classwork\WEB-INF\classes\bookstore\action webapps\classwork\WEB-INF\web.xml (bookstore, bookstore.utils, bookstore.javabeans, bookstore.action are all packages of classes and are broken down according to their purpose within my understanding of the MVC architecture). My classpath now looks like this: CLASSPATH: .;%TOMCAT_HOME%\webapps\classwork\WEB-INF\classes;%TOMCAT_HOME%\common \lib\servlet.jar;%JAVA_HOME%\jre\lib\rt.jar (any typos within this path are a result of typing it here and aren't in my actual classpath). My servlet.jar file has a new context entry for classwork that is the following: !-- classwork context -- Context path=/classwork docBase=classwork debug=0 reloadable=true / This set up was found through a combination of trial and error, the Tomcat 4.0 documentation, Goodwill's book on Tomcat 4.0 (worth the money, IMHO) and one little tip in Marty Hall's book More Servlets and JavaServer Pages (he made an invaluable comment about a common beginner's mistake: forgetting to put the dev environment in the classpath and since I used my actual deployment directory as my dev environment, I placed that directory in the classpath though I understand this habit is frowned upon). My bookstore app now works. I posted this here for all the other newbies to Tomcat 4.0 who may be able to use this info. I am currently teaching a class on Servlets and JavaServer Pages and this application is what I am using as a sample app for the students to see and try for themselves the various concepts we cover in class, hence the name classwork for the context. We had opted to use Tomcat 4.0.1 because of its support for the latest specs, its standard-setting architecture, its small size (important as our puter hard drive space is at a premium) and the fact that it is free, which is always a plus for an educational institution. It has been an adventure to stay a step ahead of the students in figuring out Tomcat's rules of play! But I have been quite happy with it, I must say. Thanks again, Paul. Zaina PS why does everyone always do a bookstore application for a sample app??? that was rhetorical, btw. -Original Message- From: Pavel Brun [mailto:[EMAIL PROTECTED]] Sent: Sunday, February 03, 2002 9:10 AM To: Tomcat Users List Subject: RE: RE: Catalina Beans - Class Path Problem I am not sure if you are running this in Windows but if you go to something equivalent to starting this at the command line, type startup debug in the %CATALINA_HOME%\bin directory and see if your classes or jars are loaded? Paul -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Sunday, February 03, 2002 8:29 AM To: Tomcat Users List Subject: Re: RE: Catalina Beans - Class Path Problem I am having the same problem only my clases ARE directly in the classes folder. Also, my utility classes, which are neither servlets nor Beans, are also giving me the same problem. Please help!!! I have tried packaging them and then without packaging. I am not sure what to do now. I am not using any IDE nor am I using a deployment tool. Tomcat Users List [EMAIL PROTECTED] wrote: Please see my comments below: All your classes and/or beans should go into: ./webapps/gateway/WEB-INF/classes, or ./webapps/gateway/WEB-INF/lib This should help you out. :-) Paul -Original Message- From: Jon Shoberg [mailto:[EMAIL PROTECTED]] Sent: Saturday, February 02, 2002 8:12 PM To: Tomcat Users List Subject: Catalina Beans - Class Path Problem Short Version: For some reason, I can not get my JSP pages to compile when loading a little bean ... It is not reading web-inf/classes. Although, it is reading web-inf/web.xml Long Version: A)Installed tomcat, got it running, all of the example programs work. B)I am building an application called Gateway I created ./webapps/gateway ./webapps
Re: RE: Catalina Beans - Class Path Problem
I am having the same problem only my clases ARE directly in the classes folder. Also, my utility classes, which are neither servlets nor Beans, are also giving me the same problem. Please help!!! I have tried packaging them and then without packaging. I am not sure what to do now. I am not using any IDE nor am I using a deployment tool. Tomcat Users List [EMAIL PROTECTED] wrote: Please see my comments below: All your classes and/or beans should go into: ./webapps/gateway/WEB-INF/classes, or ./webapps/gateway/WEB-INF/lib This should help you out. :-) Paul -Original Message- From: Jon Shoberg [mailto:[EMAIL PROTECTED]] Sent: Saturday, February 02, 2002 8:12 PM To: Tomcat Users List Subject: Catalina Beans - Class Path Problem Short Version: For some reason, I can not get my JSP pages to compile when loading a little bean ... It is not reading web-inf/classes. Although, it is reading web-inf/web.xml Long Version: A)Installed tomcat, got it running, all of the example programs work. B)I am building an application called Gateway I created ./webapps/gateway ./webapps/gateway/index.jsp ./webapps/gateway/WEB-INF/ ./webapps/gatewayWEB-INF/web.xml So I understand this to be creating a bean with id Words from the class ./webapps/gateway/classes/gwclasses/words.class in the kw.jsp. However, I am getting a compiler error saying C:\apache\Tomcat4\work\localhost\gateway\kw$jsp.java:63: Class gwclasses.words not found Any thoughts ? Thanks -- To unsubscribe: For additional commands: Troubles with the list: -- To unsubscribe: For additional commands: Troubles with the list: -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: RE: Catalina Beans - Class Path Problem
I am not sure if you are running this in Windows but if you go to something equivalent to starting this at the command line, type startup debug in the %CATALINA_HOME%\bin directory and see if your classes or jars are loaded? Paul -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Sunday, February 03, 2002 8:29 AM To: Tomcat Users List Subject: Re: RE: Catalina Beans - Class Path Problem I am having the same problem only my clases ARE directly in the classes folder. Also, my utility classes, which are neither servlets nor Beans, are also giving me the same problem. Please help!!! I have tried packaging them and then without packaging. I am not sure what to do now. I am not using any IDE nor am I using a deployment tool. Tomcat Users List [EMAIL PROTECTED] wrote: Please see my comments below: All your classes and/or beans should go into: ./webapps/gateway/WEB-INF/classes, or ./webapps/gateway/WEB-INF/lib This should help you out. :-) Paul -Original Message- From: Jon Shoberg [mailto:[EMAIL PROTECTED]] Sent: Saturday, February 02, 2002 8:12 PM To: Tomcat Users List Subject: Catalina Beans - Class Path Problem Short Version: For some reason, I can not get my JSP pages to compile when loading a little bean ... It is not reading web-inf/classes. Although, it is reading web-inf/web.xml Long Version: A)Installed tomcat, got it running, all of the example programs work. B)I am building an application called Gateway I created ./webapps/gateway ./webapps/gateway/index.jsp ./webapps/gateway/WEB-INF/ ./webapps/gatewayWEB-INF/web.xml So I understand this to be creating a bean with id Words from the class ./webapps/gateway/classes/gwclasses/words.class in the kw.jsp. However, I am getting a compiler error saying C:\apache\Tomcat4\work\localhost\gateway\kw$jsp.java:63: Class gwclasses.words not found Any thoughts ? Thanks -- To unsubscribe: For additional commands: Troubles with the list: -- To unsubscribe: For additional commands: Troubles with the list: -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Fixed - RE: RE: Catalina Beans - Class Path Problem
All fixed :) Can tomcat/catalina check the classes directory to make sure none of them have been modified. Obviosuly it will check my JSPs but apparently not so when I have to change a class. Currently I have to reload the applciation. Any thoughts? Thanks for the help. -Original Message- From: Pavel Brun [mailto:[EMAIL PROTECTED]] Sent: Sunday, February 03, 2002 9:10 AM To: Tomcat Users List Subject: RE: RE: Catalina Beans - Class Path Problem I am not sure if you are running this in Windows but if you go to something equivalent to starting this at the command line, type startup debug in the %CATALINA_HOME%\bin directory and see if your classes or jars are loaded? Paul -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Sunday, February 03, 2002 8:29 AM To: Tomcat Users List Subject: Re: RE: Catalina Beans - Class Path Problem I am having the same problem only my clases ARE directly in the classes folder. Also, my utility classes, which are neither servlets nor Beans, are also giving me the same problem. Please help!!! I have tried packaging them and then without packaging. I am not sure what to do now. I am not using any IDE nor am I using a deployment tool. Tomcat Users List [EMAIL PROTECTED] wrote: Please see my comments below: All your classes and/or beans should go into: ./webapps/gateway/WEB-INF/classes, or ./webapps/gateway/WEB-INF/lib This should help you out. :-) Paul -Original Message- From: Jon Shoberg [mailto:[EMAIL PROTECTED]] Sent: Saturday, February 02, 2002 8:12 PM To: Tomcat Users List Subject: Catalina Beans - Class Path Problem Short Version: For some reason, I can not get my JSP pages to compile when loading a little bean ... It is not reading web-inf/classes. Although, it is reading web-inf/web.xml Long Version: A)Installed tomcat, got it running, all of the example programs work. B)I am building an application called Gateway I created ./webapps/gateway ./webapps/gateway/index.jsp ./webapps/gateway/WEB-INF/ ./webapps/gatewayWEB-INF/web.xml So I understand this to be creating a bean with id Words from the class ./webapps/gateway/classes/gwclasses/words.class in the kw.jsp. However, I am getting a compiler error saying C:\apache\Tomcat4\work\localhost\gateway\kw$jsp.java:63: Class gwclasses.words not found Any thoughts ? Thanks -- To unsubscribe: For additional commands: Troubles with the list: -- To unsubscribe: For additional commands: Troubles with the list: -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Catalina Beans - Class Path Problem
As a follow-up If I try a page import of gwclasses it failes with that top level error ... Any thoughts? Thanks - Original Message - From: Jon Shoberg [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Saturday, February 02, 2002 8:12 PM Subject: Catalina Beans - Class Path Problem Short Version: For some reason, I can not get my JSP pages to compile when loading a little bean ... It is not reading web-inf/classes. Although, it is reading web-inf/web.xml Long Version: A)Installed tomcat, got it running, all of the example programs work. B)I am building an application called Gateway I created ./webapps/gateway ./webapps/gateway/index.jsp --- works no problem ./webapps/gateway/kw.jsp calls bean, has problem modified server.xml and reloaded ... my index.jsp works no problem on this web app ./webapps/gateway/WEB-INF/ ./webapps/gatewayWEB-INF/web.xml --- this app is a proteced resource, I know it is reading this properly ./webapps/gateway/classes/ ./webapps/gateway/classes/gwclasses gateway classes and beans go in here ./webapps/gateway/classes/gwclasses/words.java ./webapps/gateway/classes/gwclasses/words.class - yeah, testing my code with another ide first so I know it works C)So from kw.jsp I cam calling a bean such as jsp:useBean id=Words scope=session class=gwclasses.words / So I understand this to be creating a bean with id Words from the class ./webapps/gateway/classes/gwclasses/words.class in the kw.jsp. However, I am getting a compiler error saying C:\apache\Tomcat4\work\localhost\gateway\kw$jsp.java:63: Class gwclasses.words not found Any thoughts ? Thanks -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Catalina Beans - Class Path Problem
Please see my comments below: All your classes and/or beans should go into: ./webapps/gateway/WEB-INF/classes, or ./webapps/gateway/WEB-INF/lib This should help you out. :-) Paul -Original Message- From: Jon Shoberg [mailto:[EMAIL PROTECTED]] Sent: Saturday, February 02, 2002 8:12 PM To: Tomcat Users List Subject: Catalina Beans - Class Path Problem Short Version: For some reason, I can not get my JSP pages to compile when loading a little bean ... It is not reading web-inf/classes. Although, it is reading web-inf/web.xml Long Version: A)Installed tomcat, got it running, all of the example programs work. B)I am building an application called Gateway I created ./webapps/gateway ./webapps/gateway/index.jsp --- works no problem ./webapps/gateway/kw.jsp calls bean, has problem modified server.xml and reloaded ... my index.jsp works no problem on this web app ./webapps/gateway/WEB-INF/ ./webapps/gatewayWEB-INF/web.xml --- this app is a proteced resource, I know it is reading this properly ./webapps/gateway/classes/ ./webapps/gateway/classes/gwclasses gateway classes and beans go in here ./webapps/gateway/classes/gwclasses/words.java ./webapps/gateway/classes/gwclasses/words.class - yeah, testing my code with another ide first so I know it works C)So from kw.jsp I cam calling a bean such as jsp:useBean id=Words scope=session class=gwclasses.words / So I understand this to be creating a bean with id Words from the class ./webapps/gateway/classes/gwclasses/words.class in the kw.jsp. However, I am getting a compiler error saying C:\apache\Tomcat4\work\localhost\gateway\kw$jsp.java:63: Class gwclasses.words not found Any thoughts ? Thanks -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]