Re: Tomcat j2sdk and image
Hi, do you have a graphics environment when running under Solaris? If not then that would be my guess to a reason why it's not working, since you have a graphics environment when running under W2K. Try adding -Djava.awt.headless=true to your commandline when starting tomcat. If this doesn't do the trick, you need the graphics environment to generate your images. Trond [EMAIL PROTECTED] wrote: Hi, The program java use : java.awt.Frame; java.awt.Graphics; java.awt.Image; and Acme.JPM.encoders.GifEncoders who encode image in Gif. N.B. : the application works fine on W2K with Tomcat-4.0.4 using jdk-1.3.1, and Tomcat-4.1.30 and Tomcat-5.0.28 with jdk-1.4.2 Dale, Matt a écrit : I'd be surprised if anyone could with the scant information you have provided. You haven't even mentioned the image library that you are using. I would suggest that you get a profiler or debugger in order to work out what your code is doing at the time that it is generating the image and which methods are taking all the time. Ta Matt -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 02 May 2005 16:33 To: tomcat-user@jakarta.apache.org Subject: Tomcat j2sdk and image Hi, I have a java application who generate image. On Sun Solaris 8, It works fine with Tomcat-4.0.4 and jdk-1.3.1 It was the same with Tomcat-4.1.18 and jdk-1.4.1 But when I use Tomcat-4.1.30 with jdk-1.4.2 or Tomcat-5.0.28 with jdk-1.4.1 or jdk-1.4.2, the image make a long time to be generating. What is the problem ? Can somebody help me ? AL - 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]
Re: out of memory error
Speaking of disk space, I ran out of it today because my cron job to delete my log files didn't work. Ooopppsss ;) Trond Mark Benussi wrote: : ) Yes Matt good point. For future reference if anyone is seeing any disk full issues then they do not have a big enough hard disk... Original Message Follows From: Dale, Matt [EMAIL PROTECTED] Reply-To: Tomcat Users List tomcat-user@jakarta.apache.org To: Tomcat Users List tomcat-user@jakarta.apache.org Subject: RE: out of memory error Date: Tue, 26 Apr 2005 15:42:51 +0100 Or you simply don't have enough memory allocated to the JVM and you need to increase it. -Original Message- From: Mark Benussi [mailto:[EMAIL PROTECTED] Sent: 26 April 2005 15:41 To: [EMAIL PROTECTED]; tomcat-user@jakarta.apache.org Subject: RE: out of memory error I hit this issue today, for a host of reasons. You are getting this error because the ammount of memory allocated to the JVM running Tomcat has been taken up. This ould be for the following reasons: You are doing some large database reads without using a methodology to read in batches. You are storing large objects in the request or session. You may have memory leaks (A term I hate because it implies that there is a problem in the underlying system but what it actually means is you are keeping references to objects you no longer require). Original Message Follows From: Sergey Livanov [EMAIL PROTECTED] Reply-To: Sergey Livanov [EMAIL PROTECTED] To: Tomcat users tomcat-user@jakarta.apache.org Subject: out of memory error Date: Tue, 26 Apr 2005 17:10:02 +0300 Pls help me to investigate type of error. Sometimes pages are not downloaded. We have looked into Log file and found out a message out of memory. When is this error appeared and what do we have to do to avoid this type of error? 2005-04-25 08:15:10 ApplicationDispatcher[] Servlet.service() for servlet jsp threw exception java.lang.OutOfMemoryError 2005-04-25 08:15:11 StandardWrapperValve[action]: Servlet.service() for servlet action threw exception java.lang.OutOfMemoryError -- regards, Sergey mailto:[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] - 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 get www.site.com homepage requests to forward to Tomcat without a redirect?
Hi, try removing the [R] from your RewriteRule. If you read up on the mod_rewrite docs, you should see that the [R] flag is causing the redirect. Trond PAlvin wrote: I'm currently using Tomcat 4. When someone goes to my site, say, www.site.com, I'd like it run a servlet for the home page instead of a static page (my entire site is dynamic). I configured the connector to send all *.htm files to Tomcat and I created a re-write rule in the Apache configuration file like this: RewriteEngine on RewriteRule ^/$ /home.htm [R] This works great, EXCEPT, that the browser is sent a redirect and I heard that is bad for search engines. I could send *all* http requests to tomcat, BUT, obviously, I DON'T want Tomcat serving up images. So, is there any way to configure Apache and/or Tomcat to make: www.site.com ---run-- www.site.com/home.htm without a redirect? How do I get www.site.com requests to go to Tomcat??? Peter Alvin mobile 719-210-3858 skype 'smartmicro' - 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: Tomcat 5 + Apache SOAP?
I also would recommend Axis, but if you put the jar files in common/lib you will not be able to reload your app. At least that happened to me with axis 1.1 under 5.0.28... That also breaks the rule that the app should be as self-contained as possible to make it as portable as possible. Trond Mark Leone wrote: Apache SOAP is the original apache SOAP implementation. I recommend you check out apache Axis, its successor. I have Axis 1.2 (formerly ran 1.1) running in Tomcat 5.5.8, and I had it running in Tomcat 4.x for over a year. Just make sure that the jar files that Axis needs are in the common/lib directory (if Tomcat needs them also). Not sure if HttpServlet is in that catagory, but worth a try. Kristian Rink wrote: Hi all; being into the state of having to check out several SOAP implementations to decide which one to be used for a certain project, I currently (for the first time) am playing around with Tomcat and Apache SOAP, trying to get a simple SOAP service up and running... Actually, I'm not very close to that, right now, getting stuck in the very first stage of getting Tomcat to work with Apache-SOAP: * Tomcat itself is up and running. * http://localhost:8080/soap/ works * Trying to access http://localhost:8080/soap/servlet/rpcrouter ends up with an error message like this: ---snip--- type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: Error allocating a servlet instance org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:105) org.apache.catalina.connector.CoyoteAdapter.service (CoyoteAdapter.java:148) org.apache.coyote.http11.Http11Processor.process (Http11Processor.java:856) org.apache.coyote.http11.Http11Protocol $Http11ConnectionHandler.processConnection(Http11Protocol.java:744) org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket (PoolTcpEndpoint.java:527) org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt (LeaderFollowerWorkerThread.java:80) org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run (ThreadPool.java:684) java.lang.Thread.run(Thread.java:595) root cause java.lang.NoClassDefFoundError: javax/servlet/http/HttpServlet java.lang.ClassLoader.defineClass1(Native Method) java.lang.ClassLoader.defineClass(ClassLoader.java:620) java.security.SecureClassLoader.defineClass (SecureClassLoader.java:124) java.net.URLClassLoader.defineClass (URLClassLoader.java:260) java.net.URLClassLoader.access$100 (URLClassLoader.java:56) java.net.URLClassLoader$1.run (URLClassLoader.java:195) java.security.AccessController.doPrivileged (Native Method) java.net.URLClassLoader.findClass (URLClassLoader.java:188) ---snip--- Googling for that error left me pretty helpless since I by now tried several hints regarding problems with Apache SOAP on top of Tomcat 4.x, but none of these worked. So, can anyone enlighten me on where to tweak to make the SOAP package find the javax.servlet package? System I'm running: Debian unstable Tomcat 5.5.9 JDK 1.5.0 Apache SOAP 2.3.1 Additionally: Are there any other implementations of SOAP for Tomcat that might be worth investigating? Thanks for your patience and bye, Kris - 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: Plain text mime-mapping and IE
Hi Tim, try serving the file through a servlet or jsp, or use a filter mapped to *.las and *.dat, and use response.setHeader(Content-Disposition, inline; filename=file.txt), and response.setContentType(text/plain). Works for me... Trond Tim Sodergren wrote: Hello Group, First time user. I am using Tomcat 4.1.30 to serve (among other things) plain text files with .dat and .las extensions. I have added the following lines to the conf/web.xml file: mime-mapping extensionlas/extension mime-typetext/plain/mime-type /mime-mapping mime-mapping extensiondat/extension mime-typetext/plain/mime-type /mime-mapping And they display properly in Netscape or Firefox. When trying to view in IE, however it doesn't recognize the file type and prompts the user to open or save. If the user selects open whatever text editor IE chooses can't find the file. Save works properly. Does IE's mime-sniffer completely ignore my server settings? Is there a workaround for this (without having to change all of my files and links to .txt)? Thanks in advance. -Tim - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 5.5.x returns wrong value for request.getRequestURI()
Hi, pretty sure isn't always good enough ;) To get the uri that forwarded to the jsp you need to use %=request.getAttribute(javax.servlet.forward.request_uri)%. Check out the servlet 2.4 spec section 8.4 for more info. Trond Yaakov Chaikin wrote: Hi, Using Tomcat 5.5.7 (tried Tomcat 5.5.9 with the same results) on Windows XP. When forwarding to a JSP page that is located in /WEB-INF/jsp/success.jsp and calling: %= request.getRequestURI() % inside the success.jsp page, the result I get is: /WEB-INF/jsp/success.jsp I am pretty sure that according to the API, this is the wrong result. It should have returned the URI of the **request**, not the path to the resource. Is this a known bug or there is some weird Tomcat setting that I need to change. I ran this on Tomcat without changing any of the original settings. BTW, the same is true of request.getRequestURL(). It returns (peculiar enough): http://localhost:8080/WEB-INF/jsp/success.jsp Thanks, Yaakov. - 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: Memory Leak Solved
Hi, don't know if you are using it, but there's also a known issue with 5.0.28 and 'swallowOutput' in the Context element. After I turned it off, I haven't gotten any out of memory errors... Trond sysdba wrote: We have struggled with a memory leak in 5.0.28/5.0.30 for months. There have been many complaints about the necessity to restart Tomcat every couple days due to Out of Memory errors, but no solutions that cured it. Well, the suggestion to put the single line: Introspector.flushCaches(); in the destroy method of a servlet in a redeployable app finally solves it. Our Tomcat web server has now run for seven days without an OOM error. The amount of time spent with the Optimizeit profiler trying to locate a nonexistent memory leak in the application code cannot be overestimated. This discovery should be bold red lettered in the docs. Gary Harris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: RES: Memory Leak Solved
Hi, here's the bugzilla: http://issues.apache.org/bugzilla/show_bug.cgi?id=33368, and here's a link to the archives where Robert Willie found this issue (read the entire thread...): http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg146409.html. Trond Paulo Alvim wrote: The Introspector.flushCaches(); in the contextDestroyed wasn't enough for us... How should we use the 'swallowOutput'? We've tried this way without results: Context displayName=eCompany 3.0 docBase=/eprj path=eprj.war privileged=true swallowOutput=false (...) Trond, Do you have links to this known issue? -Mensagem original- De: Trond G. Ziarkowski [mailto:[EMAIL PROTECTED] Enviada em: sexta-feira, 15 de abril de 2005 11:08 Para: Tomcat Users List Assunto: Re: Memory Leak Solved Hi, don't know if you are using it, but there's also a known issue with 5.0.28 and 'swallowOutput' in the Context element. After I turned it off, I haven't gotten any out of memory errors... Trond sysdba wrote: We have struggled with a memory leak in 5.0.28/5.0.30 for months. There have been many complaints about the necessity to restart Tomcat every couple days due to Out of Memory errors, but no solutions that cured it. Well, the suggestion to put the single line: Introspector.flushCaches(); in the destroy method of a servlet in a redeployable app finally solves it. Our Tomcat web server has now run for seven days without an OOM error. The amount of time spent with the Optimizeit profiler trying to locate a nonexistent memory leak in the application code cannot be overestimated. This discovery should be bold red lettered in the docs. Gary Harris - 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: TC 5.5 and commons-dbcp
Hi Robert, the JNDI resource configuration has changed in 5.5. Check out the docs for an example: http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jndi-datasource-examples-howto.html. Also Tomcat 5.5 has changed the commons-dbcp-x.x.x.jar to naming-factory-dbcp.jar. And the org.apache.commons.dbcp.BasicDataSource is now moved to org.apache.tomcat.dbcp.dbcp.BasicDataSource. Trond Robert Bateman wrote: I'm in the process of moving an application that is in production today on a TC 4.1.30 deployment over to 5.5. So far, everything has moved without too much trouble. That is, until I get to the use of commons-dbcp in the code. The code uses BasicDataSource to interface to commons-dbcp. Under 4.1.30 (and I believe 5.0 as well...) I can do: Context ctx = new InitialContext(); BasicDataSource ds = (BasicDataSource)ctx.lookup(jndi string); And I would get a data source. Under 5.5.7 and 5.5.9, ctx.lookup() throws an Exception. BUT, neither getMessage() nor getCause() return anything legit (both return NULL). My setup requires me to run TC with -security. Using -verbose:class and -Djava.security.debug=access,failure (THANKS Jon Wingfield!), I've determined that TC 5.5.7 and 5.5.9 are loading everything and that I have permission to access the various modules [Opened /usr/java/Tomcat/common/endorsed/commons-dbcp-1.2.1.jar] [Opened /usr/java/Tomcat/common/endorsed/mysql-connector-java-3.0.12-production-bin.jar] access: access allowed (java.io.FilePermission /usr/java/Tomcat/common/endorsed/commons-dbcp-1.2.1.jar read) access: access allowed (java.io.FilePermission /usr/java/Tomcat/common/endorsed/mysql-connector-java-3.0.12-production-bin.jar read) access: access allowed (java.io.FilePermission /usr/java/Tomcat/common/lib/naming-factory-dbcp.jar read) [Loaded org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory] But I don't get anything legit out of ctx.lookup() :( I'd like to see if I can debug this to isolate *where* things are going a-stray... Can anyone set my on the correct path? A search of this list hasn't revealed anything *other* than my JNDI string is incorrect (I can deploy the same WAR to 4.1.30 and 5.0 and it works - so I suspect my environment and possibly TC 5.5 and the -security setting...) Thanks in advance! Bob - 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 check whether session has expired or not
Hi, there was a long discussion on this topic a while ago. Search the archives for 'detect expired session'. Trond ajay kumar wrote: Hi Friends I am developing e-commerce based web applications,I want to check whether user session has expired, so that i will display Your session has expired message to the user.So how to find out that session expiry. This is very important as i am doing e-commerce apllications. Regards --Ajay Kumar - 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]
jsvc restart trouble
Hi all, I'm using tomcat 5.5.7 with latest jsvc from cvs. In my development environment I frequently run into the java.lang.OutOfMemoryError: PermGen space because of many reloads of my app. To restart Tomcat I issue 'kill -s SIGHUP $PID'. This works well when Tomcat is running normally, but after the java.lang.OutOfMemoryError: PermGen space it just kills the process. Anyone else having the same problem? How do you restart Tomcat using jsvc? Trond - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: apache + jakarta tomcat twice a time?
Hi, not sure I understand your question (twice a time?). If you are wondering if you can have them both running at the same time the answer is yes. To have Tomcat and Apache work together you need mod_jk or mod_proxy. mod_jk can be found here: http://jakarta.apache.org/tomcat/connectors-doc/ Trond Tamer Higazi wrote: Hi! I am asking myself if it is possible to run both servers twice a time?! The goal is that different Webapplications with different engines (php, JSP) should run on the server. For any comment, Thank you Tamer - 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: symlink in a webapp
Hi, http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/context.html Look for the allowLinking attribute... Trond || Guillaume Lederrey wrote: Hello ! I'm trying to have a symlink in one of my webapp. Something like : myApp/ +- WEB-INF/ +- myOtherDir - symlink to somewhere else Tomcat doesnt seem to follow the symlink (I get a 404). It probably is that way for very good security reasons, but in the developpement phase, it would me most usefull for me to be able to use that trick. I suspect there is a config option somewhere but I could find it ... Thx for your help ... Guillaume Lederrey - 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: Tomcat -- port 80 for Linux
Hi, I would suggest using jsvc as it seems that many people are struggling with mod_jk / mod_proxy. Be sure to use latest version from cvs though, not the one that comes with Tomcat, to save you some trouble with restarting etc. (at least with 5.0.28). Trond Jury Levykin wrote: Hello! I use tomcat 5.5 as main web server at Linux host. Me need run tomcat in port 80. To solve this task I see two way: 1. Running tomcat as daemon in port 80 by jsvc command. 2. Running apache in port 80 and use mod_jk to redirect users request to tomcat. What way is most secure? - 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: Where to download the Compatibility Package for running Tomcat 5.5 with 1.4 jdk?
Hi, they are available for download with the other downloads here http://jakarta.apache.org/site/downloads/downloads_tomcat-5.cgi. Named 5.5.X Compat tar.gz/zip. Trond David wrote: Dear Members, On the documentation there is a comment about downloading the Compatibility Package in order to run Tomcat 5.5 under 1.4.x version. I don't see such package on the download section. Do you have any idea where to find such package? Tanks in advance, David - Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using JDBC with 5.5.x
Hi, the way to define JNDI Datasources has changed from 5.0.x to 5.5.x. Check out the docs http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jndi-datasource-examples-howto.html Trond Martin Dubuc wrote: I am having some problems using JDBC with 5.5.x releases. I can use JDBC with 5.0.28, but as soon as I switch to 5.5.x, I get the following errors trying to connect to database: Mar 29, 2005 11:26:37 AM org.apache.catalina.realm.DataSourceRealm open SEVERE: Exception performing authentication org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Server connection failure during transaction. Due to underlying exception: 'com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception: ** BEGIN NESTED EXCEPTION ** java.io.EOFException STACKTRACE: java.io.EOFException at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1842) at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2288) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2784) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:750) at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3573) at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1151) at com.mysql.jdbc.Connection.createNewIO(Connection.java:1889) at com.mysql.jdbc.Connection.init(Connection.java:430) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:268) at org.apache.tomcat.dbcp.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:37) at org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:290) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:877) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:851) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540) at org.apache.catalina.realm.DataSourceRealm.open(DataSourceRealm.java:402) at org.apache.catalina.realm.DataSourceRealm.authenticate(DataSourceRealm.java:282) at org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:256) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:391) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:526) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:595) ** END NESTED EXCEPTION ** '. ** BEGIN NESTED EXCEPTION ** com.mysql.jdbc.CommunicationsException MESSAGE: Communications link failure due to underlying exception: ** BEGIN NESTED EXCEPTION ** java.io.EOFException STACKTRACE: java.io.EOFException at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1842) at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2288) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2784) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:750) at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3573) at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1151) at com.mysql.jdbc.Connection.createNewIO(Connection.java:1889) at com.mysql.jdbc.Connection.init(Connection.java:430) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java :268) at org.apache.tomcat.dbcp.dbcp.DriverConnectionFactory.createConnection( DriverConnectionFactory.java:37) at org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.makeObject(Pool ableConnectionFactory.java:290) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.validateConnectionFactory (BasicDataSource.java:877) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDat aSource.java:851) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540) at org.apache.catalina.realm.DataSourceRealm.open(DataSourceRealm.java:402) at org.apache.catalina.realm.DataSourceRealm.authenticate(DataSourceRealm.java:282) at
Re: Source code for Servlet.jar
Hi, the source code for servlet.jar is part of the tomcat source release. - Trond Rajaneesh wrote: Hi All, Where do I find the source code for the servlet.jar? Disclaimer This message is not an official communication of SLK Software. The sender of this message is neither acting as an agent nor in any other capacity for or on behalf of SLK Software. SLK Software accepts no responsibility or liability in connection with the posting of this message. - 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: Default password
Hi, there is no default login/passwd. You have to edit $CATALINA_HOME/conf/tomcat-users.xml and add: role rolename=manager/ role rolename=admin/ user username=myuser password=mypass roles=manager, admin/ - Trond samsher khan wrote: What is the default login for tomcat 5.0.30 tomcat admin and tomcat manager I tried admin as username and admin as password it's not working Yahoo! India Matrimony: Find your life partner online Go to: http://yahoo.shaadi.com/india-matrimony - 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: Thanks Trond
Hi, at office I am using tomcat 5.0.25. In that server my jsp's are running but when I try to run servlet in IE the browser tell me download the war file instead of executing it. How do you deploy your war file? I'm guessing that you have not used the manager since you could not login? The only way I can make sense of this, is if you have copied the war file into $CATALINA_HOME/webapps/ROOT/ and try to access it from your browser by entering http://localhost:8080/myapp.war. If this is the case then you should copy the file into $CATALINA_HOME/webapps instead and tomcat will automatically expand your war file into a directory named after your war file, and you should be able to access your jsp files by entering http://localhost:8080/myapp/myfile.jsp If you have deployed your war file correctly I don't know what is causing this behaviour. - Trond - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat cant handel pressing F5 a couled of times
Hi, I can press F5 until my finger goes sore, and still tomcat is running smooth. Seems to me that you have a problem in your app. Trond Martyn Hiemstra wrote: Hi All I beleive I may have found a major flaw in Tomcat 4, 5.0 and 5.5 I have created a numerous amount of applications and deployed them. After a page has loaded I press F5 5 times. This causes tomcat to CRASH I have tried Tomcat 4, Tomcat 5, Tomcat 5.5 all with different java versions. I have disabled all the filters in my application. Every possible combination will crash tomcat if you perss F5 more than 5 times fast. If you are running tomcat please try it and let me know if tomcat crashes and with which version. After looking for hours I found a filter that catches all the incoming requests. Each request is put in a queue and the first and last request is let through, the rest is thrown away. This seems to work. Has anybody else got this problem? Martyn - 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: JSP-Servlet tutorial
Hi, TheServerSide.com has a free pdf which should cover the jsp/servlet part. You can download it from here: http://www.theserverside.com/books/addisonwesley/ServletsJSP/index.tss For jdbc I would recommend the jdbc tutorial from Sun. Trond Venkat Radha Venkataramanan wrote: Can somebody direct me to a tutorial on jsp/servlet that pulls data from a database and displays the content via a jsp? Thanks - 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-page directive
Hi, Have you tried to move your the error-page directive to between the welcome-file-list and taglib directives. Seem to remember this happening to me some time ago as well. Trond !-- The Usual Welcome File List -- welcome-file-list welcome-fileindex.jsp/welcome-file /welcome-file-list error-page exception-typejava.lang.ClassNotFoundException/exception-type location/pages/apperror.jsp/location /error-page !-- Struts Tag Library Descriptors -- taglib taglib-uri/tags/struts-bean/taglib-uri taglib-location/WEB-INF/struts-bean.tld/taglib-location /taglib /web-app - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: error-page directive
Hi, the order does matter, and the order is specified in the dtd that you are using for your webapp. Trond Ian van der Neut wrote: On Tue, 1 Mar 2005 10:41:36 +0100, Ian van der Neut [EMAIL PROTECTED] wrote: On Tue, 01 Mar 2005 10:32:42 +0100, Trond G. Ziarkowski [EMAIL PROTECTED] wrote: Hi, Have you tried to move your the error-page directive to between the welcome-file-list and taglib directives. Seem to remember this happening to me some time ago as well. That seems to get rid of the message, but it doesn't seem to honour the directive, because I still get tomcats default exception stacktrace page. The fact that it is not honoured seems to be because of a problem in the apperror.jsp file. Moving the error-page directive before the taglib directive solves the problem indeed. Just curious, does order matter in web.xml? If so, where is this documented? Or is this just a bug? Thank you very much, Ian. - 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: Very Straneg problem with MySQL-Connector
Hi, your ploblem is most likely debian related. In debian mysql has a config parameter skip-networking which denies tcp connections to mysql. Make sure this setting is not set, and that you grant your user access from 127.0.0.1 not localhost because when using localhost mysql expects the user to connect via a unix socket, not a tcp socket. Good luck Trond monkiboy wrote: Hi everybody! I have a weird problem to use the MySQL-connector under Linux (Debian). I heard it can come from Tomcat. I have no problem in windows XP, all is working fine ! But under Linux when I try to connect to mysql throught mysql-connector wrote in a Servlet I have this message : Message: Invalid authorization specification message from server: Access denied for user 'root'@'monkinetwork' (using password: YES) SQLState: 28000 ErrorCode: 1045 I am Using : Tomcat 5.0.28 MySQL-Connector version is : mysql-connector-java-3.0.15-ga-bin.jar JDK Version : 1_5_0_01. Servlet-Examples and JSP works fine! So I don't think the problem come from JDK. MySQL version : MySQL-SERVER-4.1.9-2 : All is working under console mode ! Here's My Servlet TESt1.java: Code: import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import java.sql.*; import java.sql.DriverManager; public class TEST1 extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType(text/html); PrintWriter out = response.getWriter(); String url = jdbc:mysql://localhost:3306/HeroDB; String user = root; String password = password; try{ Class.forName(com.mysql.jdbc.Driver); out.println(br DRIVERS JDBC : OK!); Connection connection = DriverManager.getConnection(url,user,password); out.println(br Database connection : OK!); } catch (ClassNotFoundException e) { out.println(Error with JDBC Drivers !); } catch(SQLException ex) { out.println(br ERROR MESSAGE br); while (ex != null) { out.println(brMessage: + ex.getMessage ()); out.println(brSQLState: + ex.getSQLState ()); out.println(brErrorCode: + ex.getErrorCode ()); ex = ex.getNextException(); out.println(); } } } } AND THE HTML PAGE in order to access to the Servlet : Code: HTML HEAD TITLEDataBase Test/TITLE /HEAD BODY BGCOLOR=#FDF5E6 H2 ALIGN=CENTERDataBase TEST/H2 FORM ACTION=http://localhost:8080/TEST1; CENTER INPUT TYPE=SUBMIT VALUE = CONNEXION TEST /CENTER /FORM /BODY /HTML Theses codes works very well under windows, but under linux system here what I've got : DRIVERS JDBC : OK! ERROR MESSAGE Message: Invalid authorization specification message from server: Access denied for user 'root'@'monkinetwork' (using password: YES) SQLState: 28000 ErrorCode: 1045 Well, the web.xml file is well configured. Anyway : I already tried with class: org.gjt.mm.mysql.driver, but I have the same message error ! By the way, it's very strange that I can play with MySQL under the terminal but not throught tomcat. Any suggestions please , because it's giving me a very hard time ! ? Thank you ! ++ monkiboy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Cookies in Tomcat 5.5.7
Hi all! I'm making a filter that checks that my cookies are set, and sets them if they are missing. Code for setting cookie: String path = request.getContextPath(); cookie = new Cookie(name, value); cookie.setPath(path); logger.debug(Setting cookie: + cookie.getName() + , + cookie.getPath()); response.addCookie(cookie); Code for checking cookies: String path = request.getContextPath(); for (Cookie c : cookies) { String cName = c.getName(); String cPath = c.getPath(); logger.debug(Checking: + cName + , + cPath); } When setting the cookie the Cookie.getPath() method returns the path I have set. But when checking cookies all calls to Cookie.getPath() returns null regardless of what path I have set. When viewing the cookies in Firefox the path is the same as when I created the cookie. Is this a bug? Has anyone experienced similar behaviour? Trond - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cookies in Tomcat 5.5.7
Thanks Tim, I was trying to use the same cookiename for different paths in my webapp, but since the path is not sent I just have to use different cookienames. Trond Tim Funk wrote: getPath() in only useful for setting cookies. The browser only sends the name /value pairing of the cookie back to you. It omits path and expiration. -Tim Trond G. Ziarkowski wrote: Hi all! I'm making a filter that checks that my cookies are set, and sets them if they are missing. Code for setting cookie: String path = request.getContextPath(); cookie = new Cookie(name, value); cookie.setPath(path); logger.debug(Setting cookie: + cookie.getName() + , + cookie.getPath()); response.addCookie(cookie); Code for checking cookies: String path = request.getContextPath(); for (Cookie c : cookies) { String cName = c.getName(); String cPath = c.getPath(); logger.debug(Checking: + cName + , + cPath); } When setting the cookie the Cookie.getPath() method returns the path I have set. But when checking cookies all calls to Cookie.getPath() returns null regardless of what path I have set. When viewing the cookies in Firefox the path is the same as when I created the cookie. - 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: commons-logging logger instances - how to initialize in replicated session objects
Hi, I'm maybe stepping out of my territory here, but I think that static members are not serialized/deserialized. To re-initialize your static logger maybe you should try to implement the readObject(java.io.ObjectInputStream in) method from the java.io.Serializable interface something like this: readObject(...) { super.readObject(...); log = LogFactory.getLog(...); } Hope this is of some help Trond - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat 5.5.7 compiler settings
Hi all! I have just upgraded from 5.0.28 to 5.5.7. My only problem is that Tomcat can't compile some of my jsps that are using features found in jdk1.5 (auto-boxing). I have tried adding: init-param param-namecompilerSourceVM/param-name param-value1.5/param-value /init-param init-param param-namecompilerTargetVM/param-name param-value1.5/param-value /init-param under the jsp servlet in CATALINA_HOME/conf/web.xml without any luck. If I precompile my jsps with jdk1.5.0 it works, but in my development environment I would like Tomcat to compile my jsp files. Any help appreciated Trond - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Memory leak in tomcat 5.0.28
Thank you Robert!! Just wanna say thanks alot for sharing all your findings with the rest of us. I start my tomcat 5.0.28 server with -ms252m -mx512m and it was running for about 3-4 days before i got the OutOfMemoryError. Since i removed the swallowOutput from my context, my server has'nt been over 200m of used memory for 5 days!! Once again thank you for finding this leak. Regards Trond - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Restart-On-Failure for Tomcat?
Hi! Someone mentioned on this list a while ago that Java Service Wrapper is capable of doing this. Haven't tested it myself but you can check it out at http://wrapper.tanukisoftware.org/ Trond Robert McIntosh wrote: Hi, I'm supporting a web application running on Apache (2.0x) /Tomcat(5.0.x) w/ mod-jk. The web application seems to cause Tomcat (5.0.28) to fail on average once a week. Restarting tomcat tends to do the trick, however this is in a production enviornment. I've been looking for a restart-on-failure script or inherent feature in Tomcat that can perform this. Please forward me information on how to monitor Tomcat for error conditions and restart the application. Thanks! Robert [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]
Using SSL for selected pages only
Hi all! I have setup a security-constraint in my web.xml: security-constraint web-resource-collection web-resource-nameUserHome/web-resource-name url-pattern/home/*/url-pattern /web-resource-collection user-data-constraint transport-guaranteeCONFIDENTIAL/transport-guarantee /user-data-constraint /security-constraint Tomcat now redirects all requests to myapp/home/* to use ssl. In my jsp's I use c:url to create relative urls in links. When the user stands in i.e /myapp/home/userInfo.htm and now presses the link to go to the frontpage /myapp/index.htm, is there a way that I can make tomcat not use ssl? Or do I have to modify my links to acheive this? Trond - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 5 - Datasource Connection Pooling
Hi! 1)My problem is my working directory is different. I use ant to create war file and then i manually stop the server - delete existing war file / existing directory (This is due to some Win TomCat problem .??..). Then i deploy it using TomCat Manager. It automatically creates META-INF file for me, i do not have META-INF inside my working directory. So where i can put my context.xml ? You have already answered this yourself, META-INF/ directory of your war file. The only way to avoid the META-INF directory is to not use a war file, as a war file simply is a jar file, and the META-INF is part of the jar file specification. 2) What shall i put inside context.xml and what shall i put inside server.xml / web/xml ? The example pages: http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html tells you exactly what to put in each file. You just have to read them one more time and keep focused. I'll give you some hints as well: - Leave server.xml the way it was before you started tampering with it. - Copy CATALINA_HOME/conf/enginename/servername/yourapp.xml, to your context.xml file, and add your resource specification inside the context as in the examples. Then include context.xml in your war file in the META-INF dir. Your app must be running for the yourapp.xml file to exist as it is deleted when you undeploy your app. - In web.xml you need to add a resource-ref as you can see from the examples Good luck Trond - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: kaffe and tomcat 5.5.4
Hi, Perhaps there is another way to run tomcat 5.54 on port 80 as an unprivileged user in linux? thank you, Ryan Harris Try wrapper.sourceforge.net. Trond - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Where do I set the -server option?
Hi, from your next post (alternatives to jsvc) I assume you are using jsvc. Run jsvc -help to see that it has a -jvm option. Here all available jvms should be listed as well. On my debian box it did not find my jvm.cfg, so I could not use the -jvm option. To see where it tries to locate your jvm.cfg run: jsvc -debug -help, and make a symlink or something to your jvm.cfg in the correct location. Trond Hello, does anybody know where to set the -server option on a linux machine? Thanks Michael Kastner - 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: Where do I set the -server option?
Hi again Michael, Does anyone have actually _use_ jsvc and the -server parameter? As you might have figured out, I'm using it, but I'm using it with tomcat 5.0.28. And as you also should have figured by now, the option when using jsvc is -jvm server. Trond - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Session restart replication when using jsvc
Thanks Bill! I checked out the latest sources from CVS and now it works correctly. Thanks also to Wade for lots of good input. Regards Trond - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Where do I set the -server option?
Hi Michael -jvm JVM name use a specific Java Virtual Machine. Available JVMs: 'null' It says null because jsvc cannot find your jvm.cfg file. On my system i ran jsvc -debug -help to find out where it was looking for it. I found that jsvc was expecting to find my jvm.cfg in JAVA_HOME/jre/lib, but the file resides in JAVA_HOME/jre/lib/i386. So I made a symlink to it in JAVA_HOME/jre/lib and then running jsvc -help on my box is looking like this: -jvm JVM name use a specific Java Virtual Machine. Available JVMs: 'client' 'server' Now you should be able to start jsvc with the -jvm server option set. To actually verify that the server vm is started you can put this %=System.getProperty(java.vm.name)% inside a jsp and it should say: Java HotSpot(TM) Server VM Trond - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Session restart replication when using jsvc
Hi all! I recently switched from using Tomcat 5.0.28/jk2/Apache2 to running tomcat standalone using jsvc. This works great for me except for one thing; Sessions are not replicated when I restart tomcat. To stop Tomcat I'm using 'kill -9 `cat /var/run/jsvc.pid`'. When Tomcat is stopped this way the StandardManager does not serialize the sessions to SESSIONS.ser. Can I stop Tomcat in another way, to make it serialize the sessions? Do I have to use a PersistentManager? Write my own manager? Regards Trond - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Session restart replication when using jsvc
Hi Wolfgang! by using signal 9 you give Tomcat no chance to perform any further action. Maybe you omit -9 from your kill command. Thanks for the tip. Tried it, but same results. Trond - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Java developer friendly Linux distro
Hi! Linux dont have a good text editor in which I can run Ant builds That's where you are wrong my friend. Try jEdit from www.jedit.org. It is made in Java and runs on any platform, and it has several plugins capable of running Ant builds. A great editor in my opinion. Trond - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: access log question
Running linux? webalizer $CATALINA_HOME/logs/acces_log.`date +%F`.txt should do the trick Trond - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: access log question
Hi! so combined is just more information? Yes. so i guess webalizer knows how to deal with that format also right? I suggest you read up on webalizer's docs to find out which log formats it supports, but the answer is yes. what i currently have is seperate accesslog files created by tomcat each day. i want webalizer to generate data for all files. i dont know if webalizer get multiple files so i feagured that tomcat might have the option to accumulate one file instead of creating a file per day. what should i do in order to get this behaviour? To have tomcat log to one file you should *read the docs* for the Access Log Valve, which you can find here: http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/valve.html#Access%20Log%20Valve Trond - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Session timeout
How about trying? Put this inside your web-app in web.xml session-config session-timeout10/session-timeout /session-config The number within the session-timeout element must be expressed in minutes. Works for me with the StandardManager, in tomcat 5 Trond Freddy Villalba A. wrote: Hi everybody, Is it possible to configure the session timeout using the org.apache.catalina.session.StandardManager Session Manager or am I forced to use the Persistent Manager just for doing so? (Tomcat v4.1) Regards, F. - 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: Migrating from Apache2/JK2 to Tomcat standalone
Hi! 3) In Apache I'm using some aliases to serve images stored outside my appbase from inside my webapp (Alias /myapp/alias /path/outside/appbase). I've implemented this by creating context xml files for all my aliases with appBase=/path/outside/appbase path=/myapp/alias. Again, is this the preferred way of doing this? I have found that I cannot forward to these aliases that I have created. I was writing a servlet that would forward the client to the correct image in /myapp/images using a RequestDispatcher. When I changed the alias to /images and it works. Not a cry for help this time :) Just telling about my experience since I found it to be a bit strange. Trond - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Migrating from Apache2/JK2 to Tomcat standalone
Hi! What's your hardware? In development I have a Dell PowerEdge something 2.4 Xeon, 512MB RAM, for production I have an IBM something 2.8 Xeon, 1GB RAM Trond - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Migrating from Apache2/JK2 to Tomcat standalone
Hi all! I'm migrating from Apache2/JK2/Tomcat 5.0.28 to Tomcat standalone (don't need php anymore), and have some questions regarding the matter. 1) Since Tomcat now will be serving all the static content as well, will it require more threads than when only serving dynamic content? 2) In Apache I'm using mod_rewrite to rewrite requests to mydomain.com/ to mydomain.com/myapp. I've implemented this behaviour by using response.sendRedirect in a scriptlet in the index.jsp of my ROOT app. Is this the preferred way of doing this? 3) In Apache I'm using some aliases to serve images stored outside my appbase from insisde my webapp (Alias /myapp/alias /path/outside/appbase). I've implemented this by creating context xml files for all my aliases with appBase=/path/outside/appbase path=/myapp/alias. Again, is this the preferred way of doing this? 4) I've compiled jsvc and adapted the Tomcat5.sh to start the server. If I do Tomcat5.sh stop ; Tomcat5.sh start to do a restart of the server my machine hangs. If I allow a pause between stop and start then the server starts with no problem. Is this a known issue? Any other hints and tips to complete the setup of my server is also much appreciated. Trond - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Migrating from Apache2/JK2 to Tomcat standalone
Thanks for your replies Allistair :) 2) In Apache I'm using mod_rewrite to rewrite requests to mydomain.com/ to mydomain.com/myapp. I've implemented this behaviour by using response.sendRedirect in a scriptlet in the index.jsp of my ROOT app. Is this the preferred way of doing this? Depends on what you want. If you want mydomain.com/ to be your web application, that's fine, your webapp needs to be the root web application. If you want mydomain.com/mywebapp that's OK too. You don't need a redirect of any kind. This functionality is setup using Context element configuration more of which is in the online Tomcat documentation :) All our customers have links to mydomain.com/myapp/mypages, so it's easier for me to keep this layout, than having my customers update their links. 3) In Apache I'm using some aliases to serve images stored outside my appbase from insisde my webapp (Alias /myapp/alias /path/outside/appbase). I've implemented this by creating context xml files for all my aliases with appBase=/path/outside/appbase path=/myapp/alias. Again, is this the preferred way of doing this? Same answer, it's not best practice. I'm serving pdf files and thumbnails of selected pages. These thumbnails total 200M and growing, so I'm willing to sacrifice the self-containment of my app. Even though Yoav has given me a lesson in the importance of self-contained apps previously ;) I consider my app to be as self-contained as practically possible. 4) I've compiled jsvc and adapted the Tomcat5.sh to start the server. If I do Tomcat5.sh stop ; Tomcat5.sh start to do a restart of the server my machine hangs. If I allow a pause between stop and start then the server starts with no problem. Is this a known issue? Same :) I have now added a restart target to my Tomcat5.sh that sleeps 5 sec. between stop and start. Thanks again Trond - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Axis and Tomcat
Hi, I use axis to connect to some webservices from my webapp. If the axis jar files are in WEB-INF/lib I can reload my app and everything is fine. But when I moved them to CATALINA_HOME/common/lib to shrink the size of my war file I get a NullPointerException (stack trace follows) when the application has been reloaded and I try to connect to a service. The application runs fine until I try to connect to a webservice. To make sure that this was not a problem with my app only, I installed the webapp that comes with axis and tested with same result; happyaxis.jsp is reporting that everything is fine, but when I try to access the AxisServlet the same exception is thrown when the appplication has been reloaded. Can anyone tell me why this is happening? java.lang.NullPointerException at org.apache.catalina.loader.WebappClassLoader.findResources(WebappClassLoader.java:956) at java.lang.ClassLoader.getResources(ClassLoader.java:1015) at org.apache.commons.discovery.jdk.JDK12Hooks.getResources(JDK12Hooks.java:150) at org.apache.commons.discovery.resource.DiscoverResources$1.getNextResources(DiscoverResources.java:153) at org.apache.commons.discovery.resource.DiscoverResources$1.getNextResource(DiscoverResources.java:129) at org.apache.commons.discovery.resource.DiscoverResources$1.hasNext(DiscoverResources.java:116) at org.apache.commons.discovery.resource.names.DiscoverNamesInFile$1.getNextClassNames(DiscoverNamesInFile.java:186) at org.apache.commons.discovery.resource.names.DiscoverNamesInFile$1.getNextClassName(DiscoverNamesInFile.java:170) at org.apache.commons.discovery.resource.names.DiscoverNamesInFile$1.hasNext(DiscoverNamesInFile.java:157) at org.apache.commons.discovery.resource.names.NameDiscoverers$1.getNextIterator(NameDiscoverers.java:143) at org.apache.commons.discovery.resource.names.NameDiscoverers$1.hasNext(NameDiscoverers.java:126) at org.apache.commons.discovery.resource.classes.ResourceClassDiscoverImpl$1.getNextResource(ResourceClassDiscoverImpl.java:159) at org.apache.commons.discovery.resource.classes.ResourceClassDiscoverImpl$1.hasNext(ResourceClassDiscoverImpl.java:147) at org.apache.axis.configuration.EngineConfigurationFactoryFinder$1.run(EngineConfigurationFactoryFinder.java:159) at java.security.AccessController.doPrivileged(Native Method) at org.apache.axis.configuration.EngineConfigurationFactoryFinder.newFactory(EngineConfigurationFactoryFinder.java:152) at org.apache.axis.transport.http.AxisServletBase.getEngineEnvironment(AxisServletBase.java:285) at org.apache.axis.transport.http.AxisServletBase.getEngine(AxisServletBase.java:208) at org.apache.axis.transport.http.AxisServletBase.getEngine(AxisServletBase.java:187) at org.apache.axis.transport.http.AxisServlet.doGet(AxisServlet.java:224) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:339) 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) 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
Re: Axis and Tomcat
BTW, I am using Axis 1.1 and Tomcat 5.0.28 Trond - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Axis and Tomcat
Thanks Yoav, I have tried shared/lib as well, and the result is the same. I don't *have* to do it, it's just that my connection to the server is so slow so I wanted to save time when uploading new versions ;) Trond - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Axis and Tomcat
Hi, Perhaps for development you can use an unpacked WAR, set reloadable=true, and only upload the relevant classes/jars as needed, instead of the whole WAR... I have this setup in dev environment, but I make weekly releases to the production server, sometimes twice a week depending on how many bugs I introduce ;) Those uploads are the ones taking time. For development I am using the setup you suggested. Thanks again for all help. Trond - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Which webframework to use?
Hi all! Obviously I'm way off topic here, but I'm posting this anyway. I started developing JSP/Servlets using Tomcat 6 months ago. At the time I started developing my app I wasn't much aware of MVC and frameworks to help me with that, so I have developed everything from scratch. Lately I have been reading up on Spring, WebWork, Struts and JSF. It seems to me that the question is to Struts or not to Struts. People using Struts are convinced that they have the right solution, but some of them are scared that JSF is going to take over. And Spring seems to go on about how easy it is to use and also mix with other frameworks. My webapp is somewhat close to the MVC pattern, not bad for not knowing about it when design started :), and I think that it should be quite easy for me to implement one of these frameworks. In my understanding the biggest competitors are Struts and JSF, and in the 2.x release of Struts they will rely on JSF as supporting technology so one of these seems to be a good choice. Any good tips on the matter would be greatly appreciated. Trond - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JDBC transactions using MySQL / DBCP in Tomcat 5.0.28
Hi all! In my webapp I do two db inserts into two different tables. If the second one fails I want to rollback the first one. My code is something like the following: Connection con = gotten from jndi DataSource DBBean db = new DBBean(con); try { con.setAutoCommit(false); Object o = db.getSomething(); Object o2 = db.getSomethingElse(); db.doInsert1(params); db.doInsert2(params); con.commit(); } catch (SQLException sqle) { con.rollback(); throw sqle; } finally { if (con != null) { con.close(); } } I thought that this should do the trick, but if the second insert fails the data inserted in the first insert are still there. I am using MySQL 4.0.21-7 with InnoDB and have tested that I can use transactions with the MySQL client. Anyone got any tips? Regards Trond - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSP fragments file extension and the jasper2 ant task
Hey Jim, thanks for the tip. This works when the jspf files are compiled in tomcat, but the jasper2 ant task does nothing with them... Trond Ziarkowski, You may want to try adding the following to your web.xml servlet-mapping servlet-namejsp/servlet-name url-pattern*.jspf/url-pattern /servlet-mapping - Jim - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JSP fragments file extension and the jasper2 ant task
Hi all! The J2EE 1.4 tutorial says: The recommended file extension for the source file of a JSP page is |.jsp|. The page can be composed of a top file that includes other files that contain either a complete JSP page or a fragment of a JSP page. The recommended extension for the source file of a fragment of a JSP page is |.jspf|. My project is growing and it would be nice for me to use this difference in extension to easier separate top files from fragment files. I precompile my jsp files using the tomcat deployer, but it won't compile my fragment files if i give them the .jspf extension, and change my jsp:include to reflect this change. Is there a way to make the jasper2 task also include these files? I haven't found any docs on the jasper2 task anywhere. A hint to find these would be appreciated. Regards Trond Ziarkowski - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Apache / Tomcat restart
Hello all! I'm running a webapp with apache 2, tomcat 5 and jk2 under debian. The system is running fine for about a week or so. Then some strange small things start to happen. The webapp loads new pages put doesn't show them in a browser, all GET requests are ok, but POST requests are not responding, and other things like that. When apache / tomcat is restarted everything is back to normal. I wonder if other people are experiencing similar things? How often do you _need_ to restart your systems? There is no problem for me to restart the system with a cron job at night, but if you guys don't have to restart why should I? I think that my tomcat / jk2 config is proper, but I have no experience in configuring apache 2 so this is pretty much out of the box configured. Regards Trond Ziarkowski - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Apache / Tomcat restart
Hi Shapira, the reason for running apache / jk2 is that we are running other things on the same server using php. Haven't tried to make php run inside tomcat, never even checked to see if it is possible. The php stuff existed before we started using tomcat so the natural approach for us was to expand our existing solution to also support running servlets / jsp. However we are in the process of porting our old php stuff to servlets / jsp, so in the near future we should be able to use tomcat standalone. I'm a junior (2yrs. exp.) and curious about hints / tips when you talk about good design and support / maintenance practices. Pointers to good docs on these topics or som pointers from you or others that are more experienced than myself would be much appreciated. Regards Trond Ziarkowski - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Active connections in db pool
Is there a way of finding out how many commections which are currently active when using a db connection pool? I got this error message in my logs: Cannot get a connection, pool exhausted. When I increased the number of mxActive the error message of course disappeared. I tripled the number of connections just to make sure that it will not happen again for some while, but I would like to check the value from time to time so I can increase it yet again if that would be necessary or decrease it if I really needed just oldMax + 10. Regards Trond Ziarkowski - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Stability problems using Apache / Tomcat / jk2
System: Debian testing i386 jdk1.5.0 Tomcat 5.0.28 - CATALINA_OPTS -ms64m -mx128m Apache 2.0.52-1 libapache-mod-jk2 2.0.4-3 MySQL 4.0.21-7 mysql-connector-java-3.0.15-ga Tomcat is running a service called Tomcat-Apache, an engine called Apache with a host called localhost. localhost has the /admin and /manager webapps and my webapp, /mediaport, using precompiled jsp pages and Servlets, and a connection pool to MySQL. Configurations: Apache configuration is default debian config server.xml service definition: Service name=Tomcat-Apache Connector port=8009 debug=0 protocol=AJP/1.3 / Engine name=Apache defaultHost=localhost debug=0 Realm className=org.apache.catalina.realm.MemoryRealm pathname=conf/tomcat-users.xml/ Logger className=org.apache.catalina.logger.FileLogger prefix=apache. suffix=.log timestamp=true/ Host name=localhost debug=0 appBase=webapps unpackWARs=true autoDeploy=false deployOnStartup=true xmlValidation=true xmlNamespaceAware=true Logger className=org.apache.catalina.logger.FileLogger prefix=localhost. suffix=.log timestamp=true/ /Host /Engine /Service workers2.properties: [logger] info=Native logger level=ERROR [config:] file=${serverRoot}/conf/workers2.properties debug=0 debugEnv=0 [uriMap:] info=Maps the requests. debug=0 [shm:] info=Scoreboard. Required for reconfiguration and status with multiprocess servers file=anonymous debug=0 [workerEnv:] info=Global server options timing=0 debug=0 [lb:lb] info=Default load balancer. debug=0 [channel.socket:localhost:8009] info=Ajp13 forwarding over socket debug=0 tomcatId=localhost:8009 [status:] [uri:/jkstatus] group=status: [uri:/admin/*] info=Tomcat HTML based administration web application. debug=0 [uri:/manager/*] info=A scriptable management web application for the Tomcat Web Server. debug=0 [uri:/mediaport/*.jsp] [uri:/mediaport/servlet/*] Here are my problems 1. Strange log message This message shows up frequently in error.log: [Tue Oct 19 17:14:40 2004] [error] ajp13.service() ajpGetReply recoverable error 3 [Tue Oct 19 17:14:40 2004] [error] ajp13.service() ajpGetReply recoverable error 3 [Tue Oct 19 17:14:40 2004] [error] ajp13.service() Error forwarding ajp13:localhost:8009 1 0 [Tue Oct 19 17:14:40 2004] [error] mod_jk2.handler() Error connecting to tomcat 3, status 200 2. Serious stability problem Sometimes tomcat stops and gives a 500 error. This seems to happen at times when load is high, but happens every once in a while when load is low as well. A restart of Tomcat does the work. This results in having to restart tomcat at least 2-3 times a day. This is what show up in the logs catalina.out: 19.okt.2004 17:14:43 org.apache.coyote.tomcat5.CoyoteConnector pause SEVERE: Protocol handler pause failed java.net.ConnectException: Connection refused at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:364) at java.net.Socket.connect(Socket.java:507) at java.net.Socket.connect(Socket.java:457) at java.net.Socket.init(Socket.java:365) at java.net.Socket.init(Socket.java:207) at org.apache.jk.common.ChannelSocket.unLockSocket(ChannelSocket.java:460) at org.apache.jk.common.ChannelSocket.pause(ChannelSocket.java:272) at org.apache.jk.server.JkMain.pause(JkMain.java:657) at org.apache.jk.server.JkCoyoteHandler.pause(JkCoyoteHandler.java:202) at org.apache.coyote.tomcat5.CoyoteConnector.pause(CoyoteConnector.java:1444) at org.apache.catalina.core.StandardService.stop(StandardService.java:521) at org.apache.catalina.core.StandardServer.stop(StandardServer.java:2347) at org.apache.catalina.startup.Catalina.stop(Catalina.java:605) at org.apache.catalina.startup.Catalina.start(Catalina.java:580) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425) 19.okt.2004 17:14:44 org.apache.catalina.core.StandardService stop INFO: Stopping service Tomcat-Apache 19.okt.2004 17:14:44 org.apache.catalina.core.StandardHostDeployer remove INFO: Removing web application at context path /admin 19.okt.2004 17:14:44 org.apache.catalina.logger.LoggerBase stop INFO: unregistering logger Apache:type=Logger,path=/admin,host=localhost 19.okt.2004 17:14:44 org.apache.catalina.core.StandardHostDeployer remove INFO: Removing web application at context path /mediaport