Does Jasper use the Context Classpath
Greetings! I know there are two (or three) different classpaths within Tomcat 3.2. The question is, does Jasper, when compiling JSP files, use the Context Classpath, which referrs to the WEB-INF/classes directory for that specific JSP? If not, how could I add the Context Classpath to the Jasper code? Can someone point me to a breakdown of the classloading within Jasper specifically? I've seen the classloading for Servlets, and that is all kosher. Thank you in advance for any tips, pointers, or direction. Will -- /~'find `funny quote`': Command not found; humor not installed. 1986 Concours 72,xxx CDA #00046 COG AMA Overland Park, KS [EMAIL PROTECTED] PCS: 316-371-FOAD http://will.mylanders.com/
RE: JSP Compile Test Case
yeah, I thought of that after I sent the message and moved the jsp directory above the WEB-INF directory and changed the Context mount point. Didn't help. Same error. Will -- /~'find `funny quote`': Command not found; humor not installed. 1986 Concours 72,xxx 1982 Maxim 12,xxx (For Sale!) CDA #00046 Overland Park, KS [EMAIL PROTECTED] PCS: 316-371-FOAD http://will.mylanders.com/ On Mon, 23 Jul 2001, Filip Hanik wrote: Tomcat works fine, it is your WAR that is screwed up. under WEB-INF there are two directories /lib and /classes you have added in a JSP directory, and then you set your context root to point to WEB-INF/xxx. when you do this, Tomcat expects another (a second one) WEB-INF to be available under WEB-INF/jsp look at the servlet specification and on the other tomcat examples on how a WAR file should look. the hint I can give you now is that WEB-INF is your context classpath, all other files should be stored outside, and the context root should point to the root of the WAR file. Filip ~ Namaste - I bow to the divine in you ~ Filip Hanik Software Architect [EMAIL PROTECTED] www.filip.net -Original Message- From: Will England [mailto:[EMAIL PROTECTED]] Sent: Monday, July 23, 2001 1:15 PM To: [EMAIL PROTECTED] Cc: will a england Subject: JSP Compile Test Case Hi! Got around to writing a test case. Data: SunOS 2.7 JDK 1.2 Tomcat 3.2.2 Setup: I have a single JSP page that retrieves a String from a java class, then prints the string. Code Layout: The one class: /webhome/jsptest/html/WEB-INF/classes/com/layoutwizard/testcase/tes tClass.class The one JSP /webhome/jsptest/html/WEB-INF/jsp/index.jsp The install directory: /usr/local/tomcat-3.2/jakarta-tomcat/ I'm using the distribution server.xml, with one addtion: --- server.xml excerpt --- Context path=/jsptest docBase=/webhome/jsptest/html/WEB-INF/jsp debug=0 reloadable=true /Context --- end server.xml excerpt --- There is no web.xml, because there are no servlets in this case. Tomcat is using the following as a classpath: /usr/local/tomcat-3.2/jakarta-tomcat/lib/ant.jar /usr/local/tomcat-3.2/jakarta-tomcat/lib/jasper.jar /usr/local/tomcat-3.2/jakarta-tomcat/lib/jaxp.jar /usr/local/tomcat-3.2/jakarta-tomcat/lib/parser.jar /usr/local/tomcat-3.2/jakarta-tomcat/lib/servlet.jar /usr/local/tomcat-3.2/jakarta-tomcat/lib/test /usr/local/tomcat-3.2/jakarta-tomcat/lib/tools.jar /usr/local/tomcat-3.2/jakarta-tomcat/lib/webserver.jar /usr/java1.2/bin/../lib/tools.jar The JSP is coded as follows: --- begin jsp code --- html head titleThe Name We Got Is/title /head body h1Pulling a name from a java class /h1 %@ page import=com.layoutwizard.testcase.* % %@ page import=java.lang.* % jsp:useBean id=bob class=com.layoutwizard.testcase.testClass/ %String name = bob.getName();% P%=name% /p /body /html --- end jsp code --- All things considerd, I get the following error on trying to load the JSP: org.apache.jasper.JasperException: Unable to compile class for JSP/usr/local/tomcat-3.2/jakarta-tomcat/work/localhost_8080%2Fjspte st/_0002findex_0002ejspindex_jsp_0.java:13: Package com.layoutwizard.testcase not found in import. import com.layoutwizard.testcase.*; Other JSP's that do not rely on code in the com.layoutwizard.* (or other external hirearchies) work just fine. SO, What Am I Doing Wrong? Thanks in advance, again! Will -- /~'find `funny quote`': Command not found; humor not installed. 1986 Concours 72,xxx 1982 Maxim 12,xxx (For Sale!) CDA #00046 Overland Park, KS [EMAIL PROTECTED] PCS: 316-371-FOAD http://will.mylanders.com/
Re: Antwort: Re: Multiple virtual host with individual webapp dirs, one tomcat
On Thu, 19 Jul 2001 [EMAIL PROTECTED] wrote: Hi Will, the problem is, that when I put directories or .war files in webapps, the context is added to all virtual hosts. But I need individual contexts for each virtual host. For virtual hosts, you are either running Tomcat 3.2 and using the Host parameter in the server.xml file, or running multiple copies of Tomcat 3.1. If you are using the Host paramter, you'll have to add the contexts manually, or you can look at the admin servlets distributed with Tomcat. While I couldn't get them to work, apparantly there is a context manager that allows you to view, add and delete contexts from within a host section of the server.sml file. Good luck! Will
RE: JSP compile error - class not found
Greetings! Tried copying tools.jar to the TOMCAT_HOME/lib directory. Didn't help. Set TOMCAT_HOME and JAVA_HOME vars. Didn't help. Any other ideas? -- /~'find `funny quote`': Command not found; humor not installed. 1986 Concours 72,xxx 1982 Maxim 12,xxx (For Sale!) CDA #00046 Overland Park, KS [EMAIL PROTECTED] PCS: 316-371-FOAD http://will.mylanders.com/ On Tue, 17 Jul 2001, Robert Finneran wrote: First thing, try copying tools.jar to your TOMCAT_HOME/lib directory. (Also make sure your TOMCAT_HOME and JAVA_HOME enviroment vars are set) Second, the may be issues involving the use of multiple class loaders (??) Hope this helps! -Original Message- From: Will England [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 17, 2001 4:11 PM To: [EMAIL PROTECTED] Subject: JSP compile error - class not found Greetings! Running tomcat 3.2 on Sun 2.7 Porting a working application from 3.1. All jsp's and servlets work under 3.1. Running multiple virtual machines under one Tomcat with the host parameter in server.xml. The JSPs are failing to compile -- org.apache.jasper.JasperException: Unable to compile class for JSP Class xxx not found. The classes that are giving me problems are in the WEB-INF/classes directory. They have correct permissions. The classpath that tomcat is using is: bin/../lib/ant.jar: bin/../lib/db-2.7.7: bin/../lib/db-2.7.7.jar: bin/../lib/jasper.jar: bin/../lib/jaxp.jar: bin/../lib/log4j.jar: bin/../lib/mail.jar: bin/../lib/mm.mysql-2.0.1-bin.jar: bin/../lib/parser.jar: bin/../lib/servlet.jar: bin/../lib/test: bin/../lib/webserver.jar: /usr/java1.2/bin/../lib/tools.jar The servlets work correctly. The only odd bit in server.xml is the use of this: RequestInterceptor className=org.apache.tomcat.request.Jdk12Interceptor/ so that I can read text files from each WEB-INF directory for each web application. I've checked the FAQ's, google, groups.google, Sun and Apache's web pages. I haven't been able to find any reason for this to happen. I've cleared the work/ directory out, cleared out all compliled classes and recompiled the entire thing from source. I'm rather stumped. Anyone have any suggestions or ideas why my JSP's won't compile? Thanks in advance for any tips, tricks or advice! Will
Re: Multiple virtual host with individual webapp dirs , one tomcat
On Wed, 18 Jul 2001 [EMAIL PROTECTED] wrote: Is it possible to give every single vhost his own webapp-dir where developpers can put new contexts, which are automatically added after restarting tomcat so no editing of server.xml is required. If you want to *change* the code in a context, you can do this just by adding the new class files under the WEB-INF directory. If you want to add a *new* context that didn't already exist, you have to edit the server.xml file. One other option is to have the developers jar up the whole application and deploy it to TOMCAT_HOME/webapps as a .war file. Then, no changes are needed to server.xml; tomcat just reads and expands the .war file and runs with it. Never did this, not sure how well it works. Will
JSP's not finding classes in WEB-INF
Greetings! Ok - running Tomcat 3.2 on SunOS 2.7, with Java 1.2. I have a working application with servlets and JSP pages running under Tomcat 3.1. I'm trying to port it to 3.2. However, every time I hit a JSP page, it gives a 500 error about how it cannot find classes to compile. Those classes are located in the WEB-INF directory, under the /classes folder. The classpath does *not* contain the WEB-INF/classes directory. If I hard-code the WEB-INF/classes directory into the classpath, they work. However, I do not want to do this. What is the problem, and how can I resolve it? I have tried settiing the environment variables TOMCAT_HOME and JAVA_HOME, and moving tools.jar into TOMCAT_HOME/lib. Thanks for any tips or pointers! Will -- /~'find `funny quote`': Command not found; humor not installed. 1986 Concours 72,xxx 1982 Maxim 12,xxx (For Sale!) CDA #00046 Overland Park, KS [EMAIL PROTECTED] PCS: 316-371-FOAD http://will.mylanders.com/
Re: JSP's not finding classes in WEB-INF
On Wed, 18 Jul 2001, Aditya Anand wrote: However, every time I hit a JSP page, it gives a 500 error about how it cannot find classes to compile. Those classes are located in the WEB-INF directory, under the /classes folder. I assume these are your bean classes. These should be put under the WEB-INF/lib directory rather than the classes directory. The classes directory is ment only for un-jarred servlet classes that have been declared in the web.xml file. Actually, just to make things interesting, those *are* servlet classes. We have both servlets and JSP's that use library classes for various things. Currently, they live in WEB-INF/classes. One of these years we'll get things sorted out a bit better. Put any servlet jars, beans, and required non-statndard libraries under the lib folder (like log4J, or xalan) Ok, so I created a jar file with the servlet classes and library classes in it and moved it to WEB-INF/lib. Didn't work. I cannot put this .jar file in TOMCAT_HOME/lib -- each context / virtual host will have slightly different bits in the servlets. Will
RE: JSP's not finding classes in WEB-INF
On Wed, 18 Jul 2001, Sampige, Srinivas wrote: If you have just .class files then your JSP should work after placing those classes under WEB-INF/classes .But if you classes are in a .jar file then place them under WEB-INF/lib . Hope this helps -srinivas I have .class files under WEB-INF/classes and also tried making a .jar file of the .class files and moving that to WEB-INF/lib. Neither worked. Thanks for the tip, tho... Will
Filtering this lise (was Re: Tomcat: subject)
I just filter on To: or CC: of [EMAIL PROTECTED] Works like a charm. Will
RE: JSP's not finding classes in WEB-INF
On Wed, 18 Jul 2001, Jann VanOver wrote: Okay -- I can't quote the source, but I read recently that this is a Tomcat bug. Sure seems that way. The Coocon list has about 300 posts to it about dynamic compilation failing. If you put .class files into tomcat's WEB-INF\classes directory they go into an unnamed package and then can't be found when they're needed. Currently, the classes are in a structure like this: WEB-INF/classes/com/layoutwizard/server/query/ WEB-INF/classes/com/layoutwizard/server/ WEB-INF/classes/com/layoutwizard/util/ and so on. So, that's not going to help - it's already all layed out via packages. Thanks for the idea, tho! Will
RE: JSP's not finding classes in WEB-INF
Ok - there is the Jasper log, which indicates it's not finding *any* classpath. --- begin jasper log --- 2001-07-18 01:21:24 - Scratch dir for the JSP engine is: /usr/local/tomcat-3.2/jakarta-tomcat/work/localhost_8080%2Fexamples 2001-07-18 01:21:24 - IMPORTANT: Do not modify the generated servlets 2001-07-18 01:21:29 - JspEngine -- /init.jsp 2001-07-18 01:21:29 -ServletPath: /init.jsp 2001-07-18 01:21:29 - PathInfo: null 2001-07-18 01:21:29 - RealPath: /webhome/java1/html/jsp/init.jsp 2001-07-18 01:21:29 - RequestURI: /jsp/init.jsp 2001-07-18 01:21:29 - QueryString: Session=normalTemplate=boxesSessionMode=testEvent=InitFlushSession=true 2001-07-18 01:21:29 - Request Params: 2001-07-18 01:21:29 -Session = normal 2001-07-18 01:21:29 -FlushSession = true 2001-07-18 01:21:29 -Event = Init 2001-07-18 01:21:29 -SessionMode = test 2001-07-18 01:21:29 -Template = boxes 2001-07-18 01:21:29 - Classpath according to the init parameter is: --- end jasper log --- Does Jasper even know about the WEB-INF/classes for dynamic compilation of JSP pages? Will -- /~'find `funny quote`': Command not found; humor not installed. 1986 Concours 72,xxx 1982 Maxim 12,xxx (For Sale!) CDA #00046 Overland Park, KS [EMAIL PROTECTED] PCS: 316-371-FOAD http://will.mylanders.com/
RE: JSP's not finding classes in WEB-INF
Hmmm. According to Dr. Mel Martinez on the tomcat-dev list, Jasper *cannot* see the web-inf/classes part of your web app for compliation. SO, I guess the solution is to pre-compile the JSP's (somehow) and leave the compiled .class files in the TOMCAT_HOME/work directory. Then, we're *screwed* if a customer wants to modify one of the JSP files on their server. Grrr. Ideas? http://w6.metronet.com/~wjm/tomcat/2001/Mar/msg00696.html -- /~'find `funny quote`': Command not found; humor not installed. 1986 Concours 72,xxx 1982 Maxim 12,xxx (For Sale!) CDA #00046 Overland Park, KS [EMAIL PROTECTED] PCS: 316-371-FOAD http://will.mylanders.com/
JSP compile error - class not found
Greetings! Running tomcat 3.2 on Sun 2.7 Porting a working application from 3.1. All jsp's and servlets work under 3.1. Running multiple virtual machines under one Tomcat with the host parameter in server.xml. The JSPs are failing to compile -- org.apache.jasper.JasperException: Unable to compile class for JSP Class xxx not found. The classes that are giving me problems are in the WEB-INF/classes directory. They have correct permissions. The classpath that tomcat is using is: bin/../lib/ant.jar: bin/../lib/db-2.7.7: bin/../lib/db-2.7.7.jar: bin/../lib/jasper.jar: bin/../lib/jaxp.jar: bin/../lib/log4j.jar: bin/../lib/mail.jar: bin/../lib/mm.mysql-2.0.1-bin.jar: bin/../lib/parser.jar: bin/../lib/servlet.jar: bin/../lib/test: bin/../lib/webserver.jar: /usr/java1.2/bin/../lib/tools.jar The servlets work correctly. The only odd bit in server.xml is the use of this: RequestInterceptor className=org.apache.tomcat.request.Jdk12Interceptor/ so that I can read text files from each WEB-INF directory for each web application. I've checked the FAQ's, google, groups.google, Sun and Apache's web pages. I haven't been able to find any reason for this to happen. I've cleared the work/ directory out, cleared out all compliled classes and recompiled the entire thing from source. I'm rather stumped. Anyone have any suggestions or ideas why my JSP's won't compile? Thanks in advance for any tips, tricks or advice! Will -- /~'find `funny quote`': Command not found; humor not installed. 1986 Concours 72,xxx 1982 Maxim 12,xxx (For Sale!) CDA #00046 Overland Park, KS [EMAIL PROTECTED] PCS: 316-371-FOAD http://will.mylanders.com/
Running multiple virtual hosts with one JVM
Hello! The idea I've got is to run 2 or 4 or 8 virtual hosts, all doing the same thing, under one JVM. I got this working several months ago, but it has slipped my mind as to how to do this. I recall having each virtual host having its own unique web.xml file, it's own unique WEB-INF directory, and the WEB-INF containing a complete set of the classes for the application. Each virtual host was configured in the apache conf file, pointing to different ports. Each port was listend to in one server.xml file. Each different port pointed to a unique WEB-INF directory, as mentioned above. Does this sound correct? Are there better ways to have multiple virtual hosts running under one JVM? Thanks in advance for any tips, howtos, etc. Will -- /~'find `funny quote`': Command not found; humor not installed. 1986 Concours 72,xxx 1982 Maxim 12,xxx (For Sale!) CDA #00046 Overland Park, KS [EMAIL PROTECTED] PCS: 316-371-FOAD http://will.mylanders.com/
Re: Should we do moderation on this mailinglist??
Good points. 1) Google now has Usenet reading and posting. Anyone with port 80 and a GUI browser can read / post to Usenet. 2) So, Gary, are you going to read the FAQ about creating a newsgroup and hold the vote? All you have to do is post a RFD, wait, post a CFV, wait, count the votes and then (assuming it's approved), get one of the newsadmins to start the group. It's all there in news.anwers Will -- If Al Gore invented the Internet, then I invented spellcheck! Dan Quayle, quoted at the National Press Club, 8/3/1999 [EMAIL PROTECTED] Recovery : http://will.mylanders.com/ PCS: 316-371-FOAD On Thu, 7 Jun 2001, Gary Dale wrote: Your points are well taken. However, in defence of newsgroups, this is a high-volume list that I think would be better handled as a newsgroup. 1) I think a lot of people aren't able to stay in the list continually due to the volume. There's a lot of subscribe, unsubscribe going on for people who need occaisional help. 2) the process of subscribing to a listserve can be a little off-putting and then there's the delay in getting getting on. 3) How many firewalls block all news groups? I wouldn't want to exclude anyone, but surely anyone in a position to be running a java server has access to newsgroups somehow. 4) Threaded discussions are better handled in newsgroups than listserves. 5) You can see the (recent) history before asking the same question that someone else asked a couple of days ago. 6) Yes, you can keep the mailing list going but hopefully a news group would open things up to whole new range of people while reducing the mail volume to something manageable. Milt Epstein wrote: On Wed, 6 Jun 2001, Gary Dale wrote: I'd prefer to see a news group rather than this mailing list. Something like comp.infosystems.www.servers.apache.jakarta or just comp.infosystems.www.servers.jakarta would be appropriate. For that matter, there should be comp.infosystems.www.servers.apache group too. The ms-windows and unix subgroups of www.servers aren't very appropriate since many of the issues relating to Apache are common to multiple OSs. [ ... ] Seems to me, having a newsgroup is fine, but I don't see why it needs to be an either/or thing. There is a procedure for creating newsgroups, and if anyone wants to get the process started for a tomcat/jakarta/apache newsgroup (or newsgroups), they're certainly welcome to. But regardless of whether that happens (and/or succeeds, which is certainly not a sure thing), there's no reason the mailing list can't go on. Regarding moderating the mailing list, I don't think that is feasible. For one thing, as some have suggested, it would take a lot of work, so it would be hard to find people to do it. Plus philosophically, I'm not sure we really want to go that route. And of course, there is a list owner (that exists as an entity, if not a person or persons, even if they don't show themselves around here much :-), and they'd get final say it what happens with this list. That may be the biggest point, because there has been no input from any owner on this list for a while on any of these issues (although they are on record as saying a newsgroup is a bad idea, mostly because many people don't have access to newsgroups because of firewalls, proxies, and such). Also, no disrespect intended, but I'm not sure it's such a good idea to try to come up with sweeping ideas to improve a mailing list after having only been subscribed a few weeks. That's not very long to get to know the ins and outs of a mailing list, how things ebb and flow, what's been suggested/tried or not, etc. Anyway, of the recent ideas suggested, I think the one that has the best combination of merit/feasibility is dividing up the list into sub-lists. This would have to be done carefully, of course, to actually improve the situation. I'd be willing to give this a go (although it might be the kind of thing where it would be good to have more than one person involved). The first step though, would be to try to get in contact with the list owner and see if they would go for it. I'll try doing that. Milt Epstein Research Programmer Software/Systems Development Group Computing and Communications Services Office (CCSO) University of Illinois at Urbana-Champaign (UIUC) [EMAIL PROTECTED]
Re: Logging
Make sure you have: Logger name=tc_log path=logs/tomcat.log customOutput=yes / Logger name=servlet_log path=logs/servlet.log customOutput=yes / Logger name=JASPER_LOG path=logs/jasper.log^ verbosityLevel = INFORMATION /^ in your server.xml. I know the output goes to either servlet_log or tc_log, and make a call to this.getServletContext().log(msg, e); This worked for me. Will -- If Al Gore invented the Internet, then I invented spellcheck! Dan Quayle, quoted at the National Press Club, 8/3/1999 [EMAIL PROTECTED] Recovery : http://will.mylanders.com/ PCS: 316-371-FOAD On Wed, 6 Jun 2001, Jeff Gaer wrote: I am running tomcat 3.2.1 standalone on windows 2k professional using the sun jdk 1.3.1. I use the Servlet.log(string) method to output diagnostics but do not see it appear in the logs logs/jasper.log contains 2001-06-06 11:28:32 - Scratch dir for the JSP engine is: C:\jakarta-tomcat-3.2.1\work\localhost_8080%2Fbobo 2001-06-06 11:28:32 - IMPORTANT: Do not modify the generated servlets and servlet.log contains 2001-06-06 11:28:32 - path=/bobo :jsp: init 2001-06-06 11:28:32 - path=/admin :jsp: init 2001-06-06 11:28:32 - path=/ClrCmrc :jsp: init 2001-06-06 11:28:32 - path=/ClrCmrcPmtPrc :jsp: init 2001-06-06 11:28:32 - path= :jsp: init 2001-06-06 11:28:36 - path=/ClrCmrcPmtPrc :xsl: init 2001-06-06 11:28:38 - path=/ClrCmrcPmtPrc :xsl2: init The servlet executes successfully but there are dozens of calls to log(str) none of which appear in the logs. Is there a configuration step I am missing? Thanks in advance for any help. Jeff Gaer ClearCommerce Corp.
RE: download files using ftp from browser
You are exactally correct. To download a file via FTP, all you do is make sure you have a functioning FTP server, make sure the files are available to anonymous users on the FTP server and then make the A HREF links like this: ftp://ftp.yourserver.com/path/to/file.html instead of http://www.yourserver.com/path/to/file.html This tells the client interface program (web browser) to connect via the FTP protocol instead of the HTTP protocol. Will -- If Al Gore invented the Internet, then I invented spellcheck! Dan Quayle, quoted at the National Press Club, 8/3/1999 [EMAIL PROTECTED] Recovery : http://will.mylanders.com/ PCS: 316-371-FOAD On Wed, 6 Jun 2001, Ross Dyson wrote: What happens if you have your ftp server set up, and you have the path to a file in your ftp server's default path, and on your download page you have prefix it with ftp:// I think the ftp downloads must be a function of your ftp server. -Original Message- From: aswath satrasala [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 6 June 2001 8:03 AM To: [EMAIL PROTECTED] Subject: download files using ftp from browser Hello, Sorry, I think I did not phrase the question properly or I think I am looking for alternate answers. I am looking to download files using FTP from my website through browser. (This is similar to sun's option to provide JDK download using FTP) I have simple website (all html) which displays all the files in a given directory. When the user click on any file, then file download is started. I think this is a http download and is the default behavior of the browser. I would like to do a ftp download instead of http download (This is similar to sun's option to provide JDK download using FTP) I wanted to do this, because I understand that FTP is a better protocol for file download. Also my file size are large like 1GB Thanks -Aswath From: William Kaufman [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: '[EMAIL PROTECTED]' [EMAIL PROTECTED] Subject: RE: download files using ftp Date: Tue, 5 Jun 2001 07:05:36 -0700 Do you mean you're trying to do an FTP download _of_ Java _in_ Java? I wouldn't attempt this: there's one form (the license agreement) followed by another form (the FTP download site selection). And Sun would probably consider bypassing the forms (if possible) as legally questionable, especially the license agreement. If you're just trying to do an FTP download in Java (of something else), look at http://java.sun.com/j2se/1.3/docs/api/java/net/URL.html specifically, URL.openConnection(). -- Bill K. -Original Message- From: aswath satrasala [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 05, 2001 6:57 AM To: [EMAIL PROTECTED] Subject: download files using ftp Hi, I have seen on Sun's web site, an option to download JDK using ftp download. Are there any samples to do this. Please point to the documentation. Thanks -Aswath From: François Andromaque [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: TOMCAT and APACHE Date: Tue, 5 Jun 2001 15:44:07 +0200 I've configured separately apache to work with SSL and TOMCAT to establish a distant database connection, i would like know to make the both to work together. If mod_jk is really necessary, what are the steps to compile it? _ Get your FREE download of MSN Explorer at http://explorer.msn.com _ Get your FREE download of MSN Explorer at http://explorer.msn.com
Re: multiple instances of tomcat
Also, when you start tomcat, use the -r option to point to the correct server.xml file. ex: tomcat-start -r /usr/local/tomcat/conf/server-2.xml tomcat-start -r /usr/local/tomcat/conf/server-1.xml Where server-1.xml defines tomcat on port 8001, and server-2 defines tomcat on 8002. Will -- If Al Gore invented the Internet, then I invented spellcheck! Dan Quayle, quoted at the National Press Club, 8/3/1999 [EMAIL PROTECTED] Recovery : http://will.mylanders.com/ PCS: 316-371-FOAD On Fri, 4 May 2001, Peter Hrastnik wrote: It is possible: You must have two different server.xml files. In the server.xml file you can configure that port in the http connector element. You also need to have 2 startup-scripts that call tomcat with the appropriate server.xml file. You don't need Apache to do this. Bye, Peter.
Multiple Unique Instances WITHOUT multiple JVM?
Greetings! Here's what we want to do: We want to host our new servlet product as an ASP. Each customer of ours would get a unique configuration for the product. However, all of the servlets would run from one code base. We'd have the classes here: /webhome/classes/com/ourcompany/server/product and each customer would have their own WEB-INF: /webhome/customer1/WEB-INF/ Each customers servlets would be mapped like this: /servlet/customer1/user /servlet/customer1/inventory /servlet/customer1/checkout And the second customer: /servlet/customer2/user /servlet/customer2/inventory /servlet/customer2/checkout user, inventory and checkout would all point to the same set of classes up in /webhome/classes. I know this is simple to do, if you are willing to spin up a new JVM for each customer / virtual host. However, with one box and 30 customers, that'd be right memory intensive. Questions: 1) Will this even work? Has anyone done this before? 2) How can we get different config files for each customer without explicitly referring to them as init-params in the web.xml file? (we need to be able to get the config from non-servlet aware classes). Thanks in advance for any tips; ask me if you need any clairification. Will -- If Al Gore invented the Internet, then I invented spellcheck! Dan Quayle, quoted at the National Press Club, 8/3/1999 [EMAIL PROTECTED] Recovery : http://will.mylanders.com/ PCS: 316-371-FOAD
Re: Multiple Unique Instances WITHOUT multiple JVM?
On Tue, 24 Apr 2001, Sam Newman wrote: I think there is a simpler solution. Firstly, have one web app. Secondly, have a database (could even be an encyrpted text file) containing user information. That, unfortunately, wont work. Each customer has many users. Each customer also has many proprietary data files that only the users of that customer can see. Each customer requires a virtual host (customer1.ourhost.com). The codebase is already written based on having only one customer per machine. Now the spec has changed, and they want multple customers per machine. Each customer needs custom configuration data read into a class, and the class may or may not be running under a servlet. The idea is to put out multiple WEB-INF directories with customer-specific config data, images, binary files, etc. Then, have the config set up like such: apache config: VirtualHost ApJServMount /servlet ajpv12://host.server.com:8007/servlet/customer1 /VirtualHost VirtualHost ApJServMount /servlet ajpv12://host.server.com:8007/servlet/customer2 /VirtualHost and so on, mounting each virtual host to a different entry in the server.xml on one JVM. server.xml Context path=/servlet/customer1 docBase=/webhome/customer1 debug=0 reloadable=true /Context Context path=/servlet/customer2 docBase=/webhome/customer2 debug=0 reloadable=true /Context Each Context would have its own unique WEB-INF directory that could contain the web.xml file and other text files with configuration data. Is this going to work at all? Can one JVM manage multiple WEB-INF directories? All library classes will be in the main class repository; only config and binary data will be stored in the WEB-INF directory for each customer. Thanks again for pointers, tips, etc... Will - Original Message - From: Will England [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, April 24, 2001 4:42 PM Subject: Multiple Unique Instances WITHOUT multiple JVM? Greetings! Here's what we want to do: We want to host our new servlet product as an ASP. Each customer of ours would get a unique configuration for the product. However, all of the servlets would run from one code base. We'd have the classes here: /webhome/classes/com/ourcompany/server/product and each customer would have their own WEB-INF: /webhome/customer1/WEB-INF/ Each customers servlets would be mapped like this: /servlet/customer1/user /servlet/customer1/inventory /servlet/customer1/checkout And the second customer: /servlet/customer2/user /servlet/customer2/inventory /servlet/customer2/checkout user, inventory and checkout would all point to the same set of classes up in /webhome/classes. I know this is simple to do, if you are willing to spin up a new JVM for each customer / virtual host. However, with one box and 30 customers, that'd be right memory intensive. Questions: 1) Will this even work? Has anyone done this before? 2) How can we get different config files for each customer without explicitly referring to them as init-params in the web.xml file? (we need to be able to get the config from non-servlet aware classes). Thanks in advance for any tips; ask me if you need any clairification. Will -- If Al Gore invented the Internet, then I invented spellcheck! Dan Quayle, quoted at the National Press Club, 8/3/1999 [EMAIL PROTECTED] Recovery : http://will.mylanders.com/ PCS: 316-371-FOAD
Does mod_jk require 3.2? (was :Re: Multiple Unique Instances WITHOUTmultiple JVM?)
On Tue, 24 Apr 2001, Jeff Kilbride wrote: Hi Will, Take a look at the mod_jk HowTo at: http://jakarta.apache.org/tomcat/jakarta-tomcat/src/doc/index.html There's an example virtual host configuration using a single JVM at the end of the file. No way - I can just mount /webhome/customer1/servlet like that? No aliasing from /servlet/ to http://server:port/servlet? Whoah. So, does mod_jk require using tomcat 3.2? Will
Books on Tomcat
Hi! Does anyone know of any dead-tree books that document the Tomcat platform I've checked O'Reilly and Amazon, with no luck. I've found a few simple basic articles, but that is it. Thanks in advance! Will -- If Al Gore invented the Internet, then I invented spellcheck! Dan Quayle, quoted at the National Press Club, 8/3/1999 [EMAIL PROTECTED] Recovery : http://will.mylanders.com/ PCS: 316-371-FOAD
Logging, server.xml and so on
Greetings! After many days of searching and so on, I am still looking for information on using the default logging built into Tomcat. I am running Tomcat 3.2.1 under apache 1.3.12 on Solaris 2.7, with Java 1.3. I have a servlet application set up that catches all the 'expected' errors and logs them to text files, databases, etc. This includes bad input, missing or wrong parameters, and so on. However, I still need to catch 'unexpected' errors at the top level and log them to a standard log file. Currently, I just am doing this: } catch (Exception e) { e.printStacktrace(); } This is fine for development; at least I can see on the console what happened. However, for production rollout, I'd sure like to be able to have some real logs. I have checked google, groups.google and the mailing list. I do not want to simply do a `tomcat start 21` log, I want actual java interfaces to a logger object that can write to the log listed in server.xml. My server.xml file currently has a log listed: --- server.xml excerpt --- Logger name="tc_log" path="logs/tomcat.log" customOutput="yes" verbosityLevel="ERROR"/ --- server.xml excerpt --- However, this isn't working yet. Also, in the ContextManager section of server.xml for my servlet, I see this line: !-- ContextInterceptor className="org.apache.tomcat.context.LogEvents" / -- As you can see, it is commented out. I have not found any references to this in the FAQ or docs; of course it is entirely possible I have overlooked this. Uncommenting this did not change anything. I have also tried to import org.apache.tomcat.logging.* into my servlet to create a logger or TomcatLogger class, but the "package org.apache.tomcat.logging does not exist". SO, in a nutshell, how do I get access to a logger object to log errors and exceptions to the log referenced in the server.xml file? Thanks in advance for any tips, pointers etc. Will -- "If Al Gore invented the Internet, then I invented spellcheck!" Dan Quayle, quoted at the National Press Club, 8/3/1999 [EMAIL PROTECTED] Recovery : http://will.mylanders.com/ PCS: 316-371-FOAD
Re: Logging, server.xml and so on
On Tue, 17 Apr 2001, Sam Newman wrote: To get stuff into the log, you have to do the following (I'm assuming your in a servlet at the time!) this.getServletContext().log("msg"); or this.getServletContext().log("msg", exception); Check the API docs for HttpServletContext for more details. As to how you can tailor this logging to reflect the debug level set for your context (ala log4j), I don't know. This works a treat in all my stuff anyway. Damn. Missed it by *that* much. That's too simple. Thank you. Will