re: Starting and stopping Tomcat as non-root
Alternatively, is there a way to make Linux so that it lets any user bind to any port? So you don't mind one of your machine's users (or a cracker who has guessed a bad password) installing their own little fake webserver on port 80 that does {pick your poison}? The practice of allowing only root to bind below 1024 is a convention, not a requirement, and although some badly implemented software (eg sendmail) has resulted in bad things, you can gain a certain amount of trust with a machine that requires root privileges to run software on certain ports. Whether or not you actually trust the root user and the machine is a different story ;) Like John said, you can change the source or use an OS that doesn't care what you do below 1024. Cheers, Michael -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Where should i put dynamically generated graphics
I can think of a couple of ways offhand: -process the request -generate your image -store your image somewhere (optional) - either - write the image directly out to the servlet's underlying outputstream as a buffered byte output stream (I don't think PrintWriter would be appropriate. This would probably also in involve a response.setContentType(image/gif); ... but i've never done this, so I'm probably wrong.) -or- -store your image somewhere -return html that has a bunch of img src= tags or hyperlinks to the images eg: /* get my images! */ public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { /* optionally clean out the temp image directory */ /* genrt imgs, store in gen_images/username/ under the current context */ response.setContentType(text/html); PrintWriter out = response.getWriter(); out.println( htmlbody ); out.println( img src=\gen_images/username/foo.gif\ ); out.println( img src=\gen_images/username/foo1.gif\ ); out.println( img src=\gen_images/username/foo2.gif\ ); out.println( /body/html ); } of course, feel free to spruce that html up ;) hope that helps, Michael - Original Message - From: Felipe Schnack [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Friday, August 30, 2002 8:06 AM Subject: RE: Where should i put dynamically generated graphics How can I return an image from a servlet?? On Thu, 2002-08-29 at 20:05, Sexton, George wrote: It depends. One way I have done it is to have the generator servlet save it on the session, and have the page the generator servlet writes make a request to a simple servlet that returns the graphic, and then deletes it from the session. Another way would be to write it to the temp dir. From the Servlet API Spec: SRV.3.7.1 Temporary Working Directories A temporary storage directory is required for each servlet context. Servlet containers must provide a private temporary directory per servlet context, and make it available via the javax.servlet.context.tempdir context attribute. The objects associated with the attribute must be of type java.io.File. Then, using a servlet mapping request the generated image and have the servlet retrieve the temporary image. I guess that you could make another dir writable to the server, and store the image in their natively. George Sexton MH Software, Inc. Home of Connect Daily Web Calendar Software http://www.mhsoftware.com/connectdaily.htm Voice: 303 438 9585 -Original Message- From: Andy Wagg [mailto:[EMAIL PROTECTED]] Sent: 29 August, 2002 4:01 PM To: [EMAIL PROTECTED] Subject: Where should i put dynamically generated graphics Hello I have a web application that generates a gif file that is then subsequently displayed. It expects to find the gif file in the context of the web application. The web app is deployed as a war so obviously the generated files cant be put there. Any suggestions as to where these files could be copied that would be accesible by the browser. Thanks in advance. -- 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] -- Felipe Schnack Analista de Sistemas [EMAIL PROTECTED] Cel.: (51)91287530 Linux Counter #281893 Faculdade Ritter dos Reis www.ritterdosreis.br [EMAIL PROTECTED] Fone/Fax.: (51)32303328 -- 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: one last plea for help
Peter, Your last comment is a little unclear - do you mean that you request 1 URL and it gets redirected to another, or that you see some page that you think shouldn't be in the current web app? I think more information is in order, specifically, your relevant configuration information, workers.properties, any aliases you've set up, any errors in the log files, any contexts you've set up... Let me just understand what is happening: -you start Tomcat -you start Apache -you access http://myserver.com/webapp1 and it works -wait five minutes -access http://myserver.com/webapp1 and it gives you http://myserver.com/webapp2 Try seeing if Tomcat standalone serves the applications correctly, that is: http://myserver2.com:8080/webapp1 gives http://myserver2.com:8080/webapp1 and the same for webapp2 Regards, Michael - Original Message - From: Peter Choe [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, August 27, 2002 12:06 PM Subject: one last plea for help i am desparate. can anyone help me? i am using apache 1.3.26 to server my static webpages on one server and connecting to a separate tomcat 3.1 server through mod_jk. when i start up apache, it is able to connect to the webapps fine. but after several minutes, something strange happens. if i put in the url of one webapplication, the browser shows a different webapplication. for example: i have a webapp called directory which is suppose to show a phone directory by going to http://myserver.com/directory it works when apache is just started, but after awhile, when i go to http://myserver.com/directory, i gives me a page that should actually be something like http://myserver.com/email. has this happened to anyone else? anyone know what is causing this? -- 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: javax directory
What exactly are the errors? If you are writing a servlet (or some other class that imports something from the javax.servlet package) you need servlet.jar in your CLASSPATH so your java compiler knows where to find the class definitions. The Java 2 SDK does not come with the 'javax.servlet' packages. There are any number of ways to accomplish this. put the copy of servlet.jar that you find in the Tomcat distribution in your $JAVA_HOME/jre/lib/ext (this isn't the greatest approach, but it's the easiest) write your own little compile script that constructs its own CLASSPATH that includes servlet.jar, wherever it is located check out the tomcat docs on building web apps with Ant: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/appdev/source.html The javax directory in the CATALINA_HOME/webapps/tomcat-docs/servletapi directory is the Javadoc API for the javax.servlet packages, it doesn't contain any class files. Regards, Michael - Original Message - From: Reis, Tom [EMAIL PROTECTED] To: Tomcat Users List (E-mail) [EMAIL PROTECTED] Sent: Tuesday, August 27, 2002 12:19 PM Subject: javax directory What is the javax directory. I know there is one in the Tomcat-docs but I thought there class files and not just html files. The reason I am asking this question is I have a java program that has the following code: import javax.servlet.*; import javax.servlet.http.HttpServlet; I receive errors when trying to compile this program -- 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: one last plea for help
Pretty much. See: http://jakarta.apache.org/tomcat/tomcat-3.3-doc/AJPv13.html Adding support for SSL, so that isSecure() and geScheme() will function correctly within the servlet container. The client certificates and cipher suite will be available to servlets as request attributes. Regards, Michael - Original Message - From: Jason Koeninger [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Tuesday, August 27, 2002 2:20 PM Subject: RE: one last plea for help I may be wrong, but isn't the only difference between ajp13 and ajp12 with respect to SSL that the ServletRequest.isSecure method works correctly? Regards, Jason Koeninger JJ Computer Consulting http://www.jjcc.com On Tue, 27 Aug 2002 14:11:55 -0400, Turner, John wrote: As far as I know, based on a discussion last week on this topic, communications between apache and tomcat via AJP13 are unencrypted whether you have tomcat enabled for SSL or not. You are correct that mod_ssl is used for SSL on apache. That is all you need to encrypt a session between a browser and a webserver. The connector (which uses the AJP13 protocol) does not use SSL. The request is decrypted by apache, then sent over the connector to tomcat. Tomcat processes the request, and sends the result back over the connector to apache. Apache encrypts the response, and sends it back to the browser. So, to setup SSL on apache, use mod_ssl. (http://www.modssl.org) Using mod_ssl will have no effect on the connection between apache and tomcat using the AJP13 connector. John Turner [EMAIL PROTECTED] -Original Message- From: Peter Choe [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 27, 2002 2:06 PM To: Tomcat Users List Subject: RE: one last plea for help what do you mean? i want to use mod_ssl on apache to encrypt connection between the server and the browser. i have read that you need ajp13 connector to use ssl. Peter Choe At 01:44 PM 8/27/2002, you wrote: The connection between apache and tomcat is not encrypted. There's more detail on this in the archives, there was a discussion on it last week. John Turner [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Tomcat Installation on linux
try 'sh ./catalina.sh start' from jakarta-tomcat-4.0.4/bin regards, michael - Original Message - From: khozaima shakir [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, August 26, 2002 11:23 AM Subject: Re: Tomcat Installation on linux Hi Randall, Sorry, guess the way i typed was misleading, i typed just shutdown.sh at command prompt. The directory that I was in when I type in startup.sh or shutdown.sh is user/userName/jakarta-tomcat-4.0.4/bin The output i get on shutdown is -- Segmentation fault Shakir From: Randall R Schulz [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: Tomcat Installation on linux Date: Mon, 26 Aug 2002 07:18:58 -0700 Shakir, Where did you get that command from? Here's what you did: You truncated your shutdown.sh script. The : is the no-op command that is used when one wants to use side-effects (such as I/O redirection) without running a command. The is similar to that of the DOS/CMD.exe/Command.com in Windows, it redirects output to the file whose name follows. So you ran the null command (which produces no output) and redirected it to the shutdown.sh script, thus truncating it. Had you used the append output redirection, , all would be OK, since adding 0 bytes to the end of shutdown.sh would not do any damage (it would only alter the last modification time of that file, which you could see with ls -l shutdown.sh). So you'll have to retrieve the shutdown.sh script from your Tomcat distribution. Then to use it, just invoke it. Since it usually does not run indefinitely and does not produce a lot of output or usually any particularly interesting output, there's no need to redirect its output. I recommend that people recently switching from Windows to Linux or another Unix-like system get some tutorial materials on these basics. There are some vague similarities with Windows, but a lot is different and groping around in the dark is not really advisable. Good luck. Randall Schulz Mountain View, CA USA At 04:21 2002-08-26, khozaima shakir wrote: Hi Jhair, yes, I am running tomcat from shell. About shoutdown, I shutdown tomcat by : shutdown.sh Thanks Shakir -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- 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: Strange message compiling a JSP in Tomcat 4.0.4
Nome, Although I'm not sure exactly what the problem is, this has happened to me before when I've replaced some class files or jars that a JSP uses while Tomcat was running, and then updated the JSP so Tomcat had to recompile it. A restart of Tomcat fixed the problem. regards, Michael - Original Message - From: Adziashvili, Itzik [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Sent: Monday, August 26, 2002 11:13 AM Subject: RE: Strange message compiling a JSP in Tomcat 4.0.4 Do you have the stack trace? -Original Message- From: Nome real [mailto:[EMAIL PROTECTED]] Sent: Monday, August 26, 2002 4:19 PM To: Tomcat Users List Subject: Strange message compiling a JSP in Tomcat 4.0.4 Hi all, I'm using Tomcat 4.0.4 with Security Manager, Sun JDK 1.3.1_04 , trying to run a JSP. I receive the following error: org.apache.jasper.JasperException: Unable to compile class for JSPerror: An error has occurred in the compiler; please file a bug report (http://java.sun.com/cgi-bin/bugreport.cgi). 1 error Unfortunately, I have no access to the source code. Any hint ? Thanks -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Design Questions..
Michael, I'm sure everyone else is gonna tell you this too, but here are some pointers from just glancing over the code. - set up your db connection in the init() method, not doGet(). doGet() is executed every time the servlet is called with an HTTP GET. So, effectively, you are loading the driver and creating a connection and DBThing object and blah blah blah every time your servlet is called. That's a performance killer. - better yet, use a Connection Pool that's created on startup. Write your own, or there are many available. I'm sure others will provide links... - as far as your question: I'm assuming you're using an HTML form to POST/GET to the servlet. There are alot of ways you can go, but a simple one is to have a parameter called 'databaseaction' or whatever, and that indicates which operation the servlet will perform from it's doGet() or doPost(). Alternatvely, you can have a different HTML form/page for each action that calls the servlet (or a different servlet, although that's pretty inefficient) with a different parameter. This is easy enough, but how do I have the servlet update its own output in the web browser so that it reflects the new changes? Is there a refresh command or something. You can have the servlet (or JSP) just call itself, and at the end of processing, just display whatever you were going to display normally. Servlets are based on a request/response model, so once the servlet has finished returning data to your browser, it is not going to attempt to push new data out. It would have to be called again after the update takes place. I was thinking having a jsp page where the user inputs the changes, and then POST it to the servlet.. still not sure how the page gets updated. Anybody have any example sites/code?? You can have the form on the JSP just call the JSP again. The JSP tests for the right combination of parameters and performs the appropriate actions... e.g. in 'faq.jsp' (this is basically just snippits) html body % JDBCConnectionPool connectionPool = (JDBCConnectionPool)application.getAttribute(edu.tcnj.cs.cmsc446.Connection pool); % form name=myform action=faq.jsp method=POST ... /form % /* get params, test for form submission, take appropriate action */ String submitted=request.getParameter( Submit ); String questiontext=request.getParameter( questiontext ); String username=request.getParameter( username ); if( submitted!=null submitted.equals( Submit Question ) questiontext!=null !questiontext.equals( ) username!=null !username.equals( ) ){ edu.tcnj.cs.cmsc446.SQLWorker sqlWorker = new edu.tcnj.cs.cmsc446.SQLWorker(); try{ sqlWorker.setConnection( connectionPool.getConnection() ); sqlWorker.submitQuestion( questiontext, username ); sqlWorker.logQuestionPost( username, question, request.getRemoteAddr() ); }catch(Exception badQues){ application.log( faq.jsp: error submitting new question=+badQues ); }finally{ if( connectionPool!=null ) connectionPool.free( sqlWorker.getConnection() ); } }else{ out.println( pNo question asked at this time. Enjoy browsing./p ); } % !-- more html -- % edu.tcnj.cs.cmsc446.SQLWorker sqlWorker = new edu.tcnj.cs.cmsc446.SQLWorker(); try{ sqlWorker.setConnection( connectionPool.getConnection() ); Vector entries = sqlWorker.getQuestions(); if( entries!=null ){ Question ques=null; for( int i=0;ientries.size();i++ ){ ques = (Question)entries.elementAt( i ); out.println( trtd width=\23%\font face=\Arial, Helvetica, sans-serif\ size=\2\a href=\answer.jsp?refNum=+ques.getRefNum()+\+ques.getRefNum()+/a/fo nt/td ); out.println( td width=\77%\font face=\Arial, Helvetica, sans-serif\ size=\2\+ques.getQuestion()+/font/td/tr ); } }else{ out.println( trtdno entries/tdtdno questions at this time/td/tr ); } }catch( Exception e ){ application.log( faq.jsp: error getting all questions=+e ); }finally{ if( connectionPool!=null ) connectionPool.free( sqlWorker.getConnection() ); } % /body /html Regards, Michael -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Design Questions..
The Tomcat distribution has great docs. There is a tutorial on how to develop a simple app also. Also, you may want to check out Sun's Java tutorial on Servlets: http://java.sun.com/docs/books/tutorial/servlets/ Enjoy! Michael - Original Message - From: Michael Hanna [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Monday, August 26, 2002 8:00 PM Subject: Re: Design Questions.. thanks, I think I'm starting to understand how all this stuff is supposed to work... Michael On Monday, August 26, 2002, at 05:59 PM, Michael E. Locasto wrote: Michael, I'm sure everyone else is gonna tell you this too, but here are some pointers from just glancing over the code. - set up your db connection in the init() method, not doGet(). doGet() is executed every time the servlet is called with an HTTP GET. So, effectively, you are loading the driver and creating a connection and DBThing object and blah blah blah every time your servlet is called. That's a performance killer. - better yet, use a Connection Pool that's created on startup. Write your own, or there are many available. I'm sure others will provide links... - as far as your question: I'm assuming you're using an HTML form to POST/GET to the servlet. There are alot of ways you can go, but a simple one is to have a parameter called 'databaseaction' or whatever, and that indicates which operation the servlet will perform from it's doGet() or doPost(). Alternatvely, you can have a different HTML form/page for each action that calls the servlet (or a different servlet, although that's pretty inefficient) with a different parameter. This is easy enough, but how do I have the servlet update its own output in the web browser so that it reflects the new changes? Is there a refresh command or something. You can have the servlet (or JSP) just call itself, and at the end of processing, just display whatever you were going to display normally. Servlets are based on a request/response model, so once the servlet has finished returning data to your browser, it is not going to attempt to push new data out. It would have to be called again after the update takes place. I was thinking having a jsp page where the user inputs the changes, and then POST it to the servlet.. still not sure how the page gets updated. Anybody have any example sites/code?? You can have the form on the JSP just call the JSP again. The JSP tests for the right combination of parameters and performs the appropriate actions... e.g. in 'faq.jsp' (this is basically just snippits) html body % JDBCConnectionPool connectionPool = (JDBCConnectionPool)application.getAttribute(edu.tcnj.cs.cmsc446.Connection pool); % form name=myform action=faq.jsp method=POST ... /form % /* get params, test for form submission, take appropriate action */ String submitted=request.getParameter( Submit ); String questiontext=request.getParameter( questiontext ); String username=request.getParameter( username ); if( submitted!=null submitted.equals( Submit Question ) questiontext!=null !questiontext.equals( ) username!=null !username.equals( ) ){ edu.tcnj.cs.cmsc446.SQLWorker sqlWorker = new edu.tcnj.cs.cmsc446.SQLWorker(); try{ sqlWorker.setConnection( connectionPool.getConnection() ); sqlWorker.submitQuestion( questiontext, username ); sqlWorker.logQuestionPost( username, question, request.getRemoteAddr() ); }catch(Exception badQues){ application.log( faq.jsp: error submitting new question=+badQues ); }finally{ if( connectionPool!=null ) connectionPool.free( sqlWorker.getConnection() ); } }else{ out.println( pNo question asked at this time. Enjoy browsing./p ); } % !-- more html -- % edu.tcnj.cs.cmsc446.SQLWorker sqlWorker = new edu.tcnj.cs.cmsc446.SQLWorker(); try{ sqlWorker.setConnection( connectionPool.getConnection() ); Vector entries = sqlWorker.getQuestions(); if( entries!=null ){ Question ques=null; for( int i=0;ientries.size();i++ ){ ques = (Question)entries.elementAt( i ); out.println( trtd width=\23%\font face=\Arial, Helvetica, sans-serif\ size=\2\a href=\answer.jsp?refNum=+ques.getRefNum()+\+ques.getRefNum()+/a/fo nt/td ); out.println( td width=\77%\font face=\Arial, Helvetica, sans-serif\ size=\2\+ques.getQuestion()+/font/td/tr ); } }else{ out.println( trtdno entries/tdtdno questions at this time/td/tr ); } }catch( Exception e ){ application.log( faq.jsp: error getting all questions=+e ); }finally{ if( connectionPool!=null ) connectionPool.free( sqlWorker.getConnection() ); } % /body /html Regards, Michael -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:tomcat-user- [EMAIL
Re: Requested resource is not available
Mike, Make sure you have WEB-INF/ directories (and web.xml) for those webapps. Also, try restarting Tomcat. In addition, you can use the manager app to deploy new webapps. Regards, Michael - Original Message - From: Mike Markovich [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, August 25, 2002 6:02 PM Subject: Requested resource is not available Hi, I'm in the process of upgrading from Tomcat 3.2 to Tomcat 4.0.4 on NT. I've completed the install and I can run the examples. I can also run a JSP if I install it in ROOT/WEB-INF/classes. My problem is that I can't get anything else to run. A major hint is that directories added under webapps don't show up. When I try to access them I get Error 404, the requested resource is not available. Any suggestions will be greatly appreciated. Mike -- 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:[OT] Requested resource is not available
Michael, Thanks for your response, I thought I was doing all the things you suggested, but just to make sure I recreated web.xml and restarted tomcat and now things work as expected. Oh well, only a couple of hours lost because I was doing something different then what I thought I was doing... Mike I'm glad things worked out; I know the feeling...I just spent some time cursing and fiddling b/c my form wasn't calling the proper page, but I *knew* that it was...until I finally checked. -Michael -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: preconfigured persist sessions?
Maia, In 4.0.4 and 4.1.7 (and probably all of 4.x), there is a commented out entry in server.xml (with explanatory comments right before it). So it looks like persistent sessions are _not_ enabled by default. !-- Manager className=org.apache.catalina.session.PersistentManager debug=0 saveOnRestart=true maxActiveSessions=-1 minIdleSwap=-1 maxIdleSwap=-1 maxIdleBackup=-1 Store className=org.apache.catalina.session.FileStore/ /Manager -- Regards, Michael - Original Message - From: Maia Zaharieva [EMAIL PROTECTED] To: Tomcat User List [EMAIL PROTECTED] Sent: Tuesday, August 13, 2002 7:13 AM Subject: preconfigured persist sessions? is tomcat configured to use persist sessions? and if so - how can i tell tomcat to dont do so? thanks, maia -- 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: Quick Question
Alex, Probably the current working directory, which is whatever directory Tomcat was started out of (probably bin/, but not necessarily so). You can provide a full file name in the code, or use your web.xml to set a context parameter that indicates a base path to do read/write relative to in your servlet. You could also put that file somewhere your web application's Classloader will see it and load it via a findResource() or getResourceAsStream(). Regards, Michael - Original Message - From: Isabel Lameda [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Sent: Tuesday, August 13, 2002 8:50 AM Subject: RE: Quick Question Try to create a file in your bean and see where Tomcat stores it -Mensaje original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Enviado el: Lunes, 12 de Agosto de 2002 06:00 p.m. Para: Tomcat Users List Asunto: Quick Question Hi all, I wrote a simple java bean that reads a txt file, the problem is where do I need to put the txt file??... What is the default directory in Tomcat?? when I put something like this in my java bean : FileReader(config.txt) Where does tomcat look for that file? thanks Alex -- 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: Memory alloc on tomcat 4.0.4
Hi, I believe that the reason you have so many java threads is due to the way the jdk/jre is implemented for linux, you'll see basically every thread in top or ps. http://www.blackdown.org/java-linux/docs/support/faq-release/FAQ-java-linux- 4.html#ss4.2 Michael - Original Message - From: Rodrigo Giammarini [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Tuesday, August 13, 2002 11:03 AM Subject: Re: Memory alloc on tomcat 4.0.4 Hi The output I pasted is a output of the top command on Linux. If you are asking why I have so many threads the answer is I don't know! I think that are threads between tomcat and apache that are never closed. RG - Original Message - From: Shapira, Yoav [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Tuesday, August 13, 2002 10:10 AM Subject: RE: Memory alloc on tomcat 4.0.4 Hi, Hi, Is possible to limit the amount of memory taken by each java thread? You can control the amount allocated to the VM. It will be shared by all the threads used by that VM. You would do this using the -Xmx runtime option. Type java -X to see all these types of options. PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME COMMAND 5150 geodem 9 0 56888 49M 26560 S 0.0 39.7 0:05 java 5151 geodem 9 0 56888 49M 26560 S 0.0 39.7 0:00 java 5152 geodem 9 0 56888 49M 26560 S 0.0 39.7 0:05 java 5153 geodem 9 0 56888 49M 26560 S 0.0 39.7 0:00 java 5154 geodem 9 0 56888 49M 26560 S 0.0 39.7 0:00 java 5155 geodem 9 0 56888 49M 26560 S 0.0 39.7 0:00 java 5156 geodem 9 0 56888 49M 26560 S 0.0 39.7 0:00 java 5157 geodem 9 0 56888 49M 26560 S 0.0 39.7 0:00 java 5158 geodem 9 0 56888 49M 26560 S 0.0 39.7 0:04 java 5160 geodem 9 0 56888 49M 26560 S 0.0 39.7 0:00 java 5161 geodem 9 0 56888 49M 26560 S 0.0 39.7 0:00 java 5162 geodem 9 0 56888 49M 26560 S 0.0 39.7 0:00 java 5163 geodem 9 0 56888 49M 26560 S 0.0 39.7 0:00 java 5164 geodem 9 0 56888 49M 26560 S 0.0 39.7 0:00 java 5165 geodem 9 0 56888 49M 26560 S 0.0 39.7 0:00 java 5166 geodem 9 0 56888 49M 26560 S 0.0 39.7 0:00 java 5167 geodem 9 0 56888 49M 26560 S 0.0 39.7 0:00 java 5168 geodem 9 0 56888 49M 26560 S 0.0 39.7 0:00 java What tomcat configuration, if I might ask, produced the above output? Yoav Shapira Millennium ChemInformatics -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Re[4]: Quick Question
Check out the API too. http://jakarta.apache.org/tomcat/tomcat-4.0-doc/servletapi/index.html Regards, Michael - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, August 13, 2002 1:08 PM Subject: Re: Re[4]: Quick Question Hi, Alex. Since JSP's are turned into servlets before they are executed, I don't see why you couldn't do this. For your convenience, JSP's have some common objects already available for use. The application object is equivalent to the javax.servlet.ServletContext object you would get by doing a getServletContext() call. So, application.getInitParameter(key) should do the trick, too. HTH, -Jeff Jacob Kjome [EMAIL PROTECTED]To: Tomcat Users List [EMAIL PROTECTED] m cc: Subject: Re[4]: Quick Question 08/13/02 12:00 PM Please respond to Jacob Kjome Hello TOMITA, I know next to nothing about JSP. Haven't touched it. I use XMLC and Barracuda to do presentation. However, I would think that you should be able to use getServletContext() or something analogous in JSP. Jake Tuesday, August 13, 2002, 11:13:44 AM, you wrote: TLC Can I use something like this in my jsp page (instead of a java sevlet) to TLC get the parameter name?, TLC before that I set the parameter in my web.xml file like this: TLC context-param TLC param-nameparameter name/param-name TLC param-valuelocalhost/param-value TLC /context-param TLC String value = getServletContext().getInitParameter(parameter name); TLC because I'm confusing here because of the name getServletContext. is TLC it only works in a sevlet or it will work too in a jsp page??? TLC thanks again TLC Alex Tomita TLC [EMAIL PROTECTED] TLC 13/08/2002 10:54 a.m. TLC Please respond to Tomcat Users List TLC To: Tomcat Users List [EMAIL PROTECTED] TLC cc: Tomcat Users List [EMAIL PROTECTED] TLC Subject:Re: Re[2]: Quick Question TLC My bean is WEB-INF/classes TLC Jacob Kjome [EMAIL PROTECTED] TLC 13/08/2002 10:43 a.m. TLC Please respond to Tomcat Users List TLC To: Tomcat Users List [EMAIL PROTECTED] TLC cc: TLC Subject:Re[2]: Quick Question TLC Hello TOMITA, TLC Where does your Bean exist? Is it in one of Tomcat's classloaders, or TLC is it running out the WEB-INF/classes or WEB-INF/lib folder of your TLC webapp. I'm geussing the it is in one of Tomcat's classloaders TLC meaning $CATALINA_HOME/common/lib, server/lib, or lib (shared/lib in TLC Tomcat-4.1.x). TLC Those classloaders can't see the individual webapp classloaders. TLC However, libraries in your webapp *can* see Tomcat's plublic TLC classloaders (all bug server/lib, server/classes). TLC You may have to rearrange the location of your libraries. TLC Jake TLC Tuesday, August 13, 2002, 9:29:19 AM, you wrote: TLC Hi all, TLC I'm trying to resolve this problem with all the solutions that you TLC gave TLC me, but it doesn't work... TLC This is what I did: TLC in my java bean (not a servlet), I have this code: TLC public class DbBean { TLCpublic int Connect() { TLCInputStream is = TLC TLC Thread.currentThread().getContextClassLoader().getResourceAsStream (config.txt); TLC if (is == null) { TLC return 0; TLC } TLC else { TLC return 1; TLC } TLC } TLC then in my jsp, I called this method, and then I write the value (0 TLC or TLC 1).. TLC The txt file is in WEB-INF/classes/beans..., because DbBean is in TLC a TLC package called beans, and I start tomcat from TOMCAT_HOME/bin.. TLC When I load the jsp, the method Connect of the DbBean (java bean) TLC returned TLC 0, which means the InputStream is null, but if I put the txt file in TLC TOMCAT_HOME/bin, I had no problem, the method returned 1 why TLC is TLC that??.. I'm using Tomcat 3.2 TLC Do I need to set something else in Tomcat?? TLC thanks again TLC Alex Tomita TLC Drinkwater, GJ (Glen) [EMAIL PROTECTED] TLC 13/08/2002 08:11 a.m. TLC Please respond to Tomcat Users List TLC To: Tomcat Users List [EMAIL PROTECTED] TLC cc: TLC Subject:RE: Quick Question TLC tomcats default directory is where ever you called the startup.sh/bat TLC file. TLC So if you dont use another script to call the startup.sh/bat file TLC tomcats TLC default will be the bin directory. TLC Use this code to find the directory where WEB-INF is. Then you can TLC traverse TLC your directory structure from there. TLC file://get context path TLC ServletConfig scon = null ; TLC String workingDir = null;
Re: apache+tomcat?
- Original Message - From: Lee Zhao [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Tuesday, August 13, 2002 7:30 PM Subject: apache+tomcat? Can someone please explain why one needs or wants to use apache in addition to tomcat? Can one just use tomcat as plain web server for serving HTML pages? Thanks in advance. The main reason is performance. Yes, Tomcat can be used standalone as an HTTP server. However, a compiled Apache instance is faster at serving static content. Since Tomcat's main job is to be a servlet container, if quick response is an issue, it should spend its time being one, rather than serving static content. Of course, people's requirements are different, and Tomcat serving both static and dynamic content is cool for many different folks depending on their needs. Check out the website and the mailing list archives for good bits of information relating to this topic, it's a very popular one. Regards, Michael -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: new to tomcat
Amit, But when i create TESTJSP directory under Tomcat4.0 - webapps --- TESTJSP --- HelloWorld.jsp did you restart Tomcat after you created that directory and put the jsp in it? You don't need a Context entry in server.xml for directories under webapps/ ... they will get loaded automagically at startup. Regards, Michael try to view in browser .. http://localhost:8080/TESTJSP/HelloWorld.jsp it gives error saying HTTP 404 error .. requested resources are not available.. Can u tell me what type of error is it? regards Amit Luktuke - Original Message - From: Ben Walding [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Saturday, August 10, 2002 1:40 PM Subject: Re: new to tomcat Possibly : You should have called the dir webapps not webaaps Although this is probably just a typo in your email :) Amit Luktuke wrote: hello I am very new to Tomcat4.0. I have successfully installed tomcat4.0 on my machine but can not able to run simple HelloWorld.jsp file. I have put it in folder C:\Tomcat4.0\webaaps\TestJSP\Helloworld.jsp webapps On brower .. http://localhost:8080/TestJSP/Helloworld.jsp My O.S is windows 2000 professional i have JDK1.3 installed. Can anyone help me Regards Amit Luktuke -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: tomcat + apache
We can at least make a best effort ... :) Carlos, el documentoRoot de apache esta en /usr/local/httpd/htdocs. Como puedo hacer andar en el puerto 80 unas paginas jsp que estan el: /usr/local/httpd/htdocs/admin ? Que necessita hacer es añadir un contexcto en /opt/jakarta/webapps/conf/server.xml que dice: Context path=/admin docBase=/usr/local/httpd/htdocs/admin debug=0 reloadable=true / y (pienso, no uso el mod_webapp, uso mod_jk) WebAppDeploy admin tomcat /admin Location /admin/WEB-INF/ AllowOverride None deny from all /Location Lo siento para mi espanol muy mal. Buen suerte, Michael -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: new to tomcat
No sir, you can pretty much put the directory any place you want, as long as you then specify a Context entry telling Tomcat where to find it. Regards, Michael - Original Message - From: Vishal Mukherjee [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Monday, August 12, 2002 8:25 AM Subject: Re: new to tomcat hi Is it necessary to deploy the application under webapps directory only. Regards Vishal - Original Message - From: Michael E. Locasto [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Monday, August 12, 2002 6:04 PM Subject: Re: new to tomcat Amit, But when i create TESTJSP directory under Tomcat4.0 - webapps --- TESTJSP --- HelloWorld.jsp did you restart Tomcat after you created that directory and put the jsp in it? You don't need a Context entry in server.xml for directories under webapps/ ... they will get loaded automagically at startup. Regards, Michael try to view in browser .. http://localhost:8080/TESTJSP/HelloWorld.jsp it gives error saying HTTP 404 error .. requested resources are not available.. Can u tell me what type of error is it? regards Amit Luktuke - Original Message - From: Ben Walding [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Saturday, August 10, 2002 1:40 PM Subject: Re: new to tomcat Possibly : You should have called the dir webapps not webaaps Although this is probably just a typo in your email :) Amit Luktuke wrote: hello I am very new to Tomcat4.0. I have successfully installed tomcat4.0 on my machine but can not able to run simple HelloWorld.jsp file. I have put it in folder C:\Tomcat4.0\webaaps\TestJSP\Helloworld.jsp webapps On brower .. http://localhost:8080/TestJSP/Helloworld.jsp My O.S is windows 2000 professional i have JDK1.3 installed. Can anyone help me Regards Amit Luktuke -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: help with server.xml
Mona, I'm assuming you are running Tomcat 4.04 standalone, on :8080. Not quite sure exactly what the issue is here, but I have some suggestions: Just for fun, try a different browser to see if the problem is client side. Does the user Tomcat is installed as have permissions to read those directories '/scratch/project/telescience'? Also, turn up your log levels (crank all those 'debug' attributes up to 99), restart Tomcat, and look at your server log files and see what they say. Post any errors here if you still have problems. Regards, Michael - Original Message - From: Mona Wong-Barnum [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, August 02, 2002 10:35 PM Subject: help with server.xml Hi: I'm new to Tomcat and am trying to configure 4.0.4. I modified server.xml appBase and docBase: Host name=localhost debug=0 appBase=/scratch/project/telescience/webapps unpackWARs=true [...] !-- Tomcat Root Context -- Context path= docBase=/scratch/project/telescience debug=0/ /Host I have a index.html in the /scratch/project/telescience/ directory. When I tried to access that page via the URL using Netscape, I keep getting: A network error occurred while Netscape was receiving data. (Network Error. I/O error) Try connecting again. What am I doing wrong? I looked all over for an answer but having found it so I decided to post to the list. All help is really appreciated. Sincerely, Mona == Mona Wong-Barnum National Center for Microscopy and Imaging Research University of California, San Diego http://ncmir.ucsd.edu/ The truth shall set you free, but first it will piss you off A Landmark instructor == -- 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 directory
And you've provided appropriate servelet and servlet-mapping entries in your web.xml? -Michael - Original Message - From: Daliso Zuze [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Saturday, August 03, 2002 4:51 AM Subject: Servlet directory I have put some servlet classes in my web applications classes directory, however when I try to access it via the url http://localhost:8080/myapp/servlet/myservlet it does not work. It seems to only work when I put the classes in the default ROOT web app and access it via http://localhost:8080/servlet/myservlet. Is there a way of configuring tomcat to make it work from the first url??? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: nullpointer (on forward) in tomcat (both 331 332)
Jeff, The Javadocs for ServletContext.getRequestDispatcher( String pathname ): The pathname must begin with a / and is interpreted as relative to the current context root. Use getContext to obtain a RequestDispatcher for resources in foreign contexts. This method returns null if the ServletContext cannot return a RequestDispatcher. Also, add a test here: try {rd = sc.getRequestDispatcher(nextPage); if( rd==null ) System.out.println( Rd is null. ); } catch (NullPointerException np) { System.out.println(* NullPointerException on getRequestDispatcher ); np.printStackTrace(); } Hope that helps... Regards, Michael - Original Message - From: Jeff Boring [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, August 03, 2002 9:01 AM Subject: nullpointer (on forward) in tomcat (both 331 332) The following servlet code throws nullpointer (on forward) in tomcat (both 3.3.1 3.3.2). Any ideas where to start looking? Jeff W. Boring [EMAIL PROTECTED] -- code - public void forwardToNextPage(String nextPage, HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException { System.out.println(*); System.out.println( REQ - + req.toString() ); System.out.println(*); System.out.println(*); System.out.println( RES - + res.toString() ); System.out.println(*); ServletContext sc = null; RequestDispatcher rd = null; try {sc = getServletContext();} catch (NullPointerException np) { System.out.println(* NullPointerException on getServletContext ); np.printStackTrace(); } try {rd = sc.getRequestDispatcher(nextPage); } catch (NullPointerException np) { System.out.println(* NullPointerException on getRequestDispatcher ); np.printStackTrace(); } try {rd.forward(req, res);} catch (NullPointerException np) { System.out.println(* NullPointerException on forward ); np.printStackTrace(); } --- console -- * NullPointerException on forward java.lang.NullPointerException at com.ibm.eadtraining.servlet.EADTrainingController.forwardToNextPage(E ADTrainingController.java:89) at com.ibm.eadtraining.servlet.EADTrainingController.submitLogin(EADTrai ningController.java:212) at com.ibm.eadtraining.servlet.EADTrainingController.doPost(EADTrainingC ontroller.java:46) at javax.servlet.http.HttpServlet.service(HttpServlet.java) at javax.servlet.http.HttpServlet.service(HttpServlet.java) at org.apache.tomcat.facade.ServletHandler.doService(ServletHandler.java :570) at org.apache.tomcat.core.Handler.invoke(Handler.java:322) at org.apache.tomcat.core.Handler.service(Handler.java:235) at org.apache.tomcat.facade.ServletHandler.service(ServletHandler.java:4 81) at org.apache.tomcat.core.ContextManager.internalService(ContextManager. java:917) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:833 ) at org.apache.tomcat.modules.server.Http10Interceptor.processConnection( Http10Interceptor.java:176) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java :508) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP ool.java:533) at java.lang.Thread.run(Thread.java:479) -- 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]
[OT] re: And I LOVE you too, John!
Steve, You _do_ have to admit that answering repeated queries on the same topic gets a little frustrating...and your email has a pissed off tone too. quote Does anyone out there have the download link to access and then install this file WHICH I STILL DON'T HAVE! I am getting sick and tired of seeing other members of the tomcat users newsgroup referring to this file, but I still do not have access to it!!! /quote You could always have built mod_jk from the source, which is distributed. I think a smart guy once said something about a plank in one's eye... In that theme, there is no need to fight..hey, it's Friday... Regards, Michael - Original Message - From: steve Burrus [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Friday, August 02, 2002 5:25 PM Subject: And I LOVE you too, John! Hello dear Johnnie, this is Steve Burrus, and I just now read your little response back to me in which you seemed to set a pissed off tone toward me!! I am QUITE SORRY if I hijacked threads to make my demands [-sic] of other members of the tomcat users newsgroup, and that includes you, by the way. BUT, is that any way to talk to me, I mean, did your mommie teach u to talk to other people that damned way, saying I hope you choke on that file.?!!! When you clean up your language, sir, I will more closely heed your admonitions of me!! * Turner, John wrote: And we are getting sick (or at least I am) of you posting messages like this Hijacking threads to make your demands is not polite! Learn some manners. Your question has been answered numerous times. I have answered it twice myself! This will make the third time. This is the last time I will answer any of your posts, Steve Burrus!!! The file you want is RIGHT HERE: http://www.acg-gmbh.de/mod_jk/ I hope you choke on that file. John Turner [EMAIL PROTECTED] -Original Message- From: steve Burrus [mailto:[EMAIL PROTECTED]] Sent: Friday, August 02, 2002 2:44 PM To: Tomcat Users List Subject: Re: Apache + Tomcat sometimes pegs CPU Hello there, I need the file--mod_jk.dll--to be able to smoothly connect the Tomcat 4.0.* Server with the Apache HTTP Server!!! Does anyone out there have the download link to access and then install this file WHICH I STILL DON'T HAVE! I am getting sick and tired of seeing other members of the tomcat users newsgroup referring to this file, but I still do not have access to it!!! * Jeff Larsen wrote: Thanks, I figured that I wasn't the first one to see this. Is my current mod_jk going to need upgrading also? Jeff - Original Message - From: Tim Funk [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Friday, August 02, 2002 12:28 PM Subject: Re: Apache + Tomcat sometimes pegs CPU Upgrade to 4.0.4. Earlier (4.0.X) versions have a problems with POST requests when the browser terminates before sending enough data. This caused an infinite loop between apache and tomcat. Here is the simple way to reproduce, (and watch your cpu go way up): % telnet webserver 80 POST /somepage.jsp HTTP/1.1 Host: webserver:80 Connection: Close Content-Type: application/x-www-form-urlencoded Content-Length: 200 PutStuff here and kill telnet session before 200 chars -Tim Jeff Larsen wrote: I forgot to mention... Even when the CPU is pegged, the site functions normally. Jeff - Original Message - From: Jeff Larsen [EMAIL PROTECTED] To: tomcat-user [EMAIL PROTECTED] Sent: Friday, August 02, 2002 12:02 PM Subject: Apache + Tomcat sometimes pegs CPU I'm running Apache 1.3.23/Tomcat 4.0.3 (jdk1.3.1) on Solaris 7 connected with mod_jk. Sometimes I I find that the CPU on the web server box is pegged at 100%. It's a dedicated server and I am bouncing Apache and Tomcat once a week to help alleviate the problem. If I didn't restart every week, it would just be a matter of time before things spiraled out of control again. The processes that are responsible are java (Tomcat) and libhttpd.ep (Apache, with --enable-rule=SHARED_CORE) each with about 50% of the CPU. If I bounce Tomcat, no change. If I bounce Apache, it returns to normal (low) CPU usage. I have Apache running on other machines without Tomcat and this does not happen. So it's got to be a mod_jk thing. There are no log messages of any significance. Any ideas on how to fix it? Thanks, Jeff -- To unsubscribe, e-mail:
Re: URL configuration.
This may be a bit basic, but besides setting the port to 80 in server.xml, make sure you've got a valid DNS record to point your domainname to that IP address. I got the impression from your message that they weren't linked. Regards, Michael - Original Message - From: Turner, John [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Sent: Wednesday, July 31, 2002 7:53 AM Subject: RE: URL configuration. If you want to use tomcat stand-alone (no separate webserver), change the port in server.xml. If you want to use tomcat in conjunction with a webserver (Apache, IIS, iPlanet, etc) you will need a connector so that servlet and JSP requests on port 80 are sent to tomcat. John Turner [EMAIL PROTECTED] -Original Message- From: RNivas [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 31, 2002 3:10 AM To: Tomcat-User Subject: URL configuration. I am having application running on Tomcat at port 8080. every time i access the application i am getting URL like http://ip-adress:8080/start.jsp I am having one registered domain name www.123domain.com How can I access my application like www.123domain.com/start.jsp My server running at winNT 4.0 Thanks RN -- 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: Finding the servlets
Toby, Not sure about the 'reserved' bit, but webapps is the default starting point for Tomcat to look for directories that conform to the specs. Each subdirectory should be a complete Context. I'm not sure if the name 'webapps' is actually specified, but that is beside the point. Tomcat will auto-load any directory under webapps/ as a Context. I'm not sure what would happen if you changed the parameters to these entries: AutoWebApp dir=modules host=DEFAULT trusted=true/ AutoDeploy source=webapps target=webapps / If you want to specify a directory outside of the Tomcat install as a Context (and thus having its own WEB-INF and whatnot) 3.3.1 lets you write a simple XML file for each Context definition and stick it in conf/ At the end of server.xml: !-- Context definitions can be placed here ( not recommended ) or in separate files. The ContextXmlReader will read all context definitions ( you can customize the base filename ). The default is conf/apps-[name].xml. See conf/apps-examples.xml and conf/apps-admin.xml -- So, add a conf/apps-webprod.xml or something to that effect and customize the docBase attribute and whatever else you need to do. Context path=/webapp docBase=/web/prod/webapp reloadable=false trusted=false /Context Hope this helped. Regards, Michael Locasto - Original Message - From: Toby Saville [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Sent: Wednesday, July 31, 2002 2:20 AM Subject: Finding the servlets How do i tell tomcat (3.3.1) to use a directory other than ROOT for finding the WEB-INF with my servlets? I want to run my website in /web/prod/webapp/ and have the servlets in WEB-INF/classes/ but tomcat keeps looking in tomcat_install/webapps/ROOT/WEB-INF/classes/. Also, is the webapps/ directory a reserved name that tomcat looks for (like WEB-INF) or is it just set via the AutoWebApp directive in server.xml? thanks. -t0bes *** This message is intended for the addressee named and may contain confidential information. If you are not the intended recipient, please delete it and notify the sender. Views expressed in this message are those of the individual sender, and are not necessarily the views of the Department of Information Technology Management. This email message has been swept by MIMEsweeper for the presence of computer viruses. *** -- 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: memory management
Brian, % path/to/your/jdk/bin/java -X will print out the help for non-standard command line argument extensions for the JVM. You can increase the amount of heap space and other good stuff available to the whole JVM. AFAIK, Tomcat sets no limit on the amount of memory a servlet consumes. Regards, Michael - Original Message - From: Brian Wolf [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, July 31, 2002 9:45 PM Subject: memory management Can anyone tell me how to increase the amount of memory available to a servlet running in tomcat? Thanks in advance! Brian -- 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: Apache + mod_jk + Tomcat + Internet
I'm not so sure you want to do this anyway; besides the security considerations, you're going to take an extra performance hit where every request for dynamic content has to go back out over the web to your Tomcat machine and come back ... Why can't you just put Tomcat on the Linux box too? or apache on Windows? or run Tomcat standalone... Regards, Michael Locasto - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, July 31, 2002 6:22 PM Subject: Apache + mod_jk + Tomcat + Internet Hi All I was wondering if the following is possible I have a Apache (1.3.26) web server on Linux and a tomcat (4.04) on Windows XP which communicates via the mod_jk module. At present they are on the LAN but due to exceptional reasons I need to separate them and the only way I will be able to connect them is over the internet. Is it possible for me too safely have them running as if they were operating on a safe LAN as before without the need of a VPN? Regards -- 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: TC and applicationwide beans
Tomcat 3.3.x provides the lib/apps directory (see the README file in there) for Jar files that contains classes to be shared among all webapps. Sessions are not cross-context. Sessions are specific to the webapp they are created in for security reasons. Sessions are created via a request.getSession() call in your servlet or JSP. So, you can use the same class definition of a bean in two separate webapps if the class definition is in $TOMCAT_HOME/lib/apps... (or alternatively, in the WEB-INF/lib directories of your two webapps, but that is just wasted space). The webapps will create two separate instances of your bean. Regards, Michael - Original Message - From: Power-Netz (Schwarz) [EMAIL PROTECTED] To: tomcat liste [EMAIL PROTECTED] Sent: Monday, July 29, 2002 5:58 AM Subject: TC and applicationwide beans Hi, can tomcat swap beans from one application to another if both use the classes? If I have a webapp A which granted access to the system and uses a login bean to store the data, does tc accept this bean ( in the same session ) on the webapp B with same classes? Or is a new session created if the user switches from one app to another??? (related to tc 3.3.2dev) Ihr Support-Team POWER-NETZ® Full-Service-Provider Online-Support: Support: 0190 - 15 11 15 (EUR 0,62/Min) http://Support.Power-Netz.de (kostenlos) http://Support.Power-Netz.com (kostenlos) Vertrieb Tel: 01805 - 57 35 57 (EUR 0,12/Min.) Vertrieb Fax: 01805 - 57 45 57 (EUR 0,12/Min.) Power-Netz Am Plan 1 37581 Bad Gandersheim http://www.Power-Netz.de mailto:[EMAIL PROTECTED] +=+ --I N F O C E N T E R-- + Senden Sie eine leere e-mail an: + Providerwechsel: mailto:[EMAIL PROTECTED] + Daten/Preise Webspace: mailto:[EMAIL PROTECTED] + Reseller-Programm: mailto:[EMAIL PROTECTED] + Dedizierte Server: mailto:[EMAIL PROTECTED] + Adult/Erotikserver: mailto:[EMAIL PROTECTED] + Domainpreise: mailto:[EMAIL PROTECTED] + Domain-Nameserver: mailto:[EMAIL PROTECTED] + SSL-Zertifikate: mailto:[EMAIL PROTECTED] + Geschaeftsbedingungen: mailto:[EMAIL PROTECTED] + =+ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: runaway queries with tomcat and Progress database using JDBC driver.
- Original Message - From: Nathan Smith [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Sunday, July 28, 2002 7:28 PM Subject: runaway queries with tomcat and Progress database using JDBC driver. Does anybody have any ideas on how I might implement the best practical way to shutdown or stop a query once it has been executed in a servlet and has taken too long to return back any data. Why is it taking too long? In general, once you call statement.executeXXX(), the call is translated and passed on to your database. You can't stop that unless your database has some control software to examine and stop running queries. Make sure your SQL is doing what you want it to and not trying to return the cross-product of two or more tables or something else that would take a long time. But of course, you could want it to take a long time... For example, I've got a Servlet that uploads quite a bit of data into my database, and it takes about 10 to 15 minutes, but I expect that, so it's cool. Since I *don't* fork this job off, the servlet does not immediately return, and I get no webpage back for that time, and the request winds up timing out. But the servlet (and the database) is still chugging merrily away... One solution is to execute the query within a new thread and then try and make the thread exit after a certain amount of time has elapsed. The difficult part of this will stopping the thread also stop the process running on the server, as once the query is executed it gets communicated through the driver to the SQL engine and then to the database. The database is probably doing something; and unless your database software is shoddy, that something is probably exactly what you told it to do, and it's not merely timing out or hanging.. If you want the Servlet to return immediately, then the solution is to pass that task off to another thread, which I'll call SQLWorker. Depending on the nature of the task and the way you write the SQLWorker, you may or may not be able to stop the query in the database server. If you are only executing 1 SQL statement, then stopping the SQLWorker won't do much good because the database already is processing the query. On the other hand, if you've got a whole bunch, stopping the SQLWorker will stop it from sending further queries. Hope this helps.. Regards, Michael -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: warp connector and number of connecionst
I'm assuming you're using some 4.0.x version, I think warp has been deprecated and replaced by Coyote in 4.1. This document isn't of much use... http://jakarta.apache.org/tomcat/tomcat-4.0-doc/config/warp.html but you can probably find out the answer in the source org.apache.catalina.connector.warp.WarpConnector I believe that maxProcessors represents the number of threads that will be created to handle request/response pairs. However, each thread can probably handle a number of open connections. In the following config entry, perhaps acceptCount is the number of connections each processor can handle. Connector className=org.apache.catalina.connector.warp.WarpConnector port=8008 minProcessors=5 maxProcessors=75 enableLookups=true appBase=webapps acceptCount=10 debug=0/ The source would be your best bet. Regards, Michael - Original Message - From: Ryszard Lach [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, July 28, 2002 5:58 PM Subject: warp connector and number of connecionst Hi! What does maxProcessors attribute in warp connector mean ? I thought it is the total number of connections between apache and the engine the connector was defined in, but I see there is many times more established tcp connections between my apache and tomcat then defined in maxProcessors. Maybe it is the number of connections for every application ? Richard. -- First they ignore you. Then they laugh at you. Then they fight you. Then you win. - Mohandas Gandhi. -- 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: Tomcat developer or user documentation.
Nathan, There is pretty good documentation both on the website and contained within the distributions in the doc/ directory. There is no John Q's Chronicle of Setting Up Tomcat 3.3.1 to the best of my knowledge. However, I think that something like that would be a great thing to write and submit to the developer list. If I only had the time... ;) This is for 4.0: http://jakarta.apache.org/tomcat/tomcat-4.0-doc/index.html http://jakarta.apache.org/tomcat/tomcat-4.0-doc/appdev/index.html and for 3.3.1 http://jakarta.apache.org/tomcat/tomcat-3.3-doc/index.html The source code is another good place, at least to understand the architecture or finer points of performance. The performance of your Servlets hitting the database is pretty much up to the developers of your Servlets and the database machine. Making Tomcat 3.3.1 bulletproof probably means stripping out the non-essential items (examples/ test/ admin/), making sure your webapps are performance demons, creating a proper set of workers/connectors to your load, and making sure you have enough memory. You might also have to play with the Session manager params too. Taking down your log levels is a possible performance gain too. If you define any Context entries in server.xml, set reloadable=false. Having a webserver like Apache handle static content is a plus. A search of the mailing list for similar topics might yield some fruit, as well as a general call for folks to write up their ten best tips and tricks, and submit it to the list. Maybe we can put together a document between us. Regards, Michael - Original Message - From: Nathan Smith [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Sunday, July 28, 2002 11:38 PM Subject: Tomcat developer or user documentation. Is their anywhere some really solid indepth documentation for setting up and maintaining tomcat for production or development environments. I need to tweak Tomcat 3.3.1 so that it is basically bulletproof and will not fall over under strenuous use, or basically when many users are querying a database and waiting for results concurrently. The more advanced information the better, thanks. Nathan. -- 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: How to migrate for Tomcat 3.3.1 to Tomcat 4.x?
Nathan, The Tomcat homepage says that Version 4.0 implements the final released versions of the Servlet 2.3 and JSP 1.2 specifications. As required by the specifications, Tomcat 4.0 also supports web applications built for the Servlet 2.2 and JSP 1.1 specifications with no changes. So it looks like 4.0 will support your webapps. Check out the new server.xml and the docs. You can read the specs here: http://jcp.org/aboutJava/communityprocess/first/jsr053/index.html A check of bugzilla for any outstanding or serious bugs against the version of Tomcat 4 you are thinking of migrating to would be helpful. Beyond that, your best bet would be to download it and see what breaks when you move your webapps to the development environment. Regards, Michael - Original Message - From: Nathan Smith [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Sunday, July 28, 2002 11:46 PM Subject: How to migrate for Tomcat 3.3.1 to Tomcat 4.x? Have I been living under a rock or something? Does anybody know of information for migrating a Tomcat 3.3.1 web application to Tomcat 4.x and up. I have had Tomcat 4.0 able to start in the past and had the logon screen loaded but after logging in an exception is thrown for the next page. Both pages are jsp's. What is needed to have the web application working under Tomcat 4.x and if anything what needs to be changed. I know that the Servlet and JSP specifications have changed regarding the web.xml, which has to have all elements in the correct order and the most of the elements for taglib tld files now have '-' in them. Is their something quite important I have missed or forgotten about, it's sure not a simple task of copying the web application from one tomcat to another. Nathan. -- 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]
load balancing workers admin tool
Hey all, Are there any tomcat administration modules in the works or do i have to build my own? Specifically, I'm thinking about managing multiple JVM's/workers for load balancing. I'd also like to be able to manage contexts in a more secure manner than the current /admin context allows... I know that most of this stuff is pretty simple administration of XML or properties files but the server itself is in a 24x7 environment and can't be taken down/restarted. Any administration would have to be a live change. Any information about an easy way to do these kind of things would be much appreciated. I've been using the Tomcat environment and doing basic configurations for a while now, but I'm a newbie at being an admin. Thanks for reading, -michael