Re: Need access to classes outside Tomcat for JSPs
Why do you want your classes outside of Tomcat? Copy the classes to your project when you build and eliminate the dependency. Or better yet, use a build environment like Ant to do the copying for you. As a bonus, it'll catch errors before you get to production and the webapp will be more portable. --David Dan wrote: Classpath problem. Really frustrating. I'm trying to duplicate a setup on system A to system B and can't get it working. My problem is when I access the JSP page, Tomcat complains of a ClassNotFound exception. This happens with all of my custom classes. If I create a simple JSP page with no custom classes the JSP compiles fine. When I manually execute the class via java com.xxx.MyClass it responds appropriately (my environment's CLASSPATH includes the custom library paths). My custom classes live outside of the Tomcat directory (see below) because I use these classes in other non-web based applications, so they need to be available system wide. I have melted my brain today trying to figure out why system A works with this configuration but system B gives me the ClassNotFound exception. I have even copied my entire Tomcat directory from system A to system B with no change. I thought perhaps I was starting the service with additional parameters but I don't see any in the registry settings. Does anyone have an educated guess as to why I can't get this thing to work the way it's working on the other system and/or how I can get this working with my custom classes OUTSIDE of Tomcat. Win2K SP4 Tomcat v5.0.27 as NT Service e:\java\tomcat e:\java\sdk (JDK 1.4.2) e:\java\library\custom\ (custom libraries) e:\java\library\basic (libraries from other sources) - 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: Need access to classes outside Tomcat for JSPs
Do people read anymore? As previously stated in the original post, these classes need to be available to other non-web, non TomCat applications. I do not want to have to maintain two different repositories. Also as previously stated I have the desired configuration running on another box but I cannot duplicate the setup on this box. If your only advice is to move them into TomCat, then please don't even bother replying. At 08:21 AM 3/1/2005, David wrote: Why do you want your classes outside of Tomcat? Copy the classes to your project when you build and eliminate the dependency. Or better yet, use a build environment like Ant to do the copying for you. As a bonus, it'll catch errors before you get to production and the webapp will be more portable. --David Dan wrote: Classpath problem. Really frustrating. I'm trying to duplicate a setup on system A to system B and can't get it working. My problem is when I access the JSP page, Tomcat complains of a ClassNotFound exception. This happens with all of my custom classes. If I create a simple JSP page with no custom classes the JSP compiles fine. When I manually execute the class via java com.xxx.MyClass it responds appropriately (my environment's CLASSPATH includes the custom library paths). My custom classes live outside of the Tomcat directory (see below) because I use these classes in other non-web based applications, so they need to be available system wide. I have melted my brain today trying to figure out why system A works with this configuration but system B gives me the ClassNotFound exception. I have even copied my entire Tomcat directory from system A to system B with no change. I thought perhaps I was starting the service with additional parameters but I don't see any in the registry settings. Does anyone have an educated guess as to why I can't get this thing to work the way it's working on the other system and/or how I can get this working with my custom classes OUTSIDE of Tomcat. Win2K SP4 Tomcat v5.0.27 as NT Service e:\java\tomcat e:\java\sdk (JDK 1.4.2) e:\java\library\custom\ (custom libraries) e:\java\library\basic (libraries from other sources) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Need access to classes outside Tomcat for JSPs
1. Yes people do read, and offer advice based on whether a) they can and b) how rude the poster is. You fall into (b) right now, so good luck. 2. Tomcat, not TomCat. 3. This is a voluntary user list and you should not expect to receive help as you seem to. -Original Message- From: Dan [mailto:[EMAIL PROTECTED] Sent: 01 March 2005 13:55 To: Tomcat Users List Subject: Re: Need access to classes outside Tomcat for JSPs Do people read anymore? As previously stated in the original post, these classes need to be available to other non-web, non TomCat applications. I do not want to have to maintain two different repositories. Also as previously stated I have the desired configuration running on another box but I cannot duplicate the setup on this box. If your only advice is to move them into TomCat, then please don't even bother replying. At 08:21 AM 3/1/2005, David wrote: Why do you want your classes outside of Tomcat? Copy the classes to your project when you build and eliminate the dependency. Or better yet, use a build environment like Ant to do the copying for you. As a bonus, it'll catch errors before you get to production and the webapp will be more portable. --David Dan wrote: Classpath problem. Really frustrating. I'm trying to duplicate a setup on system A to system B and can't get it working. My problem is when I access the JSP page, Tomcat complains of a ClassNotFound exception. This happens with all of my custom classes. If I create a simple JSP page with no custom classes the JSP compiles fine. When I manually execute the class via java com.xxx.MyClass it responds appropriately (my environment's CLASSPATH includes the custom library paths). My custom classes live outside of the Tomcat directory (see below) because I use these classes in other non-web based applications, so they need to be available system wide. I have melted my brain today trying to figure out why system A works with this configuration but system B gives me the ClassNotFound exception. I have even copied my entire Tomcat directory from system A to system B with no change. I thought perhaps I was starting the service with additional parameters but I don't see any in the registry settings. Does anyone have an educated guess as to why I can't get this thing to work the way it's working on the other system and/or how I can get this working with my custom classes OUTSIDE of Tomcat. Win2K SP4 Tomcat v5.0.27 as NT Service e:\java\tomcat e:\java\sdk (JDK 1.4.2) e:\java\library\custom\ (custom libraries) e:\java\library\basic (libraries from other sources) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE --- QAS Ltd. Developers of QuickAddress Software a href=http://www.qas.com;www.qas.com/a Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- /FONT - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Need access to classes outside Tomcat for JSPs
You can redirect the tomcat's work directory to your classes. That should work for you ! Viorel Dragomir . .. --- - Original Message - From: Allistair Crossley To: Tomcat Users List Sent: Tuesday, March 01, 2005 15:56 Subject: RE: Need access to classes outside Tomcat for JSPs 1. Yes people do read, and offer advice based on whether a) they can and b) how rude the poster is. You fall into (b) right now, so good luck. 2. Tomcat, not TomCat. 3. This is a voluntary user list and you should not expect to receive help as you seem to. -Original Message- From: Dan [mailto:[EMAIL PROTECTED] Sent: 01 March 2005 13:55 To: Tomcat Users List Subject: Re: Need access to classes outside Tomcat for JSPs Do people read anymore? As previously stated in the original post, these classes need to be available to other non-web, non TomCat applications. I do not want to have to maintain two different repositories. Also as previously stated I have the desired configuration running on another box but I cannot duplicate the setup on this box. If your only advice is to move them into TomCat, then please don't even bother replying. At 08:21 AM 3/1/2005, David wrote: Why do you want your classes outside of Tomcat? Copy the classes to your project when you build and eliminate the dependency. Or better yet, use a build environment like Ant to do the copying for you. As a bonus, it'll catch errors before you get to production and the webapp will be more portable. --David Dan wrote: Classpath problem. Really frustrating. I'm trying to duplicate a setup on system A to system B and can't get it working. My problem is when I access the JSP page, Tomcat complains of a ClassNotFound exception. This happens with all of my custom classes. If I create a simple JSP page with no custom classes the JSP compiles fine. When I manually execute the class via java com.xxx.MyClass it responds appropriately (my environment's CLASSPATH includes the custom library paths). My custom classes live outside of the Tomcat directory (see below) because I use these classes in other non-web based applications, so they need to be available system wide. I have melted my brain today trying to figure out why system A works with this configuration but system B gives me the ClassNotFound exception. I have even copied my entire Tomcat directory from system A to system B with no change. I thought perhaps I was starting the service with additional parameters but I don't see any in the registry settings. Does anyone have an educated guess as to why I can't get this thing to work the way it's working on the other system and/or how I can get this working with my custom classes OUTSIDE of Tomcat. Win2K SP4 Tomcat v5.0.27 as NT Service e:\java\tomcat e:\java\sdk (JDK 1.4.2) e:\java\library\custom\ (custom libraries) e:\java\library\basic (libraries from other sources) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE --- QAS Ltd. Developers of QuickAddress Software a href=http://www.qas.com;www.qas.com/a Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- /FONT - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Need access to classes outside Tomcat for JSPs
Everybody take it easy. We've all at least thought what Dan posted, at one time or another, especially when dealing with Tomcat documentation (official or otherwise) and the pro-this or pro-that solution folks. There's no need to escalate this into a flame war. I only wish I was far enough along to help, but I've only gotten Tomcat to recognize webapps (well, really just JSP files, but that's b/c of my inexperience and lack of time right now) outside of $CATALINA_HOME. I DO HOWEVER, suspect that a solution is to be had somewhere in your web.xml file (as opposed to server.xml, which is not as fine-tuned for your needs), but these are guesses. So, assuming you're under other pressures, as most of us are, and not just being rude for rudeness' sake, does anyone have a clue how to do this without throwing the baby out with the bath water as the first reply suggested? Think community, -Matt On Tue, 1 Mar 2005, Allistair Crossley wrote: 1. Yes people do read, and offer advice based on whether a) they can and b) how rude the poster is. You fall into (b) right now, so good luck. 2. Tomcat, not TomCat. 3. This is a voluntary user list and you should not expect to receive help as you seem to. -Original Message- From: Dan [mailto:[EMAIL PROTECTED] Sent: 01 March 2005 13:55 To: Tomcat Users List Subject: Re: Need access to classes outside Tomcat for JSPs Do people read anymore? As previously stated in the original post, these classes need to be available to other non-web, non TomCat applications. I do not want to have to maintain two different repositories. Also as previously stated I have the desired configuration running on another box but I cannot duplicate the setup on this box. If your only advice is to move them into TomCat, then please don't even bother replying. At 08:21 AM 3/1/2005, David wrote: Why do you want your classes outside of Tomcat? Copy the classes to your project when you build and eliminate the dependency. Or better yet, use a build environment like Ant to do the copying for you. As a bonus, it'll catch errors before you get to production and the webapp will be more portable. --David Dan wrote: Classpath problem. Really frustrating. I'm trying to duplicate a setup on system A to system B and can't get it working. My problem is when I access the JSP page, Tomcat complains of a ClassNotFound exception. This happens with all of my custom classes. If I create a simple JSP page with no custom classes the JSP compiles fine. When I manually execute the class via java com.xxx.MyClass it responds appropriately (my environment's CLASSPATH includes the custom library paths). My custom classes live outside of the Tomcat directory (see below) because I use these classes in other non-web based applications, so they need to be available system wide. I have melted my brain today trying to figure out why system A works with this configuration but system B gives me the ClassNotFound exception. I have even copied my entire Tomcat directory from system A to system B with no change. I thought perhaps I was starting the service with additional parameters but I don't see any in the registry settings. Does anyone have an educated guess as to why I can't get this thing to work the way it's working on the other system and/or how I can get this working with my custom classes OUTSIDE of Tomcat. Win2K SP4 Tomcat v5.0.27 as NT Service e:\java\tomcat e:\java\sdk (JDK 1.4.2) e:\java\library\custom\ (custom libraries) e:\java\library\basic (libraries from other sources) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE --- QAS Ltd. Developers of QuickAddress Software a href=http://www.qas.com;www.qas.com/a Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- /FONT - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Matthew Kozak Rutgers University-Camden [EMAIL PROTECTED] ** They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety. -Ben Franklin ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Need access to classes outside Tomcat for JSPs
I sent one through, but it has not come in yet (copied below) ... Right, a well formed web application is packaged with its dependent classes. Tomcat loads classes from either WEB-INF/classes folder or the lib folder in the form of a JAR for your webapp, or other places like common/lib and shared/lib. It does not use your system classpath. The previous poster was absolutely right with his advice. You need to sort out your build environment. You can still have 1 source respository, but when you build (via Ant let's say since it's the most ubiquitous) you direct compiled classes into your 2 locations. You could perhaps wrap them in a JAR for Tomcat's purposes, it's up to you. Having the same classes twice is no bad thing - having source twice is. -Original Message- From: Matt [mailto:[EMAIL PROTECTED] Sent: 01 March 2005 14:15 To: Tomcat Users List Subject: RE: Need access to classes outside Tomcat for JSPs Everybody take it easy. We've all at least thought what Dan posted, at one time or another, especially when dealing with Tomcat documentation (official or otherwise) and the pro-this or pro-that solution folks. There's no need to escalate this into a flame war. I only wish I was far enough along to help, but I've only gotten Tomcat to recognize webapps (well, really just JSP files, but that's b/c of my inexperience and lack of time right now) outside of $CATALINA_HOME. I DO HOWEVER, suspect that a solution is to be had somewhere in your web.xml file (as opposed to server.xml, which is not as fine-tuned for your needs), but these are guesses. So, assuming you're under other pressures, as most of us are, and not just being rude for rudeness' sake, does anyone have a clue how to do this without throwing the baby out with the bath water as the first reply suggested? Think community, -Matt On Tue, 1 Mar 2005, Allistair Crossley wrote: 1. Yes people do read, and offer advice based on whether a) they can and b) how rude the poster is. You fall into (b) right now, so good luck. 2. Tomcat, not TomCat. 3. This is a voluntary user list and you should not expect to receive help as you seem to. -Original Message- From: Dan [mailto:[EMAIL PROTECTED] Sent: 01 March 2005 13:55 To: Tomcat Users List Subject: Re: Need access to classes outside Tomcat for JSPs Do people read anymore? As previously stated in the original post, these classes need to be available to other non-web, non TomCat applications. I do not want to have to maintain two different repositories. Also as previously stated I have the desired configuration running on another box but I cannot duplicate the setup on this box. If your only advice is to move them into TomCat, then please don't even bother replying. At 08:21 AM 3/1/2005, David wrote: Why do you want your classes outside of Tomcat? Copy the classes to your project when you build and eliminate the dependency. Or better yet, use a build environment like Ant to do the copying for you. As a bonus, it'll catch errors before you get to production and the webapp will be more portable. --David Dan wrote: Classpath problem. Really frustrating. I'm trying to duplicate a setup on system A to system B and can't get it working. My problem is when I access the JSP page, Tomcat complains of a ClassNotFound exception. This happens with all of my custom classes. If I create a simple JSP page with no custom classes the JSP compiles fine. When I manually execute the class via java com.xxx.MyClass it responds appropriately (my environment's CLASSPATH includes the custom library paths). My custom classes live outside of the Tomcat directory (see below) because I use these classes in other non-web based applications, so they need to be available system wide. I have melted my brain today trying to figure out why system A works with this configuration but system B gives me the ClassNotFound exception. I have even copied my entire Tomcat directory from system A to system B with no change. I thought perhaps I was starting the service with additional parameters but I don't see any in the registry settings. Does anyone have an educated guess as to why I can't get this thing to work the way it's working on the other system and/or how I can get this working with my custom classes OUTSIDE of Tomcat. Win2K SP4 Tomcat v5.0.27 as NT Service e:\java\tomcat e:\java\sdk (JDK 1.4.2) e:\java\library\custom\ (custom libraries) e:\java\library\basic (libraries from other sources) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e
RE: Need access to classes outside Tomcat for JSPs
Right, a well formed web application is packaged with its dependent classes. Tomcat loads classes from either WEB-INF/classes folder or the lib folder in the form of a JAR for your webapp, or other places like common/lib and shared/lib. It does not use your system classpath. The previous poster was absolutely right with his advice. You need to sort out your build environment. You can still have 1 source respository, but when you build (via Ant let's say since it's the most ubiquitous) you direct compiled classes into your 2 locations. You could perhaps wrap them in a JAR for Tomcat's purposes, it's up to you. Having the same classes twice is no bad thing - having source twice is. Allistair. -Original Message- From: Dan [mailto:[EMAIL PROTECTED] Sent: 01 March 2005 13:55 To: Tomcat Users List Subject: Re: Need access to classes outside Tomcat for JSPs Do people read anymore? As previously stated in the original post, these classes need to be available to other non-web, non TomCat applications. I do not want to have to maintain two different repositories. Also as previously stated I have the desired configuration running on another box but I cannot duplicate the setup on this box. If your only advice is to move them into TomCat, then please don't even bother replying. At 08:21 AM 3/1/2005, David wrote: Why do you want your classes outside of Tomcat? Copy the classes to your project when you build and eliminate the dependency. Or better yet, use a build environment like Ant to do the copying for you. As a bonus, it'll catch errors before you get to production and the webapp will be more portable. --David Dan wrote: Classpath problem. Really frustrating. I'm trying to duplicate a setup on system A to system B and can't get it working. My problem is when I access the JSP page, Tomcat complains of a ClassNotFound exception. This happens with all of my custom classes. If I create a simple JSP page with no custom classes the JSP compiles fine. When I manually execute the class via java com.xxx.MyClass it responds appropriately (my environment's CLASSPATH includes the custom library paths). My custom classes live outside of the Tomcat directory (see below) because I use these classes in other non-web based applications, so they need to be available system wide. I have melted my brain today trying to figure out why system A works with this configuration but system B gives me the ClassNotFound exception. I have even copied my entire Tomcat directory from system A to system B with no change. I thought perhaps I was starting the service with additional parameters but I don't see any in the registry settings. Does anyone have an educated guess as to why I can't get this thing to work the way it's working on the other system and/or how I can get this working with my custom classes OUTSIDE of Tomcat. Win2K SP4 Tomcat v5.0.27 as NT Service e:\java\tomcat e:\java\sdk (JDK 1.4.2) e:\java\library\custom\ (custom libraries) e:\java\library\basic (libraries from other sources) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE --- QAS Ltd. Developers of QuickAddress Software a href=http://www.qas.com;www.qas.com/a Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- /FONT - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Need access to classes outside Tomcat for JSPs
Well, not to be rude, but your design choice is IMHO, poor. Build tools are available and designed to handle version control -- which is what I read as the reason for your reluctance to include the classes directly in the webapp. Every few months, I see someone come on the list asking what you are asking and the advice is always the same: Don't do it that way. Good luck in your efforts. Just don't expect a lot of help on this. --David Dan wrote: Do people read anymore? As previously stated in the original post, these classes need to be available to other non-web, non TomCat applications. I do not want to have to maintain two different repositories. Also as previously stated I have the desired configuration running on another box but I cannot duplicate the setup on this box. If your only advice is to move them into TomCat, then please don't even bother replying. At 08:21 AM 3/1/2005, David wrote: Why do you want your classes outside of Tomcat? Copy the classes to your project when you build and eliminate the dependency. Or better yet, use a build environment like Ant to do the copying for you. As a bonus, it'll catch errors before you get to production and the webapp will be more portable. --David Dan wrote: Classpath problem. Really frustrating. I'm trying to duplicate a setup on system A to system B and can't get it working. My problem is when I access the JSP page, Tomcat complains of a ClassNotFound exception. This happens with all of my custom classes. If I create a simple JSP page with no custom classes the JSP compiles fine. When I manually execute the class via java com.xxx.MyClass it responds appropriately (my environment's CLASSPATH includes the custom library paths). My custom classes live outside of the Tomcat directory (see below) because I use these classes in other non-web based applications, so they need to be available system wide. I have melted my brain today trying to figure out why system A works with this configuration but system B gives me the ClassNotFound exception. I have even copied my entire Tomcat directory from system A to system B with no change. I thought perhaps I was starting the service with additional parameters but I don't see any in the registry settings. Does anyone have an educated guess as to why I can't get this thing to work the way it's working on the other system and/or how I can get this working with my custom classes OUTSIDE of Tomcat. Win2K SP4 Tomcat v5.0.27 as NT Service e:\java\tomcat e:\java\sdk (JDK 1.4.2) e:\java\library\custom\ (custom libraries) e:\java\library\basic (libraries from other sources) - 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: Need access to classes outside Tomcat for JSPs
My apologies for being over the edge, but after pulling my hair out for the last few days and reading all kinds of web and USENET postings, along with searching the list archives, I came across all kinds of writings that did not address the issue of if (and how) this could be done, most just say to put them in the WEB-INF or the shared directories of TomCat. I know it can be done because that's the way I have my other box setup now. My shared classes are in E:\java\library. My WEB-INF\classes directory is empty, and TomCat compiles the JSPs fine. But for the life of me I cannot duplicate this setup on the new box. That's what really makes this frustrating. I've done a system search for files containing library\custom and nothing relevant shows up. Searching the registry turns up nothing as well. The only tidbit that I've come across is that parameter java.class.path is ignored when running as a service, instead Imagepath can specify a classpath. But I don't remember doing this on my other machine, and my registry entries for the service don't show any additional startup parameters. I wonder if procrun stores these values someplace else, but if so it's not stored anyplace within the Tomcat directory since I've copied the entire Tomcat directory from the working box to this box. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Need access to classes outside Tomcat for JSPs
Just as soon as I hit send Registry entry. HKLM | Software | Apache Software Foundation | Procrun 2.0 | Tomcat5 | Parameters | Java Classpath = .;e:\java\library\basic;e:\java\library\custom;E:\java\Tomcat\bin\bootstrap.jar - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Need access to classes outside Tomcat for JSPs
If you happen to change the bootstrap classpath - please do not email the list with ClassNotFound issues. ;) If you really need to access jar's or classes outside of your webapp you can either: 1) Write your own WebAppClassloader - icky but doable 2) Change $CATALINA_HOME/conf/catalina.properties and change either the common or shared loader. This is more managable but all webapps will share these classes. Adding your own classes to the system classpath will cause major headaches. Adding common libraries to the common or shared classloader typically is the least of all evils when you can't place classes inside WEB-INF. -Tim Dan wrote: Just as soon as I hit send Registry entry. HKLM | Software | Apache Software Foundation | Procrun 2.0 | Tomcat5 | Parameters | Java Classpath = .;e:\java\library\basic;e:\java\library\custom;E:\java\Tomcat\bin\bootstrap.jar - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Need access to classes outside Tomcat for JSPs
Just a curious question to this, I know Dan has his setup already but is there any reason that this could not be set up the other way around? I mean that the classes/jars are in the normal spot in Tomcat and the outside app accesses them there. The outside app shouldn't care where the files reside as long as the path to them is known and this way Tomcat is a untouched normal install. Or am I missing something here? I am just trying to learn. Thanks Doug - Original Message - From: Tim Funk [EMAIL PROTECTED] To: Tomcat Users List tomcat-user@jakarta.apache.org Sent: Tuesday, March 01, 2005 10:37 AM Subject: Re: Need access to classes outside Tomcat for JSPs If you happen to change the bootstrap classpath - please do not email the list with ClassNotFound issues. ;) If you really need to access jar's or classes outside of your webapp you can either: 1) Write your own WebAppClassloader - icky but doable 2) Change $CATALINA_HOME/conf/catalina.properties and change either the common or shared loader. This is more managable but all webapps will share these classes. Adding your own classes to the system classpath will cause major headaches. Adding common libraries to the common or shared classloader typically is the least of all evils when you can't place classes inside WEB-INF. -Tim Dan wrote: Just as soon as I hit send Registry entry. HKLM | Software | Apache Software Foundation | Procrun 2.0 | Tomcat5 | Parameters | Java Classpath = .;e:\java\library\basic;e:\java\library\custom;E:\java\Tomcat\bin\bootstrap.jar - 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: Need access to classes outside Tomcat for JSPs
You could do it that way but I don't feel that placing common resources in a specific application directory is the proper approach. For example, if I had shared dlls that are used for Microsoft Office, I wouldn't place them into the Word application's directory. At 10:50 AM 3/1/2005, Doug wrote: Just a curious question to this, I know Dan has his setup already but is there any reason that this could not be set up the other way around? I mean that the classes/jars are in the normal spot in Tomcat and the outside app accesses them there. The outside app shouldn't care where the files reside as long as the path to them is known and this way Tomcat is a untouched normal install. Or am I missing something here? I am just trying to learn. Dan wrote: Just as soon as I hit send Registry entry. HKLM | Software | Apache Software Foundation | Procrun 2.0 | Tomcat5 | Parameters | Java Classpath = .;e:\java\library\basic;e:\java\library\custom;E:\java\Tomcat\bin\bootstrap.jar - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Need access to classes outside Tomcat for JSPs
Classpath problem. Really frustrating. I'm trying to duplicate a setup on system A to system B and can't get it working. My problem is when I access the JSP page, Tomcat complains of a ClassNotFound exception. This happens with all of my custom classes. If I create a simple JSP page with no custom classes the JSP compiles fine. When I manually execute the class via java com.xxx.MyClass it responds appropriately (my environment's CLASSPATH includes the custom library paths). My custom classes live outside of the Tomcat directory (see below) because I use these classes in other non-web based applications, so they need to be available system wide. I have melted my brain today trying to figure out why system A works with this configuration but system B gives me the ClassNotFound exception. I have even copied my entire Tomcat directory from system A to system B with no change. I thought perhaps I was starting the service with additional parameters but I don't see any in the registry settings. Does anyone have an educated guess as to why I can't get this thing to work the way it's working on the other system and/or how I can get this working with my custom classes OUTSIDE of Tomcat. Win2K SP4 Tomcat v5.0.27 as NT Service e:\java\tomcat e:\java\sdk (JDK 1.4.2) e:\java\library\custom\ (custom libraries) e:\java\library\basic (libraries from other sources) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]