Re: servlet unavailable
On September 16, 2003 11:27 am, Dorin Ciuca wrote: Hi, In what circumstances tomcat (4.1.x) set a servlet unavailable ? Is it possible that a servlet is set unavailable after a high load ? Some users of my web application report error page HTTP Status 503 - Servlet xxx is currently unavailable. Thanks, Dorin Sometimes, the servlet is unavailable because the container has encountered some errors during the servlet's loading (for example, invalid web.xml). In that case, you can find error messages in the logs. Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Installing Tomcat as a Service
On August 20, 2003 04:19 am, Stuart Stephen wrote: Hi all, How might I go about installing Tomcat as a service in RedHat 9.0. I've never installed a service under linux manually before and I'm not sure what to do. I can't find the appropriate documentation in the manuals for either Tomcat or RedHat. I must be looking in the wrong places :O( UNRELATED: Also, If I wanted to install a java program as a service, how might I do this? Is this a similar process? Regards, Stuart man chkconfig man serviceconf man init For a Java program, write a wrapper shell script like Tomcat authors did with catalina.sh. Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Installing Tomcat as a Service
On August 20, 2003 10:56 am, Stuart Stephen wrote: Thanks for the reply, I've tried creating a script in the /etc/init.d directory and then running the chkconfig --add script-name and this hasn't worked for me. I'm getting an error saying that: service service-name does not support chkconfig I must still be doing something wrong? The script has the same permissions showing in the ls -l list? It's not about permissions, it's about the format of the script. From the chkconfig man page: - RUNLEVEL FILES Each service which should be manageable by chkconfig needs two or more commented lines added to its init.d script. The first line tells chkconfig what runlevels the service should be started in by default, as well as the start and stop priority levels. If the service should not, by default, be started in any runlevels, a - should be used in place of the runlevels list. The second line contains a description for the service, and may be extended across multiple lines with backslash continuation. For example, random.init has these three lines: # chkconfig: 2345 20 80 # description: Saves and restores system entropy pool for \ # higher quality random number generation. This says that the random script should be started in levels 2, 3, 4, and 5, that its start priority should be 20, and that its stop priority should be 80. You should be able to figure out what the description says; the \ causes the line to be continued. The extra space in front of the line is ignored. - Make sure your script has this line and ALL three numbers are present (read above to figure out what they are): # chkconfig: 2345 20 80 Paul -Original Message- From: Paul Yunusov [mailto:[EMAIL PROTECTED] Sent: 20 August 2003 13:24 To: Tomcat Users List Subject: Re: Installing Tomcat as a Service On August 20, 2003 04:19 am, Stuart Stephen wrote: Hi all, How might I go about installing Tomcat as a service in RedHat 9.0. I've never installed a service under linux manually before and I'm not sure what to do. I can't find the appropriate documentation in the manuals for either Tomcat or RedHat. I must be looking in the wrong places :O( UNRELATED: Also, If I wanted to install a java program as a service, how might I do this? Is this a similar process? Regards, Stuart man chkconfig man serviceconf man init For a Java program, write a wrapper shell script like Tomcat authors did with catalina.sh. Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: servlet question
On Tuesday 27 May 2003 06:26 pm, Paul Hsu wrote: Hi, I try to forward a HTTP request from my servlet. I am using the following code. RequestDispatcher rd = getServletContext().getRequestDispatcher(direct); rd.forward(request, response); I have no problem with code, but I have one issue is how can I change the request method from POST to GET before I forward the original request. You can't accomplish this using the RequestDispatcher facility. You will have to generate a new HTTP request within the servlet and send it to the desired destination. Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to use this mail list
On Wednesday 02 April 2003 05:26 pm, HAMILTON, DALE K (SBCSI) wrote: Sorry I'm a newbie. I read the Jakarta site and the contents of the subscription emails. I wanted to get a list of past topics with [EMAIL PROTECTED] syntax, it doesn't seem to work. Where is a good reference on news list usage? Dale K. Hamilton http://jakarta.apache.org/site/mail.html Start from here. Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Form Auth
On Tuesday 01 April 2003 10:05 am, Michael D. Kirkpatrick wrote: I am not quite sure if this question is suitable for this mailing list. If not, please forgive me. I am using the form authentication for adding security to one of my apps. Since this app will be in use with several web sites, I am forced to pass something like ?site=somesite in my url. The problem that I am running into is that on the actual login form, I do not have access to the original query string. The login page has 2 links: Create account and Recover Password. I need that original query string so I can reference the proper web site's information. What I have access to is the query string of /some_app/login.jsp?name=value for displaying the login screen. That query is what I have placed in web.xml. So here is my question. How can I capture the original query string or make the query string in web.xml dynamic? I have a gut feeling you want to know how to keep a parameter across requests. There is an abstraction called session for storing data across multiple servlet requests from the same client. Check the javax.servlet.http.HttpSession interface and, in particular, its setAttribute and getAttribute methods. Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Configuration of tomcat
On Friday 14 March 2003 01:53 pm, Eamonn Walsh wrote: Could you please help me with the following problem. I have installed the JDK and tomcat successfully on my PC. I am now ready to develop my own web application using JSP. I have admin rights on the PC. How do I set the context so that when I sdave my JSP files on my hard dsik, tomcat will know where they are? Regards, Eamonn I understand you want to save your webapp files in a non-default location. You can set your own docBase for any context in server.xml or a separate context conf file. Go to the Tomcat doc page at http://jakarta.apache.org/tomcat/tomcat-4.1-doc/ and find the Server Configuration Reference link. After following it, go to the Context page (the link is under Containers on the left hand side) and find the docBase paragraph under Attributes. It won't hurt reading the whole page though. Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: unable to start admin app...Can someone please respond
On Friday 14 March 2003 09:16 am, krip pane wrote: All, Can someone please help with running the admin application (running on solaris 2.8, tomcat4.1.18). I keep getting the following errors (truncated): 2003-03-13 09:17:18 WebappLoader[/admin]: Deploying class repositories to work directory /opt/jakarta-tomcat-4.1.18/work/Standalone/localhost/admin 2003-03-13 09:17:18 WebappLoader[/admin]: Deploy class files /WEB-INF/classes to /opt/jakarta-tomcat-4.1.18/webapps/../server/webapps/admin/WEB-INF/classes 2003-03-13 09:17:18 WebappLoader[/admin]: Deploy JAR /WEB-INF/lib/struts.jar to /opt/jakarta-tomcat-4.1.18/webapps/../server/webapps/admin/WEB-INF/lib/stru ts.jar 2003-03-13 09:17:19 ContextConfig[/admin] Exception processing JAR at resource path /WEB-INF/lib/struts.jar javax.servlet.ServletException: Exception processing JAR at resource path /WEB-INF/lib/struts.jar at org.apache.catalina.startup.ContextConfig.tldScanJar(ContextConfig.java:930 ) - Root Cause - java.io.IOException: Permission denied at java.io.UnixFileSystem.createFileExclusively(Native Method) at java.io.File.checkAndCreate(File.java:1313) at java.io.File.createTempFile(File.java:1401) at java.io.File.createTempFile(File.java:1438) Please help. TIA Make sure the user that runs Tomcat owns CATALINA_HOME all the way down or has a write permission for it. If it's a real pain, do this (dangerous because you are making CATALINA_HOME writable for everyone): su chmod a+wx $CATALINA_HOME Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: A strange problem
On Friday 14 March 2003 01:55 pm, V Y wrote: Dear All: I come across a very strange error and appreciate any help/tips. My env: I am using Jakarta Tomcat 4.1.12 (on Linux) and 4.1.18 (on Solaris). I have installed MySQL JDBC connector and I have written some JSP code to input/retrieve data from my MySQL database. The MySQL DB is running on the Linux box. In my JSP code, I used a lot of these methods to get around between pages: RequestDispatcher dp = getServletContext().getRequestDispatcher(some path to a page); dp.forward(request, response); At some other pages that does not have JSP, the standard HTTP post is used for going to the next page. I have also some backend Java code that sits in the shared/lib directory that my JSP code will interact with. I have worked on this for about a month and just this week, I came to notice this problem. A single operation involves 4 pages of fill-in-blanks on different forms. I would go through one cycle (the 4 pages) once. Redirect back to the beginning and if I would go through right away the same cycle, I would choke in between pages. The browser is spinning after I press that Continue button and after a while would display the standard Page cannot be loaded message. If I restart the servlet engine, everything is fine again for the first time and the cycle repeats. If I comment out the RequestDispatcher section above from a page that it was choking on, then it displayed that page just fine. Everything seems to point to the RequestDispatcher not able to actually forward to the next page. Sometimes, those static HTTP post pages have the same problems too though not as consistent. Not sure what I did wrong. I did not do any extra config and use Tomcat right out of the download. Any help/tip much appreciated --Vincent The JSP page that forwards to the next one has its own response (the generated HTML) wiped out when the forward method is called because that's how the forward method works: forward should be called before the response has been committed to the client (before response body output has been flushed). If the response already has been committed, this method throws an IllegalStateException. Uncommitted output in the response buffer is automatically cleared before the forward. (from the Servlet 2.3 API spec) In general, using RequestDispatcher's forward method in a JSP page is ineffective because JSPs' purpose is to generate the final response (usually, HTML) and the RequestDispatcher's purpose is to delegate producing the response to another resource. Try to use the RequestDispatcher's include method or one of the include tags to have several JSPs produce a single response (HTML) together. Remember, a JSP is just a template to generate HTML and using it for any other purpose such as coordinating workflows is an invitation for trouble. Introduce a controller servlet instead but discussing this is beyond the scope of this mailing list (as, in fact, all of the above but since Tomcat is a reference implementation of the Servlet/JSP spec, people close their eyes on this. They do, right?) Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Catalina Ant tasks
People complained about a lack of documentation for Catalina Ant tasks. The best fairly accessible document I could find to date is the App Dev Guide at the Tomcat doc site. However, I also strongly suggest looking at the tasks' source code. Look under /catalina/src/share/org/apache/catalina/ant/ in the source distribution. It can tip you off as to allowed task attributes and reveal things like that the tasks are implemented using java.net.URLConnection. ;) It's strange that Catalina tasks are not list in the external task list at the Ant site. Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Catalina Ant tasks
On Friday 21 February 2003 05:51 pm, Rasputin wrote: * Paul Yunusov [EMAIL PROTECTED] [0205 22:05]: People complained about a lack of documentation for Catalina Ant tasks. Not complaints as such, just wondered if there was any really :) best fairly accessible document I could find to date is the App Dev Guide at the Tomcat doc site. However, I also strongly suggest looking at the tasks' source code. Look under /catalina/src/share/org/apache/catalina/ant/ in the source distribution. It can tip you off as to allowed task attributes and reveal things like that the tasks are implemented using java.net.URLConnection. ;) Allowed attributes is what I was after - thanks Paul. Glad I could be of help :) Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ant deploy task?
On Thursday 20 February 2003 06:43 am, Rasputin wrote: * John Ruffin [EMAIL PROTECTED] [0205 18:05]: I asked this same question last week - with no response. What I did was tell TC to not auto-expand and get everything from the war file itself. Ant will copy the war file to catalina_home/webapps. Then I use Manager to stop and start the app - restart doesn't work for me. Testing Best Practices from the seasoned folks on the list is greatly appreciated. That works a treat - thanks John, Obviously the file being physically in webapps means it survives a reboot without requiring edits to server.xml too. I just need to figure out how to remove them now: a delete task takes care of the WARfile, then a remove ant task will drop the context, but I get problems if the remove fails while the file is still there. Does anyone jnow where the documentation for the catalina ant tasks is? Ant install task doesn't create any war files. It creates a context with the docBase at the same location as your build files. There is no need at all for any war files to use Ant's Catalina tasks. Please read the App Dev Guide at the Tomcat doc site. It is extremely useful. Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tomcat ant tasks (docs?)
On Thursday 20 February 2003 12:51 pm, Wendy Smoak wrote: On advice given here, I've got tomcat configured to _not_ unpack my .war file. Then my ant 'deploy' target [not task] simply copies the .war file over to /path/to/tomcat/webapps. Wendy, why are you dealing with war files during development at all? Ant does a great job installing and reloading from docBases at arbitrariry locations on the filesystem. I may not have read into your problem carefully enough but the very mentioning of war files with Ant Catalina tasks being used for something other that final distribution causes misgivings about your setup. Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ant deploy task?
On Wednesday 19 February 2003 12:55 pm, Wendy Smoak wrote: What's the least amount of work I can do to deploy a new version of my webapp? I've been cheating and developing directly under the webapps directory. Now I've moved to a separate directory structure and am building a .war file which gets copied over to webapps. Since Tomcat auto-expands the war file, I find I have to delete the directory and restart in order to get the new version in place. I found an ant task named 'deploy' but it doesn't seem to be apparently requires another .jar file, and I'm having no luck finding that with Google. It isn't, as far as I can tell, a core ant task: W:\java\bendevant deploy Buildfile: build.xml deploy: BUILD FAILED file:W:/java/bendev/build.xml:136: Could not create task or type of type: deploy. Ant could not find the task or a class this task relies upon. target name=deploy depends= deploy url=http://my.development.box; path=${context} war=${dist}/${context}.war username=wendy password=password / /target I'm also not sure how this is going to work... Tomcat is on the same machine so right now I'm just copying the war file over. Would it be better to use the 'install' or 'restart' tasks instead? Thanks, Wendy, There is a wonderful document on the Tomcat's website called App Developer Guide that shows some best practices for project and build management. Its sample application relies on Ant tasks you're interested in and a full build.xml is provided. Ant makes building and deploying webapps a breeze, and I wish all Tomcat users read that little guide to make their lives easier. Thanks again to Craig for authoring it. Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: deployment with ant
On Wednesday 19 February 2003 09:14 am, Rasputin wrote: Does the install ant task from 'catalina-ant.jar' work for anyone? When I try to use it works fine until I restart the server - it seems like the install task uses a HTTP PUT to put the warfile under work/ then catalina edits its own server.xml so the new context will survive a reboot. This is just what I need, but it seems to write invalid xml back to it. Have you read this: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/context.html scroll down to the fourth paragraph under Introduction (In addition to nesting..., etc). Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Redirect and Tomcat
On Thursday 30 January 2003 11:34 am, Erik Price wrote: Daniel Brown wrote: This was news to me too. But, from the horse's mouth: [...] So, in theory, you should generate a 303 response if the request method was POST, and the web page you're redirecting to should be retrieved with a GET. But in practice, the web browser will do just what you expect it to do if a 302 response is received. Hm... yes, in practice it works (currently that is how my app handles logins and it works in all browsers AFAIK), but at some point someone might implement the spec. I always try to write in compliance of the spec, so what I'm wondering is how I can specify that the sendRedirect should use GET instead of the original method, which was POST. (I seem to recall reading somewhere that sendRedirect uses the original method.) Erik Section 10.3.4 of RFC 2616 (HTTP/1.1) addresses your problem: quote 10.3.4 303 See Other The response to the request can be found under a different URI and SHOULD be retrieved using a GET method on that resource. This method exists primarily to allow the output of a POST-activated script to redirect the user agent to a selected resource. The new URI is not a substitute reference for the originally requested resource. The 303 response MUST NOT be cached, but the response to the second (redirected) request might be cacheable. The different URI SHOULD be given by the Location field in the response. Unless the request method was HEAD, the entity of the response SHOULD contain a short hypertext note with a hyperlink to the new URI(s). Note: Many pre-HTTP/1.1 user agents do not understand the 303 status. When interoperability with such clients is a concern, the 302 status code may be used instead, since most user agents react to a 302 response as described here for 303. /quote Again, setStatus() and sendRedirect() in HttpServletRequest are your friends here. I pulled the information above from rfc-editor.org. Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Redirect and Tomcat
On Wednesday 29 January 2003 07:52 pm, Roman Shpak wrote: 30 ñÎ×ÁÒØ 2003 01:49, Filip Hanik ÎÁÐÉÓÁÌ: not really sure what you are asking, but response.sendRedirect(...) in HttpServletResponse will do that Yes, of course, I know it. But problem is in redirect one url to another without any program code in servlet or jsp. Why? It needs for forward all request from https://www to https://... so if try to do this with response.sendRedirect(...) catchs warning box. But if using Apache which has directive redirect in conf file warning box never shows. So has Tomcat similar directive? Thanks. Roman, The HTTP1.1 spec says the client should follow the redirect only if the method is GET or HEAD, so check that. Also, check the status code for the response. Apache 1.3.27 uses HTTP status 302 with its Redirect directive by default. It's not clear what status Tomcat uses for sendRedirect() from the servlet specs, which only say Sends a temporary redirect response to the client using the specified redirect location URL. You can try different 3xx status codes using setStatus() from HttpServletResponse. Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: hi,I need your hand to get rid of my question
On Saturday 25 January 2003 10:45 pm, zhaoyw wrote: Dear: I am a programer ,my web Container is tomcat 4.1.12,when i develope my project,i usually change my class,these classes are used by some jsp pages,so when i launch my web application,i look the jsp page result in the IE explore,but now i need to change my class to meet my new need,i want to see the new result of the jsp,however,the tomcat can not response my change immediately ,fortunately there is a reloadable value configed in the file server.xml,the default reloading interval is 15 seconds,i want to decrease the interval to 1 second to see the new jsp as soon as possible,what shall i do ? sincerly,yours [EMAIL PROTECTED] This should help: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/manager-howto.html Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Logging
On Monday 20 January 2003 10:59 am, Reynir Hübner wrote: Is it possible somehow to set the logger in tomcat (FileLogger) so that it will tell which application the exception happenes. My problem is this : I have a server running serveral virtual hosts, most running the same web-applications. When an exception is caused it gets stack-trace-printed to the standard out, but it's impossible for me to determine which application it happenes in. Is it possible to configure the FileLogger to display where it happenes ? Thanx -reynir Reynir, Assuming your Tomcat version is 4.1.x, visit here: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/context.html then scroll down to Attributes-Standard Implementation and check swallowOutput out. HTH, Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Logging
On Monday 20 January 2003 11:42 am, Reynir Hübner wrote: allright, how could I miss that.. Thanx man, -reynir No problemo. Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Changes in jsps do not appear
On Saturday 11 January 2003 11:15 pm, Michael Muratet wrote: Greetings I am using Tomcat 4.1.10 in its standalone mode. My understanding of the documentation is that every time a jsp is requested, the source is checked and reparsed if it is more recent than the object in memory. (Where would this be?) I have a jsp that I have changed, but the changes do not appear. I have reloaded the web app via the manager app, and I have even restarted tomcat and still no change. I don't see anything in the logs that would indicate a problem, although I'm not sure what I'm looking for. Does anybody have any ideas where to start looking? Thanks. Mike Try posting the relative path to your JSP file on the server and the URL you use to access it. While you're at that , you could check if you did save the updated copy on the server or not. I personally have never had a problem like yours. Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Can't find JAVA_HOME
On Sunday 12 January 2003 03:34 am, David Durst wrote: I just dumped the tomcat 4.1.18 from RPM onto a system. It can't seem to find JAVA_HOME. I echo $JAVA_HOME and it comes back perfect, any clues Specific error messages and echo output, please? Also, you could be running Tomcat as one user and echo as another - environments are going to be different. Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: http://localhost and DNS
On Sunday 12 January 2003 02:23 pm, Tomislav Miladinovic wrote: Hi All, Very often I am experiencing problem to browse http://localhost even I use dot notation http://127.0.0.1 it seems to me there is some problem with my access to ISP's DNS server. I would like to ask any one from Canada using Rogers' ISP about their experience, let me know please have you experienced this problem. One question more, do I need some extra permission/service from ISP company to run web server application at my computer. Regards, Tomislav http://www.wikipedia.org/wiki/Off_topic Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: help - tomcat/dbcp deployment
On Sunday 12 January 2003 02:50 pm, David Durst wrote: Well, to get DBCP working was not difficult at all. I just followed Tomcat how-to docs. And, as I learned from other people, it's being used on a production level. My Tomcat's version is 4.1.12. Thank you. Igor TN I have been trying to get this damn thing working w/ postgres for about a week now. I got it working on 1 machine (MY DESKTOP) from a completely fresh install of 4.1.18 w/ J2SDK 1.4. I attempted to duplicate the enviroment on the development server, and I think I have achieved duplication, BUT it still doesn't work. It seems not not be able to find the JDBC driver, it thinks the driverClassName I am passing through is NULL. Try putting the driver's jar file in $JAVA_HOME/jre/lib/ext Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: interesting java.lang.NullPointerException error when first viewing an index.jsp page - refresh once and page loads correctly
On Friday 10 January 2003 05:49 pm, Brandon Rodak wrote: Paul, Here is a link to the Java - http://www.flex-internet.com/java.txt Thanks again for your help Brandon Rodak Web Services Computer Marketing Corporation http://www.cmcflex.com http://www.flex-internet.com Brandon, the scriptlet in your jsp gets your server's cookies from the client: Cookie[] cookies = request.getCookies(); but on the initial request, there are no cookies set by your server on any given client, so getCookies() returns null in accordance with the servlet spec. That triggers a NPE when you try to process the cookies later: for (int i=0; icookies.length; i++) { ... } Put an if statement around your for loop to check if cookies is null or not and that should fix your problem. Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: HTTP Status 404 with Tomcat 4.1.18
On Saturday 11 January 2003 08:13 am, Nihita Goel wrote: I have added the Context information in server.xml as Context path= docbase=ROOT debug=0/ Context path=/myapp docBase=myapp debug=0/ I checked the localhost log file and I can see messages Webapploader[/myapp]:Deploying class repositories to work directory $CATALINA_HOME/work/Standalone/localhost/myapp WebappLoader[/myapp]: Deploy class files /WEB-INF/classes to $CATALINA_HOME/webapps/myapp/WEB-INF/classes StandardManager[/myapp]: Seeding random number generator class java.security.SecureRandom StandardManager[/myapp]: Seeding of Random Number generator is complete StandardManager[/myapp:default]: Loading servlet default StandardManager[/myapp:invoker]:Loading container servlet invoker My class files are present in $CATALINA_HOME/Webapps/myapp/WEB-INF/classes directory and the web.xml is present in the WEB-INF directory I still get the error HTTP Status 404 with description the requested resource /myapp/servlet/TestServlet is not available. NG You don't need to add a context for your webapp to server.xml. Add this to your webapp's web.xml: servlet servlet-nameAnyNameWorks/servlet-name servlet-classTestServlet/servlet-class /servlet servlet-mapping servlet-nameAnyNameWorks/servlet-name url-pattern/AnotherNameWorksHere/url-pattern /servlet-mapping Then try accessing the servlet with this URL: http://localhost:8080/AnotherNameWorksHere Tomcat requires you to map all your resources like servlets to URL patterns. Before Tomcat 4.1.12 a special servlet called Invoker was automatically mapped to /servlet/* pattern and it invoked your servlets for you. You can find commented out lines related to that in the server's web.xml in the conf directory. If you want more info search this list and check out conf/web.xml. Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Document Root
On Saturday 11 January 2003 10:57 am, Jonathan Villa wrote: I just started messing around with Tomcat and would like to know if I can change the Document Root to a location which I prefer. For example, my machine (windows) has 2 partitions, c: and d:. C is where I store my program files, including Apache, Netbeans, Tomcat, etc. And D is where I have source code files which run under Apache. In my httpd.conf file I have DocumentRoot d:/is/clients/. Now what makes this a Tomcat question is that I would like to have d:/is/java (notice that it's not under my apache docroot) as my directory for my java source code, so how can I do it. Foolish question but need clarification. What are the differences between c:/tomcat/work/standalone/localhost and c:/tomcat/webapps. For example where do I put my code?!? I am wondering because the docs say c:/tomcat/webapps, but yet when I hit localhost/examples/... it goes to c:/tomcat/work/standalone/localhost. Hope I make sense. Jonathan Villa Application Developer IS Design Development isdesigndev.com 414.429.0327 Check this out: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/host.html in particular, the appBase attribute. and this: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/context.html and the docBase attribute. As for the work directory, it shouldn't bother you at all because it's for internal Tomcat use. The webapps directory is the default location for your web applications in Tomcat. You can change that location using the information from the first link above. Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Basic questions
On Saturday 11 January 2003 03:34 pm, Denise Mangano wrote: Hey all :) Throughout my learning experience with Tomcat, I have gotten curious about the following things. This is mostly just for informational purposes. Inquiring minds want to know ; ) #1: Is it possible to set Tomcat to restart (as user tomcat) on a schedule? #2: Is there anyway to set something up that if a user attempts to access my app within a specific time frame they are redirected to a different page. For example, when my user accesses my webapp they go to www.myhost.com/mywebapp and they are brought to index.jsp page. However, if the same exact URL is accessed within a specific time frame, they would be brought to index2.jsp. Thanks! Denise Hi, #1: It's OS-specific, and you can do it in a few ways, from writing a shell script to developing a native application. If you use UNIX, try man crond at the prompt. #2: Have a Controller servlet that will forward (RequestDispatcher comes to mind) to different JSPs based on any criteria including time. Ah, the advantages of Model 2... Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: A transport-guarantee problem with 4.1.18
On Saturday 11 January 2003 03:40 pm, Peter Lee wrote: I asked this earlier, but I still got problems with it. I upgraded to 4.1.18, but I got some problems with security constraints. I have applied a security constraint on a particular url pattern. Only certain users with a special rolename can access that link. The data transportation is also secure, therefore I put in a transport-guarantee in web.xml user-data-constraint transport-guaranteeCONFIDENTIAL/transport-guarantee /user-data-constraint It used to work but now the page does not load with v4.1.18. I got a blank page instead of a login page. Is SSL implemented differently v4.1.18 that prevents my application from working like before? I think it has to do with rolenames. I put in the needed role in tomcat-user.xml already. Did I miss something? Is there any documentation on tomcat v4.1.18 SSL security stuff? Here is my security constraint in web.xml: !-- Secure form URLs of the form http://localhost/Prefix/mypage require SSL and are redirected to https://localhost/Prefix/mypage -- security-constraint web-resource-collection web-resource-nameSSLspecial/web-resource-name url-pattern/protectedpage/*/url-pattern /web-resource-collection auth-constraint role-namespecialrole/role-name /auth-constraint user-data-constraint transport-guaranteeCONFIDENTIAL/transport-guarantee /user-data-constraint /security-constraint Did you read this? http://jakarta.apache.org/tomcat/tomcat-4.1-doc/ssl-howto.html Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Basic questions
On Saturday 11 January 2003 04:55 pm, Steve R Burrus wrote: Denise, can you figure out why this servlet doesn't seem to work for me at all. It's called the GreetingServlet.java I am not Denise but I thought I'd throw something on the table. Change your web.xml as shown below. You got your servlet-mapping element wrong before. After that just make sure GreetingServlet.class is in webapps/whatever your webapp name is/WEB-INF/classes and you're ready to go (http://localhost:8080/your webapp name goes here/MyOwnServlet should work then). web-app servlet !-- Servlet alias -- servlet-namegreeting/servlet-name !-- Fully qualified Servlet class -- servlet-classGreetingServlet/servlet-class /servlet servlet-mapping servlet-namegreeting/servlet-name url-pattern/MyOwnServlet/url-pattern /servlet-mapping /web-app Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: How do I...
On Friday 10 January 2003 12:08 pm, Luc Foisy wrote: Get out put to go into the context specific logs rather than catalina.out?? Hello, This http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/context.html tells about using the Context element in server.xml to configure a webapp. Scroll down and note the Logger entry under Nested Components. I hope this helps. Incidentally, the link above is prominently accessible from the Server Configuration Reference, which, in turn, is available by clicking on Tomcat 4.1 under DOCUMENTATION on the Tomcat main page. I think the Tomcat documentation rocks. Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: How do I...
On Friday 10 January 2003 01:18 pm, Dan Lipofsky wrote: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/context.html tells about using the Context element in server.xml to configure a webapp. Scroll down and note the Logger entry under Nested Components. I hope this helps. I have the same question as Luc. I set up a Context with a Logger inside. Messages such as JSP compile errors go to the Logger I set up, but messages that are printed to System.out still show up in catalina.out. I read the docs above but I don't see how to change this. Thanks, Dan You can't do that individually for contexts, AFAIK. Use ServletContext.log() instead of System.out.println() to manage log output with Context-specific Loggers. You can change the destination of all System.out's for your entire Catalina engine if you edit catalina.sh. System.out is whatever standard output Catalina is pointed at, and, respectively, System.err is whatever standard error output Catalina is pointed at. Standard output and standard error output are OS concepts and they can be set to a file, console, etc. when running the actual server startup command. That command is a part of the catalina.sh script (and its Windows equivalent). Search that script for /logs/catalina.out and you will see the output streams' redirection in action. The above is based on the assumption that you use Tomcat 4.1.x. Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: How do I...
On Friday 10 January 2003 02:24 pm, Luc Foisy wrote: Thanks paul, that was some kind of answer I was looking for. Since the documentation said this (after looking at it again just moments ago) Standard Error Logger (org.apache.catalina.logger.SystemErrLogger) The Standard Error Logger records all logged messages to whatever stream the standard error output of Catalina is pointed at. The default Catalina startup script points this at file logs/catalina.out relative to $CATALINA_HOME. This logger supports no additional attributes. Standard Output Logger (org.apache.catalina.logger.SystemOutLogger) The Standard Output Logger records all logged messages to whatever stream the standard output of Catalina is pointed at. The default Catalina startup script points this at file logs/catalina.out relative to $CATALINA_HOME. This logger supports no additional attributes. So I was guessing that context specific stuff couldnt be managed for System.out At the moment we have a jar file application (non web) so in development mode we have stuff going through System.out When we deploy to the web, there are a few extra classes to bridge the application with the web side of things. So in my jsp's we can simply call this ServletContext.log(), what would be the best way to snafu all the System.out and push it through ServletContext.log()?? And here is my nomination for Context specific System.out logging done by tomcat! :) o.a.c.logger.SystemOutLogger and o.a.c.logger.SystemErrLogger do the opposite of what you want. They direct all ServletContext.log() for a specific Context to the Catalina's standard output or standard error output respectively. Like I said I believe you can't cheat System.out.print() into working like ServletContext.log(), which gives you the convinience of per-Context Loggers. You can only change the entire Tomcat engine's standard (error) output to a destination other than $CATALINA_HOME/logs/catalina.out as laid out in my previous message. You may have to write a Perl script or use sed (or a Windows equivalent, if any) to replace every occurance of System.out.print()/println() with calls to a good logging API like commons-logging or log4j. Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Logs - Logger
On Friday 10 January 2003 02:23 pm, Lindomar wrote: Well, here i´m again... How was explain to me, and i see after on tomcat's docs, if i want to save all my System.out.println on log file, is necessary i place on server.xml, as following: Context ... ... !-- don't work this two lines-- Logger className=org.apache.catalina.logger.SystemErrLogger/ Logger className=org.apache.catalina.logger.SystemOutLogger/ !-- here is ok -- Logger className=org.apache.catalina.logger.FileLogger debug=0 .../ ... /context But i see nothing on logs that contains what i see on DOS Prompt (the System.out.println). I read this link, but what i found, was what you said. http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/logger.html Has anyone more any idea? Thanks again! Check out the How do I... thread from a few minutes ago. Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: dispatcher.forward(), but with new URL
On Friday 10 January 2003 02:14 pm, Erik Price wrote: Hi, Sorry if this is too simple a question, I'm still just getting my first JSP/servlet application underway. I have a servlet called LoginServlet, that is passed some POST parameters and does some processing with them. There are two possible outcomes -- one is that the authentication fails and the user is sent to a page indicating that they failed to log in. The other outcome is that the user is taken to main.jsp, which is a JSP that I have written which serves as a kind of welcome page for logged-in users. The technique that I would use to do this redirection is to call getRequestDispatcher() from the servlet context and employ the forward() method of the RequestDispatcher object. The problem is that doing so preserves the original URL of LoginServlet. My question is: how can I send the user to main.jsp without using dispatcher.forward(), so that the URL is appropriately displayed as main.jsp (plus any other URL parameters such as URL-encoded session data, etc)? I would like to do this without using filters since I haven't learned how to use these yet. Thank you, Erik Hi Erik, sendRedirect() in HttpServletResponse will send an HTTP redirect response to the client so the client's browser itself makes a new request to the new URL (main.jsp in your case). It results in the new URL being shown in the browser's address field. Note that the original request's parameters, which were sent to the servlet, are lost but check the sendRedirect()'s documentation for more details. Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: dispatcher.forward(), but with new URL
On Friday 10 January 2003 03:42 pm, Erik Price wrote: Paul Yunusov wrote: sendRedirect() in HttpServletResponse will send an HTTP redirect response to the client so the client's browser itself makes a new request to the new URL (main.jsp in your case). It results in the new URL being shown in the browser's address field. Paul, this is exactly what I was looking for! Thank you. My only fear is that if the client User Agent doesn't respect the HTTP Redirect (say it is a malicious Perl script or something), does the servlet know not to transmit any further data? Or should I manually call System.exit() after the response.sendRedirect() call? Well, the API docs say After using this method, the response should be considered to be committed and should not be written to so I guess the developer rather than the servlet should know not to transmit any further data from the servlet. Definitely no System.exit() in servlets as that would theoretically attempt to shut down the Tomcat process itself but I don't know anything about any practical repercussions. You could try that and let us know what happened. :-) Note that the original request's parameters, which were sent to the servlet, are lost but check the sendRedirect()'s documentation for more details. That is okay, I will be storing data in the session in the LoginServlet so the original parameters can be dropped. Thank you very much again. Yes, holding the data in the session is what I thought you'd do, and I am glad I could be of any help. Erik Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Context elements question
On Friday 10 January 2003 03:53 pm, Charlie Toohey wrote: per the Tomcat configuration documentation at http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/context.html you MUST define a Context with a context path equal to a zero-length string. This Context becomes the default web application for this virtual host, and is used to process all requests that do not match any other Context's context path. I have two questions about this statement: 1) I don't have a Context meeting this description and everything seems to work fine, so what are the ramifications of violating this ? Charlie, if you click on the Automatic Application Deployment link in the fourth or fifth paragraph on the same page, you will read the following: Automatic Application Deployment * Any XML ... * Any web... * Any subdirectory within the Application Base directory that appears to be an unpacked web application (that is, it contains a /WEB-INF/web.xml file) will receive an automatically generated Context element, even if this directory is not mentioned in the conf/server.xml file. This generated Context entry will be configured according to the properties set in any DefaultContext element nested in this Host element. The context path for this deployed Context will be a slash character (/) followed by the directory name, unless the directory name is ROOT, in which case the context path will be an empty string (). The last sentence seems to address your question but you could try deleting the ROOT directory, restarting Tomcat and seeing what happens then. 2) If I were to follow this, and did not have an actual webapp with a zero-length string as the context path (meaning that I would not have anything valid to specify for docBase), would I then just create a dummy webapp in directory ROOT (or wherever) just so that I could comply with this ? - Charlie Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: How do I...
On Friday 10 January 2003 04:03 pm, Luc Foisy wrote: Could I pass the ServletContext to my jar application, and reroute System.out in there with System static void setOut(PrintStream out) ? Do you see any issues with that? I briefly looked at the Tomcat source to see what it was doing Catalina.java is just routing all System.out to SystemLogHandler.java ( which is a PrintStream ) Not quite sure at the moment where the Contexts come into play ( not sure where they are linked to that same SystemLogHandler ) Where does the context logger parameter from server.xml get loaded in? What do you think Tomcat would do if I snafu'd my System.out? I guess you could write a custom OutputStream subclass for the System.out in your non-servlet classes that would interface with the layer that connects those classes to the webapp and specifically with Logger instances. However, I think this approach would violate the KISS rule and attract the wrath of future generations of programmers (or your colleagues). It's really easier to replace System.out.print() with commons-logging calls judging from the information you supplied but it's your call. Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: interesting java.lang.NullPointerException error when first viewing an index.jsp page - refresh once and page loads correctly
On Friday 10 January 2003 04:15 pm, Brandon Rodak wrote: This may be a rather easy issue but with my limited knowledge of Tomcat - I thought one of you more qualified folks would have a solution. Whenever I visit the initial index.jsp (via index.htm as a workaround) page I get the following server error: java.lang.NullPointerException at org.apache.jsp.index$jsp._jspService(index$jsp.java:75) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) and so on Clicking F5 or Refresh once loads the page - so you can see it is quite a nuisance - we have implemented Apache 1.3.27 with Tomcat 4.0.6 - I have also posted some lines of the catalina log and error logs for review below: It might help if you post some snippets from the JSP. The stack trace for the NPE gives you a clue where in the JSP to look for the culprit and what snippet to post. Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: instantiating a bean in a Servlet, not a JSP
On Friday 10 January 2003 04:19 pm, Erik Price wrote: Hi, I have another very basic question. If it is a problem tell me to leave, sorry. The index.html page has a form which lets users enter a username/password combo, which gets sent to LoginServlet. LoginServlet performs the authentication, and if it fails then the user is redirected to an error page. But if it succeeds, I want to instantiate a UserBean class (which I have created) and make the scope of that bean session. So that I can access this bean in later pages. I understand that I can have my JSPs create or refer to a named bean using jsp:useBean id=nameOfInstance class=UserBean scope=session / This is fine. But I would like to instantiate the bean in LoginServlet. How can I register the bean in the session scope for later JSP's to retrieve it? My first guess was that in LoginServlet I could call // ub is reference variable of instantiated UserBean HttpSession session = getServletContext().getSession(); session.setAttribute(nameOfInstance, ub); But I do not think that this is right. Later JSPs can access this instance of UserBean using id=ub No, the line of thought is correct but there are two problems: 1) there is no getSession() in ServletContext, use getSession() in HttpServletRequest. (HttpSession, as the name suggests, is specific to HTTP while ServletContext is application layer protocol agnostic). 2) id attribute in the jsp:useBean tag would be nameOfInstance, not ub. Thanks, Erik Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Cookies
On Friday 10 January 2003 04:23 pm, Luc Foisy wrote: Is the Cookie defined in the Servlet API permanent by default? It doesnt really say that in the docs. You might be able to assume that since you have a setMaxAge() method, but if you want to change it back to permanent, there would be no way to do so (not that I want to, just really wondering if its permanent) I looked at Cookie.java from jakarta-servletapi-4 and there is a line that says: private int maxAge = -1;// ;Max-Age=VALUE ... cookies auto-expire there. The constructor doesn't interfere with this either. I don't know if this is implementation-dependent or established somewhere in the spec. Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Context elements question
On Friday 10 January 2003 04:36 pm, Charlie Toohey wrote: Paul, That's exactly my point -- and my question. I do NOT have a ROOT directory, THEREFORE Automatic Application Deployment does not automatically create a Context element with context path equal to the empty string, THEREFORE I am violating the configuration docs which say that you MUST have a Context with a context path equal to a zero-length string. What are the ramifications of violating this ? Should I create a ROOT directory with dummy webapp just so that Tomcat will generate the Context element with context path equal to the empty string ? What will this do ? Why do the docs state that this is necessary ? - Charlie Well, Charlie, I guess the Craig's reply says it all. But then you have to wonder what special meaning Tomcat docs' authors put in the word MUST. Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: timestamps in catalina.out ?
On Saturday 04 January 2003 09:05 am, Rasputin wrote: I know it's technically System.err, but is there a way to add timestamps to it? Sorry if it'sa FAQ, I think I'm seeing problems in the threading code and this would help confirm or deny it. log4j will do that for you. You just need to set the appender to console and define the timestamp format. Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: reducing tomcat jasper memory footprint
On Monday 30 December 2002 02:37 pm, Julian Löffelhardt wrote: Hi, I'm using Apache 1.3.26 and 3 tomcat 4.0.4 instances with AJP13 loadbalancing . Our application is a CMS where all the published articles are generated offline as JSP-Files, one jsp per article. We had hige problems with the memory footprint. Due to the fact that every jsp is generated as a class and there are about 200 new artices per day the permanent segment of the JVM heap gets filled with all the classes, and I get an OutOfMemoryError. My workaround for now is setting -XX:PermSize and --XX:MapPermSize to higher values, but this just delays application hang-up. With 64 megs of permSize our Server had an approx. uptime of 1 day now it's about 3-4 days. Is there any way to unload jsp-Files (unload the class) ? llap, julian JAVAC leaks memory every time a JSP class is compiled. The more JSPs are compiled or the more often JSP classes are compiled, the more memory is leaked. You exacerbate this problem by generating a JSP per article often. IMHO, generating a JSP per article is misusing the technology. JSP is a templating solution whereas one JSP describes a layout of any number of end documents. I suggest you change your software to generate an HTML file per artcile rather than a JSP. Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: SSL Certificate
On Sunday 22 December 2002 04:41 pm, Rafael Fernandez wrote: Can somebody send me a link where I can find information on making my own SSL certificate? http://www.google.com/search?q=own+ssl+certificate Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Help needed to run Tomcat 4.1.12
On Wednesday 18 December 2002 06:27 pm, Ronin Quigley wrote: I am running Windows XP and have done the following: a.. Installed Jave SDK and set the path variable to stemRoot%\System32\Wbem;C:Java\bin; b.. Downloaded release version 4.1.12 of Tomcat c.. Set the variable JAVA HOME=C:\JAVA d.. Set the variable CATALINA_HOME= C:\TOMCAT\JAKARTA-TOMCAT 4.1.12 e.. Tested the above by doing the ECHO test and they were fine. The command prompt in Windows XP automatically defaults to C:\Documents and Settings\Go For It Web Design, how do I get a C:\ prompt? And once I get a C:\ prompt can I start it by the following? C:\ cd tomcat\jakarta-tomcat 4.1.12\bin startup.bat Any help would be much appreciated. Rocket To change the working directory to C: type C:\ and press enter in the command prompt (if my memory doesn't betray me - my Windows days are long gone). Your steps to start tomcat seem be correct but paths and names in the description of environment variables are a mess (JAVA_HOME should have the _, SystemRoot instead of stemRoot, C: must be followed by a \ in paths, there is a - instead of a space between jakarta-tomcat and 4.1.12 in the standard distribution, at least on Linux). I attribute this chaos to fast typing but I'd double check if I were you. My Windows experience taught me to avoid spaces in paths also. HTH, Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Help needed to run Tomcat 4.1.12
On Wednesday 18 December 2002 07:13 pm, Turner, John wrote: Agreedavoid spaces in pathnames if you can. As an aside, there is no reason to switch directories to start Tomcat. You can do so by typing something like c:\tomcat\bin\startup.bat from any command prompt in Windows. John Or, more generically, you can type %CATALINA_HOME%/bin/startup.bat at the prompt for the same result (I am only having a Windows flashback tonight, so again, if my memory doesn't betray me, the above should be correct. Otherwise, it's just a fantasy induced by UNIX). Paul -Original Message- From: Paul Yunusov [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 18, 2002 7:04 PM To: Tomcat Users List Subject: Re: Help needed to run Tomcat 4.1.12 On Wednesday 18 December 2002 06:27 pm, Ronin Quigley wrote: I am running Windows XP and have done the following: a.. Installed Jave SDK and set the path variable to stemRoot%\System32\Wbem;C:Java\bin; b.. Downloaded release version 4.1.12 of Tomcat c.. Set the variable JAVA HOME=C:\JAVA d.. Set the variable CATALINA_HOME= C:\TOMCAT\JAKARTA-TOMCAT 4.1.12 e.. Tested the above by doing the ECHO test and they were fine. The command prompt in Windows XP automatically defaults to C:\Documents and Settings\Go For It Web Design, how do I get a C:\ prompt? And once I get a C:\ prompt can I start it by the following? C:\ cd tomcat\jakarta-tomcat 4.1.12\bin startup.bat Any help would be much appreciated. Rocket To change the working directory to C: type C:\ and press enter in the command prompt (if my memory doesn't betray me - my Windows days are long gone). Your steps to start tomcat seem be correct but paths and names in the description of environment variables are a mess (JAVA_HOME should have the _, SystemRoot instead of stemRoot, C: must be followed by a \ in paths, there is a - instead of a space between jakarta-tomcat and 4.1.12 in the standard distribution, at least on Linux). I attribute this chaos to fast typing but I'd double check if I were you. My Windows experience taught me to avoid spaces in paths also. HTH, Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Servlet unavailable discussion
Hello, I was wondering what, in general, can cause a servlet to be unavailable as reported by a StandardWrapperValve of Tomcat 4.1.12. Thanks, Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Servlet unavailable discussion
On Sunday 01 December 2002 01:55 pm, anywhere-info wrote: could you be you dint un-comment the invoker servlet in web.xml of ur tomcat Paul Yunusov wrote: Hello, I was wondering what, in general, can cause a servlet to be unavailable as reported by a StandardWrapperValve of Tomcat 4.1.12. Thanks, Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] Thanks for the comment. Are you refering to this entry in web.xml? servlet-mapping servlet-nameinvoker/servlet-name url-pattern/servlet/*/url-pattern /servlet-mapping Individual mapping of the /servlet/* pattern to the invoker servlet for every application seems to have been the default behavior in 4.0.x. Can anyone explain, please, why it's changed to optional now? Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Servlet unavailable discussion
Thanks, Tim. Makes a lot of sense now. Paul On Sunday 01 December 2002 03:01 pm, Tim Funk wrote: Its a security hole. Look at the archives for a more in depth explanation. Personally, I hate the invoker servlet because - it exposes the class name being used. Much harder to refactor your system. - Doesn't require explicit definition of servlets. This makes maintenance very hard because there is no roadmap of servlet definitions. web.xml is nice for this. - The absense of explicit declaration allows forgetful lazy programmers to keep old servlets around allowing for security leaks. - Doesn't require explicit definition of servlets. Its worth saying a second time because I hate it that much. -Tim Paul Yunusov wrote: On Sunday 01 December 2002 01:55 pm, anywhere-info wrote: could you be you dint un-comment the invoker servlet in web.xml of ur tomcat Paul Yunusov wrote: Hello, I was wondering what, in general, can cause a servlet to be unavailable as reported by a StandardWrapperValve of Tomcat 4.1.12. Thanks, Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] Thanks for the comment. Are you refering to this entry in web.xml? servlet-mapping servlet-nameinvoker/servlet-name url-pattern/servlet/*/url-pattern /servlet-mapping Individual mapping of the /servlet/* pattern to the invoker servlet for every application seems to have been the default behavior in 4.0.x. Can anyone explain, please, why it's changed to optional now? Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Servlet unavailable discussion
On Sunday 01 December 2002 10:02 am, Paul Yunusov wrote: Hello, I was wondering what, in general, can cause a servlet to be unavailable as reported by a StandardWrapperValve of Tomcat 4.1.12. Thanks, Paul The invoker servlet discussion was useful but it didn't really address the question above. (Still, here is a good thread on the invoker servlet: http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg75346.html) There is one answer so far: not reloading a context after changing a class file in it. Any other observations on causes of unavailable servlets? Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Servlet unavailable discussion
On Sunday 01 December 2002 09:57 pm, Craig R. McClanahan wrote: On Sun, 1 Dec 2002, Paul Yunusov wrote: Date: Sun, 1 Dec 2002 15:40:41 -0500 From: Paul Yunusov [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED], [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: Re: Servlet unavailable discussion On Sunday 01 December 2002 10:02 am, Paul Yunusov wrote: Hello, I was wondering what, in general, can cause a servlet to be unavailable as reported by a StandardWrapperValve of Tomcat 4.1.12. Thanks, Paul The invoker servlet discussion was useful but it didn't really address the question above. (Still, here is a good thread on the invoker servlet: http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg75346.html) There is one answer so far: not reloading a context after changing a class file in it. Any other observations on causes of unavailable servlets? A couple of other ways to get this error (the Tomcat logs will generally include a stack trace of the original exception): * Throw an exception from the init() method of your servlet. (In particular, you can throw an UnavailableException that indicates the servlet is either permanently unavailable or unavailable only for a certain amount of time. * Throw an UnavailableException from the service() (or doGet/doPut) method of your servlet. * Specify a servlet-class that doesn't exist in your webapp. Paul Craig Great help, Craig. Thanks. Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Bezerk - tomcat calls JSP twice ?
On Sunday 01 December 2002 10:23 pm, Stephen Riek wrote: I'm either still suffering from the effects of Saturday night or really didn't understand something about Tomcat, because the following has me completely surprised and unable to explain. I have a very very simple JSP /Products/index.jsp as follows - % int i = 1; System.out.println(JSP PAGE DEBUGGING + i); String pathSuffix = null; if (request.getParameter(pathSuffix)!=null) { pathSuffix = request.getParameter(pathSuffix); System.out.println(JSP : request PARAMETER set in URL: + pathSuffix); } System.out.println(JSP : pathSuffix : + pathSuffix); % I open the page /Products/index.jsp?pathSuffix=helloworld in my browser and the following appears at the Tomcat console - JSP PAGE DEBUGGING 1 JSP : request PARAMETER set in URL: helloworld JSP : pathSuffix : helloworld No surprise so far. But then I change 'i' from 1 to 2 in the JSP and hit browser refresh and the following appears in the Tomcat console - JSP PAGE DEBUGGING 2 JSP : request PARAMETER set in URL: helloworld JSP : pathSuffix : helloworld JSP PAGE DEBUGGING 2 JSP : pathSuffix : null What on earth is happening here in the last 2 lines ? Is the JSP being called twice ? Further testing has shown that this occurs: a. If I do not change the JSP and issue the same request to the JSP, which makes me suspect it is related to caching somehow. b. Even if I change the JSP, but the request parameter is the same. This is completely and utterly bizarre. Any output to the browser is NOT duplicated so it doesn't appear to have much effect but it's very worrying for me, not being able to explain it. Could somebody please shed light on this ? Or am I still hungover ? Stephen. - With Yahoo! Mail you can get a bigger mailbox -- choose a size that fits your needs Might be the hangover - I get correct output when I follow your steps and refresh with the parameter still in the URL and without too. I use Tomcat 4.1.12. My output with the parameter in the URL: JSP PAGE DEBUGGING 1 JSP : request PARAMETER set in URL: helloworld JSP : pathSuffix : helloworld JSP PAGE DEBUGGING 2 JSP : request PARAMETER set in URL: helloworld JSP : pathSuffix : helloworld Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: mod_jk : worker not found
In workers.properties: You have: worker.list=vhost1 Should be: worker.list=ajp13 Paul On Thursday 21 November 2002 02:59 pm, max wrote: Hi I attempt to use mod_jk between tomcat 4.1.12 apache 2.0.43 with virtual host but every time i request a .jsp, apache return an internal server error in mod_jk.log we can read : [jk_uri_worker_map.c (460)]: Into jk_uri_worker_map_t::map_uri_to_worker [jk_uri_worker_map.c (477)]: Attempting to map URI '/jsp/num/numguess.jsp' [jk_uri_worker_map.c (558)]: jk_uri_worker_map_t::map_uri_to_worker, Found a suffix match vhost1 - *.jsp [mod_jk.c (1277)]: Into handler r-proxyreq=0 r-handler=jakarta-servlet r-notes=135764112 worker=vhost1 [jk_worker.c (132)]: Into wc_get_worker_for_name vhost1 [jk_worker.c (136)]: wc_get_worker_for_name, done did not found a worker The only host in my server.xml is www.vhost1.com in httpd.conf i have this : IfModule !mod_jk.c LoadModule jk_module /usr/local/apache/modules/mod_jk.so /IfModule JkWorkersFile /usr/local/tomcat/conf/jk/workers.properties JkLogFile /usr/local/tomcat/logs/mod_jk.log JkLogLevel warn NameVirtualHost * VirtualHost * ServerName www.vhost1.com DocumentRoot /usr/local/tomcat/webapps/examples Directory / Options Indexes FollowSymLinks DirectoryIndex index.html index.htm index.jsp /Directory Location /WEB-INF/* AllowOverride None deny from all /Location Location /META-INF/* AllowOverride None deny from all /Location JkMount /*.jsp vhost1 /VirtualHost my worker.properties : workers.tomcat_home=/usr/local/tomcat workers.java_home=/usr/local/java ps=/ worker.list=vhost1 worker.vhost1.port=8009 worker.vhost1.host=www.vhost1.com worker.vhost1.type=ajp13 Can you help me ? Tks __ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: help with data insertion on postgresql on tomcat4/apache2
On Saturday 10 August 2002 08:27 am, you wrote: Error messages, please. Paul Dear Paul, Thanks for your consideration, please find attached the text file that is used to generate the jsp I am having problems with. It is saved as updateTREES.jsp in the tomcat4 /examples/jsp directory of machine with jdk1.4/Apache2/Tomcat4.04 The problem seems to be with line 35 namely:- Enumeration parameters = request.getParameterNames(); When trying to execute the jsp from http://host/examples/jsp/updateTREES.jsp The error reported in Konqueror and Mozilla browser is as folows: /opt/tomcat4/work/Standalone/localhost/examples/jsp/updateTrees$.jsp.java:6 2 Class org.apache.jsp.Enumeration not fount Enumeration parameters = request.getParameterNames(); ^ 1 error, 1 warning If you could provide some help it would be appreciated. regards sibu Use java.util.Enumeration instead of Enumeration. You can also import this interface using a page directive. Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Fwd: Re: help with data insertion on postgresql on tomcat4/apache2
Use java.util.Enumeration instead of Enumeration. You can also import this interface using a page directive. Paul On Saturday 10 August 2002 10:39 am, sibusiso xolo [EMAIL PROTECTED] wrote: Thanks a millionm it worked first time. I would be gratrful for more info (on or off list) on how the page directive is used if you have the time. This is really off-topic for this list. Check the J2EE tutorial at http://java.sun.com/j2ee/tutorial/ Paul Note: please reply directly to the list. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Servlet not working
On Friday 09 August 2002 06:08 pm, Laura Findley wrote: I typed in my first example servlet today cannot seem to get it working. I made sure all the following were done: 1) Classpath is set CATALINA_HOME=$CATALINA_HOME:/usr/java/jakarta-tomcat-4.0.4 JAVA_HOME=/usr/java/j2sdk1.4.0 PATH=$PATH:$HOME/bin:/usr/java/j2sdk1.4.0/bin CLASSPATH=$CLASSPATH:/home/lfindle/java:/usr/java/jakarta-tomcat-4.0.4/comm o n/lib/servlet.jar:. export CATALINA_HOME export JAVA_HOME export PATH export CLASSPATH 2) Put the servlet in /usr/java/usr/java/jakarta-tomcat-4.0.4/webapps/begjsp-ch01/WEB-INF/classes ^^^ is this a typo? also check catalina.out, the log for your host and the log for your context in $CATALINA_HOME/logs / ExampleServlet.java Compiled it from there. Shutdown restarted Tomcat. I went to http://localhost:8080/begjsp-ch01/servlet/ExampleServlet get 404 Error message. Does anyone have any suggestions? Thanks. Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: help with data insertion on postgresql on tomcat4/apache2
On Friday 09 August 2002 10:59 pm, sibusiso xolo wrote: Greetings, I am using tomcat4.04 on SuSE8/postgresql7.2.1 with source compiled jdbc driver. I am able to do SELECTS and other queries on database tables (with jsp and servlets) but unable to do data UPDATES and INSERTS.. . Help would be appreciated. regards sibu Error messages, please. Paul -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]