Re: WEB-INF/classes not loading from corrrect classloader
Does this happen with the JPDA debugger, or running tomcat inside your IDE? [EMAIL PROTECTED] 02/28/03 16:38 PM Hello, While I'm having no problems running *outside* a debugger, I am running into a problem with classloading as I try to run 2 web-application through a debugger. The two projects have overlapping copies of the same class files (ie, both projects use Class A). The problem is that when Tomcat (4.0.6) is run through my debugger, the WEB-INF/classes are not loaded by org.apache.catalina.loader.WebappClassLoader. They are apparently loaded by the system classloader. So my Class A instance is shared between my 2 web-apps when in fact they should each have their own instance. Run outside the debugger, the WebappClassloader does its job both web-apps get their unique copies of class A. Here is what Class A has to say about who's loading it: Outside the debugger: - Class A's ClassLoader's class is [class org.apache.catalina.loader. WebappClassLoader] ClassLoader's parent class is [class org.apache.catalina.loader.StandardClassLoader] ClassLoader's parent class is [class org.apache.catalina.loader.StandardClassLoader] ClassLoader's parent class is [class sun.misc.Launcher$AppClassLoader] ClassLoader's parent class is [class sun.misc.Launcher$ExtClassLoader] Inside the debugger: [EMAIL PROTECTED] ClassLoader's class is [class sun.misc.Launcher$AppClassLoader] ClassLoader's parent class is [class sun.misc.Launcher$ExtClassLoader] Is there a way that I can prevent the WEB-INF classes from being loaded by the System classloader when using the debugger? I know this was part of the servlet spec as the Tomcat documentation notes: The web application class loader diverges from the default Java 2 delegation model (in accordance with the recommendations in the Servlet Specification, version 2.3, section 9.6). When a request to load a class from the web application's WebappX class loader is processed, this class loader will look in the local repositories first, instead of delegating before looking. So why isn't WebbappClassLoader loading the WEB-INF/classes when debugging? Thanks in advance for your help! Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: WEB-INF/classes not loading from corrrect classloader
It happens inside the debugger (Eclipse). Basically, what I have come to realize is happening is that Eclipse implicitly includes the current project (in my case the web-app) in the system classpath. So when I start tomcat by invoking Bootstrap.main thru the debugger, the project/application classfiles are always going to be loaded by the application/system classloader, not the webapp classloader. I found a plugin by sysdeo.com that solves this by calling bootstrap indirectly, so as not to include the application in the system classpath. Thanks, Craig At Friday, 28 February 2003, Larry Meadors [EMAIL PROTECTED] com wrote: Does this happen with the JPDA debugger, or running tomcat inside your IDE? [EMAIL PROTECTED] 02/28/03 16:38 PM Hello, While I'm having no problems running *outside* a debugger, I am running into a problem with classloading as I try to run 2 web-application through a debugger. The two projects have overlapping copies of the same class files (ie, both projects use Class A). The problem is that when Tomcat (4.0.6) is run through my debugger, the WEB-INF/classes are not loaded by org.apache.catalina.loader.WebappClassLoader. They are apparently loaded by the system classloader. So my Class A instance is shared between my 2 web-apps when in fact they should each have their own instance. Run outside the debugger, the WebappClassloader does its job both web-apps get their unique copies of class A. Here is what Class A has to say about who's loading it: Outside the debugger: - Class A's ClassLoader's class is [class org.apache.catalina.loader. WebappClassLoader] ClassLoader's parent class is [class org.apache.catalina.loader.StandardClassLoader] ClassLoader's parent class is [class org.apache.catalina.loader.StandardClassLoader] ClassLoader's parent class is [class sun.misc.Launcher$AppClassLoader] ClassLoader's parent class is [class sun.misc.Launcher$ExtClassLoader] Inside the debugger: [EMAIL PROTECTED] ClassLoader's class is [class sun.misc.Launcher$AppClassLoader] ClassLoader's parent class is [class sun.misc.Launcher$ExtClassLoader] Is there a way that I can prevent the WEB-INF classes from being loaded by the System classloader when using the debugger? I know this was part of the servlet spec as the Tomcat documentation notes: The web application class loader diverges from the default Java 2 delegation model (in accordance with the recommendations in the Servlet Specification, version 2.3, section 9.6). When a request to load a class from the web application's WebappX class loader is processed, this class loader will look in the local repositories first, instead of delegating before looking. So why isn't WebbappClassLoader loading the WEB-INF/classes when debugging? Thanks in advance for your help! Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: WEB-INF/classes, WEB-INF/lib
It works on my tomcat on NT. We use a lot of jars, but it it someties hard to uncompress and compress the jars with changes, so I just put the updated class in the classes dir and all works out well. When we go to production, I just jar them all back. Scott -Original Message- From: Frank Liu [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 3:04 PM To: [EMAIL PROTECTED] Subject: WEB-INF/classes, WEB-INF/lib Is it true that WEB-INF/classes overrides WEB-INF/lib in the classpath? I have a binary jar file in WEB-INF/lib and need to overwrite on class in the jar file, can you just put my class in the WEB-INF/classes and tomcat will take care of it automatically? Frank -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: WEB-INF/classes, WEB-INF/lib
- Original Message - From: Craig R. McClanahan [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Monday, October 14, 2002 2:11 PM Subject: RE: WEB-INF/classes, WEB-INF/lib On Mon, 14 Oct 2002, Scott Purcell wrote: It works on my tomcat on NT. We use a lot of jars, but it it someties hard to uncompress and compress the jars with changes, so I just put the updated class in the classes dir and all works out well. When we go to production, I just jar them all back. Containers that follow the servlet spec's requirements will load classes from /WEB-INF/classes before they look at the JAR files in /WEB-INF/lib. [Section 9.5, last sentence before 9.5.1 starts]. Do they do this on a class level, or on a package level. So, from what I see hear, patching a WEB-INF/lib JAR file with a overriding class in the WEB-INF/classes directory will work as anticipated? I never know how much caching of lookup Java is allowed to do with class lookups, or whether it does any at all (though I do assume it caches the directories/JARs when first visited, and does not look at those again, but perhaps that's a bad assumption). Regards, Will Hartung ([EMAIL PROTECTED]) -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: WEB-INF/classes, WEB-INF/lib
On Mon, 14 Oct 2002, Will Hartung wrote: Date: Mon, 14 Oct 2002 14:30:40 -0700 From: Will Hartung [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: Re: WEB-INF/classes, WEB-INF/lib - Original Message - From: Craig R. McClanahan [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Monday, October 14, 2002 2:11 PM Subject: RE: WEB-INF/classes, WEB-INF/lib On Mon, 14 Oct 2002, Scott Purcell wrote: It works on my tomcat on NT. We use a lot of jars, but it it someties hard to uncompress and compress the jars with changes, so I just put the updated class in the classes dir and all works out well. When we go to production, I just jar them all back. Containers that follow the servlet spec's requirements will load classes from /WEB-INF/classes before they look at the JAR files in /WEB-INF/lib. [Section 9.5, last sentence before 9.5.1 starts]. Do they do this on a class level, or on a package level. So, from what I see hear, patching a WEB-INF/lib JAR file with a overriding class in the WEB-INF/classes directory will work as anticipated? It's done at a per-class (or per-resource if you've got embedded resources) level, rather than per-package. Incidentally, Tomcat implements the exact same algorithm for the shared class loaders as well: - Classes in $CATALINA_HOME/shared/classes override classes in JAR files under $CATALINA_HOME/shared/lib - Classes in $CATALINA_HOME/common/classes override classes in JAR files under $CATALINA_HOME/common/lib. I never know how much caching of lookup Java is allowed to do with class lookups, or whether it does any at all (though I do assume it caches the directories/JARs when first visited, and does not look at those again, but perhaps that's a bad assumption). The classes and resources themselves are cached only when they are loaded. However, a related question is can I add new classes and resources dynamically while the app is running, and have them recognized? The answer for Tomcat, if you're running unpacked, is yes - but ONLY until the class has been loaded. You can't use this technique to replace an already loaded class, because Java gives us no mechanism to do that. Regards, Will Hartung ([EMAIL PROTECTED]) Craig -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: web-inf/classes and eclipse
Hi Michenaud, using Ant together with Eclipse might be an option. You can run Ant from inside Eclipse by right-clicking the build.xml file and choosing the right operation (I now don't know how it is called). Andreas Hi, I use the editor Eclipse but when i launch Rebuild all, it deletes all the content of the WEB-INF/classes directory. Inside, there is all my *.properties file. The idea is to create a WEB-INF/config where i could put the properties files but i don't know how to add this directory into the classpath. It would be better too if the path was a relative path. Or maybe u have others ideas ? Michenaud Laurent - Adeuza - [ Développeur Web - Administrateur Réseau ] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: web-inf/classes and eclipse
thanks for this idea. I think i will use ant.. But what about adding WEB-INF/config to the CLASSPATH ? How can i do that automatically for all tomcat projects ? -Message d'origine- De : Andreas Probst [mailto:[EMAIL PROTECTED]] Envoyé : mardi 20 août 2002 09:37 À : Tomcat Users List Objet : Re: web-inf/classes and eclipse Hi Michenaud, using Ant together with Eclipse might be an option. You can run Ant from inside Eclipse by right-clicking the build.xml file and choosing the right operation (I now don't know how it is called). Andreas Hi, I use the editor Eclipse but when i launch Rebuild all, it deletes all the content of the WEB-INF/classes directory. Inside, there is all my *.properties file. The idea is to create a WEB-INF/config where i could put the properties files but i don't know how to add this directory into the classpath. It would be better too if the path was a relative path. Or maybe u have others ideas ? Michenaud Laurent - Adeuza - [ Développeur Web - Administrateur Réseau ] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: web-inf/classes and eclipse
As far as I know, there is no classpath in Tomcat, but a classloader hierarchy. In a few threads about how to write files into the file system I read about passing a parameter to the webapp. This parameter could be the path to the config file somewhere on your system. thanks for this idea. I think i will use ant.. But what about adding WEB-INF/config to the CLASSPATH ? How can i do that automatically for all tomcat projects ? -Message d'origine- De : Andreas Probst [mailto:[EMAIL PROTECTED]] Envoyé : mardi 20 août 2002 09:37 À : Tomcat Users List Objet : Re: web-inf/classes and eclipse Hi Michenaud, using Ant together with Eclipse might be an option. You can run Ant from inside Eclipse by right-clicking the build.xml file and choosing the right operation (I now don't know how it is called). Andreas Hi, I use the editor Eclipse but when i launch Rebuild all, it deletes all the content of the WEB-INF/classes directory. Inside, there is all my *.properties file. The idea is to create a WEB-INF/config where i could put the properties files but i don't know how to add this directory into the classpath. It would be better too if the path was a relative path. Or maybe u have others ideas ? Michenaud Laurent - Adeuza - [ Développeur Web - Administrateur Réseau ] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: web-inf/classes
Chris Shen wrote: this is a bizzare one. i've placed all my classes under the web-inf/classes with the appropriate class structure and everything, and it was working fine on my tomcat 3.3. yet, after i migrated it to 4.03, i tried to run it the first time and compiled it, and i kept on getting: org.apache.jasper.JasperException: Unable to compile class for JSP C:\jakarta-tomcat-4.0.3\work\localhost\webauth\successfulLogin$jsp.java:3: Package ant.uci.edu not found in import. import ant.uci.edu.*; i did place my class directory ant\uci\edu under web-inf\classes...any idea??? Chris -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] Hi there try putting %@ page import=ant\uci\edu % Your complete dir path of your .class file in your jsp page ( page directive) as a apparently the class loader points to classes default package in j-tomcat3.3a but you can't get away from it in j-tomcat4 upwards . I had a similar problem thus useing tomcat3.3.a for now and i'll upgrade and use the classes dir path and page import directive as told via this user-help group. Cheers Chuck Amadi Sustems Programmer Rhaglennydd Systemau -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: web-inf/classes
At 15:18 -0700 5/6/02, Chris Shen wrote: this is a bizzare one. i've placed all my classes under the web-inf/classes Is it web-inf or WEB-INF? If the former, rename it. with the appropriate class structure and everything, and it was working fine on my tomcat 3.3. yet, after i migrated it to 4.03, i tried to run it the first time and compiled it, and i kept on getting: org.apache.jasper.JasperException: Unable to compile class for JSP C:\jakarta-tomcat-4.0.3\work\localhost\webauth\successfulLogin$jsp.java:3: Package ant.uci.edu not found in import. import ant.uci.edu.*; i did place my class directory ant\uci\edu under web-inf\classes...any idea??? Chris -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: WEB-INF/classes
Anja, If you are using Tomcat 3.3 you need to create an XML file (apps-applicationname.xml) where you have to declare the new context where your WEB-INF directory is... Otherwise, if you are using Tomcat 3.2 or less, you have to modify the server.xml file using the new Context entry. Is something like this: Context path=/applicationname docBase=webapps/applicationname crossContext=false debug=0 reloadable=true /Context Hope this help you.. Anja Falkner wrote: Hello, at setting up a new context for Tomcat, I must have forgotten something, because tomcat doesn't find my classes in WEB-INF/classes. The following fault appears: login_0005ftest$jsp.java:71: Class org.apache.jsp.DBSConnect not found. DBSConnect connect = new DBSConnect(); Until now I thought: When Tomcat is restarted, it recognizes the content in WEB-INF/classes. But perhaps I have to make some entries in server.xml or web.xml referring to this classes? Thank you for any help Anja
Re: WEB-INF/classes
Hi Nancy, I am using Tomcat 4.0.1. What's to do here? Anja -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: WEB-INF/classes
Hi Anja, To set up a new context you really only have to add a line to server.xml but just to take on the basics I take it from the start. create a folder that has a web-app structure : context / - WEB-INF/ web.xml - configuration file for this webapp -/lib/ your jar files here -/classes/your classes (compiled) here then add a line like this one : Context path=/nameofcontext docBase=C:\path_to_context_root debug=0 reloadable=true/ in to the host scope of your server.xml (suggestion beneath the one context that is already specified). if you do this, restart tomcat and you have a new context available under http://www.yourserver.com/nameofcontext/ there for the path to execute your servlets (in the classes directory of your webapplication) you should have http://www.yourserver.com/nameofcontext/servlet/nameofServlet hope it helps -reynir -Original Message- From: Anja Falkner [mailto:[EMAIL PROTECTED]] Sent: 7. febrúar 2002 22:06 To: Tomcat Users List Subject: Re: WEB-INF/classes Hi Nancy, I am using Tomcat 4.0.1. What's to do here? Anja -- 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: WEB-INF/classes
Anja, I'm not sure, but I know that Tomcat 3.3 and later have a similar behavior. So the only thing you have to do is to create the apps-contextname.xml file and put it on tomcat-path/conf directory: The xml file is like this: ?xml version=1.0 encoding=ISO-8859-1? webapps Context path=/contextname docBase=webapps/contextname debug=0 reloadable=true /Context /webapps If you want to can check the apps-examples.xml file that gives you a hint of this...:-) Nancy. Anja Falkner wrote: Hi Nancy, I am using Tomcat 4.0.1. What's to do here? Anja -- 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: WEB-INF/classes
Seeing org.apache.jsp as the package for DBSConnect tells me you are using a Tomcat 4.x and you didn't import the package for DBSConnect. Use something like: %@ page import=package.for.dbsconnect ... % on your JSP page. Cheers, Larry -Original Message- From: Anja Falkner [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 07, 2002 4:37 PM To: Tomcat Users List Subject: WEB-INF/classes Hello, at setting up a new context for Tomcat, I must have forgotten something, because tomcat doesn't find my classes in WEB-INF/classes. The following fault appears: login_0005ftest$jsp.java:71: Class org.apache.jsp.DBSConnect not found. DBSConnect connect = new DBSConnect(); Until now I thought: When Tomcat is restarted, it recognizes the content in WEB-INF/classes. But perhaps I have to make some entries in server.xml or web.xml referring to this classes? Thank you for any help Anja -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: WEB-INF/classes
Hi Reynir, but exactly this I have done! The strange is: My JSP-Files are found at this location with http://www.yourserver.com/nameofcontext ! But when the JSP-files use classes from WEB-INF, I get an error. I am really desperate! Anja -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: WEB-INF/classes
check out Larry Isaacs reply, it sounds very possible to solve your problem. -reynir -Original Message- From: Anja Falkner [mailto:[EMAIL PROTECTED]] Sent: 7. febrúar 2002 22:32 To: Tomcat Users List Subject: Re: WEB-INF/classes Hi Reynir, but exactly this I have done! The strange is: My JSP-Files are found at this location with http://www.yourserver.com/nameofcontext ! But when the JSP-files use classes from WEB-INF, I get an error. I am really desperate! Anja -- 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: WEB-INF/classes
Hi Anja, -Original Message- From: Anja Falkner [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 07, 2002 11:37 PM To: Tomcat Users List Subject: WEB-INF/classes Hello, at setting up a new context for Tomcat, I must have forgotten something, because tomcat doesn't find my classes in WEB-INF/classes. The following fault appears: login_0005ftest$jsp.java:71: Class org.apache.jsp.DBSConnect not found. DBSConnect connect = new DBSConnect(); I'm not familiar with JSP, but it looks like all you need is to import your DBSConnect, I don't think it really in org.apache.jsp package. Right? Until now I thought: When Tomcat is restarted, it recognizes the content in WEB-INF/classes. But perhaps I have to make some entries in server.xml or web.xml referring to this classes? Thank you for any help Anja Anton -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: web-inf/classes not found ?
Ok, thanks, I will see if I can figure out how to do that The documentation says that Tomcat (4) always adds a classloader for each web application that looks in the web-inf/classes and web-inf/dir directory, I could not find any examples/web-inf/classes reference in my server.xml, I guess I should place this information in the context for my application but I have no idea where, but I will see if I can find anything about it in the documentation. Mikael - Original Message - From: Chaber, Eric [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 27, 2001 12:53 PM Subject: RE: web-inf/classes not found ? Mikeal, you have to specify in server.xml where your classes are. for the example directory it's /webapps/examples/web-inf/classes recreate same path in server.xml /webapps/mydir/web-inf/classes reboot tomcat put your class files there tomcat should find them rgds, Eric -Original Message- From: Mikael Aronsson [mailto:[EMAIL PROTECTED]] Sent: September 27 2001 13:55 To: [EMAIL PROTECTED] Subject: web-inf/classes not found ? Hi ! Tomcat complains that it can't find some of my classes .../web-inf/classes/xxx/yyy/myclassses for example, Everything works fine when I compile it (I specify the -classpath to let the compiler find the classes), but when I run the application in Tomcat, it does not find the classes. The docs says that it should look in the web-inf/classes directory ? Am I doing something wrong here maybe ? Mikael
RE: web-inf/classes not found ?
Edit your server.xml copy paste Context path=/examples docBase=webapps/examples crossContext=false debug=0 reloadable=true /Context change examples to mydir create a dir $TOMCAT_HOME/webapps/mydir under my dir creates directories WEB-INF/classes at the end you should have $TOMCAT_HOME/webapps/mydir/WEB-INF/classes reboot tomcat put yur classes there that's how I did for my setup. -Original Message- From: Mikael Aronsson [mailto:[EMAIL PROTECTED]] Sent: September 27 2001 14:24 To: [EMAIL PROTECTED] Subject: Re: web-inf/classes not found ? Ok, thanks, I will see if I can figure out how to do that The documentation says that Tomcat (4) always adds a classloader for each web application that looks in the web-inf/classes and web-inf/dir directory, I could not find any examples/web-inf/classes reference in my server.xml, I guess I should place this information in the context for my application but I have no idea where, but I will see if I can find anything about it in the documentation. Mikael - Original Message - From: Chaber, Eric [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 27, 2001 12:53 PM Subject: RE: web-inf/classes not found ? Mikeal, you have to specify in server.xml where your classes are. for the example directory it's /webapps/examples/web-inf/classes recreate same path in server.xml /webapps/mydir/web-inf/classes reboot tomcat put your class files there tomcat should find them rgds, Eric -Original Message- From: Mikael Aronsson [mailto:[EMAIL PROTECTED]] Sent: September 27 2001 13:55 To: [EMAIL PROTECTED] Subject: web-inf/classes not found ? Hi ! Tomcat complains that it can't find some of my classes .../web-inf/classes/xxx/yyy/myclassses for example, Everything works fine when I compile it (I specify the -classpath to let the compiler find the classes), but when I run the application in Tomcat, it does not find the classes. The docs says that it should look in the web-inf/classes directory ? Am I doing something wrong here maybe ? Mikael
Re: web-inf/classes not found ?
Ok, many thanks for the help. Mikael - Original Message - From: Chaber, Eric [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 27, 2001 1:32 PM Subject: RE: web-inf/classes not found ? Edit your server.xml copy paste Context path=/examples docBase=webapps/examples crossContext=false debug=0 reloadable=true /Context change examples to mydir create a dir $TOMCAT_HOME/webapps/mydir under my dir creates directories WEB-INF/classes at the end you should have $TOMCAT_HOME/webapps/mydir/WEB-INF/classes reboot tomcat put yur classes there that's how I did for my setup. -Original Message- From: Mikael Aronsson [mailto:[EMAIL PROTECTED]] Sent: September 27 2001 14:24 To: [EMAIL PROTECTED] Subject: Re: web-inf/classes not found ? Ok, thanks, I will see if I can figure out how to do that The documentation says that Tomcat (4) always adds a classloader for each web application that looks in the web-inf/classes and web-inf/dir directory, I could not find any examples/web-inf/classes reference in my server.xml, I guess I should place this information in the context for my application but I have no idea where, but I will see if I can find anything about it in the documentation. Mikael - Original Message - From: Chaber, Eric [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 27, 2001 12:53 PM Subject: RE: web-inf/classes not found ? Mikeal, you have to specify in server.xml where your classes are. for the example directory it's /webapps/examples/web-inf/classes recreate same path in server.xml /webapps/mydir/web-inf/classes reboot tomcat put your class files there tomcat should find them rgds, Eric -Original Message- From: Mikael Aronsson [mailto:[EMAIL PROTECTED]] Sent: September 27 2001 13:55 To: [EMAIL PROTECTED] Subject: web-inf/classes not found ? Hi ! Tomcat complains that it can't find some of my classes .../web-inf/classes/xxx/yyy/myclassses for example, Everything works fine when I compile it (I specify the -classpath to let the compiler find the classes), but when I run the application in Tomcat, it does not find the classes. The docs says that it should look in the web-inf/classes directory ? Am I doing something wrong here maybe ? Mikael
RE: WEB-INF\Classes
Are you really sure that the directory is WEB-INF? Tomcat is written in Java, which means that file names are case sensitive even though Windows isn't. I would suggest removing the WEB-INF directory and recreating it. (I believe its supposed to be all caps, but just reviewing my computer here its Web-inf - I don't know if that's Explorer's way of showing me what it thinks is right, or what it really is and really supposed to be). Randy -Original Message- From: John Burr [mailto:[EMAIL PROTECTED]] Sent: Friday, February 16, 2001 4:38 PM To: [EMAIL PROTECTED] Subject: WEB-INF\Classes I'm running Tomcat 3.2.1 under Windows 2000. I have a Server.xml entry of: Context path="/JspIn24Hours" docBase="c:\JspIn24Hours" debug="4" reloadable="true" /Context I can browse to http://localhost:8080/JspIn24Hours OK and some links off of that page work. But one those pages uses a bean and I get an "Unable to load class " error on it even though the class file is under c:\JspIn24Hours\WEB-INF\classes\x . I can get around this by putting the class file under $TOMCAT_HOME\classes\x or by keeping my docBase under $TOMCAT_HOME\webapps\ in the first place. Did I miss something? Thanks for any help. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]