Re: Only one ssl domain per server instance?
Hassan Schroeder wrote: Mark Winslow wrote: I'm wondering if there's a way to get more than one ssl domain per server instance. The ssl Connector tag seems to be in the top level in server.xml. You can define multiple Connectors, each with its own keystore. But don't forget that each will need to be on a different port. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Reloadable Hangs
Dear all, I have installed Java is 1.4.1 Tomcat 5.0.28 in Windows 2000 sp1 with 1GB Ram Tomcat is running as a service. Context Reloadable == true When we compile .java into .class, Tomcat will not serve page anymore. We have to restart Tomcat inside Services or from the Monitor Tomcat menu. We have no problen with lower versions of Tomcat. What do i need to reconfigure? Edward - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
jspServlet runs out of memory while compiling some jsp files using fork=true
Hi, I'm having OutOfMemory error while Tomcat tries to compile jsp files. The problem occures few times in day so it's quite hard to repeat. Tomcat is configured to run javac in separate JVM with fork=true option. I tried to give more memory for ant using ANT_OPTS, but it didn't help. I read source code for the jasper compiler and there are variables that configure how much memory is given to ant, but I'm not able to configure them with jspServlet init parameters. How should I resolved this? Is the Jikes compiler a solution worth of trying? Stacktrace included below. I have hundreds of jars in classpath... so I can't paste the whole compiler output. BR, Vesa Varimo [EMAIL PROTECTED] 2005-05-26 21:42:53 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception java.lang.OutOfMemoryError May 7, 2005 12:21:42 PM org.apache.jasper.compiler.Compiler generateClass SEVERE: Javac exception Compile failed; see the compiler error output for details. at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:944) at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:764) at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:379) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:472) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:451) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:439) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
2 parallel requests from one user
Hi all, we have a struts action which runs in some cases very long ( 1min). In this case, a firewall between client and server cuts the connection due to inactivity. To avoid this timeout, we execute the core action in a thread, while the wrapper action polls the result of the action thread. If the result (the forward object) comes in time everything is ok and we forward to the next page. If the action takes too much time we forward to a refresh page, just before the firewall timeout will be activated. This refresh page calls the wrapper action again, and polls for a result of the core action thread until it is available. The problem is, that the core action uses the request and response objects. But these objects will be invalid, if the refresh page calls the wrapper action again and therefore the core action pukes. We use struts 1.1 and tomcat 4.1.x Does anybody have an idea, how to solve these problem? Thanks in advance for help. __ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Are we required to move to Tomcat 5.5 in order to move to JDK 1.5
I think these are both in the release/changes notes that I posted a link to earlier in this thread - so yes these are real issues. -Original Message- From: Mark Leone [mailto:[EMAIL PROTECTED] Sent: Friday 27 May 2005 02:14 To: Tomcat Users List Subject: Re: Are we required to move to Tomcat 5.5 in order to move to JDK 1.5 Sounds like the consensus is that Tomcat 5.0.x will work with jdk 1.5. FWIW I found the following two problems trying to run code built for jre 1.4 in a 1.5 jvm. 1. A couple DOM classes (don't remember which ones, but you'll know it if you run in to them) had some methods added in jdk 1.5. If you try to load an implementation class for one of these that was developed in jdk 1.4, you'll get missing method implementation errors. To resolve, you can add empty method specifications for the classes that require them, or upgrade to an XML parser that was written for jdk 1.5. 2. JDK 1.5 uses the symbol enum as a reserved keyword. You'll have to change any and all occurrences of this symbol in your code (where it is used as a variable name) to something else, e.g. enumer. There may be other backward compatibility issues, but these are the two that I've run into. -Mark Tim Diggins wrote: And, oops, I'm sorry for spreading the original FUD - Following this thread, I've just tried again to get everything working on tc5.0/jdk1.5 and hey-presto, everything ok - guess I must've had TC running on jdk1.4 after all... But planning to migrate to 5.5 anyway. thanks everyone T Steve Kirk wrote: Yes sorry, david is correct, I got it backwards. -Original Message- From: David Smith [mailto:[EMAIL PROTECTED] Sent: Thursday 26 May 2005 12:59 To: Tomcat Users List Subject: Re: Are we required to move to Tomcat 5.5 in order to move to JDK 1.5 Small correction -- 5.5 needs the compat package to work on jdk l.4, not 5.0 needs it to work on jdk 1.5. I've used TC 5.0 jdk 1.5 together no problem. --David Steve Kirk wrote: You can run 5.0.28 on jdk1.5 but you need to add a compatibility package which is available from the tc downloads page. Basically it adds 3 jars to fix issues with xml compatibility with the 1.4 vm. I haven't done it myself (I upgraded both at once) but google some of these words and you can read all about it. PS if you do go to 5.5 and have DBCP, be sure to change your context.xml to the new format required by TC5.5. I spent nearly 3 days working that out. -Original Message- From: Raverkar, Sachin (Sachin) [mailto:[EMAIL PROTECTED] Sent: Thursday 26 May 2005 08:58 To: tomcat-user@jakarta.apache.org Subject: Are we required to move to Tomcat 5.5 in order to move to JDK 1.5 Hi all, We are currently using Tomcat-5.0.28 and JDK 1.4.2_03. We need to move onto JDK 1.5. We would build our war file using JDK 1.5. Can we continue to use Tomcat-5.0.28 with JDK 1.5? Do you see any problem? Are there any known issues? Since Tomcat 5.5 is designed to run on J2SE 5.0 [JDK 1.5] and later, are we required to move to Tomcat 5.5 in order to move to JDK 1.5? - Sachin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Error filterStart in org.apache.catalina.core.StandardContext st art
Hi, I'm getting This Error while starting Tomcat. I searched the web an found out that this error can occur if starting Tomcat misses this param in CATALINA_OPTS: -Djava.awt.headless=true I checked the starting procedure and found out, that this param is set properly in the call looking like this: CATALINA_OPTS=-Xmx1024m -Xms256m -Djava.awt.headless=true -DTomcat_hale -Dlog4j.configuration=file:opt/jakarta-tomcat-5.0.28_hale/log4j.lcf -server; export CATALINA_OPTS Not having much experience with tomcat I have no idea what else could be the reason for this error. Could anyone help me? Thank you. Greetings Alexandra Strauß Oberlandesgericht München Gemeinsame IT-Stelle der bayerischen Justiz Referat IT-4 Serverbetrieb/Rechenzentrum SG4.3 Infanteriestr. 5 80797 München -- Catalina-out -- 27.05.2005 11:04:52 org.apache.catalina.core.StandardContext start SCHWERWIEGEND: Error filterStart 27.05.2005 11:04:52 org.apache.catalina.core.StandardContext start SCHWERWIEGEND: Context startup failed due to previous errors 27.05.2005 11:04:52 org.apache.catalina.core.StandardHostDeployer install INFO: Installing web application at context path /servlets-examples from URL file:/opt/jakarta-tomcat-5.0.28_hale/webapps/servlets-examples 27.05.2005 11:04:52 org.apache.catalina.core.StandardContext start SCHWERWIEGEND: Error filterStart 27.05.2005 11:04:52 org.apache.catalina.core.StandardContext start SCHWERWIEGEND: Context startup failed due to previous errors 27.05.2005 11:04:52 org.apache.catalina.core.StandardHostDeployer install INFO: Installing web application at context path /tomcat-docs from URL file:/opt/jakarta-tomcat-5.0.28_hale/webapps/tomcat-docs 27.05.2005 11:04:52 org.apache.catalina.core.StandardHostDeployer install INFO: Installing web application at context path /webdav from URL file:/opt/jakarta-tomcat-5.0.28_hale/webapps/webdav 27.05.2005 11:04:52 org.apache.catalina.core.StandardHostDeployer install INFO: Installing web application at context path /archive_sich from URL file:/opt/jakarta-tomcat-5.0.28_hale/webapps/archive_sich 27.05.2005 11:04:52 org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-8090 27.05.2005 11:04:52 org.apache.jk.common.ChannelSocket init INFO: Port busy 8009 java.net.BindException: Adresse wird bereits benutzt 27.05.2005 11:04:52 org.apache.jk.common.ChannelSocket init INFO: Port busy 8010 java.net.BindException: Adresse wird bereits benutzt 27.05.2005 11:04:52 org.apache.jk.common.ChannelSocket init INFO: Port busy 8011 java.net.BindException: Adresse wird bereits benutzt 27.05.2005 11:04:52 org.apache.jk.common.ChannelSocket init INFO: Port busy 8012 java.net.BindException: Adresse wird bereits benutzt 27.05.2005 11:04:52 org.apache.jk.common.ChannelSocket init INFO: JK2: ajp13 listening on /0.0.0.0:8013 27.05.2005 11:04:52 org.apache.jk.server.JkMain start INFO: Jk running ID=4 time=0/39 config=/opt/jakarta-tomcat-5.0.28_hale/conf/jk2.properties 27.05.2005 11:04:53 org.apache.catalina.startup.Catalina start INFO: Server startup in 6516 ms - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Consecutive threads
Kenneth Jensen: On 4/21/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: If I run a long query, followed by a series of short queries ( different browsers/pcs ) then the latter all wait for the long query to return rather than completing first as I expected. A quick guess would be that your first query starts a transaction and locks some DB-resources, and the following queries have to wait for them to become unlocked. I'm using log4j for debugging and this shows that only 2 threads are active at any given time. I ran about 12 requests that each took a minute or so to run. Only 4 different threads were used to run them and only 2 were running at a time. The application logs on starting and stopping before accessing any resources such as a database. Two threads did most of the requests consecutively between them. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Logging into rational database....
IIRC - there is a JDBCAccessLogValve - You may need to check the javadocs on its use. -Tim David wrote: Hallo, I have sent this question yesterday but nobody responded. It's a short question so please send me some information. Is it possible to configure tomcat to log the access log into a rational database? Is there an existing tutorial? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: Logging into rational database....
That's all I wanted to know. Thanks David -Ursprüngliche Nachricht- Von: Tim Funk [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 27. Mai 2005 13:30 An: Tomcat Users List Betreff: Re: Logging into rational database IIRC - there is a JDBCAccessLogValve - You may need to check the javadocs on its use. -Tim David wrote: Hallo, I have sent this question yesterday but nobody responded. It's a short question so please send me some information. Is it possible to configure tomcat to log the access log into a rational database? Is there an existing tutorial? - 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: Error filterStart in org.apache.catalina.core.StandardContext start
Are you by any chance running on a server that has no video card/monitor? A few years ago a colleague mentioned that the headless=true is required in this situation, something to do with whether the AWT classes need to be loaded, my memory is a bit vague on it. You have 4 forward slashes but then only single slashes afterwards, is that right? Looks odd, / cannot be an escape if used alone, so why 4? -Original Message- From: Strauss, Alexandra [mailto:[EMAIL PROTECTED] Sent: Friday 27 May 2005 12:07 To: 'tomcat-user@jakarta.apache.org' Subject: Error filterStart in org.apache.catalina.core.StandardContext start Hi, I'm getting This Error while starting Tomcat. I searched the web an found out that this error can occur if starting Tomcat misses this param in CATALINA_OPTS: -Djava.awt.headless=true I checked the starting procedure and found out, that this param is set properly in the call looking like this: CATALINA_OPTS=-Xmx1024m -Xms256m -Djava.awt.headless=true -DTomcat_hale -Dlog4j.configuration=file:opt/jakarta-tomcat-5.0.28_hale/ log4j.lcf -server; export CATALINA_OPTS Not having much experience with tomcat I have no idea what else could be the reason for this error. Could anyone help me? Thank you. Greetings Alexandra Strauß Oberlandesgericht München Gemeinsame IT-Stelle der bayerischen Justiz Referat IT-4 Serverbetrieb/Rechenzentrum SG4.3 Infanteriestr. 5 80797 München -- -- -- -- -- Catalina-out -- -- -- -- -- 27.05.2005 11:04:52 org.apache.catalina.core.StandardContext start SCHWERWIEGEND: Error filterStart 27.05.2005 11:04:52 org.apache.catalina.core.StandardContext start SCHWERWIEGEND: Context startup failed due to previous errors 27.05.2005 11:04:52 org.apache.catalina.core.StandardHostDeployer install INFO: Installing web application at context path /servlets-examples from URL file:/opt/jakarta-tomcat-5.0.28_hale/webapps/servlets-examples 27.05.2005 11:04:52 org.apache.catalina.core.StandardContext start SCHWERWIEGEND: Error filterStart 27.05.2005 11:04:52 org.apache.catalina.core.StandardContext start SCHWERWIEGEND: Context startup failed due to previous errors 27.05.2005 11:04:52 org.apache.catalina.core.StandardHostDeployer install INFO: Installing web application at context path /tomcat-docs from URL file:/opt/jakarta-tomcat-5.0.28_hale/webapps/tomcat-docs 27.05.2005 11:04:52 org.apache.catalina.core.StandardHostDeployer install INFO: Installing web application at context path /webdav from URL file:/opt/jakarta-tomcat-5.0.28_hale/webapps/webdav 27.05.2005 11:04:52 org.apache.catalina.core.StandardHostDeployer install INFO: Installing web application at context path /archive_sich from URL file:/opt/jakarta-tomcat-5.0.28_hale/webapps/archive_sich 27.05.2005 11:04:52 org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-8090 27.05.2005 11:04:52 org.apache.jk.common.ChannelSocket init INFO: Port busy 8009 java.net.BindException: Adresse wird bereits benutzt 27.05.2005 11:04:52 org.apache.jk.common.ChannelSocket init INFO: Port busy 8010 java.net.BindException: Adresse wird bereits benutzt 27.05.2005 11:04:52 org.apache.jk.common.ChannelSocket init INFO: Port busy 8011 java.net.BindException: Adresse wird bereits benutzt 27.05.2005 11:04:52 org.apache.jk.common.ChannelSocket init INFO: Port busy 8012 java.net.BindException: Adresse wird bereits benutzt 27.05.2005 11:04:52 org.apache.jk.common.ChannelSocket init INFO: JK2: ajp13 listening on /0.0.0.0:8013 27.05.2005 11:04:52 org.apache.jk.server.JkMain start INFO: Jk running ID=4 time=0/39 config=/opt/jakarta-tomcat-5.0.28_hale/conf/jk2.properties 27.05.2005 11:04:53 org.apache.catalina.startup.Catalina start INFO: Server startup in 6516 ms - 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: Logging into rational database....
I think there is a DBCP logger, but this is for the Java code logging statements, rather than for the access log AFAIK. Can't remember where I read this. Probably on the TC site, try starting here: http://jakarta.apache.org/tomcat/tomcat-5.5-doc/index.html -Original Message- From: David [mailto:[EMAIL PROTECTED] Sent: Friday 27 May 2005 12:14 To: tomcat-user@jakarta.apache.org Subject: Logging into rational database Hallo, I have sent this question yesterday but nobody responded. It's a short question so please send me some information. Is it possible to configure tomcat to log the access log into a rational database? Is there an existing tutorial? Thanks David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Logging into rational database....
On 5/27/05, David [EMAIL PROTECTED] wrote: Hallo, I have sent this question yesterday but nobody responded. It's a short question so please send me some information. Is it possible to configure tomcat to log the access log into a rational database? Is there an existing tutorial? Thanks David Log4J can do that. Tomcat will use Log4J if it is configured. Search in the archives to learn how to configure it. -- rgds Anto Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Reloadable Hangs
Hi, Context Reloadable == true When we compile .java into .class, Tomcat will not serve page anymore. We have to restart Tomcat inside Services or from the Monitor Tomcat menu. We have seen same here. Tomcat = 5.0.28 hangs, there seems to be a ThreadDeath exception sometimes when reload is going on. Environment is Windows XP and JDK 1.4.2. We have no problen with lower versions of Tomcat. I think that 5.0.25 used to work me. Aro S- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Logging into rational database....
Hello Use a Valve component and use the class named JDBCaccessLogValve Here is an useful URL http://jakarta.apache.org/tomcat/tomcat-5.5-doc/catalina/docs/api/org/apache /catalina/valves/JDBCAccessLogValve.html Jean-Claude -Message d'origine- De : David [mailto:[EMAIL PROTECTED] Envoyé : vendredi 27 mai 2005 13:14 À : tomcat-user@jakarta.apache.org Objet : Logging into rational database Hallo, I have sent this question yesterday but nobody responded. It's a short question so please send me some information. Is it possible to configure tomcat to log the access log into a rational database? Is there an existing tutorial? Thanks David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Reloadable Hangs
Hello How did you deploy the application ? with a WAR file ? or by installing an unpacked directory ? I read in the Professional Apache Tomcat5 book that the relaod attribute work fine only with an application installed from an unpacked directory not with a WAR file Jean-Claude -Message d'origine- De : edward see [mailto:[EMAIL PROTECTED] Envoyé : vendredi 27 mai 2005 11:32 À : tomcat-user@jakarta.apache.org Objet : Reloadable Hangs Dear all, I have installed Java is 1.4.1 Tomcat 5.0.28 in Windows 2000 sp1 with 1GB Ram Tomcat is running as a service. Context Reloadable == true When we compile .java into .class, Tomcat will not serve page anymore. We have to restart Tomcat inside Services or from the Monitor Tomcat menu. We have no problen with lower versions of Tomcat. What do i need to reconfigure? Edward - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
my build structure..opinions wanted
hi, i'm starting a project using jsp + javaBeans.. i've worked with java a lot, but i have not much experience with web applications.. for now my idea is that the application will be using javabeans, and jsp for displaying the data... i use eclipse for the development, which nicely compiles every source file automatically when i edit them. that's why i came up with the following idea: i'll create a directory in tomcat/webapps (let's call it 'mywebapp'). put my source files into mywebapp/WEB-INF/src, and instruct eclipse to put the compiled .class files into mywebapp/WEB-INF/classes. this way, i simply edit the files, press ctrl-s (to save them), switch to the browser window, and press refresh, and already i get the new results (because eclipse already compiled the file, and tomcat detected the change). i tested this approach, and it works ok. is this a suitable approach? are there any dangers with this approach? gabor - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: jspServlet runs out of memory while compiling some jsp files using fork=true
Hi, I would suggest that you do a precompilation of your jsps on a deployment machine which is separate from the live machine. So your compilation is not done on the live server, which might be on heavy load. Also you don't have the problem that the first visitor has to wait an awful long time until the page get's displayed. Cheers Bernhard -Ursprüngliche Nachricht- Von: Vesa Varimo [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 27. Mai 2005 12:45 An: tomcat-user@jakarta.apache.org Betreff: jspServlet runs out of memory while compiling some jsp files using fork=true Hi, I'm having OutOfMemory error while Tomcat tries to compile jsp files. The problem occures few times in day so it's quite hard to repeat. Tomcat is configured to run javac in separate JVM with fork=true option. I tried to give more memory for ant using ANT_OPTS, but it didn't help. I read source code for the jasper compiler and there are variables that configure how much memory is given to ant, but I'm not able to configure them with jspServlet init parameters. How should I resolved this? Is the Jikes compiler a solution worth of trying? Stacktrace included below. I have hundreds of jars in classpath... so I can't paste the whole compiler output. BR, Vesa Varimo [EMAIL PROTECTED] -- -- 2005-05-26 21:42:53 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception java.lang.OutOfMemoryError May 7, 2005 12:21:42 PM org.apache.jasper.compiler.Compiler generateClass SEVERE: Javac exception Compile failed; see the compiler error output for details. at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:944) at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:764) at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:379) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:472) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:451) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:439) at org.apache.jasper.JspCompilationContext.compile(JspCompilation Context.java:511) at org.apache.jasper.servlet.JspServletWrapper.service(JspServlet Wrapper.java:295) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet .java:292) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilt er(ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(Appli cationFilterChain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardW rapperValve.java:214) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: my build structure..opinions wanted
On 5/27/05, gabor [EMAIL PROTECTED] wrote: i'll create a directory in tomcat/webapps (let's call it 'mywebapp'). put my source files into mywebapp/WEB-INF/src, and instruct eclipse to put the compiled .class files into mywebapp/WEB-INF/classes. this way, i simply edit the files, press ctrl-s (to save them), switch to the browser window, and press refresh, and already i get the new results (because eclipse already compiled the file, and tomcat detected the change). How you will deploy the application in test and production environments. Here I use Eclipse and Ant. I disable the reloadable feature and uses the manager application to reload the application. If reloadable is enabled TC will reload the application every time I compile a Java file. -- rgds Anto Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: jspServlet runs out of memory while compiling some jsp files using fork=true
Yes, that would be one solution, but not suitable for our case because our webmasters are constantly updating jsp pages on our production servers. Btw. I'm using tomcat 5.0.28. Thx, Vesa - Original Message - From: Bernhard Slominski [EMAIL PROTECTED] To: 'Tomcat Users List' tomcat-user@jakarta.apache.org Sent: Friday, May 27, 2005 3:25 PM Subject: AW: jspServlet runs out of memory while compiling some jsp files using fork=true Hi, I would suggest that you do a precompilation of your jsps on a deployment machine which is separate from the live machine. So your compilation is not done on the live server, which might be on heavy load. Also you don't have the problem that the first visitor has to wait an awful long time until the page get's displayed. Cheers Bernhard -Ursprüngliche Nachricht- Von: Vesa Varimo [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 27. Mai 2005 12:45 An: tomcat-user@jakarta.apache.org Betreff: jspServlet runs out of memory while compiling some jsp files using fork=true Hi, I'm having OutOfMemory error while Tomcat tries to compile jsp files. The problem occures few times in day so it's quite hard to repeat. Tomcat is configured to run javac in separate JVM with fork=true option. I tried to give more memory for ant using ANT_OPTS, but it didn't help. I read source code for the jasper compiler and there are variables that configure how much memory is given to ant, but I'm not able to configure them with jspServlet init parameters. How should I resolved this? Is the Jikes compiler a solution worth of trying? Stacktrace included below. I have hundreds of jars in classpath... so I can't paste the whole compiler output. BR, Vesa Varimo [EMAIL PROTECTED] -- -- 2005-05-26 21:42:53 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception java.lang.OutOfMemoryError May 7, 2005 12:21:42 PM org.apache.jasper.compiler.Compiler generateClass SEVERE: Javac exception Compile failed; see the compiler error output for details. at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:944) at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:764) at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:379) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:472) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:451) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:439) at org.apache.jasper.JspCompilationContext.compile(JspCompilation Context.java:511) at org.apache.jasper.servlet.JspServletWrapper.service(JspServlet Wrapper.java:295) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet .java:292) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilt er(ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(Appli cationFilterChain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardW rapperValve.java:214) - 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: my build structure..opinions wanted
Don't leave the source on the production server, but it's fine in development. Strictly speaking your source files are inaccessible by web clients if they are under WEB-INF, but better safe than sorry. Why not store the src in another folder altogether - eclipse won't care where it is presumably, and this is slightly better practice. The other approach is to build a jarfile from a build script (e.g. using ant), then copy the jar to the webapps/ directory, TC will auto-deply it. Some would say this is the only way to do it. However it does slow things down when you are making frequent small changes to code. For my money, the value of a jar is ease of portability, which is a factor if you are writing for true cross-container support. I built classes direct to classes/ for a long time, then made the effort to switch to jar deployment in development, after being persuaded by people on this list. I'm glad I've done both, but to be honest I think I do prefer building to classes, as it's quicker and I can't see a disadvantage to it during dev. Your approach that sounds a quite practical solution to me. Does eclipse precompile JSPs for you too? One other thing to watch is that logging.properties and properties files go in the classes/ folder, so if you use these, be careful that eclipse does not delete them when rebuilding your classes. -Original Message- From: gabor [mailto:[EMAIL PROTECTED] Sent: Friday 27 May 2005 13:16 To: tomcat-user@jakarta.apache.org Subject: my build structure..opinions wanted hi, i'm starting a project using jsp + javaBeans.. i've worked with java a lot, but i have not much experience with web applications.. for now my idea is that the application will be using javabeans, and jsp for displaying the data... i use eclipse for the development, which nicely compiles every source file automatically when i edit them. that's why i came up with the following idea: i'll create a directory in tomcat/webapps (let's call it 'mywebapp'). put my source files into mywebapp/WEB-INF/src, and instruct eclipse to put the compiled .class files into mywebapp/WEB-INF/classes. this way, i simply edit the files, press ctrl-s (to save them), switch to the browser window, and press refresh, and already i get the new results (because eclipse already compiled the file, and tomcat detected the change). i tested this approach, and it works ok. is this a suitable approach? are there any dangers with this approach? gabor - 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: my build structure..opinions wanted
I have this target in my build-file. This makes Eclipse transfer my webapp in a jar file to the Tomcat server, which then automatically reloads it. target name=deploy depends=jar description=Deploy webapp to server copy file=${jarfile} todir=${webappdir}/WEB-INF/lib / exec executable=/usr/bin/scp arg file=${jarfile}/ arg value=tomcat.mydomain.dk:${webappdir}/WEB-INF/lib/ /exec /target --- Cheers, Kenneth On 5/27/05, Steve Kirk [EMAIL PROTECTED] wrote: Don't leave the source on the production server, but it's fine in development. Strictly speaking your source files are inaccessible by web clients if they are under WEB-INF, but better safe than sorry. Why not store the src in another folder altogether - eclipse won't care where it is presumably, and this is slightly better practice. The other approach is to build a jarfile from a build script (e.g. using ant), then copy the jar to the webapps/ directory, TC will auto-deply it. Some would say this is the only way to do it. However it does slow things down when you are making frequent small changes to code. For my money, the value of a jar is ease of portability, which is a factor if you are writing for true cross-container support. I built classes direct to classes/ for a long time, then made the effort to switch to jar deployment in development, after being persuaded by people on this list. I'm glad I've done both, but to be honest I think I do prefer building to classes, as it's quicker and I can't see a disadvantage to it during dev. Your approach that sounds a quite practical solution to me. Does eclipse precompile JSPs for you too? One other thing to watch is that logging.properties and properties files go in the classes/ folder, so if you use these, be careful that eclipse does not delete them when rebuilding your classes. -Original Message- From: gabor [mailto:[EMAIL PROTECTED] Sent: Friday 27 May 2005 13:16 To: tomcat-user@jakarta.apache.org Subject: my build structure..opinions wanted hi, i'm starting a project using jsp + javaBeans.. i've worked with java a lot, but i have not much experience with web applications.. for now my idea is that the application will be using javabeans, and jsp for displaying the data... i use eclipse for the development, which nicely compiles every source file automatically when i edit them. that's why i came up with the following idea: i'll create a directory in tomcat/webapps (let's call it 'mywebapp'). put my source files into mywebapp/WEB-INF/src, and instruct eclipse to put the compiled .class files into mywebapp/WEB-INF/classes. this way, i simply edit the files, press ctrl-s (to save them), switch to the browser window, and press refresh, and already i get the new results (because eclipse already compiled the file, and tomcat detected the change). i tested this approach, and it works ok. is this a suitable approach? are there any dangers with this approach? gabor - 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]
How to read a file on disk from a servlet
I have a servlet that must verify signatures on parts of requests, and for that I need to include a keystore file with my trusted certs. This keystore has nothing to do with the server itself and not to be used with SSL/TLS, just with this one webapp. How do I get my servlet to read the keystore file, say if I put it in $CATAILNA_HOME/webapps/mywebapp/WEB-INF/lib/mykeystore.jks. If I just ask for the file lib/mykeystore.jks or another relative path, then the path is relative to the system property user.dir (which I don't know beforehand, depends on the person who started Tomcat last time). I would rather not use an absolute path, and the request will not include information about the URL of the file ... Any advice? Thanks. --- Cheers, Kenneth - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to read a file on disk from a servlet
My preference is to rely on a JNDI lookup which will return a String. The string is a URL which you can then open and then read from mykeystore.jks. Then the JNDI lookup config would reside in the Context declaration. Then its up to the admin to place mykeystore.jks anywhere they wish. -Tim Kenneth Jensen wrote: I have a servlet that must verify signatures on parts of requests, and for that I need to include a keystore file with my trusted certs. This keystore has nothing to do with the server itself and not to be used with SSL/TLS, just with this one webapp. How do I get my servlet to read the keystore file, say if I put it in $CATAILNA_HOME/webapps/mywebapp/WEB-INF/lib/mykeystore.jks. If I just ask for the file lib/mykeystore.jks or another relative path, then the path is relative to the system property user.dir (which I don't know beforehand, depends on the person who started Tomcat last time). I would rather not use an absolute path, and the request will not include information about the URL of the file ... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: jspServlet runs out of memory while compiling some jsp files using fork=true
Is the problem caused because you redeploy the whole webapp each time? Could you just deploy only those files that have changed? I can't imagine that this leads to overloading unless the numbers are massive...? -Original Message- From: Vesa Varimo [mailto:[EMAIL PROTECTED] Sent: Friday 27 May 2005 13:34 To: Tomcat Users List Subject: Re: jspServlet runs out of memory while compiling some jsp files using fork=true Yes, that would be one solution, but not suitable for our case because our webmasters are constantly updating jsp pages on our production servers. Btw. I'm using tomcat 5.0.28. Thx, Vesa - Original Message - From: Bernhard Slominski [EMAIL PROTECTED] To: 'Tomcat Users List' tomcat-user@jakarta.apache.org Sent: Friday, May 27, 2005 3:25 PM Subject: AW: jspServlet runs out of memory while compiling some jsp files using fork=true Hi, I would suggest that you do a precompilation of your jsps on a deployment machine which is separate from the live machine. So your compilation is not done on the live server, which might be on heavy load. Also you don't have the problem that the first visitor has to wait an awful long time until the page get's displayed. Cheers Bernhard -Ursprüngliche Nachricht- Von: Vesa Varimo [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 27. Mai 2005 12:45 An: tomcat-user@jakarta.apache.org Betreff: jspServlet runs out of memory while compiling some jsp files using fork=true Hi, I'm having OutOfMemory error while Tomcat tries to compile jsp files. The problem occures few times in day so it's quite hard to repeat. Tomcat is configured to run javac in separate JVM with fork=true option. I tried to give more memory for ant using ANT_OPTS, but it didn't help. I read source code for the jasper compiler and there are variables that configure how much memory is given to ant, but I'm not able to configure them with jspServlet init parameters. How should I resolved this? Is the Jikes compiler a solution worth of trying? Stacktrace included below. I have hundreds of jars in classpath... so I can't paste the whole compiler output. BR, Vesa Varimo [EMAIL PROTECTED] -- -- 2005-05-26 21:42:53 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception java.lang.OutOfMemoryError May 7, 2005 12:21:42 PM org.apache.jasper.compiler.Compiler generateClass SEVERE: Javac exception Compile failed; see the compiler error output for details. at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:944) at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:764) at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:379) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:472) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:451) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:439) at org.apache.jasper.JspCompilationContext.compile(JspCompilation Context.java:511) at org.apache.jasper.servlet.JspServletWrapper.service(JspServlet Wrapper.java:295) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet .java:292) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilt er(ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(Appli cationFilterChain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardW rapperValve.java:214) - 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: How to read a file on disk from a servlet
From: Kenneth Jensen [mailto:[EMAIL PROTECTED] How do I get my servlet to read the keystore file, say if I put it in $CATAILNA_HOME/webapps/mywebapp/WEB-INF/lib/mykeystore.jks. http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/ServletConte xt.html#getResource(java.lang.String) - Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: jspServlet runs out of memory while compiling some jsp files using fork=true
Hi, no the webapp is running whole time without redeployments. The jsp pages are quite large, 5000-1 rows and there are many of them. Can this affect to memory usage of javac compiler? This is a strange problem, because sometimes these same pages compile just fine, sometimes they don't. Thx, Vesa - Original Message - From: Steve Kirk [EMAIL PROTECTED] To: 'Tomcat Users List' tomcat-user@jakarta.apache.org Sent: Friday, May 27, 2005 3:32 PM Subject: RE: jspServlet runs out of memory while compiling some jsp files using fork=true Is the problem caused because you redeploy the whole webapp each time? Could you just deploy only those files that have changed? I can't imagine that this leads to overloading unless the numbers are massive...? -Original Message- From: Vesa Varimo [mailto:[EMAIL PROTECTED] Sent: Friday 27 May 2005 13:34 To: Tomcat Users List Subject: Re: jspServlet runs out of memory while compiling some jsp files using fork=true Yes, that would be one solution, but not suitable for our case because our webmasters are constantly updating jsp pages on our production servers. Btw. I'm using tomcat 5.0.28. Thx, Vesa - Original Message - From: Bernhard Slominski [EMAIL PROTECTED] To: 'Tomcat Users List' tomcat-user@jakarta.apache.org Sent: Friday, May 27, 2005 3:25 PM Subject: AW: jspServlet runs out of memory while compiling some jsp files using fork=true Hi, I would suggest that you do a precompilation of your jsps on a deployment machine which is separate from the live machine. So your compilation is not done on the live server, which might be on heavy load. Also you don't have the problem that the first visitor has to wait an awful long time until the page get's displayed. Cheers Bernhard -Ursprüngliche Nachricht- Von: Vesa Varimo [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 27. Mai 2005 12:45 An: tomcat-user@jakarta.apache.org Betreff: jspServlet runs out of memory while compiling some jsp files using fork=true Hi, I'm having OutOfMemory error while Tomcat tries to compile jsp files. The problem occures few times in day so it's quite hard to repeat. Tomcat is configured to run javac in separate JVM with fork=true option. I tried to give more memory for ant using ANT_OPTS, but it didn't help. I read source code for the jasper compiler and there are variables that configure how much memory is given to ant, but I'm not able to configure them with jspServlet init parameters. How should I resolved this? Is the Jikes compiler a solution worth of trying? Stacktrace included below. I have hundreds of jars in classpath... so I can't paste the whole compiler output. BR, Vesa Varimo [EMAIL PROTECTED] -- -- 2005-05-26 21:42:53 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception java.lang.OutOfMemoryError May 7, 2005 12:21:42 PM org.apache.jasper.compiler.Compiler generateClass SEVERE: Javac exception Compile failed; see the compiler error output for details. at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:944) at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:764) at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:379) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:472) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:451) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:439) at org.apache.jasper.JspCompilationContext.compile(JspCompilation Context.java:511) at org.apache.jasper.servlet.JspServletWrapper.service(JspServlet Wrapper.java:295) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet .java:292) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilt er(ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(Appli cationFilterChain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardW rapperValve.java:214) - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: jspServlet runs out of memory while compiling some jsp files using fork=true
Hi, I think it happens randomly because it depends on the actual load on the server. Where there is not much traffic it's OK, but with more traffic the server runs out of memomry. I see your point that you cannot control the webmasters. But still with the problems you have and the obvious very big application with 1 lines in a JSP (this must we a horror to maintain the code) and hundreds of jars you should have a proper deployment process and not just copying JSPs across. It does not mean that it's more complicated, I implemented this in my company with an ant script and it's really simple, stable and secure. Nobody want's to go back to the old copy solution. Cheers Bernhard -Ursprüngliche Nachricht- Von: Vesa Varimo [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 27. Mai 2005 14:59 An: Tomcat Users List Betreff: Re: jspServlet runs out of memory while compiling some jsp files using fork=true Hi, no the webapp is running whole time without redeployments. The jsp pages are quite large, 5000-1 rows and there are many of them. Can this affect to memory usage of javac compiler? This is a strange problem, because sometimes these same pages compile just fine, sometimes they don't. Thx, Vesa - Original Message - From: Steve Kirk [EMAIL PROTECTED] To: 'Tomcat Users List' tomcat-user@jakarta.apache.org Sent: Friday, May 27, 2005 3:32 PM Subject: RE: jspServlet runs out of memory while compiling some jsp files using fork=true Is the problem caused because you redeploy the whole webapp each time? Could you just deploy only those files that have changed? I can't imagine that this leads to overloading unless the numbers are massive...? -Original Message- From: Vesa Varimo [mailto:[EMAIL PROTECTED] Sent: Friday 27 May 2005 13:34 To: Tomcat Users List Subject: Re: jspServlet runs out of memory while compiling some jsp files using fork=true Yes, that would be one solution, but not suitable for our case because our webmasters are constantly updating jsp pages on our production servers. Btw. I'm using tomcat 5.0.28. Thx, Vesa - Original Message - From: Bernhard Slominski [EMAIL PROTECTED] To: 'Tomcat Users List' tomcat-user@jakarta.apache.org Sent: Friday, May 27, 2005 3:25 PM Subject: AW: jspServlet runs out of memory while compiling some jsp files using fork=true Hi, I would suggest that you do a precompilation of your jsps on a deployment machine which is separate from the live machine. So your compilation is not done on the live server, which might be on heavy load. Also you don't have the problem that the first visitor has to wait an awful long time until the page get's displayed. Cheers Bernhard -Ursprüngliche Nachricht- Von: Vesa Varimo [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 27. Mai 2005 12:45 An: tomcat-user@jakarta.apache.org Betreff: jspServlet runs out of memory while compiling some jsp files using fork=true Hi, I'm having OutOfMemory error while Tomcat tries to compile jsp files. The problem occures few times in day so it's quite hard to repeat. Tomcat is configured to run javac in separate JVM with fork=true option. I tried to give more memory for ant using ANT_OPTS, but it didn't help. I read source code for the jasper compiler and there are variables that configure how much memory is given to ant, but I'm not able to configure them with jspServlet init parameters. How should I resolved this? Is the Jikes compiler a solution worth of trying? Stacktrace included below. I have hundreds of jars in classpath... so I can't paste the whole compiler output. BR, Vesa Varimo [EMAIL PROTECTED] -- -- 2005-05-26 21:42:53 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception java.lang.OutOfMemoryError May 7, 2005 12:21:42 PM org.apache.jasper.compiler.Compiler generateClass SEVERE: Javac exception Compile failed; see the compiler error output for details. at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:944) at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:764) at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:379) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:472) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:451) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:439) at org.apache.jasper.JspCompilationContext.compile(JspCompilation Context.java:511) at org.apache.jasper.servlet.JspServletWrapper.service(JspServlet Wrapper.java:295) at
AW: Reloadable Hangs
Hi, the thread death is caused by log4j. You have to shutdown log4j when the context is destroyed: see http://issues.apache.org/bugzilla/show_bug.cgi?id=26372 for more details. Cheers Bernhard -Ursprüngliche Nachricht- Von: Ari Suutari [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 27. Mai 2005 13:53 An: tomcat-user@jakarta.apache.org Betreff: Re: Reloadable Hangs Hi, Context Reloadable == true When we compile .java into .class, Tomcat will not serve page anymore. We have to restart Tomcat inside Services or from the Monitor Tomcat menu. We have seen same here. Tomcat = 5.0.28 hangs, there seems to be a ThreadDeath exception sometimes when reload is going on. Environment is Windows XP and JDK 1.4.2. We have no problen with lower versions of Tomcat. I think that 5.0.25 used to work me. Aro S- - 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: jspServlet runs out of memory while compiling some jsp files using fork=true
Hmh.. how does you deployment script work? Do you compile jsp pages in some other server than the live server? Well, I didn't write those pages :), I just have to live with legacy code :D Vesa - Original Message - From: Bernhard Slominski [EMAIL PROTECTED] To: 'Tomcat Users List' tomcat-user@jakarta.apache.org Sent: Friday, May 27, 2005 4:02 PM Subject: AW: jspServlet runs out of memory while compiling some jsp files using fork=true Hi, I think it happens randomly because it depends on the actual load on the server. Where there is not much traffic it's OK, but with more traffic the server runs out of memomry. I see your point that you cannot control the webmasters. But still with the problems you have and the obvious very big application with 1 lines in a JSP (this must we a horror to maintain the code) and hundreds of jars you should have a proper deployment process and not just copying JSPs across. It does not mean that it's more complicated, I implemented this in my company with an ant script and it's really simple, stable and secure. Nobody want's to go back to the old copy solution. Cheers Bernhard -Ursprüngliche Nachricht- Von: Vesa Varimo [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 27. Mai 2005 14:59 An: Tomcat Users List Betreff: Re: jspServlet runs out of memory while compiling some jsp files using fork=true Hi, no the webapp is running whole time without redeployments. The jsp pages are quite large, 5000-1 rows and there are many of them. Can this affect to memory usage of javac compiler? This is a strange problem, because sometimes these same pages compile just fine, sometimes they don't. Thx, Vesa - Original Message - From: Steve Kirk [EMAIL PROTECTED] To: 'Tomcat Users List' tomcat-user@jakarta.apache.org Sent: Friday, May 27, 2005 3:32 PM Subject: RE: jspServlet runs out of memory while compiling some jsp files using fork=true Is the problem caused because you redeploy the whole webapp each time? Could you just deploy only those files that have changed? I can't imagine that this leads to overloading unless the numbers are massive...? -Original Message- From: Vesa Varimo [mailto:[EMAIL PROTECTED] Sent: Friday 27 May 2005 13:34 To: Tomcat Users List Subject: Re: jspServlet runs out of memory while compiling some jsp files using fork=true Yes, that would be one solution, but not suitable for our case because our webmasters are constantly updating jsp pages on our production servers. Btw. I'm using tomcat 5.0.28. Thx, Vesa - Original Message - From: Bernhard Slominski [EMAIL PROTECTED] To: 'Tomcat Users List' tomcat-user@jakarta.apache.org Sent: Friday, May 27, 2005 3:25 PM Subject: AW: jspServlet runs out of memory while compiling some jsp files using fork=true Hi, I would suggest that you do a precompilation of your jsps on a deployment machine which is separate from the live machine. So your compilation is not done on the live server, which might be on heavy load. Also you don't have the problem that the first visitor has to wait an awful long time until the page get's displayed. Cheers Bernhard -Ursprüngliche Nachricht- Von: Vesa Varimo [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 27. Mai 2005 12:45 An: tomcat-user@jakarta.apache.org Betreff: jspServlet runs out of memory while compiling some jsp files using fork=true Hi, I'm having OutOfMemory error while Tomcat tries to compile jsp files. The problem occures few times in day so it's quite hard to repeat. Tomcat is configured to run javac in separate JVM with fork=true option. I tried to give more memory for ant using ANT_OPTS, but it didn't help. I read source code for the jasper compiler and there are variables that configure how much memory is given to ant, but I'm not able to configure them with jspServlet init parameters. How should I resolved this? Is the Jikes compiler a solution worth of trying? Stacktrace included below. I have hundreds of jars in classpath... so I can't paste the whole compiler output. BR, Vesa Varimo [EMAIL PROTECTED] -- -- 2005-05-26 21:42:53 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception java.lang.OutOfMemoryError May 7, 2005 12:21:42 PM org.apache.jasper.compiler.Compiler generateClass SEVERE: Javac exception Compile failed; see the compiler error output for details. at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:944) at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:764) at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:379) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:472) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:451) at
RE: jspServlet runs out of memory while compiling some jsp files using fork=true
When you say this: The jsp pages are quite large, 5000-1 rows and there are many of them. I take it that you mean that the page can display 5-10k rows of data from a database, rather than the JSP has 10k lines of code in it. I hope so. If not, it's no wonder that the compiler is struggling!! If you do mean DB rows rather than lines of code, I still don't see a particular reason why compiling the JSPs should present such a heavy load if, as you say, you are only changing a few at a time. It sounds more likely to me that it is the processing of the request by the JSPs that is probably eating up the server resources. If compilation is happening in parallel with this, maybe the two together are enough to push the performance off the edge? -Original Message- From: Vesa Varimo [mailto:[EMAIL PROTECTED] Sent: Friday 27 May 2005 14:16 To: Tomcat Users List Subject: Re: jspServlet runs out of memory while compiling some jsp files using fork=true Hmh.. how does you deployment script work? Do you compile jsp pages in some other server than the live server? Well, I didn't write those pages :), I just have to live with legacy code :D Vesa - Original Message - From: Bernhard Slominski [EMAIL PROTECTED] To: 'Tomcat Users List' tomcat-user@jakarta.apache.org Sent: Friday, May 27, 2005 4:02 PM Subject: AW: jspServlet runs out of memory while compiling some jsp files using fork=true Hi, I think it happens randomly because it depends on the actual load on the server. Where there is not much traffic it's OK, but with more traffic the server runs out of memomry. I see your point that you cannot control the webmasters. But still with the problems you have and the obvious very big application with 1 lines in a JSP (this must we a horror to maintain the code) and hundreds of jars you should have a proper deployment process and not just copying JSPs across. It does not mean that it's more complicated, I implemented this in my company with an ant script and it's really simple, stable and secure. Nobody want's to go back to the old copy solution. Cheers Bernhard -Ursprüngliche Nachricht- Von: Vesa Varimo [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 27. Mai 2005 14:59 An: Tomcat Users List Betreff: Re: jspServlet runs out of memory while compiling some jsp files using fork=true Hi, no the webapp is running whole time without redeployments. The jsp pages are quite large, 5000-1 rows and there are many of them. Can this affect to memory usage of javac compiler? This is a strange problem, because sometimes these same pages compile just fine, sometimes they don't. Thx, Vesa - Original Message - From: Steve Kirk [EMAIL PROTECTED] To: 'Tomcat Users List' tomcat-user@jakarta.apache.org Sent: Friday, May 27, 2005 3:32 PM Subject: RE: jspServlet runs out of memory while compiling some jsp files using fork=true Is the problem caused because you redeploy the whole webapp each time? Could you just deploy only those files that have changed? I can't imagine that this leads to overloading unless the numbers are massive...? -Original Message- From: Vesa Varimo [mailto:[EMAIL PROTECTED] Sent: Friday 27 May 2005 13:34 To: Tomcat Users List Subject: Re: jspServlet runs out of memory while compiling some jsp files using fork=true Yes, that would be one solution, but not suitable for our case because our webmasters are constantly updating jsp pages on our production servers. Btw. I'm using tomcat 5.0.28. Thx, Vesa - Original Message - From: Bernhard Slominski [EMAIL PROTECTED] To: 'Tomcat Users List' tomcat-user@jakarta.apache.org Sent: Friday, May 27, 2005 3:25 PM Subject: AW: jspServlet runs out of memory while compiling some jsp files using fork=true Hi, I would suggest that you do a precompilation of your jsps on a deployment machine which is separate from the live machine. So your compilation is not done on the live server, which might be on heavy load. Also you don't have the problem that the first visitor has to wait an awful long time until the page get's displayed. Cheers Bernhard -Ursprüngliche Nachricht- Von: Vesa Varimo [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 27. Mai 2005 12:45 An: tomcat-user@jakarta.apache.org Betreff: jspServlet runs out of memory while compiling some jsp files using fork=true Hi, I'm having OutOfMemory error while Tomcat tries to compile jsp files. The problem occures few times in day so it's quite hard to repeat. Tomcat is configured to run javac in separate JVM with fork=true option. I tried to give more memory for ant using ANT_OPTS, but it didn't help. I read source code for
AW: jspServlet runs out of memory while compiling some jsp files using fork=true
Well the precompliation is quite simple: You use an ant jasper task to make the java file from your jsp and then compile these classes. Then you do a mapping from the jsp to the class. This is all done on a separate machine, I do the deployment as war file, which is copied accross to the live machine. It can all be done automatically. Look at http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jasper-howto.html I post you the code from my buildfile. The only thing is that you have to reload your app when you do this, so that might be a problem for you. target name=jspc depends=get-properties-stage mkdir dir=${webapproot}/src/ !-- define the jasper task -- taskdef classname=org.apache.jasper.JspC name=jasper2 classpath id=jspc.classpath pathelement location=${java.home}/../lib/tools.jar/ fileset dir=${tomcat.home}/bin include name=*.jar/ /fileset fileset dir=${tomcat.home}/server/lib include name=*.jar/ /fileset fileset dir=${tomcat.home}/common/lib include name=*.jar/ /fileset fileset dir=${webapproot}${webappname}/WEB-INF/lib include name=*.jar/ /fileset /classpath /taskdef !-- execute jasper, creates the servlet source files -- jasper2 validateXml=false uriroot=${webapproot}${webappname} webXmlFragment=${webapproot}${webappname}/WEB-INF/generated_web.xml outputDir=${webapproot}/src / !-- compile the source files -- javac destdir=${webapproot}${webappname}/WEB-INF/classes optimize=off debug=on failonerror=false srcdir=${webapproot}/src excludes=**/*.smap classpath pathelement location=${webapproot}${webappname}/WEB-INF/classes/ pathelement location=${tomcat.home}/common/classes/ pathelement location=${tomcat.home}/shared/classes/ fileset dir=${tomcat.home}/common/lib include name=*.jar/ /fileset fileset dir=${tomcat.home}/shared/lib include name=*.jar/ /fileset fileset dir=${tomcat.home}/bin include name=*.jar/ /fileset fileset dir=${webapproot}${webappname}/WEB-INF/lib include name=*.jar/ /fileset /classpath include name=** / exclude name=tags/** / /javac !-- Load your precompiled snippet into a property -- loadfile property=precompiled srcFile=${webapproot}${webappname}/WEB-INF/generated_web.xml encoding=ISO-8859-1/ !-- Now replace the web.xml with a predifined snippet -- replace file=${webapproot}${webappname}/WEB-INF/web.xml value=${precompiled} replacetoken![CDATA[!-- precompile include --]]/replacetoken /replace /target -Ursprüngliche Nachricht- Von: Vesa Varimo [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 27. Mai 2005 15:16 An: Tomcat Users List Betreff: Re: jspServlet runs out of memory while compiling some jsp files using fork=true Hmh.. how does you deployment script work? Do you compile jsp pages in some other server than the live server? Well, I didn't write those pages :), I just have to live with legacy code :D Vesa - Original Message - From: Bernhard Slominski [EMAIL PROTECTED] To: 'Tomcat Users List' tomcat-user@jakarta.apache.org Sent: Friday, May 27, 2005 4:02 PM Subject: AW: jspServlet runs out of memory while compiling some jsp files using fork=true Hi, I think it happens randomly because it depends on the actual load on the server. Where there is not much traffic it's OK, but with more traffic the server runs out of memomry. I see your point that you cannot control the webmasters. But still with the problems you have and the obvious very
Re: jspServlet runs out of memory while compiling some jsp files using fork=true
Yeah, sorry. I meant that the precompiled jsp (java) files are that large. But no, the lines fetched from datasources are not calculated. This error occures when tomcat tries to compile these generated java files to classes using ant and javac compiler. About the performance, we have tomcat cluster and each node have loads from 0.1 to 0.4 and there are plenty of memory available. I think that the problem is that javac doesn't have enough memory to compile and it's impossible to give more memory for it afaik. Other reason could be javac leaking memory but this is unlikely because it's run in separete process with fork option set to true. Vesa - Original Message - From: Steve Kirk [EMAIL PROTECTED] To: 'Tomcat Users List' tomcat-user@jakarta.apache.org Sent: Friday, May 27, 2005 4:21 PM Subject: RE: jspServlet runs out of memory while compiling some jsp files using fork=true When you say this: The jsp pages are quite large, 5000-1 rows and there are many of them. I take it that you mean that the page can display 5-10k rows of data from a database, rather than the JSP has 10k lines of code in it. I hope so. If not, it's no wonder that the compiler is struggling!! If you do mean DB rows rather than lines of code, I still don't see a particular reason why compiling the JSPs should present such a heavy load if, as you say, you are only changing a few at a time. It sounds more likely to me that it is the processing of the request by the JSPs that is probably eating up the server resources. If compilation is happening in parallel with this, maybe the two together are enough to push the performance off the edge? -Original Message- From: Vesa Varimo [mailto:[EMAIL PROTECTED] Sent: Friday 27 May 2005 14:16 To: Tomcat Users List Subject: Re: jspServlet runs out of memory while compiling some jsp files using fork=true Hmh.. how does you deployment script work? Do you compile jsp pages in some other server than the live server? Well, I didn't write those pages :), I just have to live with legacy code :D Vesa - Original Message - From: Bernhard Slominski [EMAIL PROTECTED] To: 'Tomcat Users List' tomcat-user@jakarta.apache.org Sent: Friday, May 27, 2005 4:02 PM Subject: AW: jspServlet runs out of memory while compiling some jsp files using fork=true Hi, I think it happens randomly because it depends on the actual load on the server. Where there is not much traffic it's OK, but with more traffic the server runs out of memomry. I see your point that you cannot control the webmasters. But still with the problems you have and the obvious very big application with 1 lines in a JSP (this must we a horror to maintain the code) and hundreds of jars you should have a proper deployment process and not just copying JSPs across. It does not mean that it's more complicated, I implemented this in my company with an ant script and it's really simple, stable and secure. Nobody want's to go back to the old copy solution. Cheers Bernhard -Ursprüngliche Nachricht- Von: Vesa Varimo [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 27. Mai 2005 14:59 An: Tomcat Users List Betreff: Re: jspServlet runs out of memory while compiling some jsp files using fork=true Hi, no the webapp is running whole time without redeployments. The jsp pages are quite large, 5000-1 rows and there are many of them. Can this affect to memory usage of javac compiler? This is a strange problem, because sometimes these same pages compile just fine, sometimes they don't. Thx, Vesa - Original Message - From: Steve Kirk [EMAIL PROTECTED] To: 'Tomcat Users List' tomcat-user@jakarta.apache.org Sent: Friday, May 27, 2005 3:32 PM Subject: RE: jspServlet runs out of memory while compiling some jsp files using fork=true Is the problem caused because you redeploy the whole webapp each time? Could you just deploy only those files that have changed? I can't imagine that this leads to overloading unless the numbers are massive...? -Original Message- From: Vesa Varimo [mailto:[EMAIL PROTECTED] Sent: Friday 27 May 2005 13:34 To: Tomcat Users List Subject: Re: jspServlet runs out of memory while compiling some jsp files using fork=true Yes, that would be one solution, but not suitable for our case because our webmasters are constantly updating jsp pages on our production servers. Btw. I'm using tomcat 5.0.28. Thx, Vesa - Original Message - From: Bernhard Slominski [EMAIL PROTECTED] To: 'Tomcat Users List' tomcat-user@jakarta.apache.org Sent: Friday, May 27, 2005 3:25 PM Subject: AW: jspServlet runs out of memory while compiling some jsp files using fork=true Hi, I would suggest that you do a precompilation of your jsps on a deployment machine which is separate from the live machine. So your compilation is not done on the live server, which might be on heavy load.
Re: my build structure..opinions wanted
BTW: (long reply... apologies - much of this reflection on current development of most use to myself and my company, but just in case of use to someone else, I hit send anyway... ) --- I think it's best not to deviate TOO far from the model shown in Application Developers Guide in the tomcat docs (really, this is a fantastic starting point I think - http://jakarta.apache.org/tomcat/tomcat-5.0-doc/appdev/index.html or the 5.5 version ). I started using the sysdeo tomcat plugin for eclipse, but no longer use it as I know exactly where I am with explicit ant tasks. The build task in the application developers guide build.xml, does build to an explicit and separate build folder and then compiles copies across stuff from the web and src folders. (Note that it cleverly copies across any non-java files from the src folder hierarchy to the build/web/WEB-INF/classes hierarchy, meaning that you keep the source for your classpath located .properties (etc) files in the src directory - where it should be) Practically speaking I actually don't have a separate build directory, instead I build to the web/WEB-INF/classes directory but I do copy across properties files from the web/WEB-INF/src directory... I deploy my build directory directly to my localhost tomcat and reload it (using the tomcat reload ant-task (optional tasks which require catalina-ant.jar*) - this does the manager stuff for you. The advantage of having the non classpath items not being copied is particularly valuable when you are trying to tweak velocity templates - there's no need to reload the whole webapp simply to correct some typos in your velocity scripts) - again I'm not unit testing view outputs, at present, so this point of view may change as well I do use the dist task (building a war file) and deploying a war when I'm deploying the webapp to a different (shared) machine (and often I have a version/iteration-specific context name (like projectname-vX so that I know which (repository version or iteration number) version is being shown). hth Tim *Note: It's worth having machine-specifc properties (the localhost tomcat manager url, user and password) in a separate build.local.properties (NOT in the build.xml file), which is then NOT committed to your repository (as it will vary from machine to machine) - then ideally your ant tasks will check that these properties are around and if not throw up a helpful message. Kenneth Jensen wrote: I have this target in my build-file. This makes Eclipse transfer my webapp in a jar file to the Tomcat server, which then automatically reloads it. target name=deploy depends=jar description=Deploy webapp to server copy file=${jarfile} todir=${webappdir}/WEB-INF/lib / exec executable=/usr/bin/scp arg file=${jarfile}/ arg value=tomcat.mydomain.dk:${webappdir}/WEB-INF/lib/ /exec /target --- Cheers, Kenneth On 5/27/05, Steve Kirk [EMAIL PROTECTED] wrote: Don't leave the source on the production server, but it's fine in development. Strictly speaking your source files are inaccessible by web clients if they are under WEB-INF, but better safe than sorry. Why not store the src in another folder altogether - eclipse won't care where it is presumably, and this is slightly better practice. The other approach is to build a jarfile from a build script (e.g. using ant), then copy the jar to the webapps/ directory, TC will auto-deply it. Some would say this is the only way to do it. However it does slow things down when you are making frequent small changes to code. For my money, the value of a jar is ease of portability, which is a factor if you are writing for true cross-container support. I built classes direct to classes/ for a long time, then made the effort to switch to jar deployment in development, after being persuaded by people on this list. I'm glad I've done both, but to be honest I think I do prefer building to classes, as it's quicker and I can't see a disadvantage to it during dev. Your approach that sounds a quite practical solution to me. Does eclipse precompile JSPs for you too? One other thing to watch is that logging.properties and properties files go in the classes/ folder, so if you use these, be careful that eclipse does not delete them when rebuilding your classes. -Original Message- From: gabor [mailto:[EMAIL PROTECTED] Sent: Friday 27 May 2005 13:16 To: tomcat-user@jakarta.apache.org Subject: my build structure..opinions wanted hi, i'm starting a project using jsp + javaBeans.. i've worked with java a lot, but i have not much experience with web applications.. for now my idea is that the application will be using javabeans, and jsp for displaying the data... i use eclipse for the development, which nicely compiles every source file automatically when i edit them. that's why i came up with the following idea: i'll create a directory in tomcat/webapps (let's call it 'mywebapp').
Re: How to read a file on disk from a servlet
Thanks for both of your advices. JNDI is probably the smart way of doing it, but I am not familiar with it (beyond recognising the name and concept), and right now, the last thing I need is another tech thing to worry about (finishing a student project). :-) The ServletContext.getResource depends on a URL string from the request, as far as I can see, and I could not get it to work quickly, so I ended up wth this rather silly hack in the servlet init() method: ServletContext context = getServletConfig().getServletContext(); String slash = System.getProperty(file.separator); keystore = context.getRealPath(/) + WEB-INF + slash + getInitParameter(keystorefile); That way, I just have to know the relative path to the webapps WEB-INF dir. Thanks, Kenneth On 5/27/05, Peter Crowther [EMAIL PROTECTED] wrote: From: Kenneth Jensen [mailto:[EMAIL PROTECTED] How do I get my servlet to read the keystore file, say if I put it in $CATAILNA_HOME/webapps/mywebapp/WEB-INF/lib/mykeystore.jks. http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/ServletConte xt.html#getResource(java.lang.String) - Peter -- --- Cheers, Kenneth - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: my build structure..opinions wanted
On Fri, May 27, 2005 at 01:29:50PM +0100, Steve Kirk wrote: Your approach that sounds a quite practical solution to me. Does eclipse precompile JSPs for you too? no.. well, i don't know.. where should the compiled jsp files? be (so i can check :).. but anyway, as long as tomcat recompiles them on change, it's ok :) gabor - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Only one ssl domain per server instance?
Mark Thomas wrote: You can define multiple Connectors, each with its own keystore. But don't forget that each will need to be on a different port. Actually, I assumed the OP would assign each Connector a different *IP address*, so that conventional URLs like https://www.example.com/ https://www.secondexample.com/ could be used, rather than, e.g. http:9443//www/yuckyexample.com/ :-) YMMV, -- Hassan Schroeder - [EMAIL PROTECTED] Webtuitive Design === (+1) 408-938-0567 === http://webtuitive.com dream. code. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Compiled JSP Page Encoding
We are running our International sites on (Tomcat4.1, Jboss3.2.3, JDK 1.4) and find that any JSP pages that do not specify UTF-8 page encoding explicitly, are tagged with page encoding =iso8859 when compiled. My research indicates that Japser compiles with UTF-8 by default. Why is the compiler inserting 8859 in our compiled JSPs? Allen
Apache Integration
I'm trying to setup an Apache 2.X server to relay JSP's to a Tomcat 5.5 server. So far, the information I've found is fragmented and out of date. It concerns Tomcat 3.2 and the libraries used by this « hot-to » are deprecated. For example, it says to install the mod_jserv module, which is not suitable for Apache 2. The best document I've found so far is « Tomcat - A minimalist user's guide ». I will have to proceed to an installation on a production server. I cannot fail this installation and it has to succeed the first time. Is there anyone who came upon a complete guide on how to proceed ?? Does anyone ever installed those two versions together and has valuable advice ? Luc Boudreau Université du Québec Canada
question about localhost/ error count in tomcat manager web app
hi, i've configured my servlet to be at some location, say for instance: http://my_server:8080/xzy/abc when i access my servlet, it returns back okay and request count for my servlet increments okay on the tomcat manager web app. however, i also notice error count for localhost/ default[/] incrementing as well each time i access my servlet. any ideas why this is happening? have i missed something in my context.xml or web.xml? thanks. -annie - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
replying to msgs in digest
If I subscribe only to tomcat-user Digest, how can I send a follow-up to a particular msg? Paul Singleton -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.322 / Virus Database: 266.11.17 - Release Date: 25/May/2005 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem with precompiled JSP's (2nd Try)
Hello, I have an application that is currently running under JBoss 3.2.x with Jetty that I would like to get running on Tomcat 5.X. I have precompiled all of the JSP's and mapped them to there respective JSP path in the web.xml. Here is a sample fragment of the web.xml: ?xml version=1.0 encoding=UTF-8? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app id=WebApp display-namemjc_campus_tour/display-name servlet servlet-nametourArea0/servlet-name display-nametourArea0/display-name servlet-classcom.atomogy.virtualtour.view.pages.tourArea0_jsp/servlet-class /servlet servlet servlet-nametourArea1/servlet-name display-nametourArea1/display-name servlet-classcom.atomogy.virtualtour.view.pages.tourArea1_jsp/servlet-class /servlet servlet servlet-nametourArea2/servlet-name display-nametourArea2/display-name servlet-classcom.atomogy.virtualtour.view.pages.tourArea2_jsp/servlet-class /servlet servlet servlet-nametourArea3/servlet-name display-nametourArea3/display-name servlet-classcom.atomogy.virtualtour.view.pages.tourArea3_jsp/servlet-class /servlet servlet servlet-namefooter/servlet-name display-namefooter/display-name servlet-classcom.atomogy.virtualtour.view.include.footer_jsp/servlet-class /servlet servlet servlet-nameheader/servlet-name display-nameheader/display-name servlet-classcom.atomogy.virtualtour.view.include.header_jsp/servlet-class /servlet servlet-mapping servlet-nametourArea0/servlet-name url-pattern/pages/tourArea0.jsp/url-pattern /servlet-mapping servlet-mapping servlet-nametourArea1/servlet-name url-pattern/pages/tourArea1.jsp/url-pattern /servlet-mapping servlet-mapping servlet-nametourArea2/servlet-name url-pattern/pages/tourArea2.jsp/url-pattern /servlet-mapping servlet-mapping servlet-nametourArea3/servlet-name url-pattern/pages/tourArea3.jsp/url-pattern /servlet-mapping servlet-mapping servlet-namefooter/servlet-name url-pattern/include/footer.jsp/url-pattern /servlet-mapping servlet-mapping servlet-nameheader/servlet-name url-pattern/include/header.jsp/url-pattern /servlet-mapping welcome-file-list welcome-fileindex.jsp/welcome-file /welcome-file-list /web-app The error message that I get when trying to run the application on Tomcat is as follows: 2005-05-26 09:33:03 StandardWrapperValve[tourArea0]: Servlet.service() for servlet tourArea0 threw exception java.lang.NoSuchMethodError: org.apache.jasper.runtime.JspRuntimeLibrary.include(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Ljava/lang/String;Ljavax/servlet/jsp/JspWriter;Z)V at com.atomogy.virtualtour.view.pages.tourArea0_jsp._jspService(tourArea0_jsp.java:43) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799) at
Why no paramters in TLD function???
This is strange, I have a jsp that accessess a function declared in a TLD file. The function has NO paramters passed to it. When I try to compile the jsp into a servlet via tomcat jasper, I get: C:\Tomcat\webapps\Acuity\build.xml:98: org.apache.jasper.JasperException: The class specified in the method signature in TLD for the function rules:getAutoRefresh1 cannot be found. OK - but I have done this before a million times and I know it works, so I looked at working examples of my code where I did this and the only difference is that this function takes no parameters. So for an experiment, I changed the TLD, the jsp and the class to have a dummy int parmater passed to the function - not used just passed - AND IT COMPILED!?! WHY DOES IT MATTER IF THERE ARE PARAMTERS OR NOT - AM I DOING SOMETHING WRONG??? IS IT BECAUSE IT IS A GET METHOD??? here is the test jsp and .tld file THIS DOESNT WORK... JSP %@ taglib prefix=c uri=http://java.sun.com/jsp/jstl/core; % %@ taglib prefix=rules uri=/WEB-INF/tlds/rules.tld % %@ page isELIgnored=false % c:set var=autoRefresh value=${rules:getAutoRefresh1()} / html head /head body /body /html RULES.TLD ?xml version=1.0 encoding=UTF-8 ? taglib xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2eeweb-jsptaglibrary_2_0.x sd version=2.0 descriptionTCS Rule Engine Library/description display-nameTCS Rule Engine Functions/display-name tlib-version1.0/tlib-version short-namerules/short-name uri/WEB-INF/tags/Rules.tld/uri function namegetAutoRefresh1/name description Retrieves the auto refresh token setting /description function-classtcsServices.RulesMgr/function-class function-signaturejava.lang.String GetAutoRefresh1()/function-signature /function /taglib CODE public static String GetAutoRefresh1() { String refresh = N; if( autoRefresh ) { refresh = Y; } return refresh; } THIS WORKS?!? %@ taglib prefix=c uri=http://java.sun.com/jsp/jstl/core; % %@ taglib prefix=rules uri=/WEB-INF/tlds/rules.tld % %@ page isELIgnored=false % c:set var=autoRefresh value=${rules:getAutoRefresh1(1)} / html head /head body /body /html RULES.TLD ?xml version=1.0 encoding=UTF-8 ? taglib xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2eeweb-jsptaglibrary_2_0.x sd version=2.0 descriptionTCS Rule Engine Library/description display-nameTCS Rule Engine Functions/display-name tlib-version1.0/tlib-version short-namerules/short-name uri/WEB-INF/tags/Rules.tld/uri function namegetAutoRefresh1/name description Retrieves the auto refresh token setting /description function-classtcsServices.RulesMgr/function-class function-signaturejava.lang.String GetAutoRefresh1(int)/function-signature /function /taglib CODE public static String GetAutoRefresh1(int i) { String refresh = N; if( autoRefresh ) { refresh = Y; } return refresh; } John McClain Senior Software Engineer TCS Healthcare [EMAIL PROTECTED] (530)886-1700x235 Skepticism is the first step toward truth - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to read a file on disk from a servlet
From: Kenneth Jensen [EMAIL PROTECTED] Sent: Friday, May 27, 2005 6:49 AM The ServletContext.getResource depends on a URL string from the request, as far as I can see, and I could not get it to work quickly, so I ended up wth this rather silly hack in the servlet init() method: You can also simply use the ClassLoaders getResource methods, and place things in your classes directory. (Though I think you're better off getting the ServletContext.getResource() to work) Regards, Will Hartung ([EMAIL PROTECTED]) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Auto-Deployment Problems
Hello, I've been trying to deploy my application into Tomcat and can get it to work just fine. However, as I make additional changes to the classes within my WAR, re-deploying them causes Tomcat to delete virtually every file within the webapps directory. Here's the flow of what's happening: 1) Deploy myapp.war into Tomcat's webapp directory. 2) Start up Tomcat. Tomcat sees the myapp.war file and explodes the WAR into the myapp directory under webapps. 3) I make changes to the code. 4) After creating a new myapp.war, I use my deployment process to deploy the application using the Tomcat Ant Tasks or simply copying the file into the directory. ANT TASK: target name=deploy-tomcat echo message=Deploying IVS to ${tomcat.url}/ deploy url=${tomcat.url} username=${tomcat.user} password=${tomcat.password} path=/${app.name} war=${build.dir}/${app.name}.war update=true/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Adding content/JSPs on the fly
I'm scheming on a little project, and one of the things I want to be able to do is simply add content to the application. The typical way to add content is also rather static -- add it to the WAR and redeploy. That's not particularly dynamic tho, and doesn't really facilitate changing content from the web app. One of the things I'd like to be able to create on the fly are JSPs that are then served by the container. Now, Kenneth Jensen may have answered my question for me by providing this snippet: ServletContext context = getServletConfig().getServletContext(); String slash = System.getProperty(file.separator); keystore = context.getRealPath(/) + WEB-INF + slash + getInitParameter(keystorefile); The key being the getRealPath(/) code. So, my question is do you think that it's reasonable and fairly portable to leverage that technique to find where on the system a webapp is deployed and use that as a base path to create new resources to be served by the container? I'm aware that it is possible for a web app to be deployed in an unexploded WAR, and I would simply make it a precondition that this not be the case (and for 99% of most systems, it simply isn't an issue). But, shouldn't this pretty much work with most common servlet containers? Thanx for any insight... Regards, Will Hartung ([EMAIL PROTECTED]) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Auto-Deployment Problems (Real Version)
Hello, I've been trying to deploy my application into Tomcat and can get it to work just fine. However, as I make additional changes to the classes within my WAR, re-deploying them causes Tomcat to delete virtually every file within the webapps directory. Here's the flow of what's happening: 1) Deploy myapp.war into Tomcat's webapp directory. 2) Start up Tomcat. Tomcat sees the myapp.war file and explodes the WAR into the myapp directory under webapps. 3) I make changes to the code. 4) After creating a new myapp.war, I use my deployment process to deploy the application using the Tomcat Ant Tasks or simply by copying the file into the directory. ANT TASK: target name=deploy-tomcat echo message=Deploying MyApp to ${tomcat.url}/ deploy url=${tomcat.url} username=${tomcat.user} password=${tomcat.password} path=/${app.name} war=${build.dir}/${app.name}.war update=true/ /target 5) Tomcat sees this new myapp.war and promptly deletes everything in the webapps/myapp directory, except for /WEB-INF/lib/axis.jar. Of course, this causes my application to die horribly, and only a removal of the webapps/myapp directory and another (re-)deployment (along with a restart of apache) will fix the situation. Does anyone know why this is happening? If it makes a difference, this is running on a windows box. Thanks, Kory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat and RMI client - setup
Hi all. This might be a simple question. I have a working RMI client and server. I have tested it no problem. Now I would like to make a JSP/Servlet that will act as a RMI client and connect to the RMI server running outside Tomcat JVM. I keep running into access permission violations. I understand that I need to setup security policy, I had that for RMI. One thing than makes me slightly suspicious, is the fact that when I debug TC/RMI combo, I can see that my RMI client enters into setting up RMISecurityManager: if (System.getSecurityManager() == null) { goes in = System.setSecurityManager( new RMISecurityManager() ); } Is that OK? I thought TC would setup security manager. Now, my question is, what about Tomcat? If I want to run this, what do I need to do? If I get it, I need to: - setup catalina.policy - run it with -security option I'm on Windows XP, how do I enable security mode for TC? Am I barking up the wrong tree? Nix. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: my build structure..opinions wanted
Precompiled JSPs do 2 steps - JSP to Java, then Java to pcode, which can then be run by TC. The compiled JSPs end up as class files, mine end up in in the %catalina_home%\work\[enginename]\[hostname]\[webappname]\org\apache\jsp\WEB _INF\jsp directory (because the source JSP files are in WEB-INF\jsp). Without precomp, TC compiles each JSP on the fly, the first time that it is accessed, which slows down execution. I've never used Eclipse so was just interested. NetBeans does not by default do precomp, or even auto compile of servlets on save, although because it is based on Ant, most things are possible with a little scripting. -Original Message- From: gabor [mailto:[EMAIL PROTECTED] Sent: Friday 27 May 2005 15:12 To: Tomcat Users List Subject: Re: my build structure..opinions wanted On Fri, May 27, 2005 at 01:29:50PM +0100, Steve Kirk wrote: Your approach that sounds a quite practical solution to me. Does eclipse precompile JSPs for you too? no.. well, i don't know.. where should the compiled jsp files? be (so i can check :).. but anyway, as long as tomcat recompiles them on change, it's ok :) gabor - 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: Adding content/JSPs on the fly
It sounds reasonable, but probably isn't tested or by design, so probably best to just have a go. Re portability, the best advice I can offer is an old chestnut: read the servlet spec. This is particularly relevant in this case. The spec is generally pretty good at telling you you pretty accurately if (a) what you want to do should/must be supported or (b) what you want do do is forbidden. Of course there are some areas that it does not have a view either way on, but I find it to be an invaluable document - I have it on shortcut from my taskbar and consult it often. It's at least as useful as the javadocs or TC docs. For those of you that don't know where to find it, it's here, under specifications. http://java.sun.com/products/servlet/reference/api/index.html Choose the servlet spec version appropriate to your TC version as described in the table on the tomcat home page: http://jakarta.apache.org/tomcat/index.html Just one more specific point on your note Will - I would have thought if anything that you want it to be a precondition that the webapp NOT be deployed as a war. I've a feeling that if TC explodes the war, then it might not check the exploded FS for changes. Don't take this as gospel though, this is a hazy half-remembered bit of info. -Original Message- From: Will Hartung [mailto:[EMAIL PROTECTED] Sent: Friday 27 May 2005 18:31 To: Tomcat Users List Subject: Adding content/JSPs on the fly I'm scheming on a little project, and one of the things I want to be able to do is simply add content to the application. The typical way to add content is also rather static -- add it to the WAR and redeploy. That's not particularly dynamic tho, and doesn't really facilitate changing content from the web app. One of the things I'd like to be able to create on the fly are JSPs that are then served by the container. Now, Kenneth Jensen may have answered my question for me by providing this snippet: ServletContext context = getServletConfig().getServletContext(); String slash = System.getProperty(file.separator); keystore = context.getRealPath(/) + WEB-INF + slash + getInitParameter(keystorefile); The key being the getRealPath(/) code. So, my question is do you think that it's reasonable and fairly portable to leverage that technique to find where on the system a webapp is deployed and use that as a base path to create new resources to be served by the container? I'm aware that it is possible for a web app to be deployed in an unexploded WAR, and I would simply make it a precondition that this not be the case (and for 99% of most systems, it simply isn't an issue). But, shouldn't this pretty much work with most common servlet containers? Thanx for any insight... Regards, Will Hartung ([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]
Question: Steve Kirk
Hi Steve, You seem to be one of the more experienced users of the Tomcat user mail-list. Any thoughts on my precompiled JSP problem? Any feedback is welcomed. Best, -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.322 / Virus Database: 267.1.0 - Release Date: 5/27/2005 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Compiled JSP Page Encoding
This is as per the spec: http://www.jcp.org/aboutJava/communityprocess/maintenance/jsr053/errata_1_2_a_20020321.html Mark Tait, Allen wrote: We are running our International sites on (Tomcat4.1, Jboss3.2.3, JDK 1.4) and find that any JSP pages that do not specify UTF-8 page encoding explicitly, are tagged with page encoding =iso8859 when compiled. My research indicates that Japser compiles with UTF-8 by default. Why is the compiler inserting 8859 in our compiled JSPs? Allen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT]: Adding content/JSPs on the fly: file.separtor
When building file path strings, should one always use the System.getProperty(file.separator) return value? Is this to differentiate between Windows(\) and unix/linux/solaris(/ separators? I haven't seen that property before. And, are there any other things I should know about to make my file system accessing code portable? Yes, I am new to java. On 27 May 2005, Will Hartung wrote: I'm scheming on a little project, and one of the things I want to be able to do is simply add content to the application. The typical way to add content is also rather static -- add it to the WAR and redeploy. That's not particularly dynamic tho, and doesn't really facilitate changing content from the web app. One of the things I'd like to be able to create on the fly are JSPs that are then served by the container. Now, Kenneth Jensen may have answered my question for me by providing this snippet: ServletContext context = getServletConfig().getServletContext(); String slash = System.getProperty(file.separator); keystore = context.getRealPath(/) + WEB-INF + slash + getInitParameter(keystorefile); The key being the getRealPath(/) code. So, my question is do you think that it's reasonable and fairly portable to leverage that technique to find where on the system a webapp is deployed and use that as a base path to create new resources to be served by the container? I'm aware that it is possible for a web app to be deployed in an unexploded WAR, and I would simply make it a precondition that this not be the case (and for 99% of most systems, it simply isn't an issue). But, shouldn't this pretty much work with most common servlet containers? Thanx for any insight... Regards, Will Hartung ([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: Question: Steve Kirk
Thanks for saying that LOL :) but I'm afraid that you flatter me ;-) I've been using TC on and off for about 4 years, I have a working knowledge of the features that I actually use in my webapps, and answer Qs on those when I can, but that really is about it - there are many others on this list who are far more knowledgeable than I am about TC. Perhaps I'm talking too much at the moment and the volume is giving a false impression of quality ;) I did read your post, but unfortunately precomp JSPs are not something I use, I'm just aware of what the general benefits are, as I've worked on a project where someone else set up the precomp code for our production environment. It's on the list of things I want to learn about next, because it is good practice for production servers, and I have to set one up very soon. However I bet that someone will be along soon who can help you. I have no role in the project - I am just another web developer, the same as most people on the list. I am quite active at the moment, mainly because I just rejoined after a few months' absence, and I've just done upgrades to the latest versions of JDK/TC/NetBeans, so have read a lot of docs, and received help from list members, so have some fairly current knowledge to share. When on the list, and I have a few mins to spare, I try to help people if I know anything relevant. I think this is in the spirit of the community - give some help where you can, and what goes around comes around. Most of the real expertise and hard work in TC is provided by the team of volunteers behind the scenes. -Original Message- From: Mike Baliel [mailto:[EMAIL PROTECTED] Sent: Friday 27 May 2005 19:58 To: Tomcat Users List Subject: Question: Steve Kirk Hi Steve, You seem to be one of the more experienced users of the Tomcat user mail-list. Any thoughts on my precompiled JSP problem? Any feedback is welcomed. Best, -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.322 / Virus Database: 267.1.0 - Release Date: 5/27/2005 - 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: Adding content/JSPs on the fly
From: Steve Kirk [EMAIL PROTECTED] Sent: Friday, May 27, 2005 11:44 AM It sounds reasonable, but probably isn't tested or by design, so probably best to just have a go. Re portability, the best advice I can offer is an old chestnut: read the servlet spec. This is particularly relevant in this case. The spec is generally pretty good at telling you you pretty accurately if (a) what you want to do should/must be supported or (b) what you want do do is forbidden. Of course there are some areas that it does not have a view either way on, but I find it to be an invaluable document - I have it on shortcut from my taskbar and consult it often. It's at least as useful as the javadocs or TC docs. For those of you that don't know where to find it, it's here, under specifications. http://java.sun.com/products/servlet/reference/api/index.html Choose the servlet spec version appropriate to your TC version as described in the table on the tomcat home page: http://jakarta.apache.org/tomcat/index.html I'm reasonably familiar with the specification. One of the notable bits about it is simply the fact that within the spec, you're pretty much not guaranteed writeable access to the file system at all (save for a temporary area, and it's simply that -- temporary). But the reality is that most engines give you access to the disk that way. Just one more specific point on your note Will - I would have thought if anything that you want it to be a precondition that the webapp NOT be deployed as a war. I've a feeling that if TC explodes the war, then it might not check the exploded FS for changes. Don't take this as gospel though, this is a hazy half-remembered bit of info. As far as I know, the Servlet spec doesn't have a deployment method outside of a WAR. It's pretty much a container behavior to actually explode the WAR on to the file system, yet, most obviously do for performance reasons. But it does bring up a basic problem, for example, if by some fluke the app is redeployed, all of that new data is blasted away by the WAR..that would be Bad. But I can't see another (easy) way to create JSPs on the fly, or in fact to create any other content that can be served directly the server. It's an annoying nit of the spec, to me, that it doesn't expose this behavior to the developer. For example, unlike EJBs (which has a specified limitation on accessing the disk), the Servlet spec does allow you to access the disk, though perhaps not within the WAR hierarchy. But, there is no way to, say, forward to a static resource that the server can then handle in its own internally optimal way. Rather, I have to open the static resource, determine the content type (I can get that from the Servlet spec), and then feed it into the output stream, when in fact it would simply be easier to do req.serveStatic(/tmp/mynewgraphic.gif) or some such thing, or be able to forward outside of the web app (i.e. to a actual file rather than a URL). Simply, the application structure and such are pretty much isolated from the developer. I can't add anything dynamically to the security domain, for example, which means if I want that kind of capability in my application, I have to essentially implement ALL of the container security -- mapping, role checks, etc. Container security is an all or nothing. Be happy with its limited funcitonality or dump it entirely. So, now if I want dynamic templating in my Webapp, I, technically, have to dump JSP completely and switch to something like Velocity. All of the power of JSP, tag libraries, etc. is gone. I imagine that I could mimic the JSP environment, compile the JSP myself, compile the java myself, load the class myself and feed the output into the standard output stream, but that seems like a silly wheel to reinvent when I have a full container here that DOES THAT ALREADY, doncha think? Mind, I may still just Do It, open up paths to the disk and plonk files and JSPs in place and see what happens, but it's a flaming hoop I wish I didn't have to jump through. Regards, Will Hartung ([EMAIL PROTECTED]) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Question: Steve Kirk
Thanks Steve... I feel the same way. I'm sure someone out there has done this or has experience with it on Tomcat. When I encountered the issue two days ago, I spent a fair amount of time trying to resolve it. I ran a number of tests and after all attempts failed, I finally decided yesterday that I would attempt to defer to the user-list. I am going to give it a few days and see what folks come up with. If this runs cold for more than a few more days, I will be back on it myself. I will make sure I post whatever I find. The precompiled JSP's are particularly useful because of the initial loading time and the opportunity to distribute a WAR where code can stay somewhat hidden. In my particular case, I have packaged them up in the jar file that is sent along with the WAR. As a company we are very fond of open-source and open-systems, but we do have occasions where what we distribute needs to be a bit of a black-box. Best, Steve Kirk wrote: Thanks for saying that LOL :) but I'm afraid that you flatter me ;-) I've been using TC on and off for about 4 years, I have a working knowledge of the features that I actually use in my webapps, and answer Qs on those when I can, but that really is about it - there are many others on this list who are far more knowledgeable than I am about TC. Perhaps I'm talking too much at the moment and the volume is giving a false impression of quality ;) I did read your post, but unfortunately precomp JSPs are not something I use, I'm just aware of what the general benefits are, as I've worked on a project where someone else set up the precomp code for our production environment. It's on the list of things I want to learn about next, because it is good practice for production servers, and I have to set one up very soon. However I bet that someone will be along soon who can help you. I have no role in the project - I am just another web developer, the same as most people on the list. I am quite active at the moment, mainly because I just rejoined after a few months' absence, and I've just done upgrades to the latest versions of JDK/TC/NetBeans, so have read a lot of docs, and received help from list members, so have some fairly current knowledge to share. When on the list, and I have a few mins to spare, I try to help people if I know anything relevant. I think this is in the spirit of the community - give some help where you can, and what goes around comes around. Most of the real expertise and hard work in TC is provided by the team of volunteers behind the scenes. -Original Message- From: Mike Baliel [mailto:[EMAIL PROTECTED] Sent: Friday 27 May 2005 19:58 To: Tomcat Users List Subject: Question: Steve Kirk Hi Steve, You seem to be one of the more experienced users of the Tomcat user mail-list. Any thoughts on my precompiled JSP problem? Any feedback is welcomed. Best, -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.322 / Virus Database: 267.1.0 - Release Date: 5/27/2005 - 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] -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.322 / Virus Database: 267.1.0 - Release Date: 5/27/2005 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Adding content/JSPs on the fly
Could you instead store the JSP in a database? Let's say you have a table with the following structure: jsp_nameString jsp_content BLOB jsp_name is your primary key and is literally a JSP name. Now, create a servlet filter that examines the path that was requested and pulls out the file name part... so the path might be /my/app/page1.jsp, you just want the page.jsp part. Now, get the BLOB from the database based on that JSP name. Convert the BLOB to a string and stick it in request, then forward to a JSP that is the following: %=(String)request.getAttribute(theJSPContent)% And that's that. You could create a screen specifically for uploading a JSP and storing it in the database. Would something like this suite your needs? I realize it's not as straight-forward as one might like, but it's not too bad either. -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com Will Hartung wrote: From: Steve Kirk [EMAIL PROTECTED] Sent: Friday, May 27, 2005 11:44 AM It sounds reasonable, but probably isn't tested or by design, so probably best to just have a go. Re portability, the best advice I can offer is an old chestnut: read the servlet spec. This is particularly relevant in this case. The spec is generally pretty good at telling you you pretty accurately if (a) what you want to do should/must be supported or (b) what you want do do is forbidden. Of course there are some areas that it does not have a view either way on, but I find it to be an invaluable document - I have it on shortcut from my taskbar and consult it often. It's at least as useful as the javadocs or TC docs. For those of you that don't know where to find it, it's here, under specifications. http://java.sun.com/products/servlet/reference/api/index.html Choose the servlet spec version appropriate to your TC version as described in the table on the tomcat home page: http://jakarta.apache.org/tomcat/index.html I'm reasonably familiar with the specification. One of the notable bits about it is simply the fact that within the spec, you're pretty much not guaranteed writeable access to the file system at all (save for a temporary area, and it's simply that -- temporary). But the reality is that most engines give you access to the disk that way. Just one more specific point on your note Will - I would have thought if anything that you want it to be a precondition that the webapp NOT be deployed as a war. I've a feeling that if TC explodes the war, then it might not check the exploded FS for changes. Don't take this as gospel though, this is a hazy half-remembered bit of info. As far as I know, the Servlet spec doesn't have a deployment method outside of a WAR. It's pretty much a container behavior to actually explode the WAR on to the file system, yet, most obviously do for performance reasons. But it does bring up a basic problem, for example, if by some fluke the app is redeployed, all of that new data is blasted away by the WAR..that would be Bad. But I can't see another (easy) way to create JSPs on the fly, or in fact to create any other content that can be served directly the server. It's an annoying nit of the spec, to me, that it doesn't expose this behavior to the developer. For example, unlike EJBs (which has a specified limitation on accessing the disk), the Servlet spec does allow you to access the disk, though perhaps not within the WAR hierarchy. But, there is no way to, say, forward to a static resource that the server can then handle in its own internally optimal way. Rather, I have to open the static resource, determine the content type (I can get that from the Servlet spec), and then feed it into the output stream, when in fact it would simply be easier to do req.serveStatic(/tmp/mynewgraphic.gif) or some such thing, or be able to forward outside of the web app (i.e. to a actual file rather than a URL). Simply, the application structure and such are pretty much isolated from the developer. I can't add anything dynamically to the security domain, for example, which means if I want that kind of capability in my application, I have to essentially implement ALL of the container security -- mapping, role checks, etc. Container security is an all or nothing. Be happy with its limited funcitonality or dump it entirely. So, now if I want dynamic templating in my Webapp, I, technically, have to dump JSP completely and switch to something like Velocity. All of the power of JSP, tag libraries, etc. is gone. I imagine that I could mimic the JSP environment, compile the JSP myself, compile the java myself, load the class myself and feed the output into the standard output stream, but that seems like a silly wheel to reinvent when I have a full container here that DOES THAT ALREADY, doncha think? Mind, I may still just Do It, open up paths to the disk and plonk files and JSPs in place and see what happens, but it's a flaming hoop
Re: apache2 + mod_jk + tomcat 4.1.31 - jkstatus
Hi, I've already done that twice, it only extends the cord I'm hanging in, so I'm seeking the root-cause for this situation. Thanks anyway. What I actually want is a method/tool to determine the internal state of the tomcat container, to see which application is hogging it or if it is memory issue, etc. BR. Arnar On Thu, 2005-05-26 at 09:34 +0530, Praveen KUMAR wrote: Increase MaxThread in server.xml file Regards, Praveen Soni STMicroelectronics Pvt Ltd. Arnar Gestsson wrote, On 05/25/2005 02:45 PM: Hi all, I've installation of apache2, mod_jk and tomcat4.1.31 where the apache is serving port 80, and 5 vhost are directing jsp/servlet requests to 5 separate workers. I'm entering into bottlenecks where one of the workers issues, threadpool full. I've had problems debugging the situation and am seeking advice on how to determine the state of the workers. When using mod_jk2, jkstatus could be used but what is equivalent for mod_jk? BR. Arnar Arnar Gestsson, MSc Trackwell Software - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Adding content/JSPs on the fly
From: Frank W. Zammetti [EMAIL PROTECTED] Sent: Friday, May 27, 2005 1:04 PM Could you instead store the JSP in a database? ... snip ... Now, get the BLOB from the database based on that JSP name. Convert the BLOB to a string and stick it in request, then forward to a JSP that is the following: %=(String)request.getAttribute(theJSPContent)% If all I was interested in was displaying static data, then yes. But if I wanted access to the actual templating ability of JSP, then that doesn't help. Look at it this way. Let's say that I were using Velocity for templating instead of JSP. And let's say I have a VelocityServlet to handle it, and some url is mapped, say mywebapp/vt. So, for the HomePage Velocity template, the URL would be: http://host.com/mywebapp/vt/HomePage The Servlet gets the request, strips off the HomePage, finds the HomePage template file (or database record), fires up Velocity, renders it and spits it out response.getOutputStream. But here's the deal. I had to write the mapping code, the fetching code, the rendering code (at least the call to the renderer), and the output code. Velocity supports this, all well and good, it's not really a horrible problem. The detail, though, is that I have essentially duplicated a large chunk of what Tomcat and any compliant servlet container ALREADY provides. I had to reinvent that wheel. Doesn't that seem like a waste of time to you? Now, clearly, Tomcat implements a JSPServlet. The Jasper project is simply that. Identical pretty much to a VelocityServlet. I can tie *.vm to VelocityServlet, and they work identically to JSPs in pretty much every way and form. JSPs aren't anything special, in the big scheme of things (they ARE more complicated, however). So, if I wanted to provide the capability of dynamic JSPs (i.e. JSPs served from some source other than the WAR and webapp, say a database or a file outside of the hierarchy), I essentially have to bundle and refactor Jasper into my webapp. When I deploy my webapp on to a stock Tomcat (or, ideally, any other compliant container), the user now gets two copies of Jasper -- the installed version and my version in the webapp. Doesn't that seem redundant? It just seems like a painful hoop to jump through. I'd like to better leverage the container than how it will let me now, essentially tap in to how it gets its resources, and I'd like that to be possible through the Servlet API, via, say, a Resource Listener or somesuch thing. Regards, Will Hartung ([EMAIL PROTECTED]) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Adding content/JSPs on the fly
OK glad you've got that off yr chest ;) I can sort of see yr point, but these are not issues that have troubled me personally. I tend to look at TC from the point of view of I'm just pleased that someone else wrote TC for me for free and it works v well at what it is designed for. Every product has limitations, and can't cover every feature that we would all like, and I find it amazing that TC has so few limitations given that it is produced on the backs of volunteer contributions. I'd rather have one TC that 2 IIS's ;) If you're serious about pursuing a solution for this, Maybe there's an alternative, how about this. (It's not pretty but saves some of the reinvention that you describe). Let's say it's an acceptable limitatio to create all your new JSPs to a separate webapp folder. This webapp only has a single servlet initially, which is a type of Invoker that you write yourself, eg /dynamicWebApp/JspInvoker, which could be mapped to serve all request URIs of the form /dynamicWebApp/*.jsp Now, when /dynamicWebApp/dnynamicFile.jsp is invoked, the JspInvoker looks to see if a JSP called dynamicFile.jsp exists under that special folder. If it does, then your code translates/compiles/instantiates it (if not done already) and the request is forwarded to it's doPost method. I'm not saying this is easy, but it could be done. You'd be reinventing the classloading and service methods rather than all the other stuff. You might be forced to use SingleSignOn depending on your app, which could be a negative. Perhaps my answer is worse than yours ;) If its any consolation, one of the annoyances I have encountered in the last few months is that I have a particular webapp feature that I can't code well because Java does not provide multiple inheritance. I've done it, but the code is ugly. I've tried 99 ways of doing it different but don't have a better one. However, I realise that full multiple inheritance was deliberately excluded from Java for specific reasons, so I have to decide whether to stop using Java or accept it as good at what it is designed for. And that's an easy choice to make :) -Original Message- From: Will Hartung [mailto:[EMAIL PROTECTED] Sent: Friday 27 May 2005 20:38 To: Tomcat Users List Subject: Re: Adding content/JSPs on the fly From: Steve Kirk [EMAIL PROTECTED] Sent: Friday, May 27, 2005 11:44 AM It sounds reasonable, but probably isn't tested or by design, so probably best to just have a go. Re portability, the best advice I can offer is an old chestnut: read the servlet spec. This is particularly relevant in this case. The spec is generally pretty good at telling you you pretty accurately if (a) what you want to do should/must be supported or (b) what you want do do is forbidden. Of course there are some areas that it does not have a view either way on, but I find it to be an invaluable document - I have it on shortcut from my taskbar and consult it often. It's at least as useful as the javadocs or TC docs. For those of you that don't know where to find it, it's here, under specifications. http://java.sun.com/products/servlet/reference/api/index.html Choose the servlet spec version appropriate to your TC version as described in the table on the tomcat home page: http://jakarta.apache.org/tomcat/index.html I'm reasonably familiar with the specification. One of the notable bits about it is simply the fact that within the spec, you're pretty much not guaranteed writeable access to the file system at all (save for a temporary area, and it's simply that -- temporary). But the reality is that most engines give you access to the disk that way. Just one more specific point on your note Will - I would have thought if anything that you want it to be a precondition that the webapp NOT be deployed as a war. I've a feeling that if TC explodes the war, then it might not check the exploded FS for changes. Don't take this as gospel though, this is a hazy half-remembered bit of info. As far as I know, the Servlet spec doesn't have a deployment method outside of a WAR. It's pretty much a container behavior to actually explode the WAR on to the file system, yet, most obviously do for performance reasons. But it does bring up a basic problem, for example, if by some fluke the app is redeployed, all of that new data is blasted away by the WAR..that would be Bad. But I can't see another (easy) way to create JSPs on the fly, or in fact to create any other content that can be served directly the server. It's an annoying nit of the spec, to me, that it doesn't expose this behavior to the developer. For example, unlike EJBs (which has a specified limitation on accessing the disk), the Servlet spec does allow you to access the disk, though perhaps not within the WAR hierarchy. But, there is no way to, say, forward to a static resource that the server can
RE: Environment in Tomcat 5.0.28 not working with multiple tomcat services in server.xml
Hi Doug, Thanks for your answer. I did specify a different IP / port for the connectors. I finally changed my code to use parameter in server.xml instead of environment. This workaround worked properly, but I have not been able to do the same thing with environment. Anyway, this is fine for now. Thanks, Iannis -Original Message- From: Parsons Technical Services [mailto:[EMAIL PROTECTED] Sent: Friday, May 20, 2005 4:22 AM To: Tomcat Users List Subject: Re: Environment in Tomcat 5.0.28 not working with multiple tomcat services in server.xml You did specify a different IP for each connector? Else the 2nd one will fail because the port is in use. Unless the ports on all connectors are different. Doug - Original Message - From: Iannis Hanen [EMAIL PROTECTED] To: tomcat-user@jakarta.apache.org Cc: [EMAIL PROTECTED] Sent: Thursday, May 19, 2005 8:11 PM Subject: Environment in Tomcat 5.0.28 not working with multiple tomcat services in server.xml Hi, I am back with some more questions. I have configured Tomcat to operate with multiple services and engines (I have different services since I need separate connector for different set of web applications). For some web applications inside the host, I have specified some environment entries. In the first service, everything works great. But in the second service, I cannot access any of them. Is it a problem in Tomcat, or a misconfiguration? Here is an outline of my server.xml file below. Basically, AttrName2 in the foo2 context cannot be found. If I swap the order of the services in server.xml, only the first service (on the top) behaves properly. Thanks, Iannis Server ... Listener .../ Listener .../ Service name=Service1 Connector ... / Engine name=Engine1 defaultHost=localhost ... Logger .../ Host name=localhost ... DefaultContext Environment name=DefaultAttrName type=java.lang.String value=Some default value/ /DefaultContext Context path=/foo reloadable=false docBase=C:\foo.war workDir=C:\ tomcat\work\foo Environment name=AttrName type=java.lang.String value=myValueOK/ /Context /Host /Engine /Service Service name=Service2 Connector .../ Engine name=Engine2 defaultHost=localhost ... Logger .../ Host name=localhost ... Context path=/foo2 reloadable=false docBase=C:\foo2.war workDir=C:\ tomcat\work\foo2 Environment name=AttrName2 type=java.lang.String value=MyLostValue/ /Context /Host /Engine /Service /Server - 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]
Custom server.xml location with tomcat windows service (5.0.28)
Hi, I have been trying to setup the tomcat windows service to use an alternate configuration file location, instead of the default server.xml under conf. The tomcat service pulls all the information from the registry, but I could not find a good spot there to specify a different server.xml file location. The Start registry key has a params String value that is set to start. I tried to add a -config parameter there with the appropriate location, but the service failed to start after that. I assume that tomcat5.exe does not expect other values besides start or stop. Has anybody tried such thing before? What should I do? Regards, Iannis
Cross-site scripting vulnerability
Our security tool produces the following warning against Tomcat 4.1.29 : [HTTP/8080/TCP] Server is an enabling vector for cross-site scripting exposure in clients [trace-1]. More... I seached the mailing list and found several references to cross-site scripting. Based on the information, I am lead to believe that the problem is not with the product, but with the examples or some other non-critical piece of code. I have removed the jakarta-tomcat-4.1.29/webapps/examples directory and its' content, but the problem persists. Is there some other file/directory that needs to be removed to fix this problem? I noticed one reference to a SnoopServlet, but can't find any file by that name. Narses Barona - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: shared install under Linux
Mark wrote: Then in that case, I would make the context writable to all developers, and also make the context reloadable. By making the context reloadable, tomcat will reload any classes/jars that are placed into/or updated in the context. A couple tips would be: 1. If you are building classes into the context/WEB-INF directory, do not perform a clean operation, as this could throw tomcat off. 2. I would recommend building jar files, and then place a copy of the jar file into the context. Thanks Mark. This is what I do know (more or less). I was wondering if it is possible to install Tomcat to a common location and then run separate instances (separate server.xml files) with totally separate web apps. You can always install the whole Tomcat in separate folders (for each user) I guess. Marius On 5/26/05, Marius Scurtescu [EMAIL PROTECTED] wrote: Mark wrote: Is this for a development environment ? Yes, for development. - 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]
cant post to wiki and security
Hi 1 of 3 I wanted to include an install doc for tomcat 5.5.9 on solaris 9 with jdk1.5.0 2 of 3 I also have a question: How do you create a login for webdav servlet so that no one besides your access list can log into the webdav folder and read it 3 0f 3 WHy is wiki read only? I cant upload this to wiki My install doc follows tomcat 5.5.9 install first get jdk 1.5.x since tomcat 5.5.9 needs it jdk 5 setup ftp the jdk-1_5_0_03-solaris-sparc.tar.Z from G:~/Web/jdk_solaris9 to /home/gavin as usr gavin pass ce1tics since ftp won't work as root create new directory for installation only mkdir (whatever name u like) copy jdk into install directory cp jdk-1_5_0_03-solaris-sparc.tar.Z /home/gavin/instaler cd instaler now follow sun doc: 1. Download and check the file size to ensure that you have downloaded the full, uncorrupted software bundle. It's best to create a new directory to save the download bundle to, as the next step will extract several directories and files into this directory. The directory can be anywhere you choose. Before you download the file, notice its byte size provided on the download page on the web site. Once the download has completed, compare that file size to the size of the downloaded file to make sure they are equal. 2. Extract the contents of the compressed tar file: On SPARC processors: zcat jdk-1_5_0update-solaris-sparc.tar.Z | tar -xf - On x86/AMD64/EM64T processors: zcat jdk-1_5_0update-solaris-i586.tar.Z | tar -xf - This creates several directories (SUNWj5rt, SUNWj5dev, SUNWj5cfg, SUNWj5man, SUNWj5dmo, and SUNWj5jmp) plus a few files in the current directory. 3. Become root by running su and entering the super-user password. 4. Uninstall any earlier 5.0 package installation of JDK. If your machine has an earlier version of 5.0 already installed in the default location (/usr/jdk/jdk1.5.0), you must remove it before installing a later version of 5.0 at that location. You can skip this step if you intend to install JDK 5.0 in a non-default location. For more details, see Selecting the Default Java Platform. To uninstall the Solaris packages for JDK 5.0, remove them by running: On all processors: pkgrm SUNWj5rt SUNWj5dev SUNWj5cfg SUNWj5man SUNWj5dmo 5. Run the pkgadd command to install the packages. On all processors: pkgadd -d . SUNWj5rt SUNWj5dev SUNWj5cfg SUNWj5man SUNWj5dmo This installs the JDK 5.0 into /usr/jdk/jdk1.5.0. Version 5.0 does not automatically become the default Java platform on Solaris 9 or earlier (unless there was no default), but does become the default on Solaris 10. If you want 5.0 to be the default on Solaris 8 or 9, follow the instructions at Default Installations of Java Platform. See the pkgadd(1) and admin(4) man pages for information on installing the JDK in a non-default location. 6. Delete the tar files and extracted SUNW* directories. 7. Exit the root shell. No need to reboot. To install tomcat get the .zip file unzip tomcat-version-xyz.zap these are tomcat folders go into /bin and chmod +x * then they recommended creating a symbolic link to a tomcat directory. # ln -s jakarta-tomcat-5.5.9 tomcat In order for Tomcat to startup and shutdown, you will also need to add an environment variable pointing to the Tomcat directory (CATALINA_HOME), and one variable pointing to your Java SDK directory (JAVA_HOME). I will make the following assumptions: JAVA_HOME Java is installed into /usr/jdk/jdk1.5.0_03 CATALINA_HOME Tomcat is installed into /opt/jakarta-tomcat-5.x.xx and symlinked to /opt/tomcat. Insert the following lines inside /etc/profile or /root/.bashrc. export JAVA_HOME=/usr/jdk/jdk1.5.0_03 export CATALINA_HOME=/opt/tomcat then for our purposes here retype them at the command line so the server has them in effect now test that the server sees them by typing echo $JAVA_HOME should give /usr/jdk/jdk1.5.0_03 echo $CATALINA_HOME should give /opt/tomcat if blank line retype the export JAVA_HOME=etc. Webdav webdav is a servlet it is in /opt/tomcat/webapps/webdav and already autodeployed by default if we change the port tomcat serves from 8080 to 8084 in /opt/tomcat/conf/server.xml 2nd page down in vi hold control down and hit F once then /opt/tomcat/bin/shutdown.sh ~/bin/startup.sh (off+on) tomcat we can open http://69.8.207.143:8084/webdav and see files and folders in /opt/tomcat/webapps/webdav directory -- ___ Get your free email from http://mymail.bsdmail.com Powered by Outblaze - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cross-site scripting vulnerability
I notice the more... at the end of that... do you have the more by chance? Cross-site scripting (CSS) vulnerabilities are, generally-speaking, concerned with situations where a server-side process generates HTML dynamically and there is a possibility of input data that has not been scrubed of certain dangerous characters (i.e., ()%, etc.) being inserted into the generated code. Proper crafting of such input data can result in code being executed as trusted when it clearly should not be. (As amazing as it seems, I found the following page from Microsoft, of all sources!, to be a good explanation of the problem: http://support.microsoft.com/default.aspx?scid=kb;en-us;252985) As such, a tool that says a server is an enabling vector for such a vulnerability is not being especially helpful because virtually *any* server-side code that doesn't deal with such characters is potentially an enabling vector. If it narrows down the location of the apparent vulnerability, i.e., specified a path it tested maybe, it might point at something legitimately of concern. If it's just saying Hey, Tomcat could be used to craft a CSS hack, well, yes, it COULD, but then so could *anything* server-side that generates HTML! (Ironically, I spent most of today dealing with a servlet filter written by another team at my company that deals with cross-site scripting vulnerabilities, but which seems to have some unexpected side-effects, so I had to get up to speed on CSS vulnerabilities in a hurry!) Frank Narses Barona wrote: Our security tool produces the following warning against Tomcat 4.1.29 : [HTTP/8080/TCP] Server is an enabling vector for cross-site scripting exposure in clients [trace-1]. More... I seached the mailing list and found several references to cross-site scripting. Based on the information, I am lead to believe that the problem is not with the product, but with the examples or some other non-critical piece of code. I have removed the jakarta-tomcat-4.1.29/webapps/examples directory and its' content, but the problem persists. Is there some other file/directory that needs to be removed to fix this problem? I noticed one reference to a SnoopServlet, but can't find any file by that name. Narses Barona - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] . -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
function call hanging - Bizarre!
My web application is equipped with a ServletContextListener. Among other things the contextIntialized() method creates and starts a server object which has as one of it's data members an object that inherits from UnicastRemoteObject (the basic Java RMI server implementation). conextDestroyed() is supposed to shut my server object down, but my shutdown procedure is hanging in a seemingly impossible way. Here's the basic structure of the server I'm trying to shutdown: public class MyServer { MyRemoteServer r; // bla, bla, bla public class MyRemoteServer extends UnicastRemoteObject implements MyRemoteInterface { // bla, bla, bla public void stop() { System.out.println(PRINT #2); // bla, bla, bla } } public void stop() { // bla, bla, bla if(r != null) { System.out.println(PRINT #1); r.stop(); } } } Invocation of MyServer.stop() is not returning. The confounding thing is that I see PRINT #1 in catalina.out, but NOT PRINT #2. Some things to note: I'm running Tomcat 5.024 on Fedora 2.x I can startup and shtudown MyServer without error when I run it from a command-line java application -- I only hit the weird hang when running from within tomcat. Neither stop() method is synchronized, so I don't see how this could have anything to do with thread locks. (There are other methods on both of these objects that are synchronized, but these are not.) I've verified that UnicastRemoteObject does NOT have it's own stop method that I'm overriding to some ill end. In fact I changed the name of MyRemoteServer.stop() to MyRemoteServer.doStop() just to make sure I wasn't getting hammered by some subtle function override behavior that I'm too stupid to fathom. It's not obvious that the problem has anything to do with RMI, but that is one unusual property of the inner class MyRemoteServer so I mention it. So what on God's green Earth could cause a non-synchronous method call to hang before the first line of that method is executed? Could a corrupt object pointer explain this behavior? I haven't tried printing out the addresses of the myRemoteServer object at startup and shutdown -- perhaps that would reveal something. Much appreciation to any genius who can propose a theory as to what's going on. Matt - Do You Yahoo!? Yahoo! Small Business - Try our new Resources site!
test
Why can't I post? __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
RE: test
You just did. -Original Message- From: TK Banks [mailto:[EMAIL PROTECTED] Sent: Friday, May 27, 2005 4:52 PM To: tomcat-user@jakarta.apache.org Subject: test Why can't I post? __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat and RMI client - setup
Nikola Milutinovic [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi all. This might be a simple question. I have a working RMI client and server. I have tested it no problem. Now I would like to make a JSP/Servlet that will act as a RMI client and connect to the RMI server running outside Tomcat JVM. I keep running into access permission violations. I understand that I need to setup security policy, I had that for RMI. One thing than makes me slightly suspicious, is the fact that when I debug TC/RMI combo, I can see that my RMI client enters into setting up RMISecurityManager: if (System.getSecurityManager() == null) { goes in = System.setSecurityManager( new RMISecurityManager() ); } Is that OK? I thought TC would setup security manager. Setting an SM this late could cause wierd problems, depending on what permissions it doesn't grant, so it's probably at the least a bad idea. TC only sets up the SM if you start it with '-security'. Now, my question is, what about Tomcat? If I want to run this, what do I need to do? If I get it, I need to: - setup catalina.policy - run it with -security option I'm on Windows XP, how do I enable security mode for TC? That's the idea. And, as a bonus, it works the same on Linux, Solaris, OS/X, . Am I barking up the wrong tree? Nix. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
2 inquieries
has anyone tried: . logging using log4j to a client ngsyslog client that is just popping log messages via UDP Protocol ? . loading all webapp classes as sealed objects from a sec class loader? lbrtchx - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with precompiled JSP's (2nd Try)
I just checked, and there is indeed NoSuchMethod in Tomcat 5. You need to re-precompile your JSPs using the jspc from Tomcat 5 for it to work. It's not enough to just move the class files over, since they reference the Jasper version that they were compiled with. Mike Baliel [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello, I have an application that is currently running under JBoss 3.2.x with Jetty that I would like to get running on Tomcat 5.X. I have precompiled all of the JSP's and mapped them to there respective JSP path in the web.xml. Here is a sample fragment of the web.xml: ?xml version=1.0 encoding=UTF-8? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app id=WebApp display-namemjc_campus_tour/display-name servlet servlet-nametourArea0/servlet-name display-nametourArea0/display-name servlet-classcom.atomogy.virtualtour.view.pages.tourArea0_jsp/servlet-class /servlet servlet servlet-nametourArea1/servlet-name display-nametourArea1/display-name servlet-classcom.atomogy.virtualtour.view.pages.tourArea1_jsp/servlet-class /servlet servlet servlet-nametourArea2/servlet-name display-nametourArea2/display-name servlet-classcom.atomogy.virtualtour.view.pages.tourArea2_jsp/servlet-class /servlet servlet servlet-nametourArea3/servlet-name display-nametourArea3/display-name servlet-classcom.atomogy.virtualtour.view.pages.tourArea3_jsp/servlet-class /servlet servlet servlet-namefooter/servlet-name display-namefooter/display-name servlet-classcom.atomogy.virtualtour.view.include.footer_jsp/servlet-class /servlet servlet servlet-nameheader/servlet-name display-nameheader/display-name servlet-classcom.atomogy.virtualtour.view.include.header_jsp/servlet-class /servlet servlet-mapping servlet-nametourArea0/servlet-name url-pattern/pages/tourArea0.jsp/url-pattern /servlet-mapping servlet-mapping servlet-nametourArea1/servlet-name url-pattern/pages/tourArea1.jsp/url-pattern /servlet-mapping servlet-mapping servlet-nametourArea2/servlet-name url-pattern/pages/tourArea2.jsp/url-pattern /servlet-mapping servlet-mapping servlet-nametourArea3/servlet-name url-pattern/pages/tourArea3.jsp/url-pattern /servlet-mapping servlet-mapping servlet-namefooter/servlet-name url-pattern/include/footer.jsp/url-pattern /servlet-mapping servlet-mapping servlet-nameheader/servlet-name url-pattern/include/header.jsp/url-pattern /servlet-mapping welcome-file-list welcome-fileindex.jsp/welcome-file /welcome-file-list /web-app The error message that I get when trying to run the application on Tomcat is as follows: 2005-05-26 09:33:03 StandardWrapperValve[tourArea0]: Servlet.service() for servlet tourArea0 threw exception java.lang.NoSuchMethodError: org.apache.jasper.runtime.JspRuntimeLibrary.include(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Ljava/lang/String;Ljavax/servlet/jsp/JspWriter;Z)V at com.atomogy.virtualtour.view.pages.tourArea0_jsp._jspService(tourArea0_jsp.java:43) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at
Re: Problem with precompiled JSP's (2nd Try)
Thanks for replying Bill I have Tomcat 5.0 installed and I checked the jasper-runtime.jar located at Tomcat5.0\common\lib and in my copy the method exists... ? Are you looking in jasper-compiler or jasper-runtime? Bill Barker wrote: I just checked, and there is indeed NoSuchMethod in Tomcat 5. You need to re-precompile your JSPs using the jspc from Tomcat 5 for it to work. It's not enough to just move the class files over, since they reference the Jasper version that they were compiled with. Mike Baliel [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello, I have an application that is currently running under JBoss 3.2.x with Jetty that I would like to get running on Tomcat 5.X. I have precompiled all of the JSP's and mapped them to there respective JSP path in the web.xml. Here is a sample fragment of the web.xml: ?xml version=1.0 encoding=UTF-8? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app id=WebApp display-namemjc_campus_tour/display-name servlet servlet-nametourArea0/servlet-name display-nametourArea0/display-name servlet-classcom.atomogy.virtualtour.view.pages.tourArea0_jsp/servlet-class /servlet servlet servlet-nametourArea1/servlet-name display-nametourArea1/display-name servlet-classcom.atomogy.virtualtour.view.pages.tourArea1_jsp/servlet-class /servlet servlet servlet-nametourArea2/servlet-name display-nametourArea2/display-name servlet-classcom.atomogy.virtualtour.view.pages.tourArea2_jsp/servlet-class /servlet servlet servlet-nametourArea3/servlet-name display-nametourArea3/display-name servlet-classcom.atomogy.virtualtour.view.pages.tourArea3_jsp/servlet-class /servlet servlet servlet-namefooter/servlet-name display-namefooter/display-name servlet-classcom.atomogy.virtualtour.view.include.footer_jsp/servlet-class /servlet servlet servlet-nameheader/servlet-name display-nameheader/display-name servlet-classcom.atomogy.virtualtour.view.include.header_jsp/servlet-class /servlet servlet-mapping servlet-nametourArea0/servlet-name url-pattern/pages/tourArea0.jsp/url-pattern /servlet-mapping servlet-mapping servlet-nametourArea1/servlet-name url-pattern/pages/tourArea1.jsp/url-pattern /servlet-mapping servlet-mapping servlet-nametourArea2/servlet-name url-pattern/pages/tourArea2.jsp/url-pattern /servlet-mapping servlet-mapping servlet-nametourArea3/servlet-name url-pattern/pages/tourArea3.jsp/url-pattern /servlet-mapping servlet-mapping servlet-namefooter/servlet-name url-pattern/include/footer.jsp/url-pattern /servlet-mapping servlet-mapping servlet-nameheader/servlet-name url-pattern/include/header.jsp/url-pattern /servlet-mapping welcome-file-list welcome-fileindex.jsp/welcome-file /welcome-file-list /web-app The error message that I get when trying to run the application on Tomcat is as follows: 2005-05-26 09:33:03 StandardWrapperValve[tourArea0]: Servlet.service() for servlet tourArea0 threw exception java.lang.NoSuchMethodError: org.apache.jasper.runtime.JspRuntimeLibrary.include(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Ljava/lang/String;Ljavax/servlet/jsp/JspWriter;Z)V at com.atomogy.virtualtour.view.pages.tourArea0_jsp._jspService(tourArea0_jsp.java:43) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at
RE: test
Sorry my first attempt sent me backa message saying I wasn't a member. Though now I see that that message was sent to me via tomcat-user as well. I'm not sure why I got the error message. Sorry for the tripe. David Short [EMAIL PROTECTED] wrote:You just did. -Original Message- From: TK Banks [mailto:[EMAIL PROTECTED] Sent: Friday, May 27, 2005 4:52 PM To: tomcat-user@jakarta.apache.org Subject: test Why can't I post? __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do You Yahoo!? Yahoo! Small Business - Try our new Resources site!
Bug?: JspCompilationContext.createCompiler(JspCompilationContext.java:220)
I am trying to embed tomcat in an application. I am using Sun Java 1.5 and Tomcat 5.5.9. During the tomcat startup, I receive the following error: SEVERE: Servlet.service() for servlet jsp threw exception java.lang.NullPointerException at org.apache.jasper.JspCompilationContext.createCompiler(JspCompilationContext.java:220) I looked at the JspCompilationContext.java code and found the block where the NullPointerException occurs: /** * Create a Compiler object based on some init param data. This * is not done yet. Right now we're just hardcoding the actual * compilers that are created. */ public Compiler createCompiler() throws JasperException { if (jspCompiler != null ) { return jspCompiler; } jspCompiler = null; if (options.getCompiler() == null) { jspCompiler = createCompiler(org.apache.jasper.compiler.JDTCompiler); if (jspCompiler == null) { jspCompiler = createCompiler(org.apache.jasper.compiler.AntCompiler); } } else { jspCompiler = createCompiler(org.apache.jasper.compiler.AntCompiler); if (jspCompiler == null) { jspCompiler = createCompiler(org.apache.jasper.compiler.JDTCompiler); } } jspCompiler.init(this, jsw); return jspCompiler; } private static Compiler createCompiler(String className) { Compiler compiler = null; try { compiler = (Compiler) Class.forName(className).newInstance(); } catch (Throwable t) { // Log ? // FIXME: log } return compiler; } I was somewhat concerned by the comments within the block. I thought I would ask if there is an open bug in this area before I continued picking apart my own code. Is this a bug in Tomcat? If so, is there a work-around? If not, how should I proceed? Thank you in advance, Mark - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: shared install under Linux
Sounds like you want to setup multiple TC instances. Try using CATALINA_BASE. See this message for more info: http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg151971.html --David Marius Scurtescu wrote: Mark wrote: Then in that case, I would make the context writable to all developers, and also make the context reloadable. By making the context reloadable, tomcat will reload any classes/jars that are placed into/or updated in the context. A couple tips would be: 1. If you are building classes into the context/WEB-INF directory, do not perform a clean operation, as this could throw tomcat off. 2. I would recommend building jar files, and then place a copy of the jar file into the context. Thanks Mark. This is what I do know (more or less). I was wondering if it is possible to install Tomcat to a common location and then run separate instances (separate server.xml files) with totally separate web apps. You can always install the whole Tomcat in separate folders (for each user) I guess. Marius On 5/26/05, Marius Scurtescu [EMAIL PROTECTED] wrote: Mark wrote: Is this for a development environment ? Yes, for development. - 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: Problem with precompiled JSP's (2nd Try)
Mike Baliel [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Thanks for replying Bill I have Tomcat 5.0 installed and I checked the jasper-runtime.jar located at Tomcat5.0\common\lib and in my copy the method exists... ? Are you looking in jasper-compiler or jasper-runtime? Admittedly, I'm looking at the 5.5 version (since I removed the 5.0 version here long ago :). However, I didn't think that there were such major changes in Jasper between 5.0 and 5.5 (and a quick check of the CVS log confirms it :). The signature in all recent versions of TC 5.x jasper-runtimes is: public static void include(ServletRequest request, ServletResponse response, String relativePath, JspWriter out, boolean flush) throws IOException, ServletException { which is clearly different from your pre-compiled JSPs. Bill Barker wrote: I just checked, and there is indeed NoSuchMethod in Tomcat 5. You need to re-precompile your JSPs using the jspc from Tomcat 5 for it to work. It's not enough to just move the class files over, since they reference the Jasper version that they were compiled with. Mike Baliel [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello, I have an application that is currently running under JBoss 3.2.x with Jetty that I would like to get running on Tomcat 5.X. I have precompiled all of the JSP's and mapped them to there respective JSP path in the web.xml. Here is a sample fragment of the web.xml: ?xml version=1.0 encoding=UTF-8? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app id=WebApp display-namemjc_campus_tour/display-name servlet servlet-nametourArea0/servlet-name display-nametourArea0/display-name servlet-classcom.atomogy.virtualtour.view.pages.tourArea0_jsp/servlet-class /servlet servlet servlet-nametourArea1/servlet-name display-nametourArea1/display-name servlet-classcom.atomogy.virtualtour.view.pages.tourArea1_jsp/servlet-class /servlet servlet servlet-nametourArea2/servlet-name display-nametourArea2/display-name servlet-classcom.atomogy.virtualtour.view.pages.tourArea2_jsp/servlet-class /servlet servlet servlet-nametourArea3/servlet-name display-nametourArea3/display-name servlet-classcom.atomogy.virtualtour.view.pages.tourArea3_jsp/servlet-class /servlet servlet servlet-namefooter/servlet-name display-namefooter/display-name servlet-classcom.atomogy.virtualtour.view.include.footer_jsp/servlet-class /servlet servlet servlet-nameheader/servlet-name display-nameheader/display-name servlet-classcom.atomogy.virtualtour.view.include.header_jsp/servlet-class /servlet servlet-mapping servlet-nametourArea0/servlet-name url-pattern/pages/tourArea0.jsp/url-pattern /servlet-mapping servlet-mapping servlet-nametourArea1/servlet-name url-pattern/pages/tourArea1.jsp/url-pattern /servlet-mapping servlet-mapping servlet-nametourArea2/servlet-name url-pattern/pages/tourArea2.jsp/url-pattern /servlet-mapping servlet-mapping servlet-nametourArea3/servlet-name url-pattern/pages/tourArea3.jsp/url-pattern /servlet-mapping servlet-mapping servlet-namefooter/servlet-name url-pattern/include/footer.jsp/url-pattern /servlet-mapping servlet-mapping servlet-nameheader/servlet-name url-pattern/include/header.jsp/url-pattern /servlet-mapping welcome-file-list welcome-fileindex.jsp/welcome-file /welcome-file-list /web-app The error message that I get when trying to run the application on Tomcat is as follows: 2005-05-26 09:33:03 StandardWrapperValve[tourArea0]: Servlet.service() for servlet tourArea0 threw exception java.lang.NoSuchMethodError: org.apache.jasper.runtime.JspRuntimeLibrary.include(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Ljava/lang/String;Ljavax/servlet/jsp/JspWriter;Z)V at com.atomogy.virtualtour.view.pages.tourArea0_jsp._jspService(tourArea0_jsp.java:43) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at
rfe
I was wondering if any one other than me has had the need to use a run-time 'before-bootstrapping' and 'cleaning-after-at-the-very-end' type of functionality. I have been using it all along in my webapps and I think it is really useful to the point that, it should be included in the Tomcat as a 'standard' hack or extra functionality. I have used it primarily to: 1._ read in at run time security sensitive settings that I am not comfortable with declaring in server.xml, web.xml or in any other config file in the file system (yes, I am a healthy paranoid (I have plenty of reasons to be like that)) 2._ to create RAM based tables for session handling using hsqldb (you should still save your sessions in the back end and reload them to the front end ram based tables) This is what I have been doing the monkey way: 1._ gone to the source org.apache.catalina.startup.BootStrap.main and 1.1_ inserted my code right after the method signature to make sure absolute nothing has been previously staged by the VM 1.2_ with the necessary import declarations if needed 1.3_ recompile and jarred everything as 'bootstrap02.jar' 2._ removed 'bootstrap.jar' and placed 'bootstrap02.jar' in $CATALINA_HOME/bin/ 3._ commented out the 'CLASSPATH' setting in catalina.[bat|sh] rem set CLASSPATH=%CLASSPATH%;%CATALINA_HOME%\bin\bootstrap.jar # CLASSPATH=$CLASSPATH:$CATALINA_HOME/bin/bootstrap.jar:$CATALINA_HOME/b in/commons-logging-api.jar changing 'bootstrap.jar' for 'bootstrap02.jar' 4._ the line in which the JVM process is started exec $_RUNJAVA $JAVA_OPTS $CATALINA_OPTS \ -classpath $CLASSPATH \ -Dcatalina.base=$CATALINA_BASE \ -Dcatalina.home=$CATALINA_HOME \ -Djava.io.tmpdir=$CATALINA_TMPDIR \ org.apache.catalina.startup.Bootstrap $@ start or something similar depending on how you startup TC should be echoed (this should be standard too) Interface EntryExit{ public boolean doFirst(); public boolean doLast(); } then a class -which name should be convened upon-, say '_firstandlast', should implement the EntryExit interface and used at tomcat bootstrapping process as a command object and then discarded. If possible, no trace should be left of this object in memory and only its actions/secondary effects should be staged for this run time only. This is not an object to keep around Then people could code around inside of the doFirst() method of this command object, which will be invoked at startup and doLast() which will be invoked when TC shuts down If TC does not find this object at startup/shutdown it simply bypasses the step in either ...Bootstrap.class or at the very end of the code segment of org.apache.catalina.startup.Catalina$CatalinaShutdownHook(?) when _firstandlast.doLast() should be called. I guess I could just do it myself in TC source code, but it is better if we just spec out the feature and tell our hearts for people keeping a mental map of this code base to give it some thoughts and streamline this feature, some issues would be security relating to differing contexts and class loaders ones. lbrtchx - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
The amazingly slow performance of JSP (profiler results)
I've been tuning our application trying to get the maximum performance out if the system as possible. I've been throwing the system at jprofiler and allowing it to tell me where to optimized. In short Tomcat is slower than our DB, filesystem,. network and all other systems by about 4x. I've been able to shave some page load time off by some but not enough. The problem I'm starting to see is that we just have a large number of c:set and c:if constructs (and so forth) within loops. These loops then get executed 5 times and next thing you know it you have 50k taglib calls. The problem comes when you look at the source: Let's say you start with: c:set var=foo value=bar/ This nice little elegant piece of code gets expanded to: private boolean _jspx_meth_c_set_0(PageContext _jspx_page_context) throws Throwable { PageContext pageContext = _jspx_page_context; JspWriter out = _jspx_page_context.getOut(); // c:set org.apache.taglibs.standard.tag.rt.core.SetTag _jspx_th_c_set_0 = (org.apache.taglibs.standard.tag.rt.core.SetTag) _jspx_tagPool_c_set_var_value_nobody.get(org.apache.taglibs.standard.tag.rt.core.SetTag.class); _jspx_th_c_set_0.setPageContext(_jspx_page_context); _jspx_th_c_set_0.setParent(null); _jspx_th_c_set_0.setVar(foo); _jspx_th_c_set_0.setValue(new String(bar)); int _jspx_eval_c_set_0 = _jspx_th_c_set_0.doStartTag(); if (_jspx_th_c_set_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) return true; _jspx_tagPool_c_set_var_value_nobody.reuse(_jspx_th_c_set_0); return false; } Which explains why JSP alone is so amazingly slow! I did a comparison of the page performance here and it was 15x slower than just using Java. So the same set operation in Java was 15x faster. ... so in short ... does anyone have any way to speed this up? The other thing I noticed is that EL is evaluated at runtime (which has to be parsed) and sometimes uses reflections. Can anyone shed any more light on this and hopefully provide some performance optimization suggestions? Kevin -- Use Rojo (RSS/Atom aggregator)! - visit http://rojo.com. See irc.freenode.net #rojo if you want to chat. Rojo is Hiring! - http://www.rojonetworks.com/JobsAtRojo.html Kevin A. Burton, Location - San Francisco, CA AIM/YIM - sfburtonator, Web - http://peerfear.org/ GPG fingerprint: 5FB2 F3E2 760E 70A8 6174 D393 E84D 8D04 99F1 4412 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]