Re: is der any default username for tomcat?
On Jan 6, 2012, at 9:45 AM, André Warnier wrote: Pid wrote: On 06/01/2012 06:24, srilaxmi deevela wrote: is der any default username for tomcat? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org http://catb.org/~esr/faqs/smart-questions.html I don't agree. I think it's a good question. For example, in Germany it could be Tom Katze, in France Tom Chat, and Tom Gato for Spanish-speaking countries.. Why don't we put this to a vote ? For Hungarian Tomi Macsek :-) - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Connection has been abanded
Hi, IT is Mac OSX 10.6.8 java -version java version 1.6.0_20 Java(TM) SE Runtime Environment (build 1.6.0_20-b02-279-10M3065) Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01-279, mixed mode) tomcat is 7.0.21 database is Sybase ASE 15.0.3 We are getting this error in about every half hour or so: java.lang.NullPointerException Nov 30, 2011 3:21:28 PM org.apache.tomcat.jdbc.pool.ConnectionPool abandon WARNING: Connection has been abandoned PooledConnection[net.sourceforge.jtds.jdbc.ConnectionJDBC3@40c65cd4]:java.lang.E\ xception at org.apache.tomcat.jdbc.pool.ConnectionPool.getThreadDump(ConnectionPool.java:973) at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:727) at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:585) at org.apache.tomcat.jdbc.pool.ConnectionPool.getConnection(ConnectionPool.java:174) at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:124) at pathology.connection.CopathDbInterface.getConnectionFromPull(CopathDbInterface.java:119) at pathology.connection.CopathDbInterface.getConnection(CopathDbInterface.java:85) at pathology.connection.CopathDbInterface.getConnection(CopathDbInterface.java:68) at pathology.histology.server.DashboardServiceImpl.getBlockDashboardStatsMap(DashboardServiceImpl.java:923) at pathology.histology.server.DashboardServiceImpl.getBlockDashboardStats(DashboardServiceImpl.java:513) at pathology.histology.server.DashboardServiceImpl.getDashboardStats(DashboardServiceImpl.java:62) at sun.reflect.GeneratedMethodAccessor597.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:569) at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208) at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248) at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62) at javax.servlet.http.HttpServlet.service(HttpServlet.java:641) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apach Any good idea where to start troubleshooting ? Thanks ahead, János - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat on Ubuntu
Peter, Thanks a lot. János On Aug 25, 2011, at 3:56 AM, Peter Miklosko wrote: From Ubuntu 10.04 documentation on Tomcat 6 it doesn't look like default location https://help.ubuntu.com/10.04/serverguide/C/tomcat.html On 24 August 2011 21:18, Christopher Schultz ch...@christopherschultz.netwrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 János, On 8/24/2011 4:02 PM, János Löbb wrote: Newbie question: Is still /usr/local/tomcat is the default location for installation on Ubuntu 10.04 ? Recently I saw it in an nfs directory mounted by autofs from another server and I am wondering... Sounds like a question for the Ubuntu folks. Apache has no control over where package managers install their packages. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk5VXIgACgkQ9CaO5/Lv0PCf+wCfXPieGWGAAqpv5cqB1/qZZHwy rsAAnjHslpGkUU2xc13jjcv+VUyF0e2Q =P2M8 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Tomcat on Ubuntu
Hi, Newbie question: Is still /usr/local/tomcat is the default location for installation on Ubuntu 10.04 ? Recently I saw it in an nfs directory mounted by autofs from another server and I am wondering... Thanks ahead, János - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
[cluster] ConcurrentModificationException
Hi, It is OSX 10.6.7, java 1.6.0_24, tomcat 7.0.14, jk 1.2.31, apache 2.2.19. It is a one machine with two tomcat instances setup. I am trying to do session replication testing with the examples webapp. When I shut down one of the tomcat instances I receive this in the log of that instance: INFO: Stopping service Catalina Jun 21, 2011 2:49:12 PM org.apache.catalina.ha.session.JvmRouteBinderValve stopInternal INFO: JvmRouteBinderValve stopped Jun 21, 2011 2:49:12 PM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: contextDestroyed() Jun 21, 2011 2:49:12 PM org.apache.catalina.core.ApplicationContext log INFO: ContextListener: contextDestroyed() Jun 21, 2011 2:49:12 PM org.apache.catalina.tribes.transport.nio.NioReceiver stopListening SEVERE: Unable to close cluster receiver selector. java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.nextEntry(HashMap.java:793) at java.util.HashMap$KeyIterator.next(HashMap.java:828) at java.util.Collections$UnmodifiableCollection$1.next(Collections.java:1010) at org.apache.catalina.tribes.transport.nio.NioReceiver.closeSelector(NioReceiver.java:372) at org.apache.catalina.tribes.transport.nio.NioReceiver.stopListening(NioReceiver.java:355) at org.apache.catalina.tribes.transport.nio.NioReceiver.stop(NioReceiver.java:86) at org.apache.catalina.tribes.group.ChannelCoordinator.internalStop(ChannelCoordinator.java:203) at org.apache.catalina.tribes.group.ChannelCoordinator.stop(ChannelCoordinator.java:115) at org.apache.catalina.tribes.group.ChannelInterceptorBase.stop(ChannelInterceptorBase.java:178) at org.apache.catalina.tribes.group.ChannelInterceptorBase.stop(ChannelInterceptorBase.java:178) at org.apache.catalina.tribes.group.interceptors.MessageDispatchInterceptor.stop(MessageDispatchInterceptor.java:168) at org.apache.catalina.tribes.group.ChannelInterceptorBase.stop(ChannelInterceptorBase.java:178) at org.apache.catalina.tribes.group.GroupChannel.stop(GroupChannel.java:435) at org.apache.catalina.ha.tcp.SimpleTcpCluster.stopInternal(SimpleTcpCluster.java:743) at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:225) at org.apache.catalina.core.ContainerBase.stopInternal(ContainerBase.java:1083) at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:225) at org.apache.catalina.core.StandardService.stopInternal(StandardService.java:502) at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:225) at org.apache.catalina.core.StandardServer.stopInternal(StandardServer.java:748) at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:225) at org.apache.catalina.startup.Catalina.stop(Catalina.java:693) at org.apache.catalina.startup.Catalina.start(Catalina.java:654) 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:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:303) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:431) Jun 21, 2011 2:49:12 PM org.apache.coyote.AbstractProtocolHandler stop INFO: Stopping ProtocolHandler [http-bio-8280] Jun 21, 2011 2:49:12 PM org.apache.coyote.AbstractProtocolHandler stop INFO: Stopping ProtocolHandler [ajp-bio-8209] It is happening with both instances. One tomcat instance port numbers are 81xy, the other one has 82xy. I also noticed that session replication does not work although it worked yesterday. Here is the workers.properties file: bml0024:local administrator$ cat apache2/conf/workers.properties worker.list = lb,jkstatus worker.lb.type=lb worker.lb.balance_workers=tc241,tc242 #worker.lb.sticky_session = True #worker.lb.sticky_session_force = False worker.jkstatus.type=status worker.tc241.type = ajp13 worker.tc241.host = localhost worker.tc241.port = 8109 worker.tc241.lbfactor = 10 worker.tc241.redirect=tc242 worker.tc242.type = ajp13 worker.tc242.host = localhost worker.tc242.port = 8209 worker.tc242.lbfactor = 10 worker.tc242.redirect=tc241 Here is one tomcat instance's server.xml with comments removed: bml0024:local administrator$ sudo cat tc241/conf/server.xml Password: ?xml version='1.0' encoding='utf-8'? Server port=8105 shutdown=SHUTDOWN Listener className=org.apache.catalina.core.AprLifecycleListener SSLEngine=on / Listener className=org.apache.catalina.core.JasperListener / Listener className=org.apache.catalina.core.JreMemoryLeakPreventionListener / Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener / Listener
[cluster] jvmRoute question
Hi, To take a tomcat instance out from a cluster, now I have a no-cluster.xml and in content it is exactly the same as the server.xml, except the Cluster/ tag is commented out. The question is should I also take out the jvmRoute=tc24x variable from the Engine/ tag or leave it there. My workers.properties file remain the same whether a tomcat instance is member of a cluster or not, so I incline to leave it there. On the other hand I did testing as this variable was removed and I have not experienced any problem. The hierarchy is Server Service Engine Cluster Any good suggestion is highly appreciated. János - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomact 5.5 Clustering
On Jun 9, 2011, at 10:30 AM, Tauqir Akhtar wrote: Hi I am running two Tomcat (5.5.27) Instances on two different machines deploying the same Java Application. I have made changes in server.xml to specify the Port on which Tomcat should run on the two machines. On Machine 1 : Connector port=8001 On Machine 2 : Connector port=8002 Both the Instances are running fine. What other configuration changes (In which files) do I need to make to run these two Tomcat Instances in one Cluster? I have following variables set in the machine environment: CATALINA_OPTS : -Xms512m -Xmx1024m JAVA_OPTS : -Xmx768m JAVA_HOME : C:\Program Files\Java\jdk1.5.0_11 What other changes I need to make to run more Tomcat Instances from the same Installation on each machine? For Example: On Machine 1 :Connector port=8001 Connector port=8003 On Machine 2 :Connector port=8002 Connector port=8004 I want to run all these instances in a cluster. Your help will be highly appreciated. Thanks Tauqir Akhtar Are the two machines in the same subnet ? Is multicasting work ? What do you see in the logs ? Are there any memberships established ? Etc... - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Need Help to configure Apache Tomcat with mod_jk.so
On May 10, 2011, at 9:28 AM, jatinder singh wrote: Hi I have configured Apache and Tomcat with SSL. I want to Integrate both using mod_jk.so, for that i have followed all the instruction but when i start Apache i got the message - The requested operation has failed. My httpd.conf file is IfModule !mod_jk.c LoadModulejk_module modules/mod_jk.so /IfModule JkWorkersFile C:/Program Files/Apache Software Foundation/Apache2.2/conf/jk/workers.properties You need quotes above and below. JkLogFile C:/Program Files/Apache Software Foundation/Apache2.2/logs/jk.log JkLogLevel info JkLogStampFormat “[%a %b %d %H:%M:%S %Y]“ JkOptions +ForwardKeySize +ForwardURICompatUnparsed -ForwardDirectories JkRequestLogFormat “%w %V %T” JkMount /examples* worker1 # Should mod_jk send SSL information to Tomcat (default is On) JkExtractSSL On # What is the indicator for SSL (default is HTTPS) JkHTTPSIndicator HTTPS # What is the indicator for SSL session (default is SSL_SESSION_ID) JkSESSIONIndicator SSL_SESSION_ID # What is the indicator for client SSL cipher suit (default is SSL_CIPHER) JkCIPHERIndicator SSL_CIPHER # What is the indicator for the client SSL certificated (default is SSL_CLIENT_CERT) JkCERTSIndicator SSL_CLIENT_CERT My workers.properties file is workers.tomcat_home=C:/Program Files/Apache Software Foundation/Tomcat 6.0 workers.java_home=C:/Program Files/Java/jdk1.6.0_13 ps=/ # Define worker 'worker1' worker.list=worker1 # Set properties for worker 'example' (ajp13) worker.default.type=ajp13 worker.default.host=localhost worker.default.port=8009 worker.default.cachesize=10 worker.default.cache_timeout=600 worker.default.socket_keepalive=1 worker.default.recycle_timeout=300 worker.default.lbfactor=1 I have also changed Tomcat server.xml file Connector port=8009 protocol=AJP/1.3 redirectPort=8443 enableLookups=false request.tomcatAuthentication=false address=127.0.0.2 scheme=https secure=true/ Listener className=org.apache.jk.config.ApacheConfig workersConfig=C:/Program Files/Apache Software Foundation/Apache2.2/conf/jk/workers.properties mod_Jk =C:/Program Files/Apache Software Foundation/Apache2.2/modules/mod_jk.so jkLog=C:/Program Files/Apache Software Foundation/Apache2.2/logs/jk.log jkDebug=info noRoot=false/ both in Server tag and in Engine tag. and my httpd-ssl.conf file is SSLOptions +StdEnvVars +ExportCertData JkMount /examples* worker1 So please help me what is wrong with this. Thanks Jatinder - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: SessionExample from the examples webapp
(java/lang:AbstractStringBuilder.class)] [loading java/lang/CharSequence.class(java/lang:CharSequence.class)] [loading java/lang/Comparable.class(java/lang:Comparable.class)] [loading java/lang/StringBuffer.class(java/lang:StringBuffer.class)] [wrote webapps/examples/WEB-INF/classes/SessionExample.class] [checking HTMLFilter] [wrote webapps/examples/WEB-INF/classes/HTMLFilter.class] [total 849ms] bml0065:tomcat administrator$ pwd /usr/local/tomcat I still would like to know why it fails when the HTMLFilter.java and HTMLFilter.class is in the util folder. It beats me, but if someone know why, I will drink a good glass of vine for his/her health in the weekend :-) I just jar-ed a war from it and will deploy it soon to see if it work for me. Thanks as always, Jábnos On Apr 28, 2011, at 11:24 AM, Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 János, On 4/27/2011 4:26 PM, János Löbb wrote: Adding some -claspath based upon man javac, I reduced the number of errors to two. Save yourself some time and use the build scripts that come with Tomcat: they are capable of building TC with no errors because they include all the dependencies, etc. in whatever classpath is necessary at the time. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk25hsIACgkQ9CaO5/Lv0PA7kQCgws+TcyXomdCY9LvXkhhxxL2i RRwAnRM2L2FGGLGvJF0/Ep21ZJzb2vO7 =947o -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: SessionExample from the examples webapp
Hi Konstantin, Chuck, I think I tried also with .../WEB-INF/classes and it still complained that it could not find or open the util package. Then I moved the two HTMLFilter.* files out from there a level up, commented out the package declaration in HTMLFilter.java and then javac compiled SessionExample.java and I am happy with it. Now I know how to mess with java files from the command line with tools like nano, pico and javac :-) And yes, I did not want to compile the whole Tomcat, just modify one of the servlet examples to suit my need. Thanks you both, János On Apr 28, 2011, at 4:17 PM, Konstantin Kolinko wrote: 2011/4/28 János Löbb janos.l...@yale.edu: Hi, Adding some -claspath based upon man javac, I reduced the number of errors to two. bml0065:classes administrator$ sudo javac -classpath /usr/local/apache-tomcat-7.0.10/webapps/examples/WEB-INF/classes/util: The above should have been .../WEB-INF/classes and not ../WEB-INF/classes/util /usr/local/apache-tomcat-7.0.10/lib/servlet-api.jar SessionExample.java SessionExample.java:33: package util does not exist import util.HTMLFilter; ^ 2 Chuck: OP is building its own app, not Tomcat. Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: SessionExample from the examples webapp
On Apr 28, 2011, at 4:53 PM, Konstantin Kolinko wrote: 2011/4/29 János Löbb janos.l...@yale.edu: Hi Konstantin, Chuck, I think I tried also with .../WEB-INF/classes and it still complained that it could not find or open the util package. Then I moved the two HTMLFilter.* files out from there a level up, commented out the package declaration in HTMLFilter.java and then javac compiled SessionExample.java and I am happy with it. Now I know how to mess with java files from the command line with tools like nano, pico and javac :-) And yes, I did not want to compile the whole Tomcat, just modify one of the servlet examples to suit my need. Thanks you both, :) BTW, why you are using sudo to invoke the compiler? Usually root rights are not needed to compile a program. And may be these pages from the official Java Tutorial may be useful to you: http://download.oracle.com/javase/tutorial/getStarted/cupojava/index.html Help for javac etc. is here: http://download.oracle.com/javase/6/docs/technotes/tools/index.html#basic Best regards, Konstantin Kolinko Because the powers above me wanted to install and run it as root. I know, I know... and I recommended to set up a tomcat user who owns it... but I did not succeed. Thanks for the pointers, János - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: SessionExamples from the examples webapp
Hi, During a good night sleep I realized that I have to compile the modified .java file :-) This is my current directory: bml0065:classes administrator$ pwd /usr/local/tomcat/webapps/examples/WEB-INF/classes When I do it I am getting the following errors: nyissz bml0065:classes administrator$ sudo javac SessionExample.java Password: SessionExample.java:27: package javax.servlet does not exist import javax.servlet.ServletException; ^ SessionExample.java:28: package javax.servlet.http does not exist import javax.servlet.http.HttpServlet; ^ SessionExample.java:29: package javax.servlet.http does not exist import javax.servlet.http.HttpServletRequest; ^ SessionExample.java:30: package javax.servlet.http does not exist import javax.servlet.http.HttpServletResponse; ^ SessionExample.java:31: package javax.servlet.http does not exist import javax.servlet.http.HttpSession; ^ SessionExample.java:41: cannot find symbol symbol: class HttpServlet public class SessionExample extends HttpServlet { ^ SessionExample.java:48: cannot find symbol symbol : class HttpServletRequest location: class SessionExample public void doGet(HttpServletRequest request, ^ SessionExample.java:49: cannot find symbol symbol : class HttpServletResponse location: class SessionExample HttpServletResponse response) ^ SessionExample.java:50: cannot find symbol symbol : class ServletException location: class SessionExample throws IOException, ServletException ^ SessionExample.java:144: cannot find symbol symbol : class HttpServletRequest location: class SessionExample public void doPost(HttpServletRequest request, ^ SessionExample.java:145: cannot find symbol symbol : class HttpServletResponse location: class SessionExample HttpServletResponse response) ^ SessionExample.java:146: cannot find symbol symbol : class ServletException location: class SessionExample throws IOException, ServletException ^ SessionExample.java:80: cannot find symbol symbol : class HttpSession location: class SessionExample HttpSession session = request.getSession(true); ^ SessionExample.java:47: method does not override or implement a method from a supertype @Override ^ SessionExample.java:143: method does not override or implement a method from a supertype @Override ^ 15 errors nyassz What am I doing wrong ? My guess is that I need a -classpath option, so javac can find all those definitions it needs. What should that be on OSX 10.6.6 ? Thanks ahead, János On Apr 26, 2011, at 5:25 PM, János Löbb wrote: Folks, What should I change if I want to have as title in this servlet not Session Example but rather Session Example Old ? I modified the servlets/sessions.html and also the SessionExample.java in the WEB-INF/classes, created a war file with jar, un-deployed and re-deployed, but I do not see the change. Thanks ahead, János - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: SessionExample from the examples webapp
Hi, Adding some -claspath based upon man javac, I reduced the number of errors to two. bml0065:classes administrator$ sudo javac -classpath /usr/local/apache-tomcat-7.0.10/webapps/examples/WEB-INF/classes/util:/usr/local/apache-tomcat-7.0.10/lib/servlet-api.jar SessionExample.java SessionExample.java:33: package util does not exist import util.HTMLFilter; ^ SessionExample.java:100: cannot access HTMLFilter bad class file: /usr/local/apache-tomcat-7.0.10/webapps/examples/WEB-INF/classes/util/HTMLFilter.java file does not contain class HTMLFilter Please remove or make sure it appears in the correct subdirectory of the classpath. out.println(HTMLFilter.filter(name) + = ^ 2 errors How can I get rid off these two ? I tried this command too: sudo javac -classpath /usr/local/apache-tomcat-7.0.10/webapps/examples/WEB-INF/classes/util/HTMLFilter.class:/usr/local/apache-tomcat-7.0.10/lib/servlet-api.jar SessionExample.java and also with HTMLFilter.java in place of HTMLFilter.class, but then the number of errors climbed back to three :-( Thanks ahead, János On Apr 27, 2011, at 11:25 AM, János Löbb wrote: Hi, During a good night sleep I realized that I have to compile the modified .java file :-) This is my current directory: bml0065:classes administrator$ pwd /usr/local/tomcat/webapps/examples/WEB-INF/classes When I do it I am getting the following errors: nyissz bml0065:classes administrator$ sudo javac SessionExample.java Password: SessionExample.java:27: package javax.servlet does not exist import javax.servlet.ServletException; ^ SessionExample.java:28: package javax.servlet.http does not exist import javax.servlet.http.HttpServlet; ^ SessionExample.java:29: package javax.servlet.http does not exist import javax.servlet.http.HttpServletRequest; ^ SessionExample.java:30: package javax.servlet.http does not exist import javax.servlet.http.HttpServletResponse; ^ SessionExample.java:31: package javax.servlet.http does not exist import javax.servlet.http.HttpSession; ^ SessionExample.java:41: cannot find symbol symbol: class HttpServlet public class SessionExample extends HttpServlet { ^ SessionExample.java:48: cannot find symbol symbol : class HttpServletRequest location: class SessionExample public void doGet(HttpServletRequest request, ^ SessionExample.java:49: cannot find symbol symbol : class HttpServletResponse location: class SessionExample HttpServletResponse response) ^ SessionExample.java:50: cannot find symbol symbol : class ServletException location: class SessionExample throws IOException, ServletException ^ SessionExample.java:144: cannot find symbol symbol : class HttpServletRequest location: class SessionExample public void doPost(HttpServletRequest request, ^ SessionExample.java:145: cannot find symbol symbol : class HttpServletResponse location: class SessionExample HttpServletResponse response) ^ SessionExample.java:146: cannot find symbol symbol : class ServletException location: class SessionExample throws IOException, ServletException ^ SessionExample.java:80: cannot find symbol symbol : class HttpSession location: class SessionExample HttpSession session = request.getSession(true); ^ SessionExample.java:47: method does not override or implement a method from a supertype @Override ^ SessionExample.java:143: method does not override or implement a method from a supertype @Override ^ 15 errors nyassz What am I doing wrong ? My guess is that I need a -classpath option, so javac can find all those definitions it needs. What should that be on OSX 10.6.6 ? Thanks ahead, János On Apr 26, 2011, at 5:25 PM, János Löbb wrote: Folks, What should I change if I want to have as title in this servlet not Session Example but rather Session Example Old ? I modified the servlets/sessions.html and also the SessionExample.java in the WEB-INF/classes, created a war file with jar, un-deployed and re-deployed, but I do not see the change. Thanks ahead, János - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr
SessionExamples from the examples webapp
Folks, What should I change if I want to have as title in this servlet not Session Example but rather Session Example Old ? I modified the servlets/sessions.html and also the SessionExample.java in the WEB-INF/classes, created a war file with jar, un-deployed and re-deployed, but I do not see the change. Thanks ahead, János - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
example.war
Hi, Where can I get the war file of the supplied example webapp ? Is it possible t create a war file from the app's directory created during the tomcat install ? Thanks, János - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
[OT] How to deploy a new version of a webapp on a cluster
Hi, Let say there is a webapp called mywebapp on a two member tomcat cluster. Let's call the members tomcatA and tomcatB. The Developer wants to deploy a new version of mywebapp. The following procedure was thought: - Shut down one of the tomcats. Let it be tomcatA. From here on the existing sessions will be served from tomcatB till further notice. - Replace the clustered server.xml on tomcatA with a non-clustered server.xml - Bring up tomcatA. At this moment tomcatA is not participating in the cluster, any session with the URL: http://hostA:8080/mywebapp should have a standalone session id with no indication any of the two tomcat instances. - Undeploy mywebapp. - Deploy the new mywebapp on tomcatA with the olld name, that is as mywebapp. - Shut down tomcatA - Replace the non-clustered server.xml with the clustered server.xml - Startup tomcatA Here is the point where I need guidance. - Does the tomcat cluster know that mywebapp on tomcatA is different from mywebapp still running on tomcatB ? If yes, how does it know it ? Will at this point the sessions from tomcatB replicated to tomcatA ? - If I want my new mywebabb to clusterized should I deploy it also on tomcatB ? If yes - because somehow the cluster knows that although the name and the context path is the same, the apps are in reality different -, then how,t do so and at the same time preserve the existing sessions in tomcatB, that is replicating them over to tomcatA. My test shows, that if I just start up tomcatA with the new mywebapp on it as soon as I shut down tomcatB the sessions over tomcatB are lost. I would like to preserve those sessions and bring them over to tomcatA, so I can do the same procedure on tomcatB that I did on tomcatA, that is replacing the old app with the new one. So I am interested how others are doing it without loosing any sessions and without restrictions t the users. Thanks ahead, János - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
[cluster] standalone tomcat hijacks cluster session
Hi Two machines bml0065 and bml0066. Both have OSX 10.6.6, Tomcat 7.0.10, mod_jk 1.2.31, and httpd2.2.17. bml0065 is the reverse proxy. I am following this test plan with the examples/servlets/servlet/SessionExample as the webapp. nyissz Scenario - tc65, tc66 are running in a cluster. 1 Remove tc66 from a cluster while people are using the application. - Shut down tc66 by logging into the machine as administrator and issue the sudo /usr/local/tomcat/bin/shutdown.sh commad. - sudo cp /usr/local/tomcat/conf/no-cluster.xml /usr/local/conf/server.xml. - Start up tc66 by issuing: sudo /usr/local/tomcat/bin/startup.sh 2. Access it directly with http://bml0066.yalepathorg/examples/servlets/servlet/SessionExample. Access management console and stop/remove the application. Deploy a new version of the application. 3. Ask users to use an alternative link to that App. - http://host/app 4. Let it run for some time. 5. Add this new application to the cluster in such a way that the new application is now deployed - Shut down tc66: sudo /usr/local/tomcat/bin/shutdown.sh - sudo cp /usr/local/tomcat/conf/cluster.xml /usr/local/conf/server.xml. - Start up tomcat by issuing: sudo /usr/local/tomcat/bin/startup.sh 6. Take other tomcat tc65 out of the cluster. - Shut down tc65 by logging into the machine as administrator and issue the sudo /usr/local/tomcat/bin/shutdown.sh commad. - copy the /usr/local/tomcat/conf/no-cluster.xml to /usr/local/conf/server.xml. - Start up tomcat by issuing: sudo /usr/local/tomcat/bin/startup.sh 7. Deploy the new app on it while users seamlessly switch to tc66 8. Add tc65 back to the cluster. - Shut down tomcat: sudo /usr/local/tomcat/bin/shutdown.sh - sudo cp /usr/local/tomcat/conf/cluster.xml /usr/local/conf/server.xml. - Start up tomcat by issuing: sudo /usr/local/tomcat/bin/startup.sh 9. Now all apps are in sync on both tomcat instance. nyassz It works fine untill step 6. When I bring back tc65 as a standalone tomcat with no jvmRoute in its engine block and the Cluster tag is commented out, then when I try to access it via the URL: http://bml0065.yalepath.org/examples/servlets/servlet/SessionExample it hijacks the clustered session. Here is what is on the screen after adding two new session attribute with its value: nyissz Sessions Example Session ID: 480C796251BF44355C44FDB0EF4B5AFD.tc66 Created: Fri Apr 15 12:20:40 EDT 2011 Last Accessed: Fri Apr 15 12:44:04 EDT 2011 The following data is in your session: s4 = tc65 up tc66 still standalone s2 = still standalone s9 = tc65 standalone tc66 up s8 = tc65 down, tc66 up s1 = standalone s7 = tc65 down, tc66 up s5 = tc65 up tc66 down s6 = both are up s3 = tc65 up tc66 no cluster nyassz It should have come up without the .tc66 affix and with a different sessionid and should have just he s2 = still standalone s1 = standalone attribute names and values. I did not have this issue when tc66 was in its standalone mode. Compared it with the real clustered session accessed via the URL: http://bml0065.yalepath.org/tc/examples/servlets/servlet/SessionExample nyissz Session ID: 480C796251BF44355C44FDB0EF4B5AFD.tc66 Created: Fri Apr 15 12:20:40 EDT 2011 Last Accessed: Fri Apr 15 12:42:30 EDT 2011 The following data is in your session: s4 = tc65 up tc66 still standalone s2 = tc65 up tc66 down s9 = tc65 standalone tc66 up s8 = tc65 down, tc66 up s1 = standalone s7 = tc65 down, tc66 up s5 = tc65 up tc66 down s6 = both are up s3 = tc65 up tc66 no cluster nyassz Here is the reverse proxy config: ProxyRequests Off Proxy balancer://pathCluster BalancerMember http://bml0065.yalepath.org loadfactor=10 BalancerMember http://bml0066.yalepath.org loadfactor=10 ProxySet lbmethod=bytraffic /Proxy ProxyPass /tc/ balancer://pathCluster/ ProxyPassReverse/tc/ balancer://pathCluster/ ProxyPassReverseCookiePAth / / ProxyPassReverseCookieDomain/ / Thanks ahead, János - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [cluster] standalone tomcat hijacks cluster session
Hi, Looks like this session hijacking is a jk phenomena. If I shut down the cluster member tr66 for example and make a standalone tomcat by teking out jvmRoute from the Engine tag and comment out the Cluster tag, and then bring it up then I can get to the SessionExample servlet in two ways. One is to go to it directly via port 8080 like: http://bml0066.yalepath.org:8080/examples/servlets/servlet/SessionExample then after adding some attributes I can see this: Session ID: E118555FBBC8EF040A916C24BFF52C1E Created: Fri Apr 15 16:53:12 EDT 2011 Last Accessed: Fri Apr 15 16:58:18 EDT 2011 The following data is in your session: tc2 = standalone s1 = tc66 standalone s3 = still standalone The other way is to get to the servlet via mod_jk, like: http://bml0066.yalepath.org/examples/servlets/servlet/SessionExample note that I am not using the reverse proxy in this case. Then mod_jk should go to the app in its own session based upon the workers.properties file. But it does not. It hijacks the session in the cluster and I can see this: Session ID: E8714E81BEC77E36D6A9B775A94832DA.tc65 Created: Fri Apr 15 16:47:22 EDT 2011 Last Accessed: Fri Apr 15 16:58:48 EDT 2011 The following data is in your session: s4 = tc65 hijacked tc66 standalone s2 = tc66 down tc65 up s1 = tc66 up tc65 up tc6 = tc65 up tc66 standalone s5 = tc65 hijacked tc66 standalone s6 = tc65 hijacked tc66 standalone s3 = tc65 up tc66 standalone and it surely interfere with the cluster session because when I get to the clustered session I see that the attribute valuse are changed based upon what was change the supposedly standalone hijacked session. To get to the clustered session I use the reverse proxy like http://bml0066.yalepath.org/tc/examples/servlets/servlet/SessionExample and I can see there this: Session ID: E8714E81BEC77E36D6A9B775A94832DA.tc65 Created: Fri Apr 15 16:47:22 EDT 2011 Last Accessed: Fri Apr 15 16:59:18 EDT 2011 The following data is in your session: s4 = tc65 hijacked tc66 standalone s2 = tc66 down tc65 up s7 = tc65 up tc66 standalone s1 = tc66 up tc65 up tc6 = tc65 up tc66 standalone s5 = tc65 hijacked tc66 standalone s6 = tc65 hijacked tc66 standalone s3 = tc65 up tc66 standalone all these lines with the word hijacked came when I tried to get to the standalone session via jk, that is via the URL: http://bml0066.yalepath.org/examples/servlets/servlet/SessionExample So the question is what configuration should I put into workers. properties or to theJkMont in httpd.conf, that when I do not use the reverse proxy and the tomcat is configured as standalone, it will not give me the clustered session from the clustered other tomcat of the other machine, but rather it passes the request to the non-clustered tomcat on machine indicated by the URL ? I see, when the reverse proxy is passing the request to one or the other machine the format of the URL is the same as if I enter it manually on the host of the non-clustered tomcat, so in reality I am not surprised to get the clustered session. What surprises me is that mod_jk is not realizing that some changes were made and the tomcat on the same machine is now not part of the cluster. Or, maybe there is some settings in memory that instructs mod_jk, that ignore the freshly started up standalone tomcat and act like that tomcat is not up yet and go to the tomcat that has the clustered session, and serve that to the user. Thanks ahead, János On Apr 15, 2011, at 1:09 PM, János Löbb wrote: Hi Two machines bml0065 and bml0066. Both have OSX 10.6.6, Tomcat 7.0.10, mod_jk 1.2.31, and httpd2.2.17. bml0065 is the reverse proxy. I am following this test plan with the examples/servlets/servlet/SessionExample as the webapp. nyissz Scenario - tc65, tc66 are running in a cluster. 1 Remove tc66 from a cluster while people are using the application. - Shut down tc66 by logging into the machine as administrator and issue the sudo /usr/local/tomcat/bin/shutdown.sh commad. - sudo cp /usr/local/tomcat/conf/no-cluster.xml /usr/local/conf/server.xml. - Start up tc66 by issuing: sudo /usr/local/tomcat/bin/startup.sh 2.Access it directly with http://bml0066.yalepathorg/examples/servlets/servlet/SessionExample. Access management console and stop/remove the application. Deploy a new version of the application. 3.Ask users to use an alternative link to that App. - http://host/app 4.Let it run for some time. 5.Add this new application to the cluster in such a way that the new application is now deployed - Shut down tc66: sudo /usr/local/tomcat/bin/shutdown.sh - sudo cp /usr/local/tomcat/conf/cluster.xml /usr/local/conf/server.xml. - Start up tomcat by issuing: sudo /usr/local/tomcat/bin/startup.sh 6.Take other tomcat tc65 out of the cluster. - Shut down tc65 by logging
Re: [OT] servlet-specific error pages
Chris, I was thinking about this section in the FM 10.9.2: nyissz Error-page declarations using the exception-type element in the deployment descriptor must be unique up to the class name of the exception-type. Similarly, error-page declarations using the status-code element must be unique in the deployment descriptor up to the status code. nyassz Plus the the two paragraphs before it. So if you are not finding anything useful in the deployment descriptor, then you can add your own to it and create a class that is matching the added exception-type. There are probably many already ready made java classes in the open that you can just incorporate to emit the xml. János On Apr 12, 2011, at 6:17 PM, Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 János, On 4/12/2011 4:56 PM, János Löbb wrote: Look the 10.9 Error Handling in the 3.0 specifications. It is maya to me but you might find what you are looking for. Being somewhat familiar with the servlet specification, I was hoping for something more helpful than RTFM. :( - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk2kz2oACgkQ9CaO5/Lv0PAuBgCfV6ZCaVybXg8lwOgYzIpr+hcA yvkAoKUR90RVh86CPyPvGkwtZmOyCpoH =H/dk -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
[OT cluster]Request to comment
Hi, I have this write up regarding a tomcat cluster I have to set up: nyissz Clustering Information: Two or more servers with each having a tomcat instance installed. The cluster or proxy server will need to have load balancing. Session Replication between all the tomcat instances on all the servers in the cluster. Each tomcat instance should be able to handle the session of any user. Most likely will need to use the DeltaManager. Need to make sure fail-over is transparent to the user and the sessions are replicated between the tomcat instances. The key thing is removing a server from the cluster and adding it back to the cluster without affecting any users. This feature is needed for our application deployment strategy of deploying a web application, testing it with some users and then adding it back to the cluster. Scenario - Tomcat 1, Tomcat 2, Tomcat 3 are running in a cluster. Remove Tomcat 3 from a cluster while people are using the application. Access it directly with http:\\addressOfTomcat3:port. Access management console and stop/remove our application. Deploy a new version of the application. Ask users to use an alternative link to that App. Let it run for some time. Add this application to the cluster in such a way that the new application is now deployed or take other two machines out of the cluster. Deploy the new app on them while users seamlessly switch to Tomcat 3. Add t1 and t2 back to the cluster. Now all apps are in sync. nyassz The first 3 paragraphs are done. I have two machines with OSX 10.6.5, httpd 2.2.17, mod_jk 1.2.31, tomcat 7.0.10. One of the httpd is set up as a reverse proxy, so the httpds are load balanced. Every httpd have the mod_jk module and that dos the load balance for the tomcats. This part is working beautifully , sesions are replicated and fail over if I stop one or the other tomcats or if I stop the httpd that is not the reverse proxy. My problems are starting with the requirement of removing a server from the cluster and adding it back to the cluster without affecting the users. I know just three ways to take a server out from the cluster. I assume server here means a tomcat instance. - shut that tomcat down. - comment out the Cluster/ tag and let tomcat re-read the config change, although I do not know how to do that. I do not see any graceful options. - Change its multicast address and again re-read the config change somehow. Is there any command line or web based interface that can interact with the running cluster and take a cluster member out and put it back later ? Then my problems are magnified by the described Scenario. What is the right method to remove a tomcat instance from a cluster ? Obviously it cannot be shut down, because it still had to be accessed by another mean. If I just shut down the web application on one cluster member it renders all the replicated sessions of the webapp on other tomcat unreachable via the reverse proxy, I already tested that out. To have a successful failover looks like the heartbeat of the desired tomcat instance should be stopped for the given cluster. I can imagine that by changing the multicast address and re-read the newly modified server.xml will allow the web app to continue on the other tomcat instances of the cluster and in the meantime refurbish the taken out tomcat instance with a new version of the webapp. I can also imagine that the old webapp still run nicely on the remaing member of the cluster and the new webapp will be accessed on this now standalone tomcat instance. After the test is over, the tomcat instance with the new webapp can be added back t the cluster by changing back its multicast address to the cluster's multicast and take out the tomcat instances which are still serving the old wab app by changing their multicast address in server.xml and re-read the config change somehow. Are my assumptions correct ? Of course I will start to test them this afternoon, but all comments are welcome. Even those to read the FM, if it is chapter or paragraph specific. My thinking is this: - First I have to look jkmanager to see if the demanded functionality can be provided by it. - I will set up on the other httpd another reverse proxy for the httpds. Lets call it tctest. - In both httpd configure an additonal JkMount for the test wersion of the webapp but with a differently named load balancer, let say lbtest. This point is fuzzy in my mind at this moment, because I would like the test to have the same context path as production, but I guess that is impossible, so for production itt will be something like: JkMount /examples/* lb and for test JkMount /tctest/examples/* lbtest I have to figure out how to deploy into a subdirectory of $CATALINA_BASE/webapps/, in this case into $CATALINA_BASE/webapps/tctest/. Looks very curly to me and I afraid that the Developer has to package the example webapp as
[Cluster] Sanity check
Hi, /Httpd 2.2.17, mod_jk 1.2.31, tomcat 7.0.10, OSX 10.6.5/ Looks like there is something I do not get regarding Tomcat clustering, so I do here a sanity check :-) I have two machines with one tomcat on both. I use one of the machines as reverse proxy. here is the reverse proxy conf from the httpd.conf file: ProxyRequests Off Proxy balancer://pathCluster BalancerMember http://bml0065.yalepath.org loadfactor=10 BalancerMember http://bml0066.yalepath.org loadfactor=10 ProxySet lbmethod=bytraffic /Proxy ProxyPass /tc/ balancer://pathCluster/ ProxyPassReverse/tc/ balancer://pathCluster/ ProxyPassReverseCookiePAth / / ProxyPassReverseCookieDomain/ / The reverse proxy passes the request to one of the balance members. The balance member see that the request is for tomcat and passes it to mod_jk. Mod_jk is checking its workers.properties file and based upon the load it passes the request to one of the two Tomcat instances. Here is one of the workers.properties file: bml0065:local administrator$ cat apache2/conf/workers.properties worker.list = lb,jkstatus worker.lb.type=lb worker.lb.balance_workers=tomcat1,tomcat3 worker.lb.sticky_session = True worker.lb.sticky_session_force = False worker.jkstatus.type=status worker.tomcat1.type = ajp13 worker.tomcat1.host = bml0066.yalepath.org worker.tomcat1.port = 8109 worker.tomcat1.lbfactor = 1 worker.tomcat1.redirect=tomcat3 worker.tomcat3.type = ajp13 worker.tomcat3.host = bml0065.yalepath.org worker.tomcat3.port = 8309 worker.tomcat3.lbfactor = 1 worker.tomcat3.redirect=tomcat1 To check session replication and session failover, I use the SessionExmaple servlet from the supplied examples webapp this way: http://bml0065.yalepath.org/tc/examples/servlets/servlet/SessionExample bml0065 is the reverse proxy. When I see that the session is created I shut down that tomcat which hosts the session and add another session attribute via the SessionExample servlet. The mechanism is working fine, the session fails over to the other tomcat instance. I add more session attribute, and start up the previously shouted down tomcat instance, add more attribute, then I shut down the other tomcat instance and check for fail over, etc..etc.. Everything works. Then I do not shut down tomcat, just stop the examples webapp on that tomcat instance where currently the session resides and try to add more session attribute. Instead of failing over, I receive a 404 error: HTTP Status 404 - /examples/servlets/servlet/SessionExample type Status report message /examples/servlets/servlet/SessionExample description The requested resource (/examples/servlets/servlet/SessionExample) is not available. Apache Tomcat/7.0.10 My understanding is that the request should be rerouted to the other tomcat instance and present the sessions from that machine, the same way when tomcat itself was stopped. However that is not what happen. So the question is what do I miss in this process ? Thanks ahead, János - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [OT] servlet-specific error pages
On Apr 12, 2011, at 4:38 PM, Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 All, I have a webapp where some of the servlets are expected to return XML all the time, even for error conditions. I'd like to be able to set an error page for those servlets so the response will be in XML instead of HTML like you'd get with the default Tomcat error page or an error page we might have configured for the rest of the site. I didn't see anything in web.xml that would allow me to set an error page for a particular servlet. Any good ideas? Obviously, I can create a system-wide error resource that determines the resource that was being used and then dispatch to either an HTML-oriented or XML-oriented error page, but I was wondering if something like that already existed or if there was a better approach. Thanks, - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk2kuEEACgkQ9CaO5/Lv0PBpqACfVky6ZZvG/Rgpt4XK804jdbei JpEAnj/NF2td4NNHoBAbFBRAgsUDkC0v =xjBP -END PGP SIGNATURE- Chris, Look the 10.9 Error Handling in the 3.0 specifications. It is maya to me but you might find what you are looking for. János - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
[Cluster] context question
Hi, /Tomcat 7.0.10, OSX 10.6.5, jk 1.2.31, and httpd 2.2.17/ Without any explicit parameters in server.xml, just by setting the jvmRoute attribute in the Engine element and enabling Clustering, session failover worked if I shut down one or the other tomcat instance or the one httpd that was not the reverse proxy. However when I just stopped the example webapp in one tomcat, the session did not failover and I received a 404 http error instead of the expected session page from the other tomcat. Based upon the instructions found in the book: http://proquest.safaribooksonline.com/9780596101060/tomcat_6_clustering_implementation?sessionid=reader=htmlimagepage= explicitely: nyissz You'll also need to add distributed=true to the webapp's Context element. If there is no Context element declared for it anywhere, you will need to create one. You can create one by making a newCATALINA_HOME/conf/[EngineName]/[HostName]/examples.xml context XML fragment file or by adding one to server.xml. nyassz my thought was that the ReplicatedContect was not initiated. Well, I already learned that I should not add any context into server.xml and there is nothing in the bml0066:local administrator$ ls -l tomcat1/conf/Catalina/localhost/ bml0066:local administrator$ directory, so I created a META-INF directory inside the examples directory and placed a context.xml there with the following content: bml0066:local administrator$ cat tomcat1/webapps/examples/META-INF/context.xml ?xml version=1.0 encoding=UTF-8? Context className=org.apache.catalina.ha.context.ReplicatedContext distributed=true /Context I did it on both tomcats and bounced them. Now when I look the log, I see the following warning just after restart: INFO: Deploying web application directory examples Apr 11, 2011 12:00:28 PM org.apache.catalina.startup.SetContextPropertiesRule begin WARNING: [SetContextPropertiesRule]{Context} Setting property 'distributed' to 'true' did not find a matching property. Apr 11, 2011 12:00:28 PM org.apache.catalina.tribes.tipis.AbstractReplicatedMap init INFO: Initializing AbstractReplicatedMap with context name:/examples Apr 11, 2011 12:00:28 PM org.apache.catalina.core.ApplicationContext log INFO: ContextListener: contextInitialized() Apr 11, 2011 12:00:28 PM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: contextInitialized() So the first question is, should I use the distributed=true property here ? Is the book right ? I think it is from 2007. I already have the distributable/ tag in the webapp's web.xml. The second question is what to do to avoid the 404 message and fail the session over instead of it, when I just stop the webapp on the tomcat instance? By default I am using sticky sessions. nyissz bml0066:local administrator$ cat apache2/conf/workers.properties worker.list = lb,jkstatus worker.lb.type=lb worker.lb.balance_workers=tomcat1,tomcat3 #,tomcat2,tomcat4 worker.lb.sticky_session = True worker.lb.sticky_session_force = False worker.jkstatus.type=status worker.tomcat1.type = ajp13 worker.tomcat1.host = bml0066.yalepath.org worker.tomcat1.port = 8109 worker.tomcat1.lbfactor = 1 worker.tomcat1.redirect=tomcat3 #worker.tomcat2.type = ajp13 #worker.tomcat2.host = bml0066.yalepath.org #worker.tomcat2.port = 8209 #worker.tomcat2.lbfactor = 1 #worker.tomcat2.redirect=tomcat4 worker.tomcat3.type = ajp13 worker.tomcat3.host = bml0065.yalepath.org worker.tomcat3.port = 8309 worker.tomcat3.lbfactor = 1 worker.tomcat3.redirect=tomcat1 #worker.tomcat4.type = ajp13 #worker.tomcat4.host = bml0065.yalepath.org #worker.tomcat4.port = 8409 #worker.tomcat4.lbfactor = 1 #worker.tomcat4.redirect=tomcat2 nyassz Thanks ahead, János
Re: [Cluster] context question
On Apr 11, 2011, at 12:45 PM, János Löbb wrote: Hi, /Tomcat 7.0.10, OSX 10.6.5, jk 1.2.31, and httpd 2.2.17/ Without any explicit parameters in server.xml, just by setting the jvmRoute attribute in the Engine element and enabling Clustering, session failover worked if I shut down one or the other tomcat instance or the one httpd that was not the reverse proxy. However when I just stopped the example webapp in one tomcat, the session did not failover and I received a 404 http error instead of the expected session page from the other tomcat. Based upon the instructions found in the book: http://proquest.safaribooksonline.com/9780596101060/tomcat_6_clustering_implementation?sessionid=reader=htmlimagepage= explicitely: nyissz You'll also need to add distributed=true to the webapp's Context element. If there is no Context element declared for it anywhere, you will need to create one. You can create one by making a newCATALINA_HOME/conf/[EngineName]/[HostName]/examples.xml context XML fragment file or by adding one to server.xml. nyassz my thought was that the ReplicatedContect was not initiated. Well, I already learned that I should not add any context into server.xml and there is nothing in the bml0066:local administrator$ ls -l tomcat1/conf/Catalina/localhost/ bml0066:local administrator$ directory, so I created a META-INF directory inside the examples directory and placed a context.xml there with the following content: bml0066:local administrator$ cat tomcat1/webapps/examples/META-INF/context.xml ?xml version=1.0 encoding=UTF-8? Context className=org.apache.catalina.ha.context.ReplicatedContext distributed=true /Context I did it on both tomcats and bounced them. Now when I look the log, I see the following warning just after restart: INFO: Deploying web application directory examples Apr 11, 2011 12:00:28 PM org.apache.catalina.startup.SetContextPropertiesRule begin WARNING: [SetContextPropertiesRule]{Context} Setting property 'distributed' to 'true' did not find a matching property. Apr 11, 2011 12:00:28 PM org.apache.catalina.tribes.tipis.AbstractReplicatedMap init INFO: Initializing AbstractReplicatedMap with context name:/examples Apr 11, 2011 12:00:28 PM org.apache.catalina.core.ApplicationContext log INFO: ContextListener: contextInitialized() Apr 11, 2011 12:00:28 PM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: contextInitialized() So the first question is, should I use the distributed=true property here ? Is the book right ? I think it is from 2007. I already have the distributable/ tag in the webapp's web.xml. The second question is what to do to avoid the 404 message and fail the session over instead of it, when I just stop the webapp on the tomcat instance? By default I am using sticky sessions. nyissz bml0066:local administrator$ cat apache2/conf/workers.properties worker.list = lb,jkstatus worker.lb.type=lb worker.lb.balance_workers=tomcat1,tomcat3 #,tomcat2,tomcat4 worker.lb.sticky_session = True worker.lb.sticky_session_force = False worker.jkstatus.type=status worker.tomcat1.type = ajp13 worker.tomcat1.host = bml0066.yalepath.org worker.tomcat1.port = 8109 worker.tomcat1.lbfactor = 1 worker.tomcat1.redirect=tomcat3 #worker.tomcat2.type = ajp13 #worker.tomcat2.host = bml0066.yalepath.org #worker.tomcat2.port = 8209 #worker.tomcat2.lbfactor = 1 #worker.tomcat2.redirect=tomcat4 worker.tomcat3.type = ajp13 worker.tomcat3.host = bml0065.yalepath.org worker.tomcat3.port = 8309 worker.tomcat3.lbfactor = 1 worker.tomcat3.redirect=tomcat1 #worker.tomcat4.type = ajp13 #worker.tomcat4.host = bml0065.yalepath.org #worker.tomcat4.port = 8409 #worker.tomcat4.lbfactor = 1 #worker.tomcat4.redirect=tomcat2 nyassz Thanks ahead, János Testing out he examples webapp I found this in the log of that tomcat where I shut down the webapp: nyissz INFO: Server startup in 6625 ms Apr 11, 2011 12:43:59 PM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: sessionCreated('1CAEC5FA2D27A7410C819A8BBF9E7F77.tomcat1') Apr 11, 2011 12:47:23 PM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: sessionCreated('69EB2E77CE0D912F8584E60B4CB828D7.tomcat3') Apr 11, 2011 12:47:46 PM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: attributeAdded('69EB2E77CE0D912F8584E60B4CB828D7.tomcat3', 's1', 't3') Apr 11, 2011 12:48:40 PM org.apache.catalina.core.ApplicationContext log INFO: HTMLManager: init: Associated with Deployer 'Catalina:type=Deployer,host=localhost' Apr 11, 2011 12:48:40 PM org.apache.catalina.core.ApplicationContext log INFO: HTMLManager: init: Global resources are available Apr 11, 2011 12:48:54 PM org.apache.catalina.core.ApplicationContext log INFO: HTMLManager: list: Listing contexts for virtual host 'localhost' Apr 11, 2011 12:49:01 PM
[Cluster] fail over is failing on application stop
Hi, I started a new thread. I have two machines bml0065 and bml0066. Both have OSX 10.6.5, httpd 2.2.17, tomcat 7.0.10, jk 1.2.31. The bml0065 machine acts as a reverse proxy. Here is the server.xml from bml0066, without comments: nyissz ?xml version='1.0' encoding='utf-8'? Server port=8105 shutdown=SHUTDOWN Listener className=org.apache.catalina.core.AprLifecycleListener SSLEngine=on / Listener className=org.apache.catalina.core.JasperListener / Listener className=org.apache.catalina.core.JreMemoryLeakPreventionListener / Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener / Listener className=org.apache.catalina.core.ThreadLocalLeakPreventionListener / GlobalNamingResources Resource name=UserDatabase auth=Container type=org.apache.catalina.UserDatabase description=User database that can be updated and saved factory=org.apache.catalina.users.MemoryUserDatabaseFactory pathname=conf/tomcat-users.xml / /GlobalNamingResources Service name=Catalina Connector port=8180 protocol=HTTP/1.1 connectionTimeout=2 redirectPort=8143 / Connector port=8143 protocol=org.apache.coyote.http11.Http11Protocol SSLEnabled=true maxThreads=150 scheme=https secure=true keystoreFile=/Users/administrator/.keystore keystorePass=ITAccess clientAuth=false sslProtocol=TLS / Connector port=8109 protocol=AJP/1.3 redirectPort=8143 / Engine name=Catalina defaultHost=localhost jvmRoute=tomcat1 Cluster className=org.apache.catalina.ha.tcp.SimpleTcpCluster/ Realm className=org.apache.catalina.realm.LockOutRealm Realm className=org.apache.catalina.realm.UserDatabaseRealm resourceName=UserDatabase/ /Realm Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true Valve className=org.apache.catalina.valves.AccessLogValve directory=logs prefix=localhost_access_log. suffix=.txt pattern=%h %l %u %t quot;%rquot; %s %b resolveHosts=false/ /Host /Engine /Service /Server nyassz Similar server.xml exists for the other machine bml0065 only the jvmRoute and the ports are different. Here is a snippet showing the distributable tag in web.xml in the WEB-INF directory of the examples web app: nyissz !--Temporarily the distributable tag goes here -- !--It should be in the given webapp's web.xml -- distributable/ /web-app nyassz I created an examples.xml in the $CATALINA_BASE/conf/Catalina/localhost directory on both machines and the content of that file is this: nyissz bml0066:local administrator$ cat tomcat1/conf/Catalina/localhost/examples.xml ?xml version=1.0 encoding=UTF-8? Context className=org.apache.catalina.ha.context.ReplicatedContext/ nyassz Unfortunately if I have just Context org.apache.catalina.ha.context.ReplicatedContext/ there then I receive these type of messages: Apr 11, 2011 4:13:39 PM org.apache.tomcat.util.digester.Digester fatalError SEVERE: Parse Fatal Error at line 18 column 59: Attribute name org.apache.catalina.ha.context.ReplicatedContext associated with an element type Context must be followed by the ' = ' character. I did a little test. I opened the URL http://bml0065.yalepath.org/tc/examples/servlets/servlet/SessionExample on my machine /bml0041/. The reverse proxy sent the request to itself, then jk sent it to the tomcat3 instance on the same machine. I can see in the log of bml0065: nyissz INFO: Server startup in 6161 ms Apr 11, 2011 4:40:47 PM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: sessionCreated('CA87BED01E4A1D0FF87AED173F66E35C.tomcat3') Apr 11, 2011 4:41:04 PM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: attributeAdded('CA87BED01E4A1D0FF87AED173F66E35C.tomcat3', 's1', 't3') Apr 11, 2011 4:41:37 PM org.apache.catalina.core.ApplicationContext log INFO: HTMLManager: init: Associated with Deployer 'Catalina:type=Deployer,host=localhost' Apr 11, 2011 4:41:37 PM org.apache.catalina.core.ApplicationContext log INFO: HTMLManager: init: Global resources are available Apr 11, 2011 4:41:37 PM org.apache.catalina.core.ApplicationContext log INFO: HTMLManager: list: Listing contexts for virtual host 'localhost' nyass Looking at the tomcat log on the other machine - bml0066 - I can see that the session is replicated: nyissz Apr 11, 2011 4:40:47 PM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: sessionCreated('CA87BED01E4A1D0FF87AED173F66E35C.tomcat3') Apr 11, 2011 4:41:04 PM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: attributeAdded('CA87BED01E4A1D0FF87AED173F66E35C.tomcat3', 's1', 't3') nyassz Then I stop the examples application on the bml0065 machine running the tomcat3 instance. Then I try to
Re: reverse proxy and tomcat
André, My marching order was to setup a four member tomcat cluster on two machines and have a fail over for minimum one of the apaches. Then I reduced the number tomcats to two, one on each machine. My understanding is that although the user base for the app running on this setup will be relatively small - 20-30 users, but they will access it frequently. So they needed a solution where sessions are failing over nicely when they want do maintenance on one of the tomcats. Testing will show them if this solution is viable for their purpose or not. If not, then I probably will come to the list with other questions :-) (In 1986-1988 I was in Switzerland. The Swiss did the same, with the exception that they went home after 18:00 or 19:00 :-) I remember one time I went to work from St. Gallen to Rorschach , let say wednesday morning and I was able to get back to St. Gallen on Friday evening. By the way, the man I had to work was a German :-) I got my pay from him via the Swiss Red Cross, because just by himself he thought I was not deserving the money, because I did sleep 2 x 5hours from wednesday morning to friday evening .) Thanks a lot, János On Mar 24, 2011, at 4:46 AM, André Warnier wrote: Hi. Glad that you resolved the problem, and that maybe something out of my guessing helped you do so. This being said, I am still a bit curious about your setup, and what it achieves. I understand the balancing bit to some extent. But you are aware that, while the first front-end Apache is proxying to the second Apache (maybe itself), and that second Apache is proxying to one of the Tomcats, all these intermediate processes are waiting for their respective response, and unavailable to process other requests, right ? I mean, it is not like a re-direct, where the server tells the browser wrong address, go somehere else. When the first Apache (child) runs the mod_proxy module to proxy the call to the second Apache, that first Apache actually has to sit there, waiting for the response from the second Apache; and so on. And when the whole chain happens to be on the first Apache server, then all these resources are temporarily locked up on that same host. What I am wondering about is if the overhead of what you are doing in terms of proxying does not totally negate whatever advantage you may gain by the load-balancing part. (And I am at the moment in Germany, where people get to work at 8:00, go to lunch at 11:30 for 1/2 hour max, and are tired and go home at 16:30. And it's even worse : they expect foreigners like me to do the same.) János Löbb wrote: André, What kind of late afternoon ?? I thought for folks in Western-Europe the day starts at late afternoon :-) The good folks of France just get out from the bed at that time, just like the nyarleans here in the States :-) Thanks a lot for the excellent explanation of the process below. I truly appreciate your effort. I checked on my cookies and found that the one associated with the bml0065.yalepath.org machine and with the path of /examples was changing its content all the time. So then I looked the bottom of your email and I saw this long named creatures from NewZeeLand christened ProxyPassReverseCoockieDomain. Punched it into Google and there came my solution right on the first page: http://www.experts-exchange.com/Software/Server_Software/Web_Servers/Q_22444213.html Old Hungarian proverb: Even the blind hen is finding the corn :-) After some scrolling, I found Nick Kew article at http://www.apachetutor.org/admin/reverseproxies /Thanks Nick / Right now my very basic reverse proxy config looks like this: ProxyRequests Off Proxy balancer://pathCluster BalancerMember http://bml0065.yalepath.org loadfactor=10 route=tomcat3 BalancerMember http://bml0066.yalepath.org loadfactor=10 route=tomcat1 ProxySet lbmethod=bytraffic /Proxy ProxyPass/tc/ balancer://pathCluster/ stickysession=JSESSIONID|jsessionid ProxyPassReverse /tc/ balancer://pathCluster/ ProxyPassReverseCookiePAth / / ProxyPassReverseCookieDomain / / and now everything works again like charm :-) Tomcats can fail over and Httpds can fail over and the session is still good and valid. There is a space between the two / character above. Now off to self signing some certificates, configure the ssl.conf file and I am almost done :-) Thanks again, János On Mar 23, 2011, at 1:01 PM, André Warnier wrote: The setup with the first HTTP proxy and then the JK proxy is a bit confusing, and on this late afternoon I am not in my best guessing mode, but what I was thinking about was something like this : (Oh, and I have to add that I am not quite clear at the moment as to when Tomcat uses a cookie to return the session-id, or appends it to the URL; but anyway..) 1) the browser sends a request, with ultimate goal Tomcat 2) the request is picked up
Re: reverse proxy and tomcat
Hi Igor, I use mod-proxy to balance the apaches/httpds. I use mod-jk t balance the tomcats. For the tomcats f course I also have the workers.properties files in the apache2/conf directory. When invoke the URL to the individual balance members, everything works fine. It is when I try to use the reverse proxy then every attempt to any of the tomcats creates a new session, so fail over does not work. Thanks, János On Mar 22, 2011, at 6:59 PM, Igor Cicimov wrote: Interesting I had no idea you can mix mod_proxy and mod_jk, thought you should use the one or the other. What I do I have workers.properties file in the Apache conf directory with load-balancer worker that takes care of the load balancing ans sticky sessions. On Wed, Mar 23, 2011 at 8:54 AM, János Löbb janos.l...@yale.edu wrote: Hi, I have two machines bml0065.yalepath.org and bml0066.yalepath.org. Both have OSX 10.6.6, apache 2.2.17 and mod_jk 1.2.31 installed. Tomcat is 7.0.10 on both. Apache was compiled on both machines with proxy, proxy-balancer, proxy-http and proxy-ajp enabled. The bml0065 machine is configured as a reverse proxy. The theory is, that users hit the bml0065 machine like http://bml0065.yalepath.org/tc/examples/servlets/servlet/SessionExample and using mod-proxy and mod-proxy-http it will select either bml0065 or bml0066 depending on the lbmethod configured. Then let say it selects bml0065. Then it comes to this machine as: http://bml0065.yalepath.org/examples/servlets/servlet/SessionExample From here, because there is a JkMount for examples in its httpd.conf, it connects via mod_jk to the Tomcat instance on this machine, in this case tomcat3. The problem is that as soon the reverse proxy is involved new sessions are created all the time, so session failover do not work. If I take the reverse proxy out from the picture, everything works. Here is the reverse proxy config from httpd.conf of the bml0065 machine JkLogLevel info JkMount /examples/* lb JkMount /examples/servlets/servlet/* lb JkMount /jkmanager/* jkstatus JkWorkersFile /usr/local/apache2/conf/workers.properties JkLogFile /usr/local/apache2/logs/mod_jk.log ProxyRequests Off Proxy balancer://pathCluster BalancerMember http://bml0065.yalepath.org loadfactor=10 route=tomcat3 BalancerMember http://bml0066.yalepath.org loadfactor=10 route=tomcat1 ProxySet lbmethod=bytraffic /Proxy ProxyPass /tc/ balancer://pathCluster/ stickysession=JSESSIONID|jsessionid ProxyPassReverse/tc/ balancer://pathCluster/ Location /balancer-manager SetHandler balancer-manager Order Deny,Allow Allow from .yalepath.org /Location A very similar setup worked in 2009 with Tomcat 6.0.18 and httpd 2.2.11. Here are the snippets from both machine catalina.out file snip bml0065 Mar 22, 2011 5:06:11 PM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: sessionCreated('0409F29D221545DB0BB5F62205B24471.tomcat3') Mar 22, 2011 5:06:11 PM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: attributeAdded('0409F29D221545DB0BB5F62205B24471.tomcat3', 's1', 't3') Mar 22, 2011 5:07:06 PM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: sessionCreated('DE7A014A0F1659F0B777E0DF4A2355D4.tomcat3') Mar 22, 2011 5:07:06 PM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: attributeAdded('DE7A014A0F1659F0B777E0DF4A2355D4.tomcat3', 's2', 't3') /snip snip bml0066 Mar 22, 2011 5:06:11 PM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: sessionCreated('0409F29D221545DB0BB5F62205B24471.tomcat3') Mar 22, 2011 5:06:11 PM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: attributeAdded('0409F29D221545DB0BB5F62205B24471.tomcat3', 's1', 't3') Mar 22, 2011 5:07:06 PM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: sessionCreated('DE7A014A0F1659F0B777E0DF4A2355D4.tomcat3') Mar 22, 2011 5:07:06 PM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: attributeAdded('DE7A014A0F1659F0B777E0DF4A2355D4.tomcat3', 's2', 't3') /snip Here is the last access session from the access_log: snip bml0065 10.84.2.65 - - [22/Mar/2011:17:06:11 -0400] POST /examples/servlets/servlet/SessionExample HTTP/1.1 200 1114 10.84.2.41 - - [22/Mar/2011:17:06:11 -0400] POST /tc/examples/servlets/servlet/SessionExample HTTP/1.1 200 1114 10.84.2.65 - - [22/Mar/2011:17:06:11 -0400] GET /examples/servlets/images/code.gif HTTP/1.1 304 - 10.84.2.41 - - [22/Mar/2011:17:06:11 -0400] GET /tc/examples/servlets/images/code.gif HTTP/1.1 304 - 10.84.2.65 - - [22/Mar/2011:17:06:11 -0400] GET /examples/servlets/images/return.gif HTTP/1.1 304 - 10.84.2.41 - - [22/Mar/2011:17:06:11 -0400] GET /tc/examples/servlets/images/return.gif HTTP/1.1 304 - ::1 - - [22/Mar/2011:17:06:18 -0400] OPTIONS * HTTP/1.0 200 - ::1 - - [22
Re: reverse proxy and tomcat
Hi André, Her is the content of one of the workers.properties file. On the other machine the names are changed accordingly: bml0065:local administrator$ cat apache2/conf/workers.properties worker.list = lb,jkstatus worker.lb.type=lb worker.lb.balance_workers=tomcat1,tomcat3 #,tomcat2,tomcat4 worker.lb.sticky_session = True worker.lb.sticky_session_force = False worker.jkstatus.type=status worker.tomcat1.type = ajp13 worker.tomcat1.host = bml0066.yalepath.org worker.tomcat1.port = 8109 worker.tomcat1.lbfactor = 1 worker.tomcat1.redirect=tomcat3 #worker.tomcat2.type = ajp13 #worker.tomcat2.host = bml0066.yalepath.org #worker.tomcat2.port = 8209 #worker.tomcat2.lbfactor = 1 #worker.tomcat2.redirect=tomcat4 worker.tomcat3.type = ajp13 worker.tomcat3.host = bml0065.yalepath.org worker.tomcat3.port = 8309 worker.tomcat3.lbfactor = 1 worker.tomcat3.redirect=tomcat1 #worker.tomcat4.type = ajp13 #worker.tomcat4.host = bml0065.yalepath.org #worker.tomcat4.port = 8409 #worker.tomcat4.lbfactor = 1 #worker.tomcat4.redirect=tomcat2 Originally planned 2 tomcats per machine but now I try to simplify as much as I can. My next step is to set logging to debug and try to split the atoms to see where do I have the disaster. Let me know if you see something wrong or suspicious. There was an occasion when for the worker on the actual machine I used localhost for host and that also worked when I just load balanced tomcats by selecting one or the other proxy balance members directly without using the reverse proxy. Then for the sake of clearness I specified the FQDN for hostnames. Thanks ahead, János On Mar 23, 2011, at 11:42 AM, André Warnier wrote: Just a vague suspicion.. What are the hostnames which you use in your workers.properties, for the Tomcats ? János Löbb wrote: Hi Igor, I use mod-proxy to balance the apaches/httpds. I use mod-jk t balance the tomcats. For the tomcats f course I also have the workers.properties files in the apache2/conf directory. When invoke the URL to the individual balance members, everything works fine. It is when I try to use the reverse proxy then every attempt to any of the tomcats creates a new session, so fail over does not work. Thanks, János On Mar 22, 2011, at 6:59 PM, Igor Cicimov wrote: Interesting I had no idea you can mix mod_proxy and mod_jk, thought you should use the one or the other. What I do I have workers.properties file in the Apache conf directory with load-balancer worker that takes care of the load balancing ans sticky sessions. On Wed, Mar 23, 2011 at 8:54 AM, János Löbb janos.l...@yale.edu wrote: Hi, I have two machines bml0065.yalepath.org and bml0066.yalepath.org. Both have OSX 10.6.6, apache 2.2.17 and mod_jk 1.2.31 installed. Tomcat is 7.0.10 on both. Apache was compiled on both machines with proxy, proxy-balancer, proxy-http and proxy-ajp enabled. The bml0065 machine is configured as a reverse proxy. The theory is, that users hit the bml0065 machine like http://bml0065.yalepath.org/tc/examples/servlets/servlet/SessionExample and using mod-proxy and mod-proxy-http it will select either bml0065 or bml0066 depending on the lbmethod configured. Then let say it selects bml0065. Then it comes to this machine as: http://bml0065.yalepath.org/examples/servlets/servlet/SessionExample From here, because there is a JkMount for examples in its httpd.conf, it connects via mod_jk to the Tomcat instance on this machine, in this case tomcat3. The problem is that as soon the reverse proxy is involved new sessions are created all the time, so session failover do not work. If I take the reverse proxy out from the picture, everything works. Here is the reverse proxy config from httpd.conf of the bml0065 machine JkLogLevel info JkMount /examples/* lb JkMount /examples/servlets/servlet/* lb JkMount /jkmanager/* jkstatus JkWorkersFile /usr/local/apache2/conf/workers.properties JkLogFile /usr/local/apache2/logs/mod_jk.log ProxyRequests Off Proxy balancer://pathCluster BalancerMember http://bml0065.yalepath.org loadfactor=10 route=tomcat3 BalancerMember http://bml0066.yalepath.org loadfactor=10 route=tomcat1 ProxySet lbmethod=bytraffic /Proxy ProxyPass /tc/ balancer://pathCluster/ stickysession=JSESSIONID|jsessionid ProxyPassReverse/tc/ balancer://pathCluster/ Location /balancer-manager SetHandler balancer-manager Order Deny,Allow Allow from .yalepath.org /Location A very similar setup worked in 2009 with Tomcat 6.0.18 and httpd 2.2.11. Here are the snippets from both machine catalina.out file snip bml0065 Mar 22, 2011 5:06:11 PM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: sessionCreated('0409F29D221545DB0BB5F62205B24471.tomcat3') Mar 22, 2011 5:06:11 PM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: attributeAdded
Re: reverse proxy and tomcat
André, What kind of late afternoon ?? I thought for folks in Western-Europe the day starts at late afternoon :-) The good folks of France just get out from the bed at that time, just like the nyarleans here in the States :-) Thanks a lot for the excellent explanation of the process below. I truly appreciate your effort. I checked on my cookies and found that the one associated with the bml0065.yalepath.org machine and with the path of /examples was changing its content all the time. So then I looked the bottom of your email and I saw this long named creatures from NewZeeLand christened ProxyPassReverseCoockieDomain. Punched it into Google and there came my solution right on the first page: http://www.experts-exchange.com/Software/Server_Software/Web_Servers/Q_22444213.html Old Hungarian proverb: Even the blind hen is finding the corn :-) After some scrolling, I found Nick Kew article at http://www.apachetutor.org/admin/reverseproxies /Thanks Nick / Right now my very basic reverse proxy config looks like this: ProxyRequests Off Proxy balancer://pathCluster BalancerMember http://bml0065.yalepath.org loadfactor=10 route=tomcat3 BalancerMember http://bml0066.yalepath.org loadfactor=10 route=tomcat1 ProxySet lbmethod=bytraffic /Proxy ProxyPass /tc/ balancer://pathCluster/ stickysession=JSESSIONID|jsessionid ProxyPassReverse/tc/ balancer://pathCluster/ ProxyPassReverseCookiePAth / / ProxyPassReverseCookieDomain/ / and now everything works again like charm :-) Tomcats can fail over and Httpds can fail over and the session is still good and valid. There is a space between the two / character above. Now off to self signing some certificates, configure the ssl.conf file and I am almost done :-) Thanks again, János On Mar 23, 2011, at 1:01 PM, André Warnier wrote: The setup with the first HTTP proxy and then the JK proxy is a bit confusing, and on this late afternoon I am not in my best guessing mode, but what I was thinking about was something like this : (Oh, and I have to add that I am not quite clear at the moment as to when Tomcat uses a cookie to return the session-id, or appends it to the URL; but anyway..) 1) the browser sends a request, with ultimate goal Tomcat 2) the request is picked up by the front-end Apache, which proxies it to the back-end Apache via HTTP, after removing the /tc/ bit of the URL. 3) the back-end Apache (maybe the same one as (2)) now examines the URL, and decides that it has to be proxied to Tomcat via JK. So it does that. 4) the back-back-end Tomcat receives the request, creates a new session, etc, and returns a response which includes a JSESSIONID cookie. Presumably, in the JSESSIONID cookie, there is a cookie domain, which says for which domain this cookie is valid. 5) the response goes back through the chain and arrives at the browser. The browser stores the cookie, associated to the cookie domain indicated in the cookie. 6) the browser now sends a second request. To retrieve the same session, it should send that JSESSIONID cookie back with the second request. But is does not, because the cookie domain does not match the server to which it is talking now (the front-end Apache). 7) so the request leaves the browser without the cookie, arrives at the front-end Apache, is proxied again twice, and arrives at Tomcat without the JSESSIONID cookie. So Tomcat thinks this request does not have a session yet, and creates a new one. In other words, somewhere in your chain of proxies, something happens to the cookie (or does not happen), which causes the cookie domain to mismatch the server to which the browser is talking. The rest is left as an exercise to the reader. Maybe you are just missing a ProxyPassReverseCookieDomain directive somewhere. (but this is all just a late-afternoon guess, remember ?) János Löbb wrote: Hi André, Her is the content of one of the workers.properties file. On the other machine the names are changed accordingly: bml0065:local administrator$ cat apache2/conf/workers.properties worker.list = lb,jkstatus worker.lb.type=lb worker.lb.balance_workers=tomcat1,tomcat3 #,tomcat2,tomcat4 worker.lb.sticky_session = True worker.lb.sticky_session_force = False worker.jkstatus.type=status worker.tomcat1.type = ajp13 worker.tomcat1.host = bml0066.yalepath.org worker.tomcat1.port = 8109 worker.tomcat1.lbfactor = 1 worker.tomcat1.redirect=tomcat3 #worker.tomcat2.type = ajp13 #worker.tomcat2.host = bml0066.yalepath.org #worker.tomcat2.port = 8209 #worker.tomcat2.lbfactor = 1 #worker.tomcat2.redirect=tomcat4 worker.tomcat3.type = ajp13 worker.tomcat3.host = bml0065.yalepath.org worker.tomcat3.port = 8309 worker.tomcat3.lbfactor = 1 worker.tomcat3.redirect=tomcat1 #worker.tomcat4.type = ajp13 #worker.tomcat4.host = bml0065.yalepath.org #worker.tomcat4.port = 8409 #worker.tomcat4.lbfactor = 1
Re: session replication question in 7.0.10
Hi Mark, This SessionExample http://bml0065.yalepath.org/tc/examples/servlets/servlet/SessionExample Sorry for the mistype I have a sticky keyboard and I try to live with it. Sorry for the comment.. Ultimately it was my fault because I left out the distributable tag from one the web.xml. Thanks for your help !! Please do not be discouraged :-) János On Mar 21, 2011, at 6:17 PM, Mark Thomas wrote: On 21/03/2011 21:34, János Löbb wrote: Hi, I have two machines MachineA and MachineB with osx 10.6.6 on them. Both machines have one tomcat 7.0.10 running. On both machine the server.xml was modified minimally: -Uncommented the Cluster tag -added jvmRoute=tomcat(x) to the Engine tag where x member of {1,3}, -changed ports: for example: Engine name=Catalina defaultHost=localhost jvmRoute=tomcat3 Cluster className=org.apache.catalina.ha.tcp.SimpleTcpCluster/ If I am reading the documentation right I should have the default configuration listed in the how-to, that is I should have the ReplicationValve working. Unfortunately session replication does not work. session variables using the SessionExample application are not carried over to restarted tomcats. What is the SessionExample application? No such application ships with Apache Tomcat. With 6.0.18 I had a ReplicationContect in server.xml. I understand that is a No-No these days, so, for the examples webapp should I create a META-INF directory with a contect.xml in it ? That is context.xml not contect.xml and there should be no need to create it. My guess is that the web application you are using is not marked as distributable/ in web.xml. I thought examples should work out of box That sort of comment isn't going to encourage folks to help you. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
reverse proxy and tomcat
Hi, I have two machines bml0065.yalepath.org and bml0066.yalepath.org. Both have OSX 10.6.6, apache 2.2.17 and mod_jk 1.2.31 installed. Tomcat is 7.0.10 on both. Apache was compiled on both machines with proxy, proxy-balancer, proxy-http and proxy-ajp enabled. The bml0065 machine is configured as a reverse proxy. The theory is, that users hit the bml0065 machine like http://bml0065.yalepath.org/tc/examples/servlets/servlet/SessionExample and using mod-proxy and mod-proxy-http it will select either bml0065 or bml0066 depending on the lbmethod configured. Then let say it selects bml0065. Then it comes to this machine as: http://bml0065.yalepath.org/examples/servlets/servlet/SessionExample From here, because there is a JkMount for examples in its httpd.conf, it connects via mod_jk to the Tomcat instance on this machine, in this case tomcat3. The problem is that as soon the reverse proxy is involved new sessions are created all the time, so session failover do not work. If I take the reverse proxy out from the picture, everything works. Here is the reverse proxy config from httpd.conf of the bml0065 machine JkLogLevel info JkMount /examples/* lb JkMount /examples/servlets/servlet/* lb JkMount /jkmanager/* jkstatus JkWorkersFile /usr/local/apache2/conf/workers.properties JkLogFile /usr/local/apache2/logs/mod_jk.log ProxyRequests Off Proxy balancer://pathCluster BalancerMember http://bml0065.yalepath.org loadfactor=10 route=tomcat3 BalancerMember http://bml0066.yalepath.org loadfactor=10 route=tomcat1 ProxySet lbmethod=bytraffic /Proxy ProxyPass /tc/ balancer://pathCluster/ stickysession=JSESSIONID|jsessionid ProxyPassReverse/tc/ balancer://pathCluster/ Location /balancer-manager SetHandler balancer-manager Order Deny,Allow Allow from .yalepath.org /Location A very similar setup worked in 2009 with Tomcat 6.0.18 and httpd 2.2.11. Here are the snippets from both machine catalina.out file snip bml0065 Mar 22, 2011 5:06:11 PM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: sessionCreated('0409F29D221545DB0BB5F62205B24471.tomcat3') Mar 22, 2011 5:06:11 PM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: attributeAdded('0409F29D221545DB0BB5F62205B24471.tomcat3', 's1', 't3') Mar 22, 2011 5:07:06 PM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: sessionCreated('DE7A014A0F1659F0B777E0DF4A2355D4.tomcat3') Mar 22, 2011 5:07:06 PM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: attributeAdded('DE7A014A0F1659F0B777E0DF4A2355D4.tomcat3', 's2', 't3') /snip snip bml0066 Mar 22, 2011 5:06:11 PM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: sessionCreated('0409F29D221545DB0BB5F62205B24471.tomcat3') Mar 22, 2011 5:06:11 PM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: attributeAdded('0409F29D221545DB0BB5F62205B24471.tomcat3', 's1', 't3') Mar 22, 2011 5:07:06 PM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: sessionCreated('DE7A014A0F1659F0B777E0DF4A2355D4.tomcat3') Mar 22, 2011 5:07:06 PM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: attributeAdded('DE7A014A0F1659F0B777E0DF4A2355D4.tomcat3', 's2', 't3') /snip Here is the last access session from the access_log: snip bml0065 10.84.2.65 - - [22/Mar/2011:17:06:11 -0400] POST /examples/servlets/servlet/SessionExample HTTP/1.1 200 1114 10.84.2.41 - - [22/Mar/2011:17:06:11 -0400] POST /tc/examples/servlets/servlet/SessionExample HTTP/1.1 200 1114 10.84.2.65 - - [22/Mar/2011:17:06:11 -0400] GET /examples/servlets/images/code.gif HTTP/1.1 304 - 10.84.2.41 - - [22/Mar/2011:17:06:11 -0400] GET /tc/examples/servlets/images/code.gif HTTP/1.1 304 - 10.84.2.65 - - [22/Mar/2011:17:06:11 -0400] GET /examples/servlets/images/return.gif HTTP/1.1 304 - 10.84.2.41 - - [22/Mar/2011:17:06:11 -0400] GET /tc/examples/servlets/images/return.gif HTTP/1.1 304 - ::1 - - [22/Mar/2011:17:06:18 -0400] OPTIONS * HTTP/1.0 200 - ::1 - - [22/Mar/2011:17:06:19 -0400] OPTIONS * HTTP/1.0 200 - 10.84.2.65 - - [22/Mar/2011:17:07:06 -0400] POST /examples/servlets/servlet/SessionExample HTTP/1.1 200 1114 10.84.2.41 - - [22/Mar/2011:17:07:06 -0400] POST /tc/examples/servlets/servlet/SessionExample HTTP/1.1 200 1114 /snip The 10.84.2.41 is my machine. In the log above looks like the hit to the reverse proxy - with the /tc/ start - inserted later than the converted url for the given balance member. There is nothing interesting in the apache error_log. What am I doing wrong ? This is a test cluster. The application developer wants to test his app's failover by pulling the ethernet plug out from the non reverse proxy when the session is on that machine. Thanks ahead, János - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For
CSRF_NONCE
Hi, On two OSX 10.6.6 machine I try to make a 4 member tomcat cluster. On MachineA tomcat3 and tomcat4, on MachineB tomcat1 and tomcat2. I use MachineA as a reverse proxy. Apache2 is 2.2.17, mod_jk is 1.2.31 and tomcat is 7.0.10 When I try to get to the manager application on one or the other balance members http://bml0066.yalepath.org:8180/manager/html http://bml0065.yalepath.org:8380/manager/html I get a 500 error nyissz HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception java.lang.IllegalArgumentException: setAttribute: Non-serializable attribute org.apache.catalina.filters.CSRF_NONCE org.apache.catalina.session.StandardSession.setAttribute(StandardSession.java:1440) org.apache.catalina.ha.session.DeltaSession.setAttribute(DeltaSession.java:626) org.apache.catalina.ha.session.DeltaSession.setAttribute(DeltaSession.java:610) org.apache.catalina.session.StandardSessionFacade.setAttribute(StandardSessionFacade.java:154) org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:173) note The full stack trace of the root cause is available in the Apache Tomcat/7.0.10 logs. nyassz Looking the apache error_log on one of the machine I see this: [Mon Mar 21 14:34:43 2011] [error] [client 10.84.2.41] File does not exist: /usr/local/httpd-2.2.17/htdocs/manager So looks like mod_jk did not do its job. However the mod_jk.log file says: [Mon Mar 21 14:13:08.016 2011] [290:140735090613408] [info] init_jk::mod_jk.c (3198): mod_jk/1.2.31 (1026297) initialized Looking into Tomcat's log - catalina.out I see this: nyissz INFO: HTMLManager: init: Associated with Deployer 'Catalina:type=Deployer,host=localhost' Mar 21, 2011 2:35:33 PM org.apache.catalina.core.ApplicationContext log INFO: HTMLManager: init: Global resources are available Mar 21, 2011 2:36:18 PM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet [HTMLManager] in context with path [/manager] threw exception java.lang.IllegalArgumentException: setAttribute: Non-serializable attribute org.apache.catalina.filters.CSRF_NONCE at org.apache.catalina.session.StandardSession.setAttribute(StandardSession.java:1440) at org.apache.catalina.ha.session.DeltaSession.setAttribute(DeltaSession.java:626) at org.apache.catalina.ha.session.DeltaSession.setAttribute(DeltaSession.java:610) at org.apache.catalina.session.StandardSessionFacade.setAttribute(StandardSessionFacade.java:154) at org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:173) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:591) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.ha.tcp.ReplicationValve.invoke(ReplicationValve.java:333) at org.apache.catalina.ha.session.JvmRouteBinderValve.invoke(JvmRouteBinderValve.java:218) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:394) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:166) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:680) Mar 21, 2011 2:47:18 PM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet [HTMLManager] in context with path [/manager] threw exception java.lang.IllegalArgumentException: setAttribute: Non-serializable attribute org.apache.catalina.filters.CSRF_NONCE at org.apache.catalina.session.StandardSession.setAttribute(StandardSession.java:1440) at org.apache.catalina.ha.session.DeltaSession.setAttribute(DeltaSession.java:626)
Re: CSRF_NONCE
On Mar 21, 2011, at 3:13 PM, Mark Thomas wrote: On 21/03/2011 19:05, János Löbb wrote: When I try to get to the manager application on one or the other balance members http://bml0066.yalepath.org:8180/manager/html http://bml0065.yalepath.org:8380/manager/html Clustering the manager application is a bad idea. It is not designed to be clustered. The main issue is that you can't control the node you are using. That the CSRF_NONCE is not serializable is a separate issue. If you raise a bug in Bugzilla, someone will take a look. Mark Mark, Ok, I moved the distributable/ tag into the examples' web.xml. Now manager/html is happy :-) Thanks a lot, János - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
session replication question in 7.0.10
Hi, I have two machines MachineA and MachineB with osx 10.6.6 on them. Both machines have one tomcat 7.0.10 running. On both machine the server.xml was modified minimally: - Uncommented the Cluster tag - added jvmRoute=tomcat(x) to the Engine tag where x member of {1,3}, - changed ports: for example: Engine name=Catalina defaultHost=localhost jvmRoute=tomcat3 Cluster className=org.apache.catalina.ha.tcp.SimpleTcpCluster/ If I am reading the documentation right I should have the default configuration listed in the how-to, that is I should have the ReplicationValve working. Unfortunately session replication does not work. session variables using the SessionExample application are not carried over to restarted tomcats. I am getting the following on one machine: nyissz Mar 21, 2011 4:39:50 PM org.apache.catalina.ha.session.DeltaManager getAllClusterSessions INFO: Manager [localhost#/examples], requesting session state from org.apache.catalina.tribes.membership.MemberImpl[tcp://{10, 84, 2, 66}:4000,{10, 84, 2, 66},4000, alive=33001, securePort=-1, UDP Port=-1, id={-43 -8 -66 47 -12 -83 72 -110 -105 -3 -61 111 -111 95 5 113 }, payload={}, command={}, domain={}, ]. This operation will timeout if no session state has been received within 60 seconds. Mar 21, 2011 4:40:50 PM org.apache.catalina.ha.session.DeltaManager waitForSendAllSessions SEVERE: Manager [localhost#/examples]: No session state send at 3/21/11 4:39 PM received, timing out after 60,103 ms. nyassz and somewhat different on the other machine at about the same time: nyissz Mar 21, 2011 4:39:49 PM org.apache.catalina.ha.session.ClusterSessionListener messageReceived WARNING: Context manager doesn't exist:localhost#/examples Mar 21, 2011 4:40:55 PM org.apache.catalina.ha.session.ClusterSessionListener messageReceived WARNING: Context manager doesn't exist:localhost#/examples Mar 21, 2011 4:40:55 PM org.apache.catalina.ha.session.ClusterSessionListener messageReceived WARNING: Context manager doesn't exist:localhost#/examples Mar 21, 2011 4:41:17 PM org.apache.catalina.ha.session.ClusterSessionListener messageReceived WARNING: Context manager doesn't exist:localhost#/examples nyassz With 6.0.18 I had a ReplicationContect in server.xml. I understand that is a No-No these days, so, for the examples webapp should I create a META-INF directory with a contect.xml in it ? I thought examples should work out of box Thanks ahead, János - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: session replication question in 7.0.10
Sorry for the noise, one of the web.xml did not have the distributable/ tag :( Now it is working fine. János On Mar 21, 2011, at 5:34 PM, János Löbb wrote: Hi, I have two machines MachineA and MachineB with osx 10.6.6 on them. Both machines have one tomcat 7.0.10 running. On both machine the server.xml was modified minimally: - Uncommented the Cluster tag - added jvmRoute=tomcat(x) to the Engine tag where x member of {1,3}, - changed ports: for example: Engine name=Catalina defaultHost=localhost jvmRoute=tomcat3 Cluster className=org.apache.catalina.ha.tcp.SimpleTcpCluster/ If I am reading the documentation right I should have the default configuration listed in the how-to, that is I should have the ReplicationValve working. Unfortunately session replication does not work. session variables using the SessionExample application are not carried over to restarted tomcats. I am getting the following on one machine: nyissz Mar 21, 2011 4:39:50 PM org.apache.catalina.ha.session.DeltaManager getAllClusterSessions INFO: Manager [localhost#/examples], requesting session state from org.apache.catalina.tribes.membership.MemberImpl[tcp://{10, 84, 2, 66}:4000,{10, 84, 2, 66},4000, alive=33001, securePort=-1, UDP Port=-1, id={-43 -8 -66 47 -12 -83 72 -110 -105 -3 -61 111 -111 95 5 113 }, payload={}, command={}, domain={}, ]. This operation will timeout if no session state has been received within 60 seconds. Mar 21, 2011 4:40:50 PM org.apache.catalina.ha.session.DeltaManager waitForSendAllSessions SEVERE: Manager [localhost#/examples]: No session state send at 3/21/11 4:39 PM received, timing out after 60,103 ms. nyassz and somewhat different on the other machine at about the same time: nyissz Mar 21, 2011 4:39:49 PM org.apache.catalina.ha.session.ClusterSessionListener messageReceived WARNING: Context manager doesn't exist:localhost#/examples Mar 21, 2011 4:40:55 PM org.apache.catalina.ha.session.ClusterSessionListener messageReceived WARNING: Context manager doesn't exist:localhost#/examples Mar 21, 2011 4:40:55 PM org.apache.catalina.ha.session.ClusterSessionListener messageReceived WARNING: Context manager doesn't exist:localhost#/examples Mar 21, 2011 4:41:17 PM org.apache.catalina.ha.session.ClusterSessionListener messageReceived WARNING: Context manager doesn't exist:localhost#/examples nyassz With 6.0.18 I had a ReplicationContect in server.xml. I understand that is a No-No these days, so, for the examples webapp should I create a META-INF directory with a contect.xml in it ? I thought examples should work out of box Thanks ahead, János - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: What is the right way to redirect http to https with tomcat 7 ?
Filip, Works like charm. Thanks a lot, János On Mar 14, 2011, at 7:29 PM, Filip Hanik - Dev Lists wrote: On 3/14/2011 3:46 PM, János Löbb wrote: Hi, I set up ssl using the JAVA_HOME/bin/keytool on OSX 10.6.6 - JSSE type configuration with a self-signed certificate. Modified server.xml to include a connector: Connector port=8443 protocol=org.apache.coyote.http11.Http11Protocol SSLEnabled=true maxThreads=150 scheme=https secure=true keystoreFile=/Users/administrator/.keystore keystorePass=* clientAuth=false sslProtocol=TLS / anything else is the default, out of box. Where should I configure and how that when I hit http://localhost:8080 it should redirect to https://localhost:8443 make sure your connector 8080 has redirectPort=8443 in it, then in tomcat.home/conf/web.xml define a constraint, transport/confidential security-constraint web-resource-collection web-resource-nameEverything is https/web-resource-name url-pattern/*/url-pattern /web-resource-collection user-data-constraint transport-guaranteeCONFIDENTIAL/transport-guarantee /user-data-constraint /security-constraint ?? That is I do not want it to be web app specific, I want to have this behavior by default. I am not using httpd or mod_jk at this time and do not want to use if I can avoid them. Should I also add SSLEngine=on ?? Thanks ahead, János P.S. I looked the list from 2008 and see nothing in this regard. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
What is the right way to redirect http to https with tomcat 7 ?
Hi, I set up ssl using the JAVA_HOME/bin/keytool on OSX 10.6.6 - JSSE type configuration with a self-signed certificate. Modified server.xml to include a connector: Connector port=8443 protocol=org.apache.coyote.http11.Http11Protocol SSLEnabled=true maxThreads=150 scheme=https secure=true keystoreFile=/Users/administrator/.keystore keystorePass=* clientAuth=false sslProtocol=TLS / anything else is the default, out of box. Where should I configure and how that when I hit http://localhost:8080 it should redirect to https://localhost:8443 ?? That is I do not want it to be web app specific, I want to have this behavior by default. I am not using httpd or mod_jk at this time and do not want to use if I can avoid them. Should I also add SSLEngine=on ?? Thanks ahead, János P.S. I looked the list from 2008 and see nothing in this regard. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
programming question
Hi, What is the very basic structure of a web application that is connected to a database through a connection pool, but would not require to restart itself or restart Tomcat when the database goes down - let say for maintenance ? Telling otherwise how to write a webapp that would survive a database recycling and would not require human interactions to make it work again. Thanks ahead, János - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: programming question
On Feb 24, 2011, at 10:58 AM, David kerber wrote: On 2/24/2011 10:49 AM, János Löbb wrote: Hi, What is the very basic structure of a web application that is connected to a database through a connection pool, but would not require to restart itself or restart Tomcat when the database goes down - let say for maintenance ? Telling otherwise how to write a webapp that would survive a database recycling and would not require human interactions to make it work again. I've never had trouble having my app reconnect after restarting the database; the tomcat db connection classes handle that transparently, AFAIK. Well, I have here programmers who are writing web applications and those are stuck if I recycle the database. Therefore I have to do a 1 hour hokusz-pokusz, shutting down Tomcat, etc... all over the place, before I can recycle the database. So I just would like to know what would be the structure or skeleton of the simplest java web app that would not die if the database is pulled underneath and would reconnect like charm after the database is back again. When I mention them that their programs should handle the situation resulting from the database bounce automagically and not the dba handling the web app or Tomcat shutdowns and restarts, they look at me like I came from Mars or Saturn :-) So, I just want to know how it is done in the real world :-) Thanks ahead, János - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Tomcat shutdown
Hi, It is Tomcat 6.0.29 on OSX 10.6.5. If I ssh to the machine and shutdown Tomcat and later boot it back again, all those components which are using AWT are not usable. However if I Apple Remote Desktop to the machine, open up Terminal there, shut down Tomcat and start it up, all AWT components will work just fine. Any good explanation ? Thanks ahead, János - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat shutdown
Hi Konstantin, I see... :-) Thanks a lot, János On Feb 1, 2011, at 11:39 AM, Konstantin Kolinko wrote: 2011/2/1 János Löbb janos.l...@yale.edu: It is Tomcat 6.0.29 on OSX 10.6.5. If I ssh to the machine and shutdown Tomcat and later boot it back again, all those components which are using AWT are not usable. However if I Apple Remote Desktop to the machine, open up Terminal there, shut down Tomcat and start it up, all AWT components will work just fine. Any good explanation ? Create $CATALINA_BASE/bin/setenv.sh with the following text CATALINA_OPTS=-Djava.awt.headless=true Google for java.awt.headless for more info, e.g. look here: http://java.sun.com/developer/technicalArticles/J2SE/Desktop/headless/ Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: ApacheCon2010NA Meetup / Connector Performance
On Oct 14, 2010, at 3:00 PM, Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 All, Is there any interest in my (finally) presenting my performance data for Tomcat connectors versus Apache httpd at the conference meetup? I'd have to repeat my tests (my data is for 6.0.20 and we're on 6.0.29, now) plus add some stuff like static data via mod_jk just for a point of comparison to see what kind of overhead mod_jk adds to the mix. That kind means a pain in my arse with about 15 days to get it done. But, if there's interest, I'll get off my butt and show some purty pitchers at the meetup. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAky3U0EACgkQ9CaO5/Lv0PABKgCfcyr0VPFBzG/fowl5uXnpVyph ZUEAn0rDK2niCUWcE4f2sTkWmVjF3l+p =pyXG -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org Chris, Can You post that also here on this list ? Thanks ahead, János - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Hello and Tomcat issues with sticky sessions
workers.properties --- ps=/ worker.list=pub-app01, pub-app02, pub-app03, pub-app04, pub-app05, pub-lb worker.pub-app01.type=ajp13 worker.pub-app01.host=app01 worker.pub-app01.port=8009 worker.pub-app01.socket_keepalive=1 worker.pub-app02.type=ajp13 worker.pub-app02.host=app02 worker.pub-app02.port=8009 worker.pub-app02.socket_keepalive=1 worker.pub-app03.type=ajp13 worker.pub-app03.host=app03 worker.pub-app03.port=8009 worker.pub-app03.socket_keepalive=1 worker.pub-app04.type=ajp13 worker.pub-app04.host=app04 worker.pub-app04.port=8009 worker.pub-app04.socket_keepalive=1 worker.pub-app05.type=ajp13 worker.pub-app05.host=app05 worker.pub-app05.port=8009 worker.pub-app05.socket_keepalive=1 worker.ajp13.lbfactor=1 worker.pub-lb.type=lb worker.pub-lb.balance_workers=pub-app01,pub-app02,pub-app03,pub-app04,pub-app05 worker.pub-lb.sticky_session=1 - I think this is what worker.list should look like: worker.list=pub-lb - You might also need for every balance_worker the worker.pub-app0x.redirect=machine_name_where_the_session_from_this_machine_should_be_redirected - For the load balance worker you might need something like: worker.pub-lb.sticky_session_force=False worker.pub-lb.sticky_session=True I am getting these from my 6.0.18 config, so they might be outdated. János - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
xalan
Hi, I see this in the catalina.out: . . May 6, 2010 4:17:30 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 17970 ms [Deprecated] Xalan: org.apache.xalan.processor.TransformerFactoryImpl Is it normal ? What should I do to avoid it ? OS is OSX 10.6.2, with a latest java Apple provides with it. Tomcat is the 6.0.26 distribution. Thanks ahead, János - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: xalan
Hi Pid, Yes, I have, only this one: mysql-connector-java-5.1.12-bin.jar This is the newest of that kind. Thanks, János On May 7, 2010, at 12:26 PM, Pid wrote: On 07/05/2010 16:18, János Löbb wrote: Hi, I see this in the catalina.out: . . May 6, 2010 4:17:30 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 17970 ms [Deprecated] Xalan: org.apache.xalan.processor.TransformerFactoryImpl Is it normal ? What should I do to avoid it ? OS is OSX 10.6.2, with a latest java Apple provides with it. Tomcat is the 6.0.26 distribution. It doesn't report this on my Mac's Tomcat installation. Do you have extra JARs in tomcat/lib? p Thanks ahead, János - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
md5
Folks, What am I doing wrong here ? bash-3.2# md5 -s apache-tomcat-6.0.26.zip MD5 (apache-tomcat-6.0.26.zip) = d0892b5662287d18c06b167c4bba249d bash-3.2# cat apache-tomcat-6.0.26.zip.md5.txt 6bf77c1c820a0e7c1a1fb6463c0a2a1d t was downloadad yesterday from the Tomcat site. Thanks ahead, János - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
md5 /enlightened/
Folks, Sorry for the previous post. In the meantime I realized the meaning of the -s flag :-) János - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Tomcat on AIX 5.3
Hi, I installed Tomcat 6.0.26 in an IBM P6 LPAR . The java version is 1.5.0 that is equivalent to Java 5. The LPAR has 12G memory and there are two databases on it, a Sybase and a MySql. Sybase takes 3 G and mysql takes 3 G, so there is still plenty for Tomcat. The idea to put Tomcat here, was, that the webapp is connecting to the Sybase database on this LPAR, so getting the data locally should be faster than getting it via the network from another machine running Tomcat. Interestingly it is not the case. When the same webapp deployed on the LPAR and on the other machine - an OSX Server 10.5.8 -, the screens on a client machine are coming much faster from the OSX server compared to the AIX LPAR. Is there anything special configuring Tomcat on AIX than on OSX ? On both machines the memory settings are the same for tomcat : CATALINA_OPTS=-server -Xms512M -Xmx1024M and on AIX the option to use the IPv4 Stack is set in JAVA_OPTS. None of the .xml files were modified in the conf directory. Thanks ahead, János - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat on AIX 5.3
Filip, What tool - java based or aix based -, can I use to see where does the time go ? /I am not a Java programmer/ I do not think it is the webapp, or tomcat, because the same configuration is fast on OSX server. DNS is working fine. Thanks ahead, János On Apr 14, 2010, at 11:28 AM, Filip Hanik - Dev Lists wrote: you'd have to figure out what takes the time. Could be anything, including a DNS timeout Filip On 04/14/2010 08:34 AM, János Löbb wrote: Hi, I installed Tomcat 6.0.26 in an IBM P6 LPAR . The java version is 1.5.0 that is equivalent to Java 5. The LPAR has 12G memory and there are two databases on it, a Sybase and a MySql. Sybase takes 3 G and mysql takes 3 G, so there is still plenty for Tomcat. The idea to put Tomcat here, was, that the webapp is connecting to the Sybase database on this LPAR, so getting the data locally should be faster than getting it via the network from another machine running Tomcat. Interestingly it is not the case. When the same webapp deployed on the LPAR and on the other machine - an OSX Server 10.5.8 -, the screens on a client machine are coming much faster from the OSX server compared to the AIX LPAR. Is there anything special configuring Tomcat on AIX than on OSX ? On both machines the memory settings are the same for tomcat : CATALINA_OPTS=-server -Xms512M -Xmx1024M and on AIX the option to use the IPv4 Stack is set in JAVA_OPTS. None of the .xml files were modified in the conf directory. Thanks ahead, János - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Secured photo rendering
On Mar 9, 2010, at 9:35 AM, David kerber wrote: Caldarale, Charles R wrote: From: André Warnier [mailto:a...@ice-sa.com] Subject: Re: Secured photo rendering But it should not, if the server sends the image with the appropriate no caching and/or expires HTTP headers. The headers don't matter, since the client has the image in hand. Browsers, for example, allow a right-click to save the image, regardless of the caching state. I've seen javascript used to prevent right-clicking to save the image, but nothing can prevent them from taking a screen shot. When I use the DVD Player from Apple, I cannot take a screenshot even if I click myself to the Finder first. So there is something already in practice that prevents from taking a screenshot :-) Now how one would set such headers easily in Tomcat for static documents, that I don't know. Filters - but it won't help. - Chuck - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
[OSX specific] Number of Mach ports
Hi, How many Mach ports can be seen as normal usage ? When I start Tomcat and it is launching the default apps the number of Mach ports is around 600 per java process. On two production servers running 2-5 additional web applications and also members of a tomcat cluster this number is 1154 and 2423. /This is the #PRTS column in top /. pathsrv1: PID COMMAND %CPU TIME #TH #PRTS #MREGS RPRVT RSHRD RSIZE VSIZE 172 java 0.0% 17:46.27 41 1154787 63M48M 86M 496M reptile: PID COMMAND %CPU TIME #TH #PRTS #MREGS RPRVT RSHRD RSIZE VSIZE 18293 java 0.0% 6:24:19 73 2423524 145M 4544K 154M 439M Should I worry ? Where can I find info about Mach port usage by Tomcat ? Thanks ahead, János - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Logging of memory / thread activity
On Jul 13, 2009, at 3:47 PM, Caldarale, Charles R wrote: From: Lucas Vickers [mailto:lucasvick...@gmail.com] Subject: Logging of memory / thread activity I have an issue where Tomcat shuts down without reason. So this is in some universe without causality? Must be quantum effects. Someone replaced Schrödinger's cat with tomcat in a gedanke experiment :) - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Windows x64 Installer
On May 29, 2009, at 7:15 PM, Markus Schönhaber wrote: János Löbb: Because the electron has resting mess, it will never go with speed of light. The info by the way is not supplied by the electron, but rather with electromagnetic waves around the wire who have no resting mess, Oh, what a mess! ;-) -- Regards mks Yeah, the electron mass at c is a mess :) - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Windows x64 Installer
On May 28, 2009, at 5:36 PM, André Warnier wrote: Caldarale, Charles R wrote: From: Mladen Turk [mailto:mt...@apache.org] Subject: Re: Windows x64 Installer You've beet me by a millisecond ;) Yeah, but that's 300 km for an electron... And please note that from the electron's point of view, it may be a lot less than a millisecond.. Because the electron has resting mess, it will never go with speed of light. The info by the way is not supplied by the electron, but rather with electromagnetic waves around the wire who have no resting mess, so for them it is instantaneous whether it is 300km or to the end of the Universe :) - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: What is the difference?
On May 14, 2009, at 4:12 PM, André Warnier wrote: I'm frustrated. For once there was a question which was right at my level, you guys all beat me to answer it. Well, just to make Your day, here is another one :) Who is the absolute thin ? Here is the answer encoded: Aki a hasaat szappanozza ees a haata habzik. Enjoy, János - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Headstart on Resolving OOM-PermGen errors on webapp reload
are there any good primers on eden, Stanislaw Lem : Eden :) - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: JK 1.2.28 - load balancer worker fails on startup with one worker down ?
On Apr 17, 2009, at 8:28 AM, André Warnier wrote: Rainer Jung wrote: [...] What remains for me is your suggestion, that the error is not a fatal one, since there are other balanced workers left. We could include such a check in the startup code, although I'm not really convinced, that your problem is a good reason for this. I'm open to more argumntation and suggestions :) Argumentation #1 against a change in logic: The OP argues that one single unresolvable balanced worker should not stop the other 4 from working, hence that the balancer should start anyway, since 80% of the capacity is still available. It sounds reasonable in principle. But what if there are only 2 balanced workers in total, of which one is unresolvable at start ? would it be normal to start with only one balanced worker available anyway ? If not, then where's the limit of acceptable ? Argumentation #2 against a change in logic: Suppose the balancer would start, with the resolved workers only. Suppose the resolving problem comes from a typo, not the fact that the given host is temporarily out of the DNS system, but a definite non-existing host. It will not be retried, so there will never be another error/warning message. The host itself may be ok and respond to pings etc.., it will just never be hit by Apache's mod_jk, so this would be a very quiet error. How is the sysadmin going to figure out that there is, basically, a problem ? Argumentation for a change in logging: It would be clearer if the error message stated explicitly that the balancer worker was not started due to a /configuration/ error, see above message(s). But then, if even I could figure it out from the existing error message, then just about everyone should be able to. And what would be the use of the likes of me, if everything was clear ? ;-) Perheps with a variable: JkQuorum This could be set between two and the number of workers under the command of the loadbalancer. If it is not set, then old behavior can be followed, or be set internally to 2 or to the tomcat instances balanced. János
Re: 15 second for redeployment is to much
3. 5-7 seconds waiting while Tomcat finds that my webapp deployed files are changed If You run quartz it can look in a shorter time if Your webapp deployed or not. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [OT] Tomcat 5.5 embedded vs Tomcat 6.0.18 embedded
On Apr 7, 2009, at 7:57 AM, André Warnier wrote: János Löbb wrote: On Apr 6, 2009, at 4:10 AM, André Warnier wrote: Caldarale, Charles R wrote: [...] The metaphysical implications of existing without a trace are rather intriguing... I am surprised that you would not have heard of stealth technology. What do they call a stealthy Tomcat ? a Raptor ? No that must be a Schrödingercat :) I am sorry, but I will have to disagree. A Schrödinger Tomcat would be one that exists multiple times, in quantum superposition. Which would probably create problems with all of them trying to listen on the same TCP ports. Unless of course the listening port only gets instantiated at the first interaction with one of the Tomcats. OK. :) How about BatCat ? It is stealthy, but still can say: Miaú :) - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Session Replication in Cluster
To stick with the analogy: Your session's baby part is: FEBA6A8127A69079C79B7A641158CE20 and that remains the same if with daddy or mommy. Your session's daddy part is: itchy and Your session's mommy part is: scratchy Enjoy them :) János On Apr 3, 2009, at 5:32 PM, Roy McMorran wrote: János Löbb wrote: If You look the values created by the session earlier with ...node1, than You will see the same values after fail over with ...node2. A new session would not know about them. To verify it You can use the supplied SessionExmaple webapp. OK, trying that. So, using an example webapp (see: https://gillnet.mdibl.org/~mcmorran/session.jsp.txt (which just uses session.getID() ) ...should it return *just* the session ID part, or the concatenation of the session ID and the jvmRoute? Here's what I see: Before failover: This is the session id FEBA6A8127A69079C79B7A641158CE20.itchy This is an existing session After failover: This is the session id FEBA6A8127A69079C79B7A641158CE20.scratchy This is an existing session Thanks, -r -- Roy McMorran Systems Administrator MDI Biological Laboratory mcmor...@mdibl.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [OT] Tomcat 5.5 embedded vs Tomcat 6.0.18 embedded
On Apr 6, 2009, at 4:10 AM, André Warnier wrote: Caldarale, Charles R wrote: [...] The metaphysical implications of existing without a trace are rather intriguing... I am surprised that you would not have heard of stealth technology. What do they call a stealthy Tomcat ? a Raptor ? No that must be a Schrödingercat :) - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Session Replication in Cluster
On Apr 3, 2009, at 3:31 PM, Roy McMorran wrote: Mark Thomas wrote: Roy McMorran wrote: Is it the expected behavior then, that the 2nd part of the session ID changes after a failover, and a new cookie is set? Yes OK, please bear with me here, I may be just showing my ignorance with respect to Tomcat and web applications in general, but... If the session ID changes from ABC123.node1 to ABC123.node2, then you will start a new session at the browser. If you are going to establish a new session anyway, why bother replicating the first part of the session ID at all? Thanks, -r -- Roy McMorran Systems Administrator MDI Biological Laboratory mcmor...@mdibl.org If You look the values created by the session earlier with ...node1, than You will see the same values after fail over with ...node2. A new session would not know about them. To verify it You can use the supplied SessionExmaple webapp. It is like passing a baby among family members and making a snapshot. As long as the baby the same everything is alright :) János - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Replicated context is failing...or not ?
On Mar 29, 2009, at 8:58 PM, Caldarale, Charles R wrote: From: János Löbb [mailto:janos.l...@yale.edu] Subject: Replicated context is failing...or not ? Mar 29, 2009 11:59:47 AM org.apache.catalina.startup.HostConfig deployDescriptor WARNING: A docBase /usr/local/apache-tomcat-6.0.18/webapps/ROOT inside the host appBase has been specified, and will be ignored The above likely doesn't have anything to do with the replication problem, but on the off chance it does, you really should fix it. Looks like you have an illegal Context element somewhere. - Chuck Hi Chuck, I am looking into it, but for the first glance I see no other contexts hanging around. I found, that on one of the machines, pathsrv1, it has the Apple packaged Tomcat, I also have the following stack trace in the log when tomcat starts up: Mar 29, 2009 11:41:46 AM org.apache.catalina.core.AprLifecycleListener init INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: .:/Library/Java/Extensions:/System/Library/Java/ Extensions:/usr/lib/java Mar 29, 2009 11:41:46 AM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-8080 Mar 29, 2009 11:41:46 AM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 1890 ms Mar 29, 2009 11:41:46 AM org.apache.catalina.core.StandardService start INFO: Starting service Catalina Mar 29, 2009 11:41:46 AM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/6.0.18 Mar 29, 2009 11:41:46 AM org.apache.catalina.ha.tcp.SimpleTcpCluster start INFO: Cluster is about to start Mar 29, 2009 11:41:46 AM org.apache.catalina.tribes.transport.ReceiverBase bind INFO: Receiver Server Socket bound to:/10.48.106.107:4000 Mar 29, 2009 11:41:46 AM org.apache.catalina.tribes.membership.McastServiceImpl setupSocket INFO: Setting cluster mcast soTimeout to 500 Mar 29, 2009 11:41:46 AM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Sleeping for 1000 milliseconds to establish cluster membership, start level:4 Mar 29, 2009 11:41:46 AM org.apache.catalina.ha.tcp.SimpleTcpCluster memberAdded INFO: Replication member added:org.apache.catalina.tribes.membership.MemberImpl[tcp://{10, 48, 106, 44}:4000,{10, 48, 106, 44},4000, alive=4214446187,id={123 32 103 -62 110 51 77 58 -113 -57 43 -80 4 -20 -26 -108 }, payload={}, command={}, domain={}, ] Mar 29, 2009 11:41:46 AM org.apache.catalina.ha.tcp.SimpleTcpCluster memberAdded INFO: Replication member added:org.apache.catalina.tribes.membership.MemberImpl[tcp://{10, 48, 106, 101}:4000,{10, 48, 106, 101},4000, alive=16204423,id={124 -97 -40 -51 -99 -126 69 -73 -80 74 110 -9 80 -74 64 86 }, payload={}, command={}, domain={}, ] Mar 29, 2009 11:41:47 AM org.apache.catalina.tribes.transport.nio.NioReceiver listen SEVERE: Unable to process request in NioReceiver java.net.SocketException: Invalid argument at sun.nio.ch.Net.setIntOption0(Native Method) at sun.nio.ch.Net.setIntOption(Net.java:152) at sun.nio.ch.SocketChannelImpl$1.setInt(SocketChannelImpl.java:372) at sun.nio.ch.SocketOptsImpl.setInt(SocketOptsImpl.java:46) at sun.nio.ch.SocketOptsImpl$IP.typeOfService(SocketOptsImpl.java:249) at sun.nio.ch.OptionAdaptor.setTrafficClass(OptionAdaptor.java:158) at sun.nio.ch.SocketAdaptor.setTrafficClass(SocketAdaptor.java:330) at org .apache .catalina.tribes.transport.nio.NioReceiver.listen(NioReceiver.java:273) at org .apache.catalina.tribes.transport.nio.NioReceiver.run(NioReceiver.java: 353) at java.lang.Thread.run(Thread.java:613) Mar 29, 2009 11:41:47 AM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Done sleeping, membership established, start level:4 I realized that I had a mispell for jvmRoute in the server.xml of reptile, where jvmRoute=reptile1 instead of jvmRoute=reptile. This will be remedied tonight. Reptile is the machine to whom pathsrv1 should fail over, so it is possible that it was also the problem with the replicated context stack trace. The real workers in the workers.properties file are pathsrv1, raid2b and reptile. Thanks ahead, János - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Replicated context is failing...or not ?
Hi, 3 machines, - pathsrv1, raid2b, reptile - Macs with OSX 10.5.6. Apache 2.2.9 mod_jk 1.2.26 and Tomcat 6.0.18. Every machine has one Tomcat instance and they form a cluster. Pathsrv1 act as a reverse proxy, so the request for the only clustered web app is coming as: http://pathsrv1.yalepath.org/apps/CassetteLabeler. The application works fine. It seemingly also fails over. The session is replicated. However et every startup I see this in the catalina.date.log: snip Mar 29, 2009 11:59:44 AM org.apache.catalina.core.AprLifecycleListener init INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: .:/Library/Java/Extensions:/System/Library/Java/ Extensions:/usr/lib/java Mar 29, 2009 11:59:44 AM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-8080 Mar 29, 2009 11:59:44 AM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 427 ms Mar 29, 2009 11:59:44 AM org.apache.catalina.core.StandardService start INFO: Starting service Catalina Mar 29, 2009 11:59:44 AM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/6.0.18 Mar 29, 2009 11:59:44 AM org.apache.catalina.ha.tcp.SimpleTcpCluster start INFO: Cluster is about to start Mar 29, 2009 11:59:44 AM org.apache.catalina.tribes.transport.ReceiverBase bind INFO: Receiver Server Socket bound to:/10.48.106.101:4000 Mar 29, 2009 11:59:44 AM org.apache.catalina.tribes.membership.McastServiceImpl setupSocket INFO: Setting cluster mcast soTimeout to 500 Mar 29, 2009 11:59:44 AM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Sleeping for 1000 milliseconds to establish cluster membership, start level:4 Mar 29, 2009 11:59:45 AM org.apache.catalina.ha.tcp.SimpleTcpCluster memberAdded INFO: Replication member added:org.apache.catalina.tribes.membership.MemberImpl[tcp://{10, 48, 106, 44}:4000,{10, 48, 106, 44},4000, alive=635579,id={52 -41 110 -92 62 -31 69 -107 -125 23 -35 74 71 -34 83 -68 }, payload={}, command={}, domain={}, ] Mar 29, 2009 11:59:45 AM org.apache.catalina.ha.tcp.SimpleTcpCluster memberAdded INFO: Replication member added:org.apache.catalina.tribes.membership.MemberImpl[tcp://{10, 48, 106, 107}:4000,{10, 48, 106, 107},4000, alive=1078841,id={17 -73 -19 -61 -104 103 73 -81 -117 69 58 -59 78 -1 -56 -41 }, payload={}, command={}, domain={}, ] Mar 29, 2009 11:59:45 AM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Done sleeping, membership established, start level:4 Mar 29, 2009 11:59:45 AM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Sleeping for 1000 milliseconds to establish cluster membership, start level:8 Mar 29, 2009 11:59:45 AM org.apache.catalina.tribes.io.BufferPool getBufferPool INFO: Created a buffer pool with max size:104857600 bytes of type:org.apache.catalina.tribes.io.BufferPool15Impl Mar 29, 2009 11:59:46 AM org.apache.catalina.tribes.membership.McastServiceImpl waitForMembers INFO: Done sleeping, membership established, start level:8 Mar 29, 2009 11:59:47 AM org.apache.catalina.startup.HostConfig deployDescriptor WARNING: A docBase /usr/local/apache-tomcat-6.0.18/webapps/ROOT inside the host appBase has been specified, and will be ignored Mar 29, 2009 11:59:47 AM org.apache.catalina.ha.context.ReplicatedContext start SEVERE: Unable to start ReplicatedContext java.lang.NullPointerException at java.io.File.init(File.java:194) at org .apache.catalina.core.StandardContext.getBasePath(StandardContext.java: 4784) at org .apache .catalina.ha.context.ReplicatedContext.start(ReplicatedContext.java:62) at org .apache .catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java: 771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java: 525) at org .apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java: 627) at org .apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java: 553) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java: 488) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java: 311) at org .apache .catalina .util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java: 1053) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java: 1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java: 443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at
Re: reversed proxy stopped working with tomcat cluster
Hi Rainer, Well, I did make some bloody operation by eliminating the VmWare machine as the reverse proxy on my Mac. /Following Chris advise. :)/ Because apache2 on my Mac was not compiled with --enable-proxy, etc, I downloaded the version 2.2.11 and compiled it with the three proxy enablers /--enable-proxy, --enable-proxy-balancer, and --enable-proxy- http/. I copied the reverse proxy config part and the JkMount directives from the VmWare virtual machine into the httpd.conf file on the Mac. Now I have two machines: - A PC with Windows 2000 and a Mac with OSX 10.5.6. The PC has apache2 + mod_jk + tomcat (1 instance). - A Mac that has apache2 + mod_jk + tomcat (3 instances). The Mac also acts as a reverse proxy. Fired up the newly compiled apache2 on the Mac and now everything works like charm. It is failing over nicely when I stop the selected tomcat node. I still have to test the fail over when I stop apache on the PC in the middle of a session. I changed two things: 1. moved the reverse proxy configuration off from the Windows Xp inside the VmWare Fussion machine on the Mac, so the Mac itself became the reverse proxy. Nothing was done to the tomcats or to the apache2 on the PC, not even stopping them. 2. On the Mac I installed a newer version of apache2. /2.2.11 compared to 2.2.9/ My guess is the VmWare update and the WinXp update on the virtual machine from December changed somehow the security settings that did not allow the information to flow back to the reverse proxy. Of course, I am not sure about it. :) Theoretically it should have worked without any problems. If I have time I will install a 2.2.11 apache2 on the XP and move back to it the reverse proxy configuration from the Mac, to see if that helps or not. Thanks ahead, János On Mar 25, 2009, at 6:49 PM, Rainer Jung wrote: On 20.03.2009 18:48, János Löbb wrote: Hi, I have two real machines. One of them is a Windows XP running Apache 2.2.10 + mod_jk /release date of 10/30/2008/ + Tomcat 6.0.16. The other one is a Mac with OSX 10.5.6 with Apache 2.2.9 + mod_jk 1.2.26 and Tomcat 6.0.16. The XP machine runs one instance of Tomcat /node4/. The Mac runs 3, - node1,2,3. Altogether 4 tomcats and they form a cluster. ... In front of these two machines is an Apache 2.2.10 in a VMWare Fusion virtual Machine on Windows XP in the Mac and configured as a Reverse proxy Here is the reverse proxy config from the httpd.conf snip ProxyRequests Off Proxy balancer://pathCluster BalancerMember http://bml0039.yalepath.org loadfactor=10 BalancerMember http://bml0073.yalepath.org loadfactor=10 ProxySet lbmethod=bytraffic /Proxy ProxyPass /tc/ balancer://pathCluster/ ProxyPassReverse /tc/ balancer://pathCluster/ Location /balancer-manager SetHandler balancer-manager Order Deny,Allow Allow from .yalepath.org /Location /snip Here is the access_log from the reverse proxy: snip 10.84.2.195 - - [20/Mar/2009:12:09:48 -0400] GET /tc/CassetteLabeler HTTP/1.1 302 - Returns with a trailing slash redirect 10.84.2.195 - - [20/Mar/2009:12:09:49 -0400] GET /tc/ CassetteLabeler/ HTTP/1.1 200 1506 Returns Content with 1506 Bytes 10.84.2.195 - - [20/Mar/2009:12:09:49 -0400] GET /CassetteLabeler/pathology.labeler.labeler.Labeler/Labeler.html HTTP/1.1 404 260 Wrong request, Prefix /tc/ missing. You need to find out, where this request comes from. Likely it is either generated by someone using a link in the page returned by the previous request, or that page contains a meta tag in the head, which triggers a redirect to this wrong URL. So retrieve /tc/CassetteLabeler/ and have a look at the content to identify, whether the wrong URL /CassetteLabeler/ pathology.labeler.labeler.Labeler/Labeler.html is in the page. If no, we have to think further. If yes, you have to ask, why is this wrong URL in there. The question is, how your application generates this URL. If it generates absolute URLs instead of relative ones, then you can easily run into trouble, when the path of the real application is different from the path used from the outside. It is not unlikely though, that in such a case the app or the framework used has a configurable path prefix. But first check, if you can verify the wrong URL is somewhere in the content of the page. The request from the reverse proxy did go to the XP machine: Here are the log entries from the access log: snip 10.84.2.195 - - [20/Mar/2009:12:09:49 -0400] GET /CassetteLabeler HTTP/1.1 302 - That's only the first request, answered with the trailing slash redirect. The next request is the interesting one (the one answered with status 200). It also has to appear somewhere in your 2nd laqyer httpd logs. Here are the entries from mod_jk.log of this XP machine: snip [Fri Mar 20 12:09:49.254 2009] [852:1808] [debug] jk_uri_worker_map.c (682): Attempting to map URI '/CassetteLabeler' from 5 maps Again that's
Re: reversed proxy stopped working with tomcat cluster
Hi Chris, In our production environment we have 3 Xserves, all running apache2 , mod+jk and Tomcat. There are about 5-6 web applications running on these 3 servers standalone, -non-clustered - and there will be more. The there Xserves are doing other things too, not just web serving. That is the reason I cannot reduce the number of apache2 instances. They grandfathered in themselves :) This CassetteLabeler app is our first application that needs to be up all the time and that is why we turned to clustering, using the existing setups on these servers and hoping that just by small config changes here and there we can get our clustered app runing without worrying about the non-clustered apps. You know, the goat has to have a full stomach and the cabbage had to remain too :) . Not to destroy accidently anything in the production environment, I created a small test environment, simulating our production environment. Because I do not have 3 machines, I used the VmWare Fussion on my Mac with Windows XP to create the third machine, and to simplify things I do not run mod_jk and Tomcat on it just Apache2. The four Tomcats are forming a Tomcat Cluster. Because the individual Apaches have to communicate to their own Tomcats via their own mod_jk for the non-clustered webapps /non-clustered because they cannot be serialized/ to reach those apps, the users connect via: http://balancemember1.yalepath.org/Standalone1 kind of URL and it goes through port 80 to mod_jk and mod_jk passes it via ajp to to the appropriate tomcat. We need to preserve this behavior for the clustered app, that is why in the reversed proxy configuration the default port 80 is used. I do not think that I can changed that one. The reason for the reverse proxy is, that two of the machines in production are behind a Pix firewall and the users of the clustered app can get to it by hitting the reverse proxy. So in theory a user would hit a url like: http://reverse_proxy.yalepath.org/tc/CassetteLabeler The reverse proxy using mod_proxy, mod_proxy_balancer, mod_proxy_http would transfer it to one of the balancemembers via port 80 by the selected lbmethod. It would arrive there as: http://balancememberX.yalepath.org/CassetteLabeler The selected balance member seeing that there is a JkMount for that request would involve mod_jk and mod_jk would forward it via the ajp connector to one of the selected tomcats from the cluster. /Or that is how I imagine it :)/ Looks like the initial request is received by the reverse proxy. It selects a balance member and sends the request to it correctly, that is stripping off the /tc. Tha balancemember involves mod_jk and mod_jk forwards it to one of the clustered tomcats. Looking the debug info tomcat is doing its job and even asks for the body and receives it. Then tomcat is closing the connection to the balance member. That is where things get out of control. Then the selected balance member instead of continue with the earlier selected tomcat instance - although stickiness is specified - selects another tomcat node and sends the SAME info to it. This second tomcat does exactly as the first one did and it closes the connection. At that point the balancemember /or the reverse proxy/ sends the non-formated URL from the reverse proxy to the Apache of the second tomcat node and of course that cannot be resolved so I get a 404 error. So, I am looking why stickiness is not working, why the selected balancemember is not satisfied with the firstly selected tomcat node and just finishing the whole session with it, so the right info can flow back on the chain to the clients browser and paint the first form of the web app. Now I configured stickyness even in ProxyPass on the reverse proxy, but no cigar. ProxyRequests Off Proxy balancer://pathCluster BalancerMember http://bml0039.yalepath.org loadfactor=10 BalancerMember http://bml0073.yalepath.org loadfactor=10 ProxySet lbmethod=bytraffic /Proxy ProxyPass /tc/balancer://pathCluster/ stickysession=JSESSIONID ProxyPassReverse/tc/balancer://pathCluster/ #ProxyHTMLLogVerbose On Location /balancer-manager SetHandler balancer-manager Order Deny,Allow Allow from .yalepath.org /Location I would like to emphasize that when I request the web app from the individual balance members using of course port 80, like: http://balancemember1.yalepath.org/CassetteLabeler or http://balancemember2.yalepath.org/Cassettelabeler , everything is working right. The problem is somewhere as the info is flowing back in the chain to the reverse proxy. Thanks ahead, János On Mar 25, 2009, at 9:33 AM, Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 János, On 3/20/2009 1:48 PM, János Löbb wrote: Connector port=8280 protocol=HTTP/1.1
reversed proxy stopped working with tomcat cluster
Hi, I have two real machines. One of them is a Windows XP running Apache 2.2.10 + mod_jk /release date of 10/30/2008/ + Tomcat 6.0.16. The other one is a Mac with OSX 10.5.6 with Apache 2.2.9 + mod_jk 1.2.26 and Tomcat 6.0.16. The XP machine runs one instance of Tomcat /node4/. The Mac runs 3, - node1,2,3. Altogether 4 tomcats and they form a cluster. Here is one server .xml from node3. snip ?xml version='1.0' encoding='utf-8'? Server port=8205 shutdown=SHUTDOWN Listener className=org.apache.catalina.core.AprLifecycleListener SSLEngine=on / Listener className=org.apache.catalina.core.JasperListener / Listener className=org.apache.catalina.mbeans.ServerLifecycleListener / Listener className =org.apache.catalina.mbeans.GlobalResourcesLifecycleListener / GlobalNamingResources Resource name=UserDatabase auth=Container type=org.apache.catalina.UserDatabase description=User database that can be updated and saved factory=org.apache.catalina.users.MemoryUserDatabaseFactory pathname=conf/tomcat-users.xml / /GlobalNamingResources Service name=Catalina Connector port=8280 protocol=HTTP/1.1 connectionTimeout=2 redirectPort=8643 / Connector port=8209 protocol=AJP/1.3 redirectPort=8643 / Engine name=Catalina defaultHost=localhost jvmRoute=node3 Cluster className=org.apache.catalina.ha.tcp.SimpleTcpCluster/ Realm className=org.apache.catalina.realm.UserDatabaseRealm resourceName=UserDatabase/ Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false /Host /Engine /Service /Server snip In front of these two machines is an Apache 2.2.10 in a VMWare Fusion virtual Machine on Windows XP in the Mac and configured as a Reverse proxy Here is the reverse proxy config from the httpd.conf snip ProxyRequests Off Proxy balancer://pathCluster BalancerMember http://bml0039.yalepath.org loadfactor=10 BalancerMember http://bml0073.yalepath.org loadfactor=10 ProxySet lbmethod=bytraffic /Proxy ProxyPass /tc/balancer://pathCluster/ ProxyPassReverse/tc/balancer://pathCluster/ Location /balancer-manager SetHandler balancer-manager Order Deny,Allow Allow from .yalepath.org /Location /snip Here is the workers.property file: snip bml0073:local janos$ cat apache2/conf/workers.properties worker.list = lb,jkstatus worker.lb.type=lb worker.lb.balance_workers=node1,node2,node3,node4 worker.lb.sticky_session = True worker.lb.sticky_session_force = False worker.jkstatus.type=status worker.node1.type = ajp13 worker.node1.host = localhost worker.node1.port = 8009 worker.node1.lbfactor = 1 worker.node1.redirect=node2 worker.node2.type = ajp13 worker.node2.host = localhost worker.node2.port = 8109 worker.node2.lbfactor = 1 worker.node2.redirect=node3 worker.node3.type = ajp13 worker.node3.host = localhost worker.node3.port = 8209 worker.node3.lbfactor = 1 worker.node3.redirect=node4 worker.node4.type = ajp13 worker.node4.host = bml0039.yalepath.org worker.node4.port = 8309 worker.node4.lbfactor = 1 worker.node4.redirect=node1 /snip Similar workers.properies on the XP machine but the hosts are logically different Well, this setup worked in December. The only change I made is that the sticky parameters now assigned to the loadbalancing worker 'lb' and not to the individual real workers. /Thanks to pointing that out :) / There were some updates to the Mac OS and also to the VmWare Fussion. I fired up this cluster yesterday and I realized it does not work anymore. Here is the access_log from the reverse proxy: snip 10.84.2.195 - - [20/Mar/2009:12:09:48 -0400] GET /tc/CassetteLabeler HTTP/1.1 302 - 10.84.2.195 - - [20/Mar/2009:12:09:49 -0400] GET /tc/CassetteLabeler/ HTTP/1.1 200 1506 10.84.2.195 - - [20/Mar/2009:12:09:49 -0400] GET /CassetteLabeler/ pathology.labeler.labeler.Labeler/Labeler.html HTTP/1.1 404 260 /snip here are the entries from the error log: snip [Fri Mar 20 12:08:30 2009] [notice] Apache/2.2.10 (Win32) configured -- resuming normal operations [Fri Mar 20 12:08:30 2009] [notice] Server built: Oct 10 2008 12:39:04 [Fri Mar 20 12:08:31 2009] [notice] Parent: Created child process 2564 [Fri Mar 20 12:08:31 2009] [notice] Child 2564: Child process is running [Fri Mar 20 12:08:31 2009] [notice] Child 2564: Acquired the start mutex. [Fri Mar 20 12:08:31 2009] [notice] Child 2564: Starting 64 worker threads. [Fri Mar 20 12:08:31 2009] [notice] Child 2564: Starting thread to listen on port 80. [Fri Mar 20 12:09:32 2009] [error] [client 10.84.2.195] File does not exist: C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/ favicon.ico [Fri Mar 20 12:09:35 2009] [error] [client 10.84.2.195] File does not exist: C:/Program
DeadlockDetector
Hi, One of our programmer tries to deploy an application on Tomcat 6.0.18 and the deploying process times out. There is a part when the app connects to a mysql database and looks like that is the point where the subject matter appears. When the app is run from IntelliJ there are no problems !! The machine is an OS X 10.5.2 or better machine. The symptom is that the deployment process looks like stuck, and when I look the processes with top it shows 23456 ports in use by the java process. After shutdown of tomcat there is lingering java processes remaining, one or two, that I have to kill manually. Here is the whole log for the deployment from catalina.out. Mar 12, 2009 12:39:37 PM org.apache.catalina.startup.HostConfig deployWAR INFO: Deploying web application archive Aquamine.war Mar 12, 2009 12:39:39 PM org.apache.catalina.loader.WebappClassLoader validateJarFile INFO: validateJarFile(/usr/local/apache-tomcat-6.0.18/webapps/Aquamine/ WEB-INF/lib/javaee.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class Mar 12, 2009 12:39:39 PM org.apache.catalina.loader.WebappClassLoader validateJarFile INFO: validateJarFile(/usr/local/apache-tomcat-6.0.18/webapps/Aquamine/ WEB-INF/lib/servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class - Root WebApplicationContext: initialization started - JDK 1.4+ collections available - Commons Collections 3.x available - Loading XML bean definitions from ServletContext resource [/WEB-INF/ applicationContext.xml] - Bean factory for application context [Root WebApplicationContext]: org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [sessionFactory ,sessionFactoryCaDR ,sessionFactoryCoPath ,transactionManager ,hibernateTemplate ,hibernateTemplateCaDR ,hibernateTemplateCoPath ,org .springframework .aop .framework .autoproxy .DefaultAdvisorAutoProxyCreator ,org .springframework .transaction .interceptor .TransactionAttributeSourceAdvisor ,transactionInterceptor ,dataSource ,AppUser2 ,AppUserService2 ,ArrayAssay ,ArrayAssayService ,AssayType ,AssayTypeService ,ArrayMap ,ArrayMapService ,ArraySlide ,ArraySlideService ,ArrayUser ,ArrayUserService ,Block ,BlockService ,ClinicalCase ,ClinicalCaseService ,ClinicalAttribute ,ClinicalAttributeService ,ClinicalAttributeSet ,ClinicalAttributeSetService ,ClinicalElement ,ClinicalElementService ,Core ,CoreService ,CoreType ,CoreTypeService ,Diagnosis ,DiagnosisService ,ExportFormat ,ExportFormatService ,ExportFormatDetail ,ExportFormatDetailService ,ExportType ,ExportTypeService ,ImportFormat ,ImportFormatService ,ImportFormatDetail ,ImportFormatDetailService ,ImportType ,ImportTypeService ,Institution ,InstitutionService ,InstitutionDept ,InstitutionDeptService ,Location ,LocationService ,Patient ,PatientService ,Permission ,PermissionService ,AppUserPermission ,AppUserPermissionService ,AppUserTissueArrayPermission ,AppUserTissueArrayPermissionService ,AppUserArrayMapPermission ,AppUserArrayMapPermissionService ,AppUserAssayPermission ,AppUserAssayPermissionService ,Race ,RaceService ,ScoreAttribute ,ScoreAttributeService ,ScoreElement ,ScoreElementService ,ScoreType ,ScoreTypeService ,Sex ,SexService ,Specimen ,SpecimenService ,Spot ,SpotService ,StageAtDiagnosis ,StageAtDiagnosisService ,Target ,TargetService ,TissueArray ,TissueArrayService ,TissueSource ,TissueSourceService ,TissueType ,TissueTypeService ,LookupService ,ClinicalExportModel ,DataExportService ,CaseScoreMapperService ,MapPositionMapperService ,ClinicalExtensionService ,UserTypeService,GroupUserService,UserSessionService]; root of BeanFactory hierarchy - 102 beans defined in application context [Root WebApplicationContext] - CGLIB2 available: proxyTargetClass feature enabled - Hibernate Annotations 3.2.0.GA - Hibernate 3.2.1 - hibernate.properties not found - Bytecode provider name : cglib - using JDK 1.4 java.sql.Timestamp handling - configuring from url: jar:file:/usr/local/apache-tomcat-6.0.18/ webapps/Aquamine/WEB-INF/lib/cruella-core.jar!/hibernate.cfg.xml - Configured SessionFactory: null - Building new Hibernate SessionFactory - Binding entity from annotated class: edu.yale.ytma.entity.AppUser2 - Bind entity edu.yale.ytma.entity.AppUser2 on table app_user2 - Binding entity from annotated class: edu.yale.ytma.entity.AppUserPermission - Bind entity edu.yale.ytma.entity.AppUserPermission on table appuser_permission - Binding entity from annotated class: edu.yale.ytma.entity.AppUserTissueArrayPermission - Bind entity edu.yale.ytma.entity.AppUserTissueArrayPermission on table appuser_tissuearray_permission - Binding entity from annotated class: edu.yale.ytma.entity.AppUserArrayMapPermission - Bind entity edu.yale.ytma.entity.AppUserArrayMapPermission on table
Re: mod_jk not working as expected - is there a bug??
I am not sure the stickiness should be attached to the tc worker. I would rather do it for the the real workers level, that is at appfe[1234]. Consider also worker.appfe[1234].sticky_session_force = False for each appfe[1234] worker. János On Feb 24, 2009, at 8:47 PM, Mohit Anchlia wrote: In httpd conf I just see JkMount and no other directive. I searched for Jk. Here is workers.properties file: ## worker.list=status,tc ## Worker Configuration## # All entries in this section take the form: # worker.workername.directive=value # Worker names are defined in the worker.list directive above. # Configuration specifying the worker named status as a status worker. # This worker can be used to administer the other configured workers. worker.status.type=status # Configuration for the default load balancer worker. # Uncomment the configuration for the tc # worker, and the two node workers below to enable. # Also add lb to the workers.list directive # above. The default for the load balancer worker is # round-robin distribution of requests over # all active nodes. There are currently two nodes set # up for the load balanced worker, add more # to this list if required. Sticky sessions is defaulted to true. worker.tc.type=lb worker.tc.balance_workers=appfe1,appfe2,appfe3,appfe4 worker.tc.sticky_session=true # Two load balanced workers, called node1 and node2. # Copy the configurations and add to the # worker.tc.balanced_workers # list above to add more nodes to the Tomcat cluster. # appfe1 worker.appfe1.type=ajp13 worker.appfe1.port=8009 worker.appfe1.host=appfe1 worker.appfe1.socket_timeout=5 worker.appfe1.socket_keepalive=true worker.appfe1.prepost_timeout=5 worker.appfe1.connect_timeout=5000 worker.appfe1.retries=3 worker.appfe1.recycle_timeout=900 # Refererence BHP Apache tuning guide before uncomment the following line. The unit of reply_timeout is millisecond. #worker.appfe1.reply_timeout=0 # appfe2 worker.appfe2.type=ajp13 worker.appfe2.port=8009 worker.appfe2.host=appfe2 worker.appfe2.socket_timeout=5 worker.appfe2.socket_keepalive=true worker.appfe2.prepost_timeout=5 worker.appfe2.connect_timeout=5000 worker.appfe2.retries=3 worker.appfe2.recycle_timeout=900 # Refererence BHP Apache tuning guide before uncomment the following line. The unit of reply_timeout is millisecond. #worker.appfe2.reply_timeout=0 # appfe3 worker.appfe3.type=ajp13 worker.appfe3.port=8009 worker.appfe3.host=appfe3 worker.appfe3.socket_timeout=5 worker.appfe3.socket_keepalive=true worker.appfe3.prepost_timeout=5 worker.appfe3.connect_timeout=5000 worker.appfe3.retries=3 worker.appfe3.recycle_timeout=900 # Refererence BHP Apache tuning guide before uncomment the following line. The unit of reply_timeout is millisecond. #worker.appfe3.reply_timeout=0 # appfe4 worker.appfe4.type=ajp13 worker.appfe4.port=8009 worker.appfe4.host=appfe4 worker.appfe4.socket_timeout=5 worker.appfe4.socket_keepalive=true worker.appfe4.prepost_timeout=5 worker.appfe4.connect_timeout=5000 worker.appfe4.retries=3 worker.appfe4.recycle_timeout=900 # Refererence BHP Apache tuning guide before uncomment the following line. The unit of reply_timeout is millisecond. #worker.appfe4.reply_timeout=0 On Tue, Feb 24, 2009 at 4:50 PM, Rainer Jung rainer.j...@kippdata.de wrote: On 25.02.2009 00:00, Mohit Anchlia wrote: Reposting: Apache Server - 2.2 Tomcat server 6 Jboss - 4.2 We have Web Servers talking to Jboss App Servers over mod_jk. When we do our patch or upgrade of software we do it in rolling fashion so that there is 0 customer impact. But it looks like mod_jk load balancer on Web server doesn't detect it as soon as Jboss App Server goes down. Our goal is to have 0 customer impact. So my question is what can we do to overcome this problem. Web Server sees Http Error Code 503. Information from log file: [Mon Feb 23 13:39:42.146 2009] [31682:4143745888] [error] ajp_connection_tcp_get_message::jk_ajp_common.c (966): (appfe4) can't receive the response message from tomcat, network problems or tomcat (10.10.81.89:8009) is down (errno=104) [Mon Feb 23 13:39:42.147 2009] [31682:4143745888] [error] ajp_service::jk_ajp_common.c (2097): (appfe4) Connecting to tomcat failed. Tomcat is probably not started or is listening on the wrong port This means that mod_jk detected that your backend is down and thus puts it into an error state. All following requests will no longer be sent to this backend. Once a minute it will send a request there and try, but as long as it is down this test will not succeed and thus all requests will be sent to other nodes. The first request that gets sent to the backend you stopped might get an error back. If you want to prevent that from happening, use Cping/ Cpong: http://tomcat.apache.org/connectors-doc/generic_howto/timeouts.html so we will detect the broken node before actually sending a request there. More details are not possible to give without your JK
Re: very slow class loading on initial JSP/servlet request after restart
On Feb 24, 2009, at 3:57 PM, Juha Laiho wrote: So, looks like I'm late to the party, but will crash in nonetheless. Sam Hokin wrote: Christopher Schultz wrote: On 2/19/2009 6:23 PM, Sam Hokin wrote: The problem, which spontaneously appeared a few days before Christmas on this one server, is that the initial request of a JSP or servlet takes AGES to respond, usually exceeding several minutes. Well, I have used a number of diagnostics, like jconsole, jstat and jhat, but haven't been able to glean anything informative from them about my issue. I've run the -Xloggc JVM option, and watched it garbage collect, again not informing me of anything. Yes, if I could figure out what the JVM is actually DOING doing the long wait, I'd hopefully be able to deal with it, but I honestly haven't been able to figure out how to do that. What do you suggest? I'll cast my hat into the ring: I suspect you're loading a resource that wants to looking an external resource (like an XML file with a remote DTD/Schema and validation is on in the parser) and the DNS is tripping you up. No, there are no external references in my Java package. It's all just local class files. Still it sounds like a network (DNS) issue, but it does not pay to just argue, more information is needed. One tool that I haven't yet seen suggested is 'strace', the Linux system call tracer. This will show all the calls your application makes to the operating system. As you say the application is mostly idle during the delay, it is, in one way or another, waiting for some OS service to complete. 'strace' should provide you with timestamped information on what OS services were called, with which arguments, and how long did it take for them to return with results. 'strace' will leave you with a huge file (or a set of huge files, depending on the options you use), and going through them will take some time - but you'll most likely also find what causes the delay. If you decide to go this way, trim down your application to the minimum where you can still see the delay; with this you hopefully can get at least some reduction to the amount of log data written. Even though it is possible to temporarily attach strace to a running process (like the Tomcat at the moment when it is hung), I'd recommend starting the tomcat under truss (with -f or -ff to make it also trace new processes created), because this way it is easier to trace back the file descriptor numbers accessed. -- ..Juha It could be other network issue, like having IP6 enabled on the machine connected to an IP4 network, or an inefficient routing of network traffic for that particular machine. Sounds like it is timing out on some network task. János - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: very slow class loading on initial JSP/servlet request after restart
On Feb 24, 2009, at 4:16 PM, Sam Hokin wrote: Juha Laiho wrote: One tool that I haven't yet seen suggested is 'strace', the Linux system call tracer. This will show all the calls your application makes to the operating system. As you say the application is mostly idle during the delay, it is, in one way or another, waiting for some OS service to complete. 'strace' should provide you with timestamped information on what OS services were called, with which arguments, and how long did it take for them to return with results. 'strace' will leave you with a huge file (or a set of huge files, depending on the options you use), and going through them will take some time - but you'll most likely also find what causes the delay. Thanks, Juha. Actually Pieter suggested it a little while ago, and I've been trying to get some information out of strace. The best I can do is to put strace in front of the java command that's inside catalina.sh. That's the command that shows with ps -ef when Tomcat is running. BUT, I get nothing out of strace when I make page requests on a site, it just shows output during Tomcat startup. So, I've not figured out how to get strace to say what the JVM is during the delay. jstack has led us to a stalled File.exists() in one case, but we don't know what file it's looking for. And I'm not convinced that File.exists() is the only method that's stalling. Since this problem exists only on a production server, a server on which I must still serve at least two customer sites (due to DNS issues) in addition to our own and any others I put on there, I'm a bit restricted in terms of how much I can muck with it (not that I haven't brought those live sites down for awkward periods of time with the diagnosis I've attempted so far). I wish I had a test environment on another server that replicates this issue, but my other two servers run Tomcat perfectly fast, and since I don't understand what's causing the problem, I cannot make one of my other servers reproduce it. Another diagnostic problem is that undeploying a context with the Tomcat /manager app, and then starting it again, does NOT reset this problem - the response to a JSP request is immediate (provided it had been requested since the last Tomcat startup). This problem is only reset on a given JSP if I restart Tomcat entirely; I can reproduce it by creating fresh JSPs with new names and requesting them. But, clearly, the key diagnostic issue is finding out WHAT is going on during the delay that a JSP incurs when it is first requested of a given Tomcat instance. I've not been able to find out from strace. I'll give truss -f and truss -ff a try. How about just using tcpdump during the long delay and see what the machine is doing network wise ? man tcpdump János - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: very slow class loading on initial JSP/servlet request after restart
On Feb 20, 2009, at 10:25 AM, André Warnier wrote: Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Sam, On 2/19/2009 6:23 PM, Sam Hokin wrote: The problem, which spontaneously appeared a few days before Christmas on this one server, is that the initial request of a JSP or servlet takes AGES to respond, usually exceeding several minutes. Good... then you'll have plenty of time to /take a thread dump/ while it's spinning its wheels. I'll cast my hat into the ring: I suspect you're loading a resource that wants to looking an external resource (like an XML file with a remote DTD/Schema and validation is on in the parser) and the DNS is tripping you up. I would like to point out at this moment that my initial analysis (the one with the reindeers) does not look so bad after all. More seriously, and for my own and possibly the OP's edification : we thus have 8 cores/cpus available, and one webapp being loaded at Tomcat startup, which takes ages, but independently of class compilation, Java and Tomcat versions etc.. Say we have told Tomcat to start 100 threads. Does that mean that possibly 8 threads (or more) are all (rather busily) waiting for something in relation to some initialisation in the (rather suspect) classes belonging to that webapp ? The OP also mentions the initial request takes ages. So this initialisation would not happen really at Tomcat startup, but at the first request. Any particular setup or circumstance that could be tried to change when this happens, just to see ? No, it is definitely not the reindeers, but an octo-pussy :) János - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Cannot find workers
On Feb 19, 2009, at 12:09 PM, Wesley Schwengle wrote: On 19.02.09 16:36 Christopher Schultz wrote: On 2/19/2009 8:37 AM, Wesley Schwengle wrote: I moved some jkmount statements from my mod_jk.conf to the virtualhost section in Apache and it doesn't work as expected. What does it do, and what did you expect? It doesn't work, while the previous setup did work ;) What I don't get, and I think it is part of the problem, is the error message in the mod_jk.log, Could not find worker with name some name, while you see it being mapped. Where does mod_jk.config get included? If it's in another virtual host, then I don't think it will work. You should ensure that the JkWorkersFile directive is at httpd's top-level. No, in the main config of Apache (via /etc/apache2/mods-enabled/ mod_jk.(load|conf) - Debian/Ubuntu machine). The modules are loaded before the virtual host files are loaded.. So that should not be a problem. The only thing I moved from mod_jk config to the vhost config is the following: Alias /dir /path/to/webapps JkMount /dir/* w_worker Cheers, Wesley You might want to set JkLogLevel to debug temporary and see how the mapping is done in reality. Then You will have a fairly good idea what can be wrong. János - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: mod_jk
On Feb 17, 2009, at 7:40 PM, Mohit Anchlia wrote: Is there a way to verify if mod_jk is load balancing properly among given live servers - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org You can also look: http://Your.server.com/jkmanager János - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: AJP13 Connector and JKOptions
On Feb 18, 2009, at 8:17 AM, Pete Helgren wrote: Still struggling with this so I am reposting. I can't seem to find a configuration that allows the images and links to properly display. Info from prior posts: I have a Tomcat application that serves up a web app when I use a URL like this: http://www.mywebsite.com:8080/MyAPP Which I wanted to change to this: http://www.mywebsite.com/MyAPP Using Apache I added the worker.properties file and the following directives to an existing Apache server that has been serving several sites. #Tomcat Settings # Mount the worker containing MyAPP JKMount /MyAPP myappw How about: JkMount /MyApp* myappw ?? János # Globally deny access to the WEB-INF directory LocationMatch '.*WEB-INF.*' AllowOverride None deny from all /LocationMatch The pages display but none of the images display and several of the webapps links are broken. So, something isn't quite right. It is almost as though the application links aren't relative to the correct root. I read through the JKOptions for Apache but can't tell if I need to add one or more options to allow the links to correctly display. The reason for the use of Apache is that there are several web sites currently hosted on this server (PHP and static sites) served by Apache so it seemed logical to use Tomcat with an Apache front end to serve the Java Servlet. Any suggestions would be greatly appreciated. Apache/2.2.11 (Win32) DAV/2 mod_jk/1.2.27 mod_ssl/2.2.11 OpenSSL/ 0.9.8i Tomcat 5.5.27 Anyone seen this before? Any suggestions? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Apache Tom Cat in a VM as VMWARE or Red Hat Virtualization
On Feb 18, 2009, at 3:24 PM, Alan Chaney wrote: I agree with Jorge - I run several Tomcats under VMware for both production and development. However it is worth noting that if you use the appropriate vmware tools for your installation (vmware-guestd etc.) you get a significant performance boost on network accesses which may well be important for tomcat. (See vmxnet) YMMV. Regards Alan Chaney Jorge Medina wrote: There are no issues on running Tomcat in a VM. Tomcat is unaware of where it is running. Performance depends on the host running your VM. If you compare a VM running application A on host H compared to application A running directly on host H, you will notice that running on the real server is faster. This is true for any application, not just Tomcat. -Original Message- From: acacio costa [mailto:acaciofco...@yahoo.com.br] Sent: Wednesday, February 18, 2009 2:33 PM To: users@tomcat.apache.org Subject: Apache Tom Cat in a VM as VMWARE or Red Hat Virtualization Hi, Does anyone use Apache Tom Cat in a VM as VMWARE or Red Hat Virtualization? i apreciate to know if you have issues and a tips to go on. Other things to know, Performance comparative with a real server? as the same? better? What the parameters you perceive as better than other environment and what cause as you move Tom Cat to VM. Thanks in advance, Acacio Costa Veja quais são os assuntos do momento no Yahoo! +Buscados http://br.maisbuscados.yahoo.com - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org !DSPAM:499c67d762582136417547! - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org I would add only that You - OP - might want to have a Bridged network connection in the VM. I have VmWare Fusion on my Mac and as soon as I bridged it things got much better, network wise. János - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
unable to start ReplicatedContext
Hi I have a three machine Tomcat cluster with one tomcat instance on each. Machine names are pathsrv1, raid2b and reptile. The OS is OSX 10.5 on two machines and OSX 10.4.11 on one machine. The JVM is the latest for the particular OS. pathsrv1 act as a reverse proxy for all three machines. I am getting the error bellow in all three machines onto the catalina.out. snip Feb 8, 2009 7:02:19 PM org.apache.catalina.ha.context.ReplicatedContext start SEVERE: Unable to start ReplicatedContext java.lang.NullPointerException at java.io.File.init(File.java:194) at org .apache.catalina.core.StandardContext.getBasePath(StandardContext.java: 4784) at org .apache .catalina.ha.context.ReplicatedContext.start(ReplicatedContext.java:62) at org .apache .catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java: 771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java: 525) at org .apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java: 627) at org .apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java: 553) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java: 488) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java: 311) at org .apache .catalina .util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java: 1053) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java: 1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java: 443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java: 710) at org.apache.catalina.startup.Catalina.start(Catalina.java:578) 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:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Feb 8, 2009 7:02:19 PM org.apache.catalina.core.ContainerBase addChildInternal SEVERE: ContainerBase.addChild: start: LifecycleException: Failed to start ReplicatedContext: java.lang.NullPointerException at org .apache .catalina.ha.context.ReplicatedContext.start(ReplicatedContext.java:73) at org .apache .catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java: 771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java: 525) at org .apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java: 627) at org .apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java: 553) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java: 488) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java: 311) at org .apache .catalina .util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java: 1053) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java: 1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java: 443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java: 710) at org.apache.catalina.startup.Catalina.start(Catalina.java:578) 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:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Feb 8, 2009 7:02:19 PM org.apache.catalina.startup.HostConfig deployDescriptor SEVERE: Error deploying configuration descriptor CassetteLabeler.xml java.lang.IllegalStateException: ContainerBase.addChild: start: LifecycleException: Failed to start ReplicatedContext: java.lang.NullPointerException at org .apache .catalina.core.ContainerBase.addChildInternal(ContainerBase.java:795)
Re: Can Tomcat accomplish this?
On Feb 6, 2009, at 3:55 PM, Caldarale, Charles R wrote: From: Christopher Long [mailto:kord...@gmail.com] Subject: Re: Can Tomcat accomplish this? Unfortunately we're not looking for an ESB. That's too bad, because that's certainly what your requirement statement sounds like. We're looking specifically for a Web Server. There's no web server that does this. There are applications that run inside (or under) a web or app server that do this. - Chuck Maybe a reverse_proxy can do that. János - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: some config issue with Apple supplied Tomcat
To answer my own questions :) 1 As soon as I created the /usr/logs directory the error from the mod_jk.log disappeared and the jk-runtime-status is written into the directory with the .lock file happily. 2. I made the mistake to put an unneeded slash after the /apps on the reverse proxy configuration screen using Server Admin from Apple. János On Jan 12, 2009, at 4:26 PM, János Löbb wrote: Hi, I am trying to setup a cluster using Apple supplied Apache2 and Tomcat. On OSX, tomcat is in /Library/Tomcat. Apache is configured in a mixed way, because Apple installs 1.3 and 2.2, so there is /etc/httpd for config of 1.3 and /etc/apache2 for config of 2.2. However even the config file in /etc/apache2 refers to the workers.properties in /etc/httpd :) Looks like as siamese twins in the process of separation. Tomcat version 6.0.18 Java: java version 1.5.0_16 Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) Server VM (build 1.5.0_16-133, mixed mode) apache2: version 2.2 Tomcat is running after checking the checkbox and restarting Apache2 pathsrv1:httpd administrator$ ps -avx |grep tomcat 59195 Ss 0:01.10 0 0 0 600172628 -0 0.0 0.0 /bin/sh /Library/Tomcat/bin/tomcat-launchd.sh 62573 R+ 0:00.00 0 0 0 590472 92 -0 0.0 0.0 grep tomcat and I can get to the SessionExample via port 80. However I get this into the mod_jk.log: [Mon Jan 12 14:57:31 2009] [59281:] [error] init_jk::mod_jk.c (2701): Initializing shm:/usr/logs/jk-runtime-status.59281 errno=2. Load balancing workers will not function properly. Looking on the Internet someone recommended to create a run directory, that used to be in /usr/local/apache2/. I do not know if that is the solution for this Apple supplied config on OSx 10.5.6. I also have a second issue, but that might relate to this message above. I created a reverse proxy setup and this is what Apple put into the site configuration file: IfModule mod_proxy_balancer.c ProxyPass /apps/ balancer://balancer-group/ stickysession=JSESSIONID ProxyPassReverse /apps/ balancer://balancer-group/ Proxy balancer://balancer-group BalancerMember http://pathsrv1.yalepath.org loadfactor=1 /Proxy /IfModule Right now I have just one machine and I am trying it as a Balance member and also as a reverse proxy. So based upon the config, I thought that if I want to go to; http://pathsrv1.yalepath.org/apps/examples/servlets/servlet/SessionExample than the reverse proxy that is pathsrv1 will pass it to the balance member, that is again pathsrv1 and from there It will give me the SessionExample as if I would have gone just to http://pathsrv1.yalepath.org/examples/servlets/servlet/SessionExample Either my config is not right, or my thinking :) Any good hint is appreciated. János - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
some config issue with Apple supplied Tomcat
Hi, I am trying to setup a cluster using Apple supplied Apache2 and Tomcat. On OSX, tomcat is in /Library/Tomcat. Apache is configured in a mixed way, because Apple installs 1.3 and 2.2, so there is /etc/httpd for config of 1.3 and /etc/apache2 for config of 2.2. However even the config file in /etc/apache2 refers to the workers.properties in /etc/httpd :) Looks like as siamese twins in the process of separation. Tomcat version 6.0.18 Java: java version 1.5.0_16 Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- b06-284) Java HotSpot(TM) Server VM (build 1.5.0_16-133, mixed mode) apache2: version 2.2 Tomcat is running after checking the checkbox and restarting Apache2 pathsrv1:httpd administrator$ ps -avx |grep tomcat 59195 Ss 0:01.10 0 0 0 600172628 -0 0.0 0.0 /bin/sh /Library/Tomcat/bin/tomcat-launchd.sh 62573 R+ 0:00.00 0 0 0 590472 92 -0 0.0 0.0 grep tomcat and I can get to the SessionExample via port 80. However I get this into the mod_jk.log: [Mon Jan 12 14:57:31 2009] [59281:] [error] init_jk::mod_jk.c (2701): Initializing shm:/usr/logs/jk-runtime-status.59281 errno=2. Load balancing workers will not function properly. Looking on the Internet someone recommended to create a run directory, that used to be in /usr/local/apache2/. I do not know if that is the solution for this Apple supplied config on OSx 10.5.6. I also have a second issue, but that might relate to this message above. I created a reverse proxy setup and this is what Apple put into the site configuration file: IfModule mod_proxy_balancer.c ProxyPass /apps/ balancer://balancer-group/ stickysession=JSESSIONID ProxyPassReverse /apps/ balancer://balancer-group/ Proxy balancer://balancer-group BalancerMember http://pathsrv1.yalepath.org loadfactor=1 /Proxy /IfModule Right now I have just one machine and I am trying it as a Balance member and also as a reverse proxy. So based upon the config, I thought that if I want to go to; http://pathsrv1.yalepath.org/apps/examples/servlets/servlet/SessionExample than the reverse proxy that is pathsrv1 will pass it to the balance member, that is again pathsrv1 and from there It will give me the SessionExample as if I would have gone just to http://pathsrv1.yalepath.org/examples/servlets/servlet/SessionExample Either my config is not right, or my thinking :) Any good hint is appreciated. János - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Context placement question
Hi, I am in the process to convert our production Apache2 + mod_jk + Tomcat setup on Max OSx 10.5 to a cluster, so some applications can run on the cluster, other applications will run only on one of the two participating balance members. The Apache in one of the machines will also act as a reversed proxy. There will be just one tomcat instance per machine. The default context.xml in the conf directory - $CATALINA_BASE/conf/ context.xml -, starts up the StandardContext by default if I understand well. It will be good for those webapps that do not have their own context.xml. Now I have two questions: 1. If the default of the $CATALINA_BASE/conf/context.xml trigers the StandardContext, can I have ReplicatedContext for individual webapps that I want to run on the cluster? 2. If the answer is yes for the first question then what is the best place to put the Context path= docBase=ROOT className=org.apache.catalina.ha.context.ReplicatedContext element ? The http://tomcat.apache.org/tomcat-6.0-doc/config/context.html documentation suggests two places: a. CATALINA_BASE/conf/[enginename]/[hostname]/webapp.xml, where webapp would be unique for every webapp running on the cluster, b. inside the application's /META-INF/context.xml My major concern is that modification to the webapps context. xml or webapp.xml containing context info, should not interfere with the running of other webapps in production environment. If there is a good article about it please give me the URL. Thanks ahead, János - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Sticky Session AND session duplication?
On Oct 30, 2008, at 6:58 PM, Greg Dick wrote: Hi, I know that for typical web applications one of these approaches is generally enough to achieve load balancing across nodes in a cluster, but we here with an ICEfaces application would find it useful to do both. Session duplication to ensure the spreading around of session information, and sticky sessions to ensure all the blocking web connections from a single user get directed to the same node, until that node fails. An asynchronous ICEfaces application can have two connections to a server from a browser at the same time and it wont do to have these load balanced to separate nodes of the cluster. Various sorts of documentation hint that these operations are mutually exclusive and we have found that it doesn't work in practice but we just wanted to find if someone could either confirm that this is not supported, or that we have our configuration wrong/ understanding botched, or something. Any help would be appreciated. Greg Do You have something like this in Your workers.properties file ?? snip worker.node1.sticky_session = True worker.node2.sticky_session = True worker.node3.sticky_session = True worker.node4.sticky_session = True worker.node1.sticky_session_force = False worker.node2.sticky_session_force = False worker.node3.sticky_session_force = False worker.node4.sticky_session_force = False snap - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat Cluster Deployer
Paul, Do You have this documentation ready ?? I would rather look Your's one first, before the source code :) Thanks ahead, János On Sep 18, 2008, at 1:31 AM, Paul McGurn wrote: OK, I successfully deployed this in our test environment. Could you point me toward the general guidelines for properly creating documentation in the acceptable format? I'll start by documenting the existing cluster example that includes the farm section and work from there. Paul McGurn -Original Message- From: Mark Thomas [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 16, 2008 4:02 PM To: Tomcat Users List Subject: Re: Tomcat Cluster Deployer Paul McGurn wrote: Thanks Mark. I'll work at actually translating this into real documentation and examples. As far as patching, I'm not qualified to do that, but I'd be willing to take a crack at it if there's a list of bugs/ wishlist items for it. Sounds great. I don't recall any open bugs - check bugzilla. I'm sure you'll find some when you test it. Crate bugzilla entries as you find them and add patches where you can. Also, if you create a bugzilla entry for any doc changes I'll make sure they get applied. Note all the source for the docs is in xml not html. Mark Paul McGurn -Original Message- From: Mark Thomas [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 16, 2008 3:50 PM To: Tomcat Users List Subject: Re: Tomcat Cluster Deployer Paul McGurn wrote: Is there any (complete) documentation on the Cluster Deployer? The official documentation doesn't actually say anything about it (or let alone anything useful at all...): http://tomcat.apache.org/tomcat-6.0-doc/config/cluster-deployer.html The source code is probably your best bet. See http://svn.apache.org/repos/asf/tomcat/trunk/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java As far as I am aware, it isn't production ready. As always, patches are welcome. Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat not using multiple cores
On Oct 16, 2008, at 9:05 PM, Matthew Laird wrote: Caldarale, Charles R wrote: The only time I began to see the other cores actually start being used is when I enabled multi-threaded GC. But that doesn't give much improvement since the threads responding the web requests are still all on the same core. The most likely cause is internal synchronization in the webapp or the database it references. I've heard similar from someone else but I'm not sure how that's possible. The app is not at all threaded, is 100% read-only from the database (aside from creation of temp tables which have no interaction between client requests) and the MySQL server is on another machine humming along without any bottlenecks that I can see. But of course I'm not a Java or JVM expert and have no idea what kind of interlinks can exist between different client connections. But to my knowledge they're all pretty straight forward handlers, get data from database, format, return to user I'm leaning more towards GC issues. I setup Tomcat on a 64-bit machine and tried a few configurations: -Xms4096M -Xmx4096M -server -XX:+DisableExplicitGC -XX: +UseConcMarkSweepGC -Xms4096M -Xmx4096M -server -Xms2048M -Xmx2048M -server As I went through each of those the app became more and more sluggish and a single core finally in the last configuration did this 100% CPU usage again. Now, two issues I see. First, it's not being aggressive enough at spreading the load among different cores. Second, GC does seem to be an issue. Unless I'm missing something, which I might be. Thanks. Make sure IP6 is not enabled if You are an IP4 network. We had problems like You describe because of it. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT obviously] Re: Some Prilim questions
. The gamma energies used generally range from 0,05 MeV to 3 MeV. Yes!! That is exactly I need to able to read this list. 3 Megawatti minimum, forget about electronVolts. Even better 5 GigaWatt. Where is the LHC when I need it ?? to generate some black holes ?? János - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
clustering on different machines
Hi, I posted it earlier, but received no answers, so I try again. I have apache2 2.2.9, mod_jk 1.2.26, and Tomcat 6.0.18 running on my Mac with OSX 10.5.6. Its domain name is bml0087.yalepath.org. On my Windows 2000 machines I have tomcat 6.0.16 and its domain name is bml0039.yalepath.org. On the mac I have 3 nodes, on the Windows machine I have one. In the mac I start the three up with 10 seconds pause in between. I can see from the logs, that all 4 found each other and participate in the cluster. I use the SessionsExample. On the Mac the three nodes replicating the session to each other, but nothing goes to the Windows machine. On the Mac the failover is working, but again the one on the Mac that should fail over to the tomcat instance on the Windows machine does not fail over. Here is the workers.properties file from /usr/local/apache2/conf on the Mac: snip worker.list = lb,jkstatus worker.lb.type=lb worker.lb.balance_workers=node1,node2,node3,node4 worker.jkstatus.type=status worker.node1.type = ajp13 worker.node1.host = localhost worker.node1.port = 8009 worker.node1.lbfactor = 1 worker.node1.redirect=node2 worker.node2.type = ajp13 worker.node2.host = localhost worker.node2.port = 8109 worker.node2.lbfactor = 1 worker.node2.redirect=node3 worker.node3.type = ajp13 worker.node3.host = localhost worker.node3.port = 8209 worker.node3.lbfactor = 1 worker.node3.redirect=node4 worker.node4.type = ajp13 worker.node4.host = bml0039.yalepath.org worker.node4.port = 8309 worker.node4.lbfactor = 1 worker.node4.redirect=node1 worker.node1.sticky_session = True worker.node2.sticky_session = True worker.node3.sticky_session = True worker.node4.sticky_session = True worker.node1.sticky_session_force = False worker.node2.sticky_session_force = False worker.node3.sticky_session_force = False worker.node4.sticky_session_force = False /snip here is the relevant portion of of the server.xml from one of the Mac nodes: snip Engine name=Catalina defaultHost=localhost jvmRoute=node1 Cluster className=org.apache.catalina.ha.tcp.SimpleTcpCluster/ Context path= docBase=ROOT className=org.apache.catalina.ha.context.ReplicatedContext/ !-- This Realm uses the UserDatabase configured in the global JNDI resources under the key UserDatabase. Any edits that are performed against this UserDatabase are immediately available for use by the Realm. -- Realm className=org.apache.catalina.realm.UserDatabaseRealm resourceName=UserDatabase/ Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false /Host /Engine /snip Here is the similar server.xml portion from the Windows machine: snip Engine name=Catalina defaultHost=localhost jvmRoute=node4 Cluster className=org.apache.catalina.ha.tcp.SimpleTcpCluster/ Realm className=org.apache.catalina.realm.UserDatabaseRealm resourceName=UserDatabase/ Context path= docbase=ROOT classname=org.apache.catalina.ha.context.ReplicatedContext/ Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false/ Host name=bml0087.yalepath.org appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false/ /Engine /snip What am I doing wrong ? Thanks ahead, János - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]