Security and Forward
Hi. I have the following behaviour in Tomcat 3.2b6 on Windows NT. I protect a page P using security-constraint in the deployment descriptor. So when I call this page, the browser asks me for a login/password. Now, I have a JSP page which isjsp:forward page "P". When I call the JSP page, I see the P page without giving any login/password. I think that this is a security hole. Does anyone have already see that behaviour? Is it a bug or is it ok? Best Regards, Carole Hébrard.
unsuscribe
_ wanadoo.esDirección I+D / Portal y Servicios MultimediaJ. Salvador Mira Gregori / [EMAIL PROTECTED]Tel: +34 96 504 0031 http://www.wanadoo.es __
Custom Error Document
Is it possible to redirect to a custom error page when recieving an Error 500 from Tomcat? Eg. something equal to Apache's ErrorDocument directive. /Fred
RE: Execute JSP's in a different directory - sans-examples.
Hi Sterling, Basically, your description of the process to set up a new webapp below is correct. I suggest that you consider this process as having two parts: (a) setting up tomcat (b) setting up apache You can configure tomcat, then check that it is all correct by using tomcat's http port (default port = 8080). Once this works, then try setting up apache to pass on the relevant requests to tomcat. Setting up apache causes lots of people headaches, so I really recommend making sure it works with plain tomcat first. Tomcat 4.0 will apparently remove the need to configure apache; tomcat will be able to tell apache about what urls it wishes to handle. This is not the case for tomcat3.1/3.2 though, unfortunately. [more comments embedded below] Regards, Simon -Original Message- From: Sterling [SMTP:[EMAIL PROTECTED]] Sent: Monday, October 30, 2000 11:39 PM To: Tomcat-user Subject: Execute JSP's in a different directory - sans-examples. H- I've been poking around the docs and archives for this list and from what I see there isn't a simple way to make this happen. Set up another directory that will execute JSP files without having to go through examples. (And from what I've seen this directory cannot be inside the httpd/htdocs directory either. True?) For example: Add to tomcat-apache.conf file: ApJServMount /MYDIRECTORY ajpv12://127.0.0.1:8007 Create a directory inside /usr/local/tomcat/webapps/MYDIRECTORY [Kitching Simon] Well, you can put your document root anywhere. If it is under webapps, then you don't need to tweak the server.xml file manually, but you do have to live with the /MYDIRECTORY prefix for each url. The alternative is to edit $TOMCAT_HOME/ server.xml, and define a context, with docRoot set to any directory you want. Tomcat3.2 also comes with an admin utility to define new contexts via a web page, but I haven't tried this myself... Create all the special JSP files and dirs in that directory META-INF, WEB-INF, images, jsp, servlets. [Kitching Simon] Well, yeah. If you want to serve files to a browser, you need to put the pages somewhere... Now modify the web.xml file inside WEB-INF to include every servlet that I'm going to use. When I create another servlet I must re-edit this file to include that servlet than reload Tomcat, Restart Apache. [Kitching Simon] If you are happy to have servlets which are accessed via the url /web-app-name/servlet/servlet-class-name, and you don't need any special parameters to be passed to the servlets, then you can use the default mapping [you still need to tell apache that /web-app-name/servlet/... is to be handled by tomcat]. But if you want servlets to be executed by urls that don't have a particular prefix, or you want servlet init parameters, then yes you need a servlet entry in web.xml for each servlet. I really can't see how else it could be done...until we get that telepathic interface I've been waiting for. This can't be right. This is a lot of configuring just to pull up http://www.myserver.net/MYDIRECTORY and have it pull and executes JSP files. [Kitching Simon] No, if you just want to execute JSP files, it is quite simple. No WEB-INF directory is needed, no web.xml, etc. If you want *servlets* as well, then it gets a bit more complicated. I suggest that it is no more complicated than ASP+COM, or PHP. Is this the only way (did I even get it right?) or am I reading the wrong information? Thanks for any thoughts or insights you might have. -Sterling
RE: strange Error 404
I would remove the original WebAppA's work (%TOMCAT_HOME%\work\yourWebAppA)directory to be sure you are not picking-up anything from there. Do this before you restart Tomcat after you have done your directory renames. --- Wolfgang Egger [EMAIL PROTECTED] wrote: Servus Wyn, first thanx for your answer. -Original Message- I'm sure the problem is with the URL used to access the servlet of WebAppB. I don't think so, because of the following behaviour: Our WebServerDirStructure looks like this /websites/WebAppA /websites/WebAppA/WEB-INF /websites/WebAppA/WEB-INF/classes ... /websites/WebAppB /websites/WebAppB/WEB-INF /websites/WebAppB/WEB-INF/classes ... as written in my first mail the whole site WebAppA is working as expected, the WebAppB only shows Error 404 If I remove /websites/WebAppA and rename /websites/WebAppB with /websites/WebAppA, the whole WebAppB is working (with the URR bla/WebAppA/fasel) Because of this I assume, that something in the configuration of tomcat doesn't like WebAppB. I have done a grep "WebAppA tomcat/conf/*" and a "grep WebAppB tomcat/conf/*". The result is, that all entries for WebAppA are the same as the entries for WebAppB. Near the same, because the string WebAppA is replaced by WebAppB in each entry. Are there any other locations apart from tomcat/conf, where I have to do some configuration respectively WebAppB. Greetings from Berlin Wolfgang = Wyn Easton [EMAIL PROTECTED] __ Do You Yahoo!? Yahoo! Messenger - Talk while you surf! It's FREE. http://im.yahoo.com/
RES: Custom Error Document
Yes, but only if there's a web server calling Tomcat (Apache). Put the ErrorDocument command in Apache's httpd.conf : VirtualHost 192.168.0.13:80 ServerName www.fotoptica.com.br DirectoryIndex index.jsp index.html ApJServMount / ajpv12://192.168.0.13:8007 ErrorDocument 500 /erros/error500.html /VirtualHost Sergio Stateri Jr [EMAIL PROTECTED] Tesla Tecnologia Sao Paulo (SP) Brazil -Mensagem original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]Em nome de Fredrik Stenberg Enviada em: Terça-feira, 31 de Outubro de 2000 07:04 Para: '[EMAIL PROTECTED]' Assunto: Custom Error Document Is it possible to redirect to a custom error page when receiving an Error 500 from Tomcat? Eg. something equal to Apache's ErrorDocument directive. /Fred ___ tomcat-users mailing list [EMAIL PROTECTED] https://mailman.real-time.com/mailman/listinfo/tomcat-users
Problems in Installing
Hello, I am running a windows98 in a win32 platform. As u have mentioned i unzipped the folder and renamed the folder to tomcat..Also i set the required env variables.. 1. set TOMCAT_HOME=c:\tomcat 2.set JAVA_HOME=c:/jdk1.23. set PATH=%PATH%;%JAVA_HOME%\bin I restarted the machine after this and when i run the startup.bat tomcat doesnt run, saying "Out of Environment Space". Please advise. regards Ajay ~~~Ajay PrabhakaranCompro Services India Pvt Ltd4LSC, Uday Park, Khel Gaon MargNew Delhi - 110049IndiaPhone : 911- 011-6858049
RE: Execute JSP's in a different directory - sans-examples.
-Original Message- From: Kitching Simon [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 31, 2000 10:24 AM To: '[EMAIL PROTECTED]' Subject: RE: Execute JSP's in a different directory - sans-examples. Hi Sterling, Basically, your description of the process to set up a new webapp below is correct. I suggest that you consider this process as having two parts: (a) setting up tomcat (b) setting up apache You can configure tomcat, then check that it is all correct by using tomcat's http port (default port = 8080). Once this works, then try setting up apache to pass on the relevant requests to tomcat. Setting up apache causes lots of people headaches, so I really recommend making sure it works with plain tomcat first. Tomcat 4.0 will apparently remove the need to configure apache; tomcat will be able to tell apache about what urls it wishes to handle. This is not the case for tomcat3.1/3.2 though, unfortunately. [more comments embedded below] Regards, Simon -Original Message- From: Sterling [SMTP:[EMAIL PROTECTED]] Sent: Monday, October 30, 2000 11:39 PM To: Tomcat-user Subject: Execute JSP's in a different directory - sans-examples. H- I've been poking around the docs and archives for this list and from what I see there isn't a simple way to make this happen. Set up another directory that will execute JSP files without having to go through examples. (And from what I've seen this directory cannot be inside the httpd/htdocs directory either. True?) For example: Add to tomcat-apache.conf file: ApJServMount /MYDIRECTORY ajpv12://127.0.0.1:8007 Create a directory inside /usr/local/tomcat/webapps/MYDIRECTORY [Kitching Simon] Well, you can put your document root anywhere. If it is under webapps, then you don't need to tweak the server.xml file manually, but you do have to live with the /MYDIRECTORY prefix for each url. The alternative is to edit $TOMCAT_HOME/ server.xml, and define a context, with docRoot set to any directory you want. Tomcat3.2 also comes with an admin utility to define new contexts via a web page, but I haven't tried this myself... Create all the special JSP files and dirs in that directory META-INF, WEB-INF, images, jsp, servlets. [Kitching Simon] Well, yeah. If you want to serve files to a browser, you need to put the pages somewhere... Now modify the web.xml file inside WEB-INF to include every servlet that I'm going to use. When I create another servlet I must re-edit this file to include that servlet than reload Tomcat, Restart Apache. [Kitching Simon] If you are happy to have servlets which are accessed via the url /web-app-name/servlet/servlet-class-name, and you don't need any special parameters to be passed to the servlets, then you can use the default mapping [you still need to tell apache that /web-app-name/servlet/... is to be handled by tomcat]. But if you want servlets to be executed by urls that don't have a particular prefix, or you want servlet init parameters, then yes you need a servlet entry in web.xml for each servlet. I really can't see how else it could be done...until we get that telepathic interface I've been waiting for. This can't be right. This is a lot of configuring just to pull up http://www.myserver.net/MYDIRECTORY and have it pull and executes JSP files. [Kitching Simon] No, if you just want to execute JSP files, it is quite simple. No WEB-INF directory is needed, no web.xml, etc. If you want *servlets* as well, then it gets a bit more complicated. I suggest that it is no more complicated than ASP+COM, or PHP. Is this the only way (did I even get it right?) or am I reading the wrong information? Thanks for any thoughts or insights you might have. -Sterling
Tomcat 3.2-beta-6 or 4.0m3?
Hi, right now I work with tomcat-3.2-beta-6. Is it better to move to 4m3? What is the reason of having both versions? Zsolt -- Zsolt Koppany Intland GmbH www.intland.com Schulze-Delitzsch-Strasse 16 D-70565 Stuttgart Tel: +49-711-7871080 Fax: +49-711-7871017
RE: Tomcat 3.2-beta-6 or 4.0m3?
Hi Tomcat developers, I'd love to see some info on the release plans for these products too. I presume that those of you with "committer" status have some general long-term plans I understand that software development schedules (and esp. open-source projects) are difficult to estimate, but a rough guess would still be better than no information! I assume that 3.2 release will come well before 4.0 release, so that's one reason to stick with 3.2 instead of moving to 4.0 right now. Would I be right in guessing 3.2 release is expected sometime round december, and 4.0 release around march/april next year??? However, I am really puzzled by the existence of the 3.3 stream; surely 3.4 will come out *after* 4.0, in which case what's the point of it??? Cheers, Simon -Original Message- From: Zsolt Koppany [SMTP:[EMAIL PROTECTED]] Sent: Tuesday, October 31, 2000 1:47 PM To: [EMAIL PROTECTED] Subject: Tomcat 3.2-beta-6 or 4.0m3? Hi, right now I work with tomcat-3.2-beta-6. Is it better to move to 4m3? What is the reason of having both versions? Zsolt -- Zsolt Koppany Intland GmbH www.intland.com Schulze-Delitzsch-Strasse 16 D-70565 Stuttgart Tel: +49-711-7871080 Fax: +49-711-7871017
AW: Custom Error Document
Hi, I want to do the same. Belong the Servlet-Spec 2.2 we have to edit web.xml like this: ... web-app ... error-page error-code404/error-code location/404.html/location /error-page /web-app But my tomcat hangs in an endless loop. He does not find 404.html. In my system it's located in path_to_web_app/404.html Do you know where it has to be located? How does your system behave? I use Tomcat 3.2beta5 under NT. regards Thomas -Ursprüngliche Nachricht- Von: Fredrik Stenberg [mailto:[EMAIL PROTECTED]] Gesendet am: Dienstag, 31. Oktober 2000 11:04 An: '[EMAIL PROTECTED]' Betreff: Custom Error Document Is it possible to redirect to a custom error page when recieving an Error 500 from Tomcat? Eg. something equal to Apache's ErrorDocument directive. /Fred
RE: Custom Error Document
I am using apache but I can not get it to serve my custom Error I have included the: ErrorDocument 500 "The server made a boo boo. in my httpd but still I only get the stack-trace from tomcat with Error: 500 /Fred -Original Message- From: Sergio Stateri Jr [SMTP:[EMAIL PROTECTED]] Sent: den 31 oktober 2000 12:34 To: [EMAIL PROTECTED] Subject: RES: Custom Error Document Yes, but only if there's a web server calling Tomcat (Apache). Put the ErrorDocument command in Apache's httpd.conf : VirtualHost 192.168.0.13:80 ServerName www.fotoptica.com.br DirectoryIndex index.jsp index.html ApJServMount / ajpv12://192.168.0.13:8007 ErrorDocument 500 /erros/error500.html /VirtualHost Sergio Stateri Jr [EMAIL PROTECTED] Tesla Tecnologia Sao Paulo (SP) Brazil -Mensagem original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]Em nome de Fredrik Stenberg Enviada em: Terça-feira, 31 de Outubro de 2000 07:04 Para: '[EMAIL PROTECTED]' Assunto: Custom Error Document Is it possible to redirect to a custom error page when receiving an Error 500 from Tomcat? Eg. something equal to Apache's ErrorDocument directive. /Fred ___ tomcat-users mailing list [EMAIL PROTECTED] https://mailman.real-time.com/mailman/listinfo/tomcat-users
READ THIS First! Mailing-list archive and good tips
To unsubscribe from this list mailto:[EMAIL PROTECTED] To stop subscription for an alternate account (e.g. [EMAIL PROTECTED]) send an eMail to [EMAIL PROTECTED] Before posting any questions --- + We welcome open discussion of Tomcat issues at both advanced and beginner levels of expertise. However, please be respectful of other people's time. Before posting questions, do your own reading and research. As the saying goes, "There are no stupid questions"... except the ones you could have answered by yourself! Before posting a question, perform the following steps. + Be familiar with servlets in general. See: http://java.sun.com/products/servlet/ http://java.sun.com/products/jsp/ + Read any of the several published books about servlets or JSP. + Read the Servlet API 2.2 Specification. Download a copy of the spec in PostScript or Acrobat PDF formats: http://java.sun.com/products/servlet/download.html#specs The spec is currently not available online; you must download a copy. You may obtain free Acrobat PDF reader software from: http://www.adobe.com/products/acrobat/readstep.html Tomcat implements this spec, so think of it as one of Tomcat's manuals. + Read Tomcat's other documentation: http://jakarta.apache.org/tomcat/index.html + Study the Tomcat examples. First use the servlets found in the /examples context. Read their source code. Then try your own first servlets in the /examples context, and add an entry into /example/WEB-INF/web.xml + Search either of these two archives for past discussions. Contributed by Bob Tanner: http://archives.real-time.com/rte-tomcat/ Contributed by Philip J. Mikal: http://mikal.org/interests/java/tomcat/index.html Search for short phrases, such as your server error messages. Search the archive again with better or different phrases. Many beginner questions have already been asked, so please make several attempts at finding your question in the archive. + Read the FAQ (temporary(?) unavailable): http://jakarta.apache.org/jyve-faq/Turbine/screen/DisplayTopics/ Click the Jakarta link. + Search the bug report facility http://znutar.cortexity.com: provided by Nick Bauman. + Read this mailing list regularly, not just when you have a problem. + Examine your error messages problems not directly related to Tomcat, such as CLASSPATH problems. Write, compile, and run a "Hello World" application to be sure your problem is related to servlets or Tomcat. + Ask an expert in your company, school class, or local Java users group. http://industry.java.sun.com/jug/ + Do not treat this list as a dumping ground for your problems. Think of the list as a volunteer community of people engaging in respectful discussion. == THE MORAL OF THE STORY Help yourself first. Be responsible for your own learning. Try to solve your own problem. If you are still suffering, then post to this list. == + Be aware: This mailing list may contain viruses. Don't trust anybody. If your are not absolutely sure, do not open any attachments. Do not read the postings with a JavaScript-enabled email client. Microsoft Windows users: Disable all stuff like ActiveScripting etc. in your mail reader. Be careful with attachments, especially of type .exe .vbs or some virus attachments like "livestages.txt.shs". The .shs extension disappears/is not visible under Windows but represents an executable script which will execute when opened separately. + Other resources: - An archive of the mailing list for the developers building Tomcat discussing bugs, future releases, etc. http://www.metronet.com/~wjm/tomcat/ - Sun's mailing list for general servlet information: Search its archive at: http://archives.java.sun.com/archives/servlet-interest.html Subscribe only, if you are willing to receive hundred messages per day! - Search DejaNews at http://www.deja.com/home_ps.shtml - Look at jGuru, JCentral etc. - Search the whole Web with a popular search engine. As a developer of server applications you should know all about it. :-) You can find entire websites dedicated to Java servlets. Find the online versions of Java magazines with past articles on servlets and JSP. -- end --
Variable lost reference
I've a servlet loaded on startup. It has a class viariable (static or not static) that I inizialize in the init() method. I give it an instance of a connection pool class. This variable is shared with jsp and servlets by appletContext.setAttribute and moreover i have a static metod getVariable() that return it. All work fine with jsp reloading after they have been changed, recompiled and reloaded by tomcat. But if i change another servlet on the web application, that use appletContext.getAttribute or static method getVariable(), when tomcat reload the modified servlet (different from connectionPool servlet) , evey call to appletContext.getAttribute or getVariable in any jsp or servlet of application return null. Anyone can help me ? Is it a Bug or an error in my servlets ? Thanks
Getting the examples running
I'm new to Tomcat / Apache and trying to get the example JSP pages working. I'm running W2K, Tomcat 3.1, and JDK 1.3 installed. I thought I followed the configuration instructions correctly. I can see the static page listing the examples, but when I try to run one of the example pages I get and error: java.lang.NoClassDefFoundError: sun/tools/javac/Main at org.apache.jasper.compiler.SunJavaCompiler.compile(SunJavaCompiler.java:128) at org.apache.jasper.runtime.JspServlet.LoadJSP(JspServlet.java:413) ... What am I doing wrong and how do I fix it? Thanks in advance for any help! Sincerely, Nathan Wilhelmi
RE: Getting the examples running
You need to put %JAVA_HOME%/lib/tools.jar in your classpath, as is needed to compile JSPs.. Saludos , Ignacio J. Ortega -Mensaje original- De: Nathan Wilhelmi [mailto:[EMAIL PROTECTED]] Enviado el: martes 31 de octubre de 2000 17:37 Para: '[EMAIL PROTECTED]' Asunto: Getting the examples running I'm new to Tomcat / Apache and trying to get the example JSP pages working. I'm running W2K, Tomcat 3.1, and JDK 1.3 installed. I thought I followed the configuration instructions correctly. I can see the static page listing the examples, but when I try to run one of the example pages I get and error: java.lang.NoClassDefFoundError: sun/tools/javac/Main at org.apache.jasper.compiler.SunJavaCompiler.compile(SunJavaCompiler.java: 128) at org.apache.jasper.runtime.JspServlet.LoadJSP(JspServlet.java:413) ... What am I doing wrong and how do I fix it? Thanks in advance for any help! Sincerely, Nathan Wilhelmi
RE: Getting the examples running
There's a file called tools.jar that must be in your classpath. Add a line to your "tomcat.bat file", as follows: set CLASSPATH=%CLASSPATH%;%JAVA_HOME%\lib\tools.jar Ed I'm new to Tomcat / Apache and trying to get the example JSP pages working. I'm running W2K, Tomcat 3.1, and JDK 1.3 installed. I thought I followed the configuration instructions correctly. I can see the static page listing the examples, but when I try to run one of the example pages I get and error: java.lang.NoClassDefFoundError: sun/tools/javac/Main at org.apache.jasper.compiler.SunJavaCompiler.compile(SunJavaCompiler.java:128) at org.apache.jasper.runtime.JspServlet.LoadJSP(JspServlet.java:413) ... What am I doing wrong and how do I fix it?
RE: Win98 Tomcat 3.1 - Starts to launch but then exists???
You can also just modify the batch file properties to change the 'initial environment' to 2806 like it says in the docs somewhere Dan -Original Message- From: David Harris [mailto:[EMAIL PROTECTED]] Sent: Monday, October 30, 2000 1:15 AM To: '[EMAIL PROTECTED]' Subject: RE: Win98 Tomcat 3.1 - Starts to launch but then exists??? I've seen this problem, on the two installations that I found this happening, what was actually happening (after uncommenting out the @echo off lines in tomcat.bat is that an 'out of environment space' error was occurring. I think there are two ways to fix it... see this article: http://www.polymath-software.com/support/environ.shtml in short the method I used was no. 2 1) Open the SYSTEM.INI file and find the section "[NonWindowsApp]". 2) Ensure this section contains the following entry: CommandEnvSize=4096 obviously if it's not an environment space error, this won't work. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, October 30, 2000 4:10 PM To: [EMAIL PROTECTED] Subject: RE: Win98 Tomcat 3.1 - Starts to launch but then exists??? Hello Belive it or not i faced the same problem ...and what did i do??? I just downloaded tomcat again ...and reinstalled it ..it executed successfully in first go cheers jayram - This mail sent through http://www.sify.com
RE: Getting the examples running
Thanks for the response all - Here is my tomcat.bat file: @echo offrem A batch file to start/stop tomcat server. rem This batch file written and tested under Windows NTrem Improvements to this file are welcome rem Guess TOMCAT_HOME if it is not present if not "%TOMCAT_HOME%" == "" goto gothome SET TOMCAT_HOME=.if exist %TOMCAT_HOME%\bin\tomcat.bat goto gothome SET TOMCAT_HOME=..if exist %TOMCAT_HOME%\bin\tomcat.bat goto gothome SET TOMCAT_HOME=echo Unable to determine the value of TOMCAT_HOME.goto eof :gothome rem Set up the CLASSPATH that we need set cp=%CLASSPATH% set CLASSPATH=.set CLASSPATH=%TOMCAT_HOME%\classesset CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\webserver.jarset CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\jasper.jarset CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\xml.jarset CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\servlet.jarset CLASSPATH=%CLASSPATH%;%JAVA_HOME%\lib\tools.jarecho setclasspath for tools.jar if "%cp%" == "" goto next rem elseset CLASSPATH=%CLASSPATH%;%cp% :nextif "%1" == "start" goto startServerif "%1" == "stop" goto stopServerif "%1" == "run" goto runServerif "%1" == "env" goto setupEnvif "%1" == "ant" goto runAntif "%1" == "jspc" goto runJspc echo Usage:echo tomcat (start^|run^|env^|stop)echo start - start tomcat in a separate windowecho run - start tomcat in the current windowecho env - setup the environment for tomcatecho stop - stop tomcatecho ant - run ant with tomcat contextecho jspc - run jsp pre compilergoto cleanup :startServerecho Starting tomcat in new windowecho Using classpath: %CLASSPATH%start java %TOMCAT_OPTS% -Dtomcat.home="%TOMCAT_HOME%" org.apache.tomcat.startup.Tomcat %2 %3 %4 %5 %6 %7 %8 %9goto cleanup :runServerrem Start the Tomcat Serverecho Using classpath: %CLASSPATH%java %TOMCAT_OPTS% -Dtomcat.home="%TOMCAT_HOME%" org.apache.tomcat.startup.Tomcat %2 %3 %4 %5 %6 %7 %8 %9goto cleanup :stopServerrem Stop the Tomcat Serverecho Using classpath: %CLASSPATH%java %TOMCAT_OPTS% -Dtomcat.home="%TOMCAT_HOME%" org.apache.tomcat.startup.Tomcat -stop %2 %3 %4 %5 %6 %7 %8 %9goto cleanupgoto cleanup :runAntrem Run antset CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\ant.jarecho Using classpath: %CLASSPATH%java %ANT_OPTS% -Dant.home="%TOMCAT_HOME%" -Dtomcat.home="%TOMCAT_HOME%" org.apache.tools.ant.Main %2 %3 %4 %5 %6 %7 %8 %9goto cleanup :runJspcrem Run antecho Using classpath: %CLASSPATH%java %JSPC_OPTS% -Dtomcat.home="%TOMCAT_HOME%" org.apache.jasper.JspC %2 %3 %4 %5 %6 %7 %8 %9goto cleanup :setupEnvset cp=%CLASSPATH% :cleanuprem clean up set CLASSPATH=%cp%set port=set host=set test=set jsdkJars=set jspJars=set beanJars=set miscJars=set appJars=set appClassPath=set cp= rem pause:eof It looks to me like it is setting the class path to tools.jar. When Tomcat starts I also tools.jar listed in the class path. Any ideas what I'm still doing wrong. Thanks! Nate -Original Message-From: Ed Gomolka [mailto:[EMAIL PROTECTED]]Sent: Tuesday, October 31, 2000 9:51 AMTo: [EMAIL PROTECTED]Subject: RE: Getting the examples running There's a file called tools.jar that must be in your classpath. Add a line to your "tomcat.bat file", as follows: set CLASSPATH=%CLASSPATH%;%JAVA_HOME%\lib\tools.jar Ed I'm new to Tomcat / Apache and trying to get the example JSP pages working. I'm running W2K, Tomcat 3.1, and JDK 1.3 installed. I thought I followed the configuration instructions correctly. I can see the static page listing the examples, but when I try to run one of the example pages I get and error: java.lang.NoClassDefFoundError: sun/tools/javac/Main at org.apache.jasper.compiler.SunJavaCompiler.compile(SunJavaCompiler.java:128) at org.apache.jasper.runtime.JspServlet.LoadJSP(JspServlet.java:413) ... What am I doing wrong and how do I fix it?
Help :HANDLER THREAD PROBLEM?
I get the following exception: HANDLER THREAD PROBLEM: java.io.IOException: Stream closed prematurely java.io.IOException: Stream closed prematurely at org.apache.tomcat.service.connector.AJP12RequestAdapter.readNextReque st(Ajp12ConnectionHandler.java, Compiled Code) at org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processCon nection(Ajp12ConnectionHandler.java, Compiled Code) at org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.j ava, Compiled Code) at java.lang.Thread.run(Thread.java, Compiled Code) What is his meaning? Att. Mauricio
[tomcat-user] Re: AW: Custom Error Document
Yes, I consider tomcat to be broken, in this regard. But I make it .jsp and it works fine. Also, if you have virtual hosts, this hangs (as opposed to a loop), so I just made an default context to one of the virtual hosts, so it would pick up the WEB-INF/web.xml... probably causes some other issues, but fixes this problem. This means I have apache have ErrorDocument 500 and 404 that are .html not jsp, since apache handles recursive errors with a builtin string, so I have two copyies of my 404 html page... Also, as a note, I strongly recommend against ajp13 as I've run into issues. Will post more when I'm on the other side of the launch. Kenneth Topp --- to unsubscribe: [EMAIL PROTECTED] for more info: http://jakarta.apache.org/getinvolved/mail.html On Tue, 31 Oct 2000, Amrhein, Thomas wrote: Hi, I want to do the same. Belong the Servlet-Spec 2.2 we have to edit web.xml like this: ... web-app ... error-page error-code404/error-code location/404.html/location /error-page /web-app But my tomcat hangs in an endless loop. He does not find 404.html. In my system it's located in path_to_web_app/404.html Do you know where it has to be located? How does your system behave? I use Tomcat 3.2beta5 under NT. regards Thomas -Ursprüngliche Nachricht- Von: Fredrik Stenberg [mailto:[EMAIL PROTECTED]] Gesendet am: Dienstag, 31. Oktober 2000 11:04 An: '[EMAIL PROTECTED]' Betreff: Custom Error Document Is it possible to redirect to a custom error page when recieving an Error 500 from Tomcat? Eg. something equal to Apache's ErrorDocument directive. /Fred
Re: Security and Forward
Carole HEBRARD wrote: Hi. I have the following behaviour in Tomcat 3.2b6 on Windows NT. I protect a page P using security-constraint in the deployment descriptor. So when I call this page, the browser asks me for a login/password. Now, I have a JSP page which isjsp:forward page "P". When I call the JSP page, I see the P page without giving any login/password. I think that this is a security hole. Does anyone have already see that behaviour? Is it a bug or is it ok? This was recently clarified in discussions for servlet 2.3. Security constraints apply only on the initial request URI, not on the URIs used for request dispatchers. The assumption is that your application knows whether or not the forwarded-to page is acceptable, or it would not have done the forward in the first place. In 2.3, the same rule applies to filters -- they are only based on the original request URI. Best Regards, Carole Hébrard. Craig McClanahan
Re: Execute JSP's in a different directory - sans-examples.
H- Thank you for the clarity. Being a newbie, still not sure how Tomcat does what it does. So the confirmation on key points is very helpful. I'll go through the process and hopefully everything will work out alright. If not I'm sure the mailing list will be hearing my cries of pain and anguish soon enough. Thanks. -Sterling PS(BTW - Tomcat does work with Apache right now. The examples come up and the servlets work fine. And that crazy red page for test pops up also. Although not really sure what it's testing. 8^) Kitching Simon wrote: Hi Sterling, Basically, your description of the process to set up a new webapp below is correct. I suggest that you consider this process as having two parts: (a) setting up tomcat (b) setting up apache You can configure tomcat, then check that it is all correct by using tomcat's http port (default port = 8080). Once this works, then try setting up apache to pass on the relevant requests to tomcat. Setting up apache causes lots of people headaches, so I really recommend making sure it works with plain tomcat first. Tomcat 4.0 will apparently remove the need to configure apache; tomcat will be able to tell apache about what urls it wishes to handle. This is not the case for tomcat3.1/3.2 though, unfortunately. [more comments embedded below] Regards, Simon -Original Message- From: Sterling [SMTP:[EMAIL PROTECTED]] Sent: Monday, October 30, 2000 11:39 PM To: Tomcat-user Subject: Execute JSP's in a different directory - sans-examples. H- I've been poking around the docs and archives for this list and from what I see there isn't a simple way to make this happen. Set up another directory that will execute JSP files without having to go through examples. (And from what I've seen this directory cannot be inside the httpd/htdocs directory either. True?) For example: Add to tomcat-apache.conf file: ApJServMount /MYDIRECTORY ajpv12://127.0.0.1:8007 Create a directory inside /usr/local/tomcat/webapps/MYDIRECTORY [Kitching Simon] Well, you can put your document root anywhere. If it is under webapps, then you don't need to tweak the server.xml file manually, but you do have to live with the /MYDIRECTORY prefix for each url. The alternative is to edit $TOMCAT_HOME/ server.xml, and define a context, with docRoot set to any directory you want. Tomcat3.2 also comes with an admin utility to define new contexts via a web page, but I haven't tried this myself... Create all the special JSP files and dirs in that directory META-INF, WEB-INF, images, jsp, servlets. [Kitching Simon] Well, yeah. If you want to serve files to a browser, you need to put the pages somewhere... Now modify the web.xml file inside WEB-INF to include every servlet that I'm going to use. When I create another servlet I must re-edit this file to include that servlet than reload Tomcat, Restart Apache. [Kitching Simon] If you are happy to have servlets which are accessed via the url /web-app-name/servlet/servlet-class-name, and you don't need any special parameters to be passed to the servlets, then you can use the default mapping [you still need to tell apache that /web-app-name/servlet/... is to be handled by tomcat]. But if you want servlets to be executed by urls that don't have a particular prefix, or you want servlet init parameters, then yes you need a servlet entry in web.xml for each servlet. I really can't see how else it could be done...until we get that telepathic interface I've been waiting for. This can't be right. This is a lot of configuring just to pull up http://www.myserver.net/MYDIRECTORY and have it pull and executes JSP files. [Kitching Simon] No, if you just want to execute JSP files, it is quite simple. No WEB-INF directory is needed, no web.xml, etc. If you want *servlets* as well, then it gets a bit more complicated. I suggest that it is no more complicated than ASP+COM, or PHP. Is this the only way (did I even get it right?) or am I reading the wrong information? Thanks for any thoughts or insights you might have. -Sterling
[tomcat-user] RE: Tomcat 3.2-beta-6 or 4.0m3?
Yes, a page modeled after: http://us1.samba.org/samba/development.html would indeed kick ass.. I think the tomcat cvs is too intimidating... There should be a document explaining the tags... Anycase, my theory is that 3.3 (note that apache doesn't follow the even version number scheme of the linux kernel) will be the real sucessor to jserv.. 3.1 is sun re (ie not for production use). 3.2 is beggining to bring it back, but there are many issues, and 3.3 will have everything in good form again. 4.0 is next gen, which will take some time for people to adapt to. It supports the next generation of specifications.. my thoughts.. not gospel, but I would love for tomcat-dev to straighten things out.. Hopefully politics isn't in play. Kenneth Topp --- to unsubscribe: [EMAIL PROTECTED] for more info: http://jakarta.apache.org/getinvolved/mail.html On Tue, 31 Oct 2000, Kitching Simon wrote: Hi Tomcat developers, I'd love to see some info on the release plans for these products too. I presume that those of you with "committer" status have some general long-term plans I understand that software development schedules (and esp. open-source projects) are difficult to estimate, but a rough guess would still be better than no information! I assume that 3.2 release will come well before 4.0 release, so that's one reason to stick with 3.2 instead of moving to 4.0 right now. Would I be right in guessing 3.2 release is expected sometime round december, and 4.0 release around march/april next year??? However, I am really puzzled by the existence of the 3.3 stream; surely 3.4 will come out *after* 4.0, in which case what's the point of it??? Cheers, Simon -Original Message- From: Zsolt Koppany [SMTP:[EMAIL PROTECTED]] Sent: Tuesday, October 31, 2000 1:47 PM To: [EMAIL PROTECTED] Subject:Tomcat 3.2-beta-6 or 4.0m3? Hi, right now I work with tomcat-3.2-beta-6. Is it better to move to 4m3? What is the reason of having both versions? Zsolt -- Zsolt Koppany Intland GmbH www.intland.com Schulze-Delitzsch-Strasse 16 D-70565 Stuttgart Tel: +49-711-7871080 Fax: +49-711-7871017
RE: Apache/Tomcat Setup on Win2000 Professional
I run Tomcat 3.1 Final on win2k at work. I can say with certainty that it works. If I were you, I would not run tomcat in a directory that has spaces in its pathname. While this can work, You always have to be so damn careful with your quoting that I find it is not worth the effort. Another piece of free advice (and we know what they say about free advice,) is to run tomcat as a service. There is an excellent howto for achieving this in the docs directory. If you run tomcat as a service, then all your environment setup for tomcat is explicitly set in the wrapper.properties file - so you can stuff up your classpath and system path as much as you like without breaking tomcat. Good luck - post back some more info on your configuration if you still have trouble. Aaron Knauf Systems Integrator Genie Systems Ltd Auckland, New Zealand Ph. +64-9-573 3310 x812 email: [EMAIL PROTECTED] http://www.geniesystems.com Matthew A. Overlund [EMAIL PROTECTED] 01/11/2000 09:42 Please respond to tomcat-user To:[EMAIL PROTECTED] cc: Subject:RE: Apache/Tomcat Setup on Win2000 Professional Hi Don, If your server is responding as expected, with the exception of JSP pages not working the first thing I would check is your JSP compiler. If you are set up and using the JIKES compiler, make sure it is on the path. If you are using the default javac compiler add c:\jdk1.3\lib\tools.jar to your classpath before executing. Matthew A. Overlund -Original Message- From: Don Lee [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 31, 2000 11:42 AM To: [EMAIL PROTECTED] Subject: Apache/Tomcat Setup on Win2000 Professional Hi, I'm trying to run Apache/Jakarta-Tom cat on Windows 2000 Professional but it's not successful. If anyone has suggestion/input about what I did for setup, I'll eternally appreciate it. (Please bear in mind that I'm a beginner in Java/JSP/Apache world) Again, my OS is Windows 2000 Professional, not unix. (1) JDK1.3 Downloaded JDK1.3 and installed under c:\jdk1.3. Set the path value for C:\jdk1.3\bin;C:\jdk1.3\lib. (from System property GUI not fromautoexec.bat) (2) Apache Downloaded apache_1_3_12_win32.exe. Installed under C:\program Files\Apache Group\Apache Added ServerName localhoston \conf\httpd.conf (actual line doesn't have quotes) (3) Jakarta-Tomcat Downloadedjakarta-tomcat Win32 version. Installed under C:\program files\apache group\jakarta-tomcat (4) Mod_jserv Downloaded ApacheModuleJServ.dll Installed under C:\Program files\apache group\apache\modules Registered dll withregsrv32.exe (5)httpd.conf edit IncludeC:/program files/apache group/jakarta-tomcat/conf/tomcat-apache.conf to the end. Start tomcat using \bin\startup.bat. Start Apache. After I did all these steps, I tried with http://localhost:8080/ , it's working. I can see html files. Also, I can execute sample serverlets that come with tomcat-jakarta. But when I tried to execute sample jsp files, I'm getting 500 error. What am I doing wrong here? Any input will be greatly appreciated. Don
RE: Builds/Releases
try asking on tomcat-dev Mike -Original Message- From: Mark Porter [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 31, 2000 1:27 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Builds/Releases Why are the nightly builds broken (still!) and why is no-one answering questions about builds/releases?!? Mark -- Mark D. Porter Exchange Solutions Inc. [EMAIL PROTECTED]
RE: Getting the examples running
Your classpath statements look good. The only thing that I can advise at this point is to doublecheck your JAVA_HOME value, and ensure that it's pointing to the right place. I have sometimes seen cases where JAVA_HOME was pointing to the JRE, but the JAR file was in the JDK's Java lib directory. I have also seen the opposite case. If that's not it, then I'm out of ideas. -Original Message-From: Nathan Wilhelmi [mailto:[EMAIL PROTECTED]]Sent: Tuesday, October 31, 2000 11:36 AMTo: '[EMAIL PROTECTED]'Subject: RE: Getting the examples running Thanks for the response all - Here is my tomcat.bat file: :gothome rem Set up the CLASSPATH that we need set cp=%CLASSPATH% set CLASSPATH=.set CLASSPATH=%TOMCAT_HOME%\classesset CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\webserver.jarset CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\jasper.jarset CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\xml.jarset CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\servlet.jarset CLASSPATH=%CLASSPATH%;%JAVA_HOME%\lib\tools.jarecho setclasspath for tools.jar :startServerecho Starting tomcat in new windowecho Using classpath: %CLASSPATH%start java %TOMCAT_OPTS% -Dtomcat.home="%TOMCAT_HOME%" org.apache.tomcat.startup.Tomcat %2 %3 %4 %5 %6 %7 %8 %9goto cleanup === It looks to me like it is setting the class path to tools.jar. When Tomcat starts I also tools.jar listed in the class path. Any ideas what I'm still doing wrong.
RE: Trouble installng Tomcat on (Debian) Linux
Looks like there was a problem parsing an xml file. Since tomcat.log doesn't exist, your server.xml file may have a problem. Did you modify it? -Original Message-From: Gregory Guthrie [mailto:[EMAIL PROTECTED]]Sent: Tuesday, October 31, 2000 9:51 AMTo: [EMAIL PROTECTED]Cc: [EMAIL PROTECTED]Subject: Trouble installng Tomcat on (Debian) LinuxI installed tomcat on my Debian Linux system from Apache runs fine, but I have tomcat problems.1) How do I test it with their examples? There is a webapps/examples.war; how do I invoke it?2) Do I have to manually start it (per the Install "how to run" instructions?), or shouldn't it be automatically started as needed by Apache, like Jserv. There is a /etc/init.d/tomcat, so why manually start?-- I want to run with Apache.3) I tried to look at examples.war, "jar -vft examples.jar", but it fails (see below), yet the startup (more below) seems to have successfully loaded them?omega:/usr/share/java/webapps# jar vft examples.warjava.io.IOException: CRC of 0 is not valid in a DATA header at java.lang.Throwable.fillInStackTrace(Throwable.java:native) at java.lang.Throwable.init(Throwable.java:38) at java.lang.Exception.init(Exception.java:24) at java.io.IOException.init(IOException.java:25) at java.util.zip.ZipInputStream.closeEntry(ZipInputStream.java:137) at kaffe.tools.jar.Jar.listFilesInJar(Jar.java:605) at kaffe.tools.jar.Jar.processJar(Jar.java:402) at kaffe.tools.jar.Jar.start(Jar.java:60) at kaffe.tools.jar.Jar.main(Jar.java:39)4) I went into /usr/share/tomcat/bin/tomcat and ran "./tomcat.sh run", but got lots of errors (see below) which I didn't get the gist of. (I do have libgmp2 installed). One concern in that the startup file (init.d/tomcat) says: "# Look for the right JVM to use - Tomcat does not work with Kaffe!"but the error below reports Kaffe, and indeed:omega:/etc/init.d# java !$java -versionKaffe Virtual MachineCopyright (c) 1996-2000Transvirtual Technologies, Inc. All rights reservedEngine: Just-in-time v3 Version: 1.0.6 Java Version: 1.1In any case I never get any errors in tomcat.log (which in fact does not exist!)Thanks for any help.Gregory ([EMAIL PROTECTED])I am running Debian Linux 2.2w/http://master.debian.org/~sgybas/tomcat/ (tomcat Version: 3.1.99b6-1)ibm-jdk1.1 (1.18) [ibm-jdk-l118-linux-x86.tgz]ibm-jre1.1 (1.18) [ibm-jre-l118-linux-x86.tgz] omega:/usr/share/tomcat/bin# ./tomcat.sh runGuessing TOMCAT_HOME from tomcat.sh to ./..Setting TOMCAT_HOME to ./..Using classpath: .:./../lib/servlet.jar:./../lib/tomcat.jar:./../lib/xerces.jarorg.apache.xerces.validators.datatype.InvalidDatatypeFacetException: [exception was kaffe.util.SupportDisabled: GNU gmp was not found by Kaffe configure script] at java.lang.Throwable.fillInStackTrace(Throwable.java:native) at java.lang.Throwable.init(Throwable.java:38) at java.lang.Exception.init(Exception.java:24) at org.apache.xerces.validators.datatype.XMLException.init(XMLException.java:line unknown, pc 0x83edb81) at org.apache.xerces.validators.datatype.InvalidDatatypeFacetException.init(InvalidDatatypeFacetException.java:line unknown, pc 0x851108a) at org.apache.xerces.validators.datatype.DatatypeValidatorFactoryImpl.createDatatypeValidator(DatatypeValidatorFactoryImpl.java:line unknown, pc 0x83491f2) at org.apache.xerces.validators.datatype.DatatypeValidatorFactoryImpl.createDatatypeValidator(DatatypeValidatorFactoryImpl.java:line unknown, pc 0x839bdfe) at org.apache.xerces.validators.datatype.DatatypeValidatorFactoryImpl.initializeRegistry(DatatypeValidatorFactoryImpl.java:line unknown, pc 0x83a71a7) at org.apache.xerces.validators.datatype.DatatypeValidatorFactoryImpl.init(DatatypeValidatorFactoryImpl.java:line unknown, pc 0x8337fca) at org.apache.xerces.validators.datatype.DatatypeValidatorFactoryImpl.clinit(DatatypeValidatorFactoryImpl.java:line unknown, pc 0x838826e) at org.apache.xerces.framework.XMLParser.init(XMLParser.java:line unknown, pc 0x8339456) at org.apache.xerces.parsers.SAXParser.init(SAXParser.java:line unknown, pc 0x82ad68a) at org.apache.xerces.jaxp.SAXParserImpl.init(SAXParserImpl.java:line unknown, pc 0x82c50ba) at org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParser(SAXParserFactoryImpl.java:line unknown, pc 0x82ad1ae) at org.apache.tomcat.util.xml.XmlMapper.readXml(XmlMapper.java:213) at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:189) at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:237)2000-10-30 08:07:50 - ContextManager: Adding context Ctx( /examples )2000-10-30 08:07:51 - ContextManager: Adding context Ctx( /admin )Starting tomcat. Check logs/tomcat.log for error messages No apps in webapps/
RE: Help :HANDLER THREAD PROBLEM?
Are you using a secure Apache server like the one with mod_ssl or Raven or anything like that? Also did you just dowload mod_jserv binary? What you need to do is compile the mod_jserv binary using the Apache apxs script and make it a part of EAPI (note that I'm not sure exactely what I'm talking about, but that this is what you have to do). This problem has been driving me crazy for the past couple days, but recompiling solved it. Let me know if you have any questions. -Original Message- From: Mauricio Nuñez [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 31, 2000 12:54 PM To: [EMAIL PROTECTED] Subject: Help :HANDLER THREAD PROBLEM? I get the following exception: HANDLER THREAD PROBLEM: java.io.IOException: Stream closed prematurely java.io.IOException: Stream closed prematurely at org.apache.tomcat.service.connector.AJP12RequestAdapter.readNextReque st(Ajp12ConnectionHandler.java, Compiled Code) at org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processCon nection(Ajp12ConnectionHandler.java, Compiled Code) at org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.j ava, Compiled Code) at java.lang.Thread.run(Thread.java, Compiled Code) What is his meaning? Att. Mauricio
Helper script
Greetings, I wrote a script to make it easy for me to control tomcats on my virtual hosts. It works well for me so I thought I'd share it, just in case someone else might find it useful. It provides easy start/stop/restart control over one or all of the servers. I call it 'tomcat', and store it in /bin It uses the startup.sh and shutdown.sh scripts with the -f parameter to specify what server.xml file to use with each virtual domain. Check the config section at the top to set up variables for your installation. This is suitable for calling from an init script to control all the tomcat servers by using the 'all' parameter. Hope someone else finds it useful! DK #!/bin/sh # # Control tomcat for virtual domains # hacked together by [EMAIL PROTECTED], use at your own risk. # - Installation-specific Configuration options -- # lookup arrays for virtual server names (all refers to all servers) # shorthand names for domains DOMAINIDS="all s1 s2" # full names for domains, used to refer to server.xml files for the domain SERVERS="all sample1.com sample2.org" # full path to startup.sh and shutdown scripts provided with tomcat STARTUP_SH="/usr/local/jakarta-tomcat/bin/startup.sh" SHUTDOWN_SH="/usr/local/jakarta-tomcat/bin/shutdown.sh" # location of server.xml files for virtual domains CONFIG_DIR="/etc/tomcat" # server.xml files are named as "sample1.com.xml" where "sample1.com" is # the domain name as it appears in the SERVERS array above # End config options --- # display useage message and exit function Usage () { echo "" echo " USAGE: tomcat [domain id] [command]" echo "" echo " COMMANDS:" echo " start Start tomcat service on server [domain id]" echo " stopStop tomcat service on server [domain id]" echo " restart Restart tomcat service on server [domain id]" echo "" echo "" echo " Known domain id's are:" echo "" echo " ID Server name" echo " -- ---" COUNT=1 for i in $DOMAINIDS; do SNAME=`echo $SERVERS | cut -d" " -f$COUNT` echo " $i $SNAME" COUNT=`expr $COUNT + 1` done; echo "" echo " EXAMPLE:" echo "" echo "Start tomcat for example.com (where example.com has an ID of ex):" echo "# ./tomcat ex start" echo "" exit 1 } function StartServer { # $1 = Domain name echo -n "Starting tomcat on $1" $STARTUP_SH -f $CONFIG_DIR/$1.xml } function StopServer { # $1 = Domain name echo -n "Stopping tomcat on $1:" $SHUTDOWN_SH -f $CONFIG_DIR/$1.xml } function Control { # $1 = Domain name # $2 = Action, start, stop, restart or test case "$2" in start) StartServer $1 ;; stop) StopServer $1 ;; restart) StopServer $1 StartServer $1 ;; test) echo "Testing, Domain = $1Action = $2" ;; esac } # Make sure user supplied two and only two parameters if [ $# != 2 ]; then echo "" echo " ** Incorrect number of parameters **" Usage fi # this is a really cheezy way to check that the paramaters are # valid because I couldn't figure out an easy way to check if # a string is a member of an array # ISVALID=0 for i in SERVERS; do if [ $i = $1 ]; then ISVALID=1 fi done; if [ $ISVALID = 0 ]; then echo "" echo "** Invalid domain: $1 **" Usage fi ISVALID=0 for i in start stop restart test; do if [ $i = $2 ]; then ISVALID=1 fi done; if [ $ISVALID = 0 ]; then echo "" echo " ** Invalid command: $2 **" Usage fi # Figure out which server the user has specified COUNT=1 for i in $DOMAINIDS; do if [ $i = $1 ]; then DOMAIN_NAME=`echo $SERVERS | cut -d" " -f$COUNT` fi COUNT=`expr $COUNT + 1` done; # Take the action specified if [ $DOMAIN_NAME = "all" ]; then # call Control for all servers (except for 'all') for i in $SERVERS; do if [ $i != "all" ]; then Control $i $2 fi done; else Control $DOMAIN_NAME $2 fi exit 0
Re: Helper script
From: "David Knaack" [EMAIL PROTECTED] It uses the startup.sh and shutdown.sh scripts with the -f parameter to specify what server.xml file to use with each virtual domain. Check the config section at the top to set up variables for your installation. Note that in the server.xml file you should set the home property of the context manger to the correct home directory for each virtual domain, else it won't work right :)
CLASSPATH and JARs
Hi, Am using Tomcat 3.1. For a webapp, I have a bunch of JARs. How do I ensure that it gets picked up in the CLASSPATH ? Putting them in either the web-inf/lib or web-inf/classes does not help. From the FAQ on Jakarta site, one person recommends adding it to the system CLASSPATH. Maybe it is fixed in Tomcat 4.0 m3. anybody ? note: Am trying to get Jyve up and running, and it has tons of JARs -raghu Raghu Havaldar [EMAIL PROTECTED] Objectspace, Inc.
[ANN] Metamata Debug, Cover 2.0
Metamata is pleased to announce the release of the Metamata Development Environment, version 2.0. Key features include remote debugging, JSP source level debugging, servlet output stream monitoring, customized viewing of common servlet API data types, method and statement coverage, fix and continue, and much more. It works with JDKs 1.1, 1.2, and 1.3, all application servers, all web browsers, Windows, Solaris, and Linux. Download at http://www.metamata.com/download_top.html Thanks for reading, Louis Tribble Metamata, Inc. http://www.metamata.com Tools for serious Java developers. +1 510 796 0915
Re: Help : can't get java compiling through
Add servlet.jar to your classpath. Aaron Knauf Systems Integrator Genie Systems Ltd Auckland, New Zealand Ph. +64-9-573 3310 x812 email: [EMAIL PROTECTED] http://www.geniesystems.com
Re: [ANN] Metamata Debug, Cover 2.0
I am not remotely interested in seeing spam on this type of email on this mailing list. In my opinion, it is one step short of spam. (The one step required would be to send it from some anonymous address - at least this guy wasn't trying to be underhanded.) I would like to see this guy issued with a warning from the list maintainer. Aaron Knauf Systems Integrator Genie Systems Ltd Auckland, New Zealand Ph. +64-9-573 3310 x812 email: [EMAIL PROTECTED] http://www.geniesystems.com
Re: Tomcat 3.2-beta-6 or 4.0m3?
To follow up on a few of the items from my perspective as a Tomcat developer: Kitching Simon wrote: Hi Tomcat developers, I'd love to see some info on the release plans for these products too. I presume that those of you with "committer" status have some general long-term plans I understand that software development schedules (and esp. open-source projects) are difficult to estimate, but a rough guess would still be better than no information! I assume that 3.2 release will come well before 4.0 release, so that's one reason to stick with 3.2 instead of moving to 4.0 right now. Would I be right in guessing 3.2 release is expected sometime round december, and 4.0 release around march/april next year??? I cannot speak directly for the release plans for 3.2 final -- that is up to Sam Ruby, who is the release manager for this version. I would assume, however, that it is imminent. My personal goals for Tomcat 4.0 include: - Feature-complete implementation of the servlet 2.3 and JSP 1.2 "Proposed Final Draft" specifications that were recently published at java.sun.com (this will be accomplished with a Milestone 4 release that will be generated tomorrow night if all goes well). - Attention shifting towards bug fixing and performance tuning, with the goal of a production-quality implementation by Christmas time or so. The more people that help debug and tune it, the shorter this time frame can be. - Addition of web connectors (so you can run 4.0 behind a web server like you can with 3.2), JNDI environment support, and other new features as contributed by volunteers working on 4.0. So, which version should you use? - If you're readying a production deployment, and do not need servlet 2.3/JSP 1.2 features, definitely stick with the most recent release of 3.2. It will be more stable and performant at the moment (although early signs are that 4.0 will mature very nicely in these directions :-). - If you've got some time to help debug and tune, and/or you need the new 2.3/1.2 features (like filters, wrapped RequestDIspatcher arguments, XML syntax for JSP pages, custom tag validators, .) then grab the latest milestone of Tomcat 4.0 and help us make it better. FYI: Tomcat 4.0 will be the web component of the J2EE 1.3 reference implementation, when it is released. However, I am really puzzled by the existence of the 3.3 stream; surely 3.4 will come out *after* 4.0, in which case what's the point of it??? The "3.3" code stream was some enhancement work (based on the 3.2 code base) that started about the time that the first 3.2 beta was released, and continues to receive some attention even though the TOMCAT-DEV community voted to switch to the 4.0 code base for the next major release of Tomcat. While it continues to receive attention from a few developers, I only plan to mine some of the excellent low-level performance tuning tricks that have been implemented there. Although this code is there for anyone who wants to play with it (this is open source, after all :-), the next major release of Tomcat after 3.2 will be 4.0, based on the code that is in the "jakarta-tomcat-4.0" CVS repository. Cheers, Simon Craig McClanahan
Re: [ANN] Metamata Debug, Cover 2.0
Aaron Knauf wrote: I am not remotely interested in seeing spam on this type of email on this mailing list. In my opinion, it is one step short of spam. (The one step required would be to send it from some anonymous address - at least this guy wasn't trying to be underhanded.) I would like to see this guy issued with a warning from the list maintainer. Given the number of times I have seen questions posted (or posed to me) about development tools for servlets and JSP pages, I personally see no problem with short, one-time announcements of tools that might be of general interest like this. FYI, Sun's general interest mailing lists (such as JSP-INTEREST and SERVLET-INTEREST) follow this same policy. Aaron Knauf Craig McClanahan
Re: uninitialized instance variables in servlet
Have you checked your servlet logs to see if the UnavailableException errors actually are being thrown? You don't say what version of Tomcat you are using, but (if I remember correctly) version 3.1 did not actually honor UnavailableExceptions thrown from init(). Craig McClanahan Tom O'Connor wrote: In the init() method of my Servlet class, I populate 2 String instance variables that are later used in the doPost() method. The String values are populated by calling .getInitParameter() on the ServletConfig instance passed into init(). I verify that the String returned from .getInitParameter() != null inside init(). After tomcat starts, I start a client program that generates HTTP requests aimed at the servlet. More often than not, these requests fail with 500 Server Error as the response. For each failed request, in $TOMCAT_HOME/logs/tomcat.log there is a NullPointerException and a stack trace, and the stack trace points me to a line in my servlet where I invoke a method on the String instance variables that should have been initialized in init(). This is *NOT* a configuration file issue. I can say this because in the same webapp, I have 2 servlets that each have the same servlet-class element in web.xml. The first servlet will generate failures (sometimes) but the second servlet (which is the same class, but a different instance) will succeed. The only thing different between the two instances are the init-param values in web.xml. I also swap which servlet I invoke first and it's the first servlet invoked that fails. I've tried this using both Apache+mod_jk over Ajp13, and invoking the servlet directly through Tomcat's HTTP adapter. Doesn't the servlet spec say that no thread shall enter Servlet.service() until Servlet.init() has successfully completed? If that's true, how can my instance variables be null? The servlet looks like this: public class S extends HttpServlet { private String n = null; private String v = null; public void init(ServletConfig config) throws ... { super.init(config); n = config.getInitParameter("n"); v = config.getInitParameter("v"); if (n == null) throw new UnavailableException(); if (v == null) throw new UnavailableException(); // snip } public void doPost(...) throws ... { // this.n and this.v are used in here } }
Re: XML, DTD, Tomcat
Alex Tang wrote: Hi folks. I've got a servlet (actually a couple) that are doing some XML parsing (Mainly SAX, some DOM). The only problem I seem to be having is that when if I have a XML file that looks like this: ?xml version="1.0" encoding="UTF-8"? !DOCTYPE taglist SYSTEM "taglist.dtd" What an XML parser does with this is really a question for your parser provider -- it's not really a Tomcat issue. I would imagine that it is being resolved relative to the current working directory where you started Tomcat. Tomcat looks for the DTD file in the TOMCAT_HOME/bin directory. the XML and DTD files are in my WEB-INF/classes part of my class path. From what I understand of XML, using the !DOCTYPE ... SYSTEM "file.dtd" where the dtd file is given as a URI with no path, the parser should look for the DTD file in the same directory as the XML file. It's probably something stupid on my part. I'm creating the InputSource using an input stream which I instantiate using "getResourceAsStream()", (which is probably where I'm going wrong). InputStream ist = FormattedTextWidgetStub.class.getResourceAsStream ( ATTR_TAGFILE ); InputSource iso = new InputSource ( ist ); parser.parse ( iso ); Is there a better way to get the InputSource? or is there any other way i can get tomcat to look for my DTD file in the same directory as my XML file (considering that I must keep my XML and DTD files in my classpath (under the WEB-INF/classes directory somewhere)? While this is an appropriate way to get resources in a web application, note that doing so gives the parser no clue where the input stream is coming from. You might try getting a File reference to the input file, and passing that to your parse method instead. Alternatively, there is a mechanism in most parsers to register a separate input source for a DTD (keyed by the public identifier). Tomcat uses this approach, for example, to register its local copies of the DTD for web.xml files, so that it doesn't need to go across the network every time. thanks very much. ...alex... Craig McClanahan
Re: JSPs anywhere
Hi, Joe, You may have any directory structure for your HTML pages as long as you comply with a minimum set of requirements: - each application should be declared (as a "context") in the server.xml file of Tomcat. The organization of that diectory is up to you, with the exception of the directory WEB-INF, where you must locate the classes and/or jar files that you want to have in the "private" classpath of your application. - You can define your root application using something like this in your server.xml file: !-- your Environment -- Context path="" docBase="/apache/root/directory" debug="0" reloadable="true" /Context That should allow you to run JSP "anywhere" in your previous apache directory structure. I would suggest, anyway, you consider the logical organization suggested in the documentation. Hope it helps, Julio Serje Calian Tech. - Original Message - From: Joe Laffey [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, October 31, 2000 5:04 PM Subject: JSPs anywhere I have tried to look in the FAQ, but it seems to be down. Can anyone give me a quick step-by-step on how to setup Tomcat with Apache to allow JSP files to be executed from anywhere an HTML can be found? In other words, I do not want to keep my JSP files in the examples folder ;-) I want to put JSP files anywhere and have them run. Pointers to a FAQ would be helpful too. Thanks! Joe Laffey LAFFEY Computer Imaging St. Louis, MO - With no walls or fences on the Internet, who needs Windows or Gates? -
Re: socket exception errors on startup
It may be that a) you have another process that is using port 8080, or b) you already have an instance of tomcat running that is using that port. In case a), change in server.xml the port number Tomcat is listening to. Julio Serje Calian Tech. - Original Message - From: John Howay [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, October 31, 2000 4:13 PM Subject: socket exception errors on startup My system is Red Hat Linux 6.2, Apache 1.3, JDK/JRE 1.1.8, Tomcat 3.1 and I used an RPM for mod_jk--a 3.2 beta version. I'm trying to start Tomcat as a standalone (using ./tomcat.sh run). I get a bunch of error messages like so: java.net.SocketException: Socket closed at java.net.PlainSocketImpl at java.net.Socket at java.net.ServerSocket.implAccept at java.net.ServerSocket.accept at org.apache.tomcat.service.SimpleTcpEndpoint at org.apache.tomcat.service.TcpListenerThread at java.lang.Thread.run Endpoint ServerSocket[address=0.0.0.0/0.0.0.0, port=0, localport=8080 I've found similar submissions on this subject but couldn't find replies. Thanks for any suggestions. John Howay
Q: apache isn't forwarding to tomcat
Please respond to my email address since I'm not (yet) subscribed to the mailing list. Hi all, I can't get apache to forward jsp pages to tomcat. I'm quite familiar (as a user) with tomcat so I've tried troubleshooting it but to no avail. I'm using: OS: Linux RedHat 6.2 apache 1.3.12 tomcat 3.1 The procedure to attach tomcat to apache is simple. 1. install the right mod_jserv.so 2. Include the tomcat.conf file in the httpd.conf file. http://localhost/ works great as apache http://localhost:8080/ works great as tomcat but http://localhost/my.jsp doesn't!!! (my.jsp resides in webapps/ROOT of tomcat). I've exhausted all links at www.apache.org. Please let me know what other things might have gone wrong. Thank you Mohammed Bustany [EMAIL PROTECTED]
RE: CLASSPATH and JARs
I believe the 'correct' place to put jars is in the WEB-INF/lib directory of the context. I run tomcat 3.2beta6 on jdk1.3 and can say that it behaves correctly on redhat 6.2 and win NT and win98. Note that WEB-INF must be capital letters on unix/linux platforms, it doesn't matter on win32. Putting jars and classes in the system classpath is asking for maintainability issues - try to avoid at all costs... -Original Message- From: Raghu Havaldar [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 01, 2000 11:19 AM To: '[EMAIL PROTECTED]' Subject: CLASSPATH and JARs Hi, Am using Tomcat 3.1. For a webapp, I have a bunch of JARs. How do I ensure that it gets picked up in the CLASSPATH ? Putting them in either the web-inf/lib or web-inf/classes does not help. From the FAQ on Jakarta site, one person recommends adding it to the system CLASSPATH. Maybe it is fixed in Tomcat 4.0 m3. anybody ? note: Am trying to get Jyve up and running, and it has tons of JARs -raghu Raghu Havaldar [EMAIL PROTECTED] Objectspace, Inc.
jk_nt_service error in NT workstation
Dear Tomcat support team, I have problem in running jk_nt_service.exe. The output is some random characters with an error message at the end: L=!This program cannot be run in DOS mode. n.b. my computer is running NT4.0 with SP5 on.
Re: (Possible VIRUS) Re: ???????? - ????????????
William Brogden [EMAIL PROTECTED] wrote: Crashed my Netscape 4.61 but I don't think it was a virus, just some really weird data. -- WBB It's just an ad in Chinese. Netscape crashed? I think that happens. My Chinese version of Netscape gives me an error message every time I exit it.
SessionContext.log(...) Where does the path in the output come from?
Hi all, when using the log method from SessionContext(), the written output looks like the follwing: Context log path="" : here goes the log message string What is that "Context log path" thing? When I'm using log("...") the context log path is always empty. What is the meaning of the path and how can I set it? Regards Oliver Kurt
Builds/Releases
Why are the nightly builds broken (still!) and why is no-one answering questions about builds/releases?!? Mark -- Mark D. Porter Exchange Solutions Inc. [EMAIL PROTECTED]
Trouble installng Tomcat on (Debian) Linux
I installed tomcat on my Debian Linux system from Apache runs fine, but I have tomcat problems. 1) How do I test it with their examples? There is a webapps/examples.war; how do I invoke it? 2) Do I have to manually start it (per the Install how to run instructions?), or shouldn't it be automatically started as needed by Apache, like Jserv. There is a /etc/init.d/tomcat, so why manually start? -- I want to run with Apache. 3) I tried to look at examples.war, jar -vft examples.jar, but it fails (see below), yet the startup (more below) seems to have successfully loaded them? omega:/usr/share/java/webapps# jar vft examples.war java.io.IOException: CRC of 0 is not valid in a DATA header at java.lang.Throwable.fillInStackTrace(Throwable.java:native) at java.lang.Throwable.init(Throwable.java:38) at java.lang.Exception.init(Exception.java:24) at java.io.IOException.init(IOException.java:25) at java.util.zip.ZipInputStream.closeEntry(ZipInputStream.java:137) at kaffe.tools.jar.Jar.listFilesInJar(Jar.java:605) at kaffe.tools.jar.Jar.processJar(Jar.java:402) at kaffe.tools.jar.Jar.start(Jar.java:60) at kaffe.tools.jar.Jar.main(Jar.java:39) 4) I went into /usr/share/tomcat/bin/tomcat and ran ./tomcat.sh run, but got lots of errors (see below) which I didn't get the gist of. (I do have libgmp2 installed). One concern in that the startup file (init.d/tomcat) says: # Look for the right JVM to use - Tomcat does not work with Kaffe! but the error below reports Kaffe, and indeed: omega:/etc/init.d# java !$ java -version Kaffe Virtual Machine Copyright (c) 1996-2000 Transvirtual Technologies, Inc. All rights reserved Engine: Just-in-time v3 Version: 1.0.6 Java Version: 1.1 In any case I never get any errors in tomcat.log (which in fact does not exist!) Thanks for any help. Gregory ([EMAIL PROTECTED]) I am running Debian Linux 2.2 w/ http://master.debian.org/~sgybas/tomcat/ (tomcat Version: 3.1.99b6-1) ibm-jdk1.1 (1.18) [ibm-jdk-l118-linux-x86.tgz] ibm-jre1.1 (1.18) [ibm-jre-l118-linux-x86.tgz] omega:/usr/share/tomcat/bin# ./tomcat.sh run Guessing TOMCAT_HOME from tomcat.sh to ./.. Setting TOMCAT_HOME to ./.. Using classpath: .:./../lib/servlet.jar:./../lib/tomcat.jar:./../lib/xerces.jar org.apache.xerces.validators.datatype.InvalidDatatypeFacetException: [exception was kaffe.util.SupportDisabled: GNU gmp was not found by Kaffe configure script] at java.lang.Throwable.fillInStackTrace(Throwable.java:native) at java.lang.Throwable.init(Throwable.java:38) at java.lang.Exception.init(Exception.java:24) at org.apache.xerces.validators.datatype.XMLException.init(XMLException.java:line unknown, pc 0x83edb81) at org.apache.xerces.validators.datatype.InvalidDatatypeFacetException.init(InvalidDatatypeFacetException.java:line unknown, pc 0x851108a) at org.apache.xerces.validators.datatype.DatatypeValidatorFactoryImpl.createDatatypeValidator(DatatypeValidatorFactoryImpl.java:line unknown, pc 0x83491f2) at org.apache.xerces.validators.datatype.DatatypeValidatorFactoryImpl.createDatatypeValidator(DatatypeValidatorFactoryImpl.java:line unknown, pc 0x839bdfe) at org.apache.xerces.validators.datatype.DatatypeValidatorFactoryImpl.initializeRegistry(DatatypeValidatorFactoryImpl.java:line unknown, pc 0x83a71a7) at org.apache.xerces.validators.datatype.DatatypeValidatorFactoryImpl.init(DatatypeValidatorFactoryImpl.java:line unknown, pc 0x8337fca) at org.apache.xerces.validators.datatype.DatatypeValidatorFactoryImpl.clinit(DatatypeValidatorFactoryImpl.java:line unknown, pc 0x838826e) at org.apache.xerces.framework.XMLParser.init(XMLParser.java:line unknown, pc 0x8339456) at org.apache.xerces.parsers.SAXParser.init(SAXParser.java:line unknown, pc 0x82ad68a) at org.apache.xerces.jaxp.SAXParserImpl.init(SAXParserImpl.java:line unknown, pc 0x82c50ba) at org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParser(SAXParserFactoryImpl.java:line unknown, pc 0x82ad1ae) at org.apache.tomcat.util.xml.XmlMapper.readXml(XmlMapper.java:213) at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:189) at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:237) 2000-10-30 08:07:50 - ContextManager: Adding context Ctx( /examples ) 2000-10-30 08:07:51 - ContextManager: Adding context Ctx( /admin ) Starting tomcat. Check logs/tomcat.log for error messages No apps in webapps/ 2000-10-30 08:07:59 - PoolTcpConnector: Starting HttpConnectionHandler on 8081 Gregory Guthrie [EMAIL PROTECTED] (641)472-1125 Fax: -1103