RE: Getting Apache2 forwarding to tomcat5
I believe that SuSE does not supply JK2, but only JK. And as another poster said, JK2 is now deprecated. I got the RPM apache2-jakarta-tomcat-connectors working pretty easily as I remember. I moved from the RPM to a newer compiled version of JK version 1.2.14 a couple of months ago to get newer features and better load balancing. HTH - Richard -Original Message- From: Dan Chesmore [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 11, 2005 4:22 PM To: Tomcat Users List Subject: Getting Apache2 forwarding to tomcat5 I have read about 25 different websites on getting this setup. I have read through this list trying to find the answer I need. I have spent the last 2 days and soon 3rd day trying to get this working. I need Apache to forward port 80 and 443 requests to tomcat to 8080 and 8443. I am working on the non-ssl right now. I get an error in Apache error_log saying: [error] uriEnv.init() map to invalid worker /*.jsp-0 ajp13:localhost:8009 [error] uriEnv.init() map to invalid worker /patientC onnect-1 ajp13:localhost:8009 Let me give a bit of history and config files. This is running on SLES9 x86-64 version. Apache and tomcat and the connectors are from RPMs that came with SuSE. Everything is installed in SuSE default install location. httpd.conf.local: LoadModule jk2_module /usr/lib64/apache2/mod_jk2.so Location /*.jsp JkUriSet worker ajp13:localhost:8009 /Location Location /patientConnect JkUriSet worker ajp13:localhost:8009 /Location workers2.properties: [logger] level=DEBUG [config:] file=/etc/apache2/workers2.properties debug=0 debugEnv=0 [uriMap:] info=Maps the requests. Options: debug debug=1 [shm] info=Scoreboard. Required for reconfiguration and status with multiprocess serve rs file=/usr/share/tomcat/logs/jk2.shm size=1048576 debug=0 disabled=0 [workerEnv:] info=Global server options timing=1 debug=0 [status:] info=Status worker, displays runtime informations [uri:patientconnect.truchart.com/jkstatus/*] info=Display status information and checks the config file for changes. group=status: [channel.socket:localhost:8009] info=Ajp13 forwarding over socket # Define the worker [ajp13:localhost:8009] channel=channel.socket:localhost:8009 [uri:patientconnect.truchart.com/patientConnect/*] info=patientConnect Both the workers2.properties and the httpd.conf.local are located in /etc/apache2 directory. In the /usr/share/tomcat/conf/ directory is the jk2.properties and the server.xml jk2.properties: ## THIS FILE MAY BE OVERRIDEN AT RUNTIME. MAKE SURE TOMCAT IS STOPED ## WHEN YOU EDIT THE FILE. ## COMMENTS WILL BE _LOST_ ## DOCUMENTATION OF THE FORMAT IN JkMain javadoc. # Set the desired handler list # handler.list=apr,request,channelJni # # Override the default port for the socketChannel channelSocket.port=8009 # Default: # channelUnix.file=${jkHome}/work/jk2.socket # Just to check if the the config is working # shm.file=${jkHome}/work/jk2.shm # In order to enable jni use any channelJni directive # channelJni.disabled = 0 # And one of the following directives: # apr.jniModeSo=/opt/apache2/modules/mod_jk2.so # If set to inprocess the mod_jk2 will Register natives itself # This will enable the starting of the Tomcat from mod_jk2 # apr.jniModeSo=inprocess and the server.xml that was modified: !-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080 -- Connector port=8080 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=false redirectPort=8443 acceptCount=100 debug=0 connectionTimeout=2 disableUploadTimeout=true / !-- Note : To disable connection timeouts, set connectionTimeout value to 0 -- !-- Note : To use gzip compression you could set the following properti es : compression=on compressionMinSize=2048 noCompressionUserAgents=gozilla, traviata compressableMimeType=text/html,text/xml -- !-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 -- !-- Connector port=8443 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=false disableUploadTimeout=true acceptCount=100 debug=0 scheme=https secure=true clientAuth=false sslProtocol=TLS / -- !-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -- Connector port=8009 enableLookups=false redirectPort=8443 debug=0 protocol=AJP/1.3 / !-- Define a Proxied HTTP/1.1 Connector on port 8082 -- !-- See proxy documentation for more information about using this. -- !-- Connector port=8082 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=false acceptCount=100 debug=0 connectionTimeout=2 proxyPort=80 disableUploadTimeout=true / -- ... !-- Logger shared by all Contexts
RE: Tomcat 5.5.12 and user-agent header
Mark, Thanks - should have thought of that first. Now that I turned on LiveHTTPHeaders, I cannot get it to fail. I was able to do this consistently before. Just to be sure, I'll try again tomorrow morning. Maybe its just late. Thanks much - Richard -Original Message- From: Mark Thomas [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 11, 2005 6:14 PM To: 'Tomcat Users List'; [EMAIL PROTECTED] Subject: RE: Tomcat 5.5.12 and user-agent header Have you looked at the headers between Tomcat and your UA? Is your UA actually sending the UA header? If it is then it looks like a sitemesh problem from what you have described. There are a range of tools for looking at headers. livehttpheaders is good, as is TcpMon which is distributed as part of Axis. Mark -Original Message- From: Richard Mixon [mailto:[EMAIL PROTECTED] Sent: Monday, October 10, 2005 12:00 AM To: 'Tomcat Users List' Subject: RE: Tomcat 5.5.12 and user-agent header Leon, Thank you for the test - but I still get a null user-agent right after the login. Here is a snippet of my code: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; %@ include file=/common/taglibs.jspf% %@ page import=com.ltoj.common.Constants % html:html locale=true head %@ include file=/common/meta.jspf % titledecorator:title//title script type=text/javascript src=c:url value='/scripts/environment.js'//script script type=text/javascript src=c:url value='/scripts/util.js'//script script type=text/javascript src=c:url value='/scripts/helptip.js'//script script type=text/javascript src=c:url value='/scripts/tabs.js'//script script type=text/javascript src=c:url value='/scripts/CalendarPopup.js'//script script type=text/javascript src=c:url value='/scripts/chartWizard.js'//script link rel=stylesheet type=text/css media=all href=c:url value='/styles/default.css'/ / link rel=stylesheet type=text/css media=all href=c:url value='/styles/messages.css'/ / link rel=stylesheet type=text/css media=all href=c:url value='/styles/tabs.css'/ / decorator:head/ % String _userAgent = request.getHeader(user-agent); out.write(USER-AGENT='+_userAgent+'); ... Here's the sequence: 1) I issue a request to this page. 2) CMA says oh, that's protected and shows my custom login page. I get user-agent displayed fine: USER-AGENT='Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7' 3) But on the next page (the original target page of the request), user-agent shows as null. USER-AGENT='null' I can refresh the page or go to any other page in my application and the user agent is fine again. The only thing a bit non-standard about this JSP page is that it is a SiteMesh decorator page. If I run the same test, same pages in Tomcat 5.5.9 I never get user-agent of null. Our application does check the user-agent header a good bit. We use Select lists with option groups - but some browsers do not support this so we simulate it by indenting the select options ourselves. Luckily all of this activity happens well after the initial login - so we are safe, now that I changed the decorator to make sure user-agent is not null before doing anything with it. But it seems other applications might be affected by this - no? Thanks again - Richard -Original Message- From: Leon Rosenberg [mailto:[EMAIL PROTECTED] Sent: Sunday, October 09, 2005 1:45 PM To: Tomcat Users List; [EMAIL PROTECTED] Subject: Re: Tomcat 5.5.12 and user-agent header Hmm, I downloaded 5.5.12 and tried the agent-header specific code with it: public void processLogin(User user, HttpServletRequest req, HttpServletResponse res) { StringBuffer info = new StringBuffer(); info.append(login ); info.append(user.getUserName()); info.append( [); info.append(user.getUserId().getPlainPresentation()); info.append(] ); info.append(user.getEmail()); info.append( ); info.append(UserHelper.getGenderDescription(user.getGender())); info.append( ); info.append(UserHelper.getStatusDescription(user.getMembership Status())); info.append( ); info.append(req.getRemoteAddr()); info.append( / ); info.append(req.getRemoteHost()); info.append( Agent: ); info.append(req.getHeader(user-agent)); log.info(info); } outcome was: 2005-10-08 15:36:50,453 INFO - login leon [6] [EMAIL PROTECTED] male premium 127.0.0.1 / 127.0.0.1 Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7) Gecko/20040626 Firefox/0.8 which I think was same behaviour as before. I took tomcat out of the box (5.5.12 tar.gz
RE: Tomcat 5.5.12 and user-agent header
OK - yes, it was lack of sleep that was causing the problem to not appear, I was starting Tomcat 5.5.9 instead of 5.5.12, sorry :( The problem is still there. I even took SiteMesh out of the picture, to make sure it was not the problem (should of done that sooner). Here are the steps: 1) Request a protected page form my app. 2) My CMA login page pops up, I enter userid and password. 3) This POST is issued when I submit it: POST /stars/auth/ j_username=user1j_password=password1login=Login 4) HTTPLiveHeaders show all of the GET requests have a user-agent set (I've included all 90 lines of them below). 5) My page that appears has the following code: % String _userAgent = request.getHeader(user-agent); out.write(USER-AGENT=+_userAgent); ... 6) And displays the following on my page: USER-AGENT=null Unless someone has other ideas I'm thinking it's a but in 5.5.12 at this point and will post it to Bugzilla. Thanks to Mark and others for their help. - Richard START OF HTTPLiveHeaders capture from the above POST: http://smartfish:8080/stars/auth/ POST /stars/auth/ HTTP/1.1 Host: smartfish:8080 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q= 0.8,image/png,*/*;q=0.5 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Referer: http://smartfish:8080/stars/HomePage.do Cookie: JSESSIONID=3F6575A5957AC84BCC60FA878ED092A5.srv1; username=user1 Content-Type: application/x-www-form-urlencoded Content-Length: 45 j_username=user1j_password=password1login=Login HTTP/1.x 302 Moved Temporarily Server: Apache-Coyote/1.1 Location: http://smartfish:8080/stars/j_security_check?j_username=user1j_password=fbc e66f99c809283638f344ecb3d50674ea64189 Content-Length: 0 Date: Wed, 12 Oct 2005 16:33:46 GMT -- http://smartfish:8080/stars/j_security_check?j_username=user1j_password=fbc e66f99c809283638f344ecb3d50674ea64189 GET /stars/j_security_check?j_username=user1j_password=fbce66f99c809283638f344e cb3d50674ea64189 HTTP/1.1 Host: smartfish:8080 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q= 0.8,image/png,*/*;q=0.5 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Referer: http://smartfish:8080/stars/HomePage.do Cookie: JSESSIONID=3F6575A5957AC84BCC60FA878ED092A5.srv1; username=user1 HTTP/1.x 302 Moved Temporarily Server: Apache-Coyote/1.1 Location: http://smartfish:8080/stars/HomePage.do Content-Length: 0 Date: Wed, 12 Oct 2005 16:33:46 GMT -- http://smartfish:8080/stars/HomePage.do GET /stars/HomePage.do HTTP/1.1 Host: smartfish:8080 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q= 0.8,image/png,*/*;q=0.5 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Referer: http://smartfish:8080/stars/HomePage.do Cookie: JSESSIONID=3F6575A5957AC84BCC60FA878ED092A5.srv1; username=user1 HTTP/1.x 200 OK Server: Apache-Coyote/1.1 Pragma: No-cache Cache-Control: no-cache,no-store,max-age=0 Expires: Thu, 01 Jan 1970 00:00:00 GMT Content-Type: text/html;charset=UTF-8 Content-Language: en Content-Length: 2989 Date: Wed, 12 Oct 2005 16:33:52 GMT -- http://smartfish:8080/stars/WEB-INF/pages/%3C%=request.getContextPath()%%3E/ images/cm_fill.gif GET /stars/WEB-INF/pages/%3C%=request.getContextPath()%%3E/images/cm_fill.gif HTTP/1.1 Host: smartfish:8080 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7 Accept: image/png,*/*;q=0.5 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Referer: http://smartfish:8080/stars/HomePage.do Cookie: JSESSIONID=3F6575A5957AC84BCC60FA878ED092A5.srv1; username=user1 HTTP/1.x 400 Invalid URI Server: Apache-Coyote/1.1 Transfer-Encoding: chunked Date: Wed, 12 Oct 2005 16:33:52 GMT Connection: close -- -Original Message- From: Richard Mixon [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 12, 2005 12:45 AM To: 'Tomcat Users List' Subject: RE: Tomcat 5.5.12 and user-agent header Mark, Thanks - should have thought of that first. Now that I turned on LiveHTTPHeaders, I cannot get it to fail. I was able to do this consistently before
RE: Tomcat 5.5.12 and user-agent header
Have not tried it with Apache/mod_jk in front - just with Tomcat and accessing it as http://computername:8080/stars/HomePage.do . Not sure of your drift. Are you just looking for another date point (that's good) - or is there some implication as to how user-agent headers work with Tomcat standalone? Thank you - Richard -Original Message- From: Jess Holle [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 12, 2005 10:00 AM To: Tomcat Users List Subject: Re: Tomcat 5.5.12 and user-agent header Does this only occur when connecting directly to Tomcat or is it also an issue when going through Apache and mod_jk? Richard Mixon wrote: OK - yes, it was lack of sleep that was causing the problem to not appear, I was starting Tomcat 5.5.9 instead of 5.5.12, sorry :( The problem is still there. I even took SiteMesh out of the picture, to make sure it was not the problem (should of done that sooner). Here are the steps: 1) Request a protected page form my app. 2) My CMA login page pops up, I enter userid and password. 3) This POST is issued when I submit it: POST /stars/auth/ j_username=user1j_password=password1login=Login 4) HTTPLiveHeaders show all of the GET requests have a user-agent set (I've included all 90 lines of them below). 5) My page that appears has the following code: % String _userAgent = request.getHeader(user-agent); out.write(USER-AGENT=+_userAgent); ... 6) And displays the following on my page: USER-AGENT=null Unless someone has other ideas I'm thinking it's a but in 5.5.12 at this point and will post it to Bugzilla. Thanks to Mark and others for their help. - Richard START OF HTTPLiveHeaders capture from the above POST: http://smartfish:8080/stars/auth/ POST /stars/auth/ HTTP/1.1 Host: smartfish:8080 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/pla in;q= 0.8,image/png,*/*;q=0.5 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Referer: http://smartfish:8080/stars/HomePage.do Cookie: JSESSIONID=3F6575A5957AC84BCC60FA878ED092A5.srv1; username=user1 Content-Type: application/x-www-form-urlencoded Content-Length: 45 j_username=user1j_password=password1login=Login HTTP/1.x 302 Moved Temporarily Server: Apache-Coyote/1.1 Location: http://smartfish:8080/stars/j_security_check?j_username=user1j_passwor d=fbc e66f99c809283638f344ecb3d50674ea64189 Content-Length: 0 Date: Wed, 12 Oct 2005 16:33:46 GMT -- http://smartfish:8080/stars/j_security_check?j_username=user1j_passwor d=fbc e66f99c809283638f344ecb3d50674ea64189 GET /stars/j_security_check?j_username=user1j_password=fbce66f99c809283638 f344e cb3d50674ea64189 HTTP/1.1 Host: smartfish:8080 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/pla in;q= 0.8,image/png,*/*;q=0.5 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Referer: http://smartfish:8080/stars/HomePage.do Cookie: JSESSIONID=3F6575A5957AC84BCC60FA878ED092A5.srv1; username=user1 HTTP/1.x 302 Moved Temporarily Server: Apache-Coyote/1.1 Location: http://smartfish:8080/stars/HomePage.do Content-Length: 0 Date: Wed, 12 Oct 2005 16:33:46 GMT -- http://smartfish:8080/stars/HomePage.do GET /stars/HomePage.do HTTP/1.1 Host: smartfish:8080 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/pla in;q= 0.8,image/png,*/*;q=0.5 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Referer: http://smartfish:8080/stars/HomePage.do Cookie: JSESSIONID=3F6575A5957AC84BCC60FA878ED092A5.srv1; username=user1 HTTP/1.x 200 OK Server: Apache-Coyote/1.1 Pragma: No-cache Cache-Control: no-cache,no-store,max-age=0 Expires: Thu, 01 Jan 1970 00:00:00 GMT Content-Type: text/html;charset=UTF-8 Content-Language: en Content-Length: 2989 Date: Wed, 12 Oct 2005 16:33:52 GMT -- http://smartfish:8080/stars/WEB-INF/pages/%3C%=request.getContextPath() %%3E/ images/cm_fill.gif GET /stars/WEB-INF/pages/%3C%=request.getContextPath()%%3E/images/cm_fill.g if HTTP/1.1 Host: smartfish:8080 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7 Accept: image/png,*/*;q=0.5 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive
RE: Tomcat 5.5.12 and user-agent header
Leon, Thank you for the test - but I still get a null user-agent right after the login. Here is a snippet of my code: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; %@ include file=/common/taglibs.jspf% %@ page import=com.ltoj.common.Constants % html:html locale=true head %@ include file=/common/meta.jspf % titledecorator:title//title script type=text/javascript src=c:url value='/scripts/environment.js'//script script type=text/javascript src=c:url value='/scripts/util.js'//script script type=text/javascript src=c:url value='/scripts/helptip.js'//script script type=text/javascript src=c:url value='/scripts/tabs.js'//script script type=text/javascript src=c:url value='/scripts/CalendarPopup.js'//script script type=text/javascript src=c:url value='/scripts/chartWizard.js'//script link rel=stylesheet type=text/css media=all href=c:url value='/styles/default.css'/ / link rel=stylesheet type=text/css media=all href=c:url value='/styles/messages.css'/ / link rel=stylesheet type=text/css media=all href=c:url value='/styles/tabs.css'/ / decorator:head/ % String _userAgent = request.getHeader(user-agent); out.write(USER-AGENT='+_userAgent+'); ... Here's the sequence: 1) I issue a request to this page. 2) CMA says oh, that's protected and shows my custom login page. I get user-agent displayed fine: USER-AGENT='Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7' 3) But on the next page (the original target page of the request), user-agent shows as null. USER-AGENT='null' I can refresh the page or go to any other page in my application and the user agent is fine again. The only thing a bit non-standard about this JSP page is that it is a SiteMesh decorator page. If I run the same test, same pages in Tomcat 5.5.9 I never get user-agent of null. Our application does check the user-agent header a good bit. We use Select lists with option groups - but some browsers do not support this so we simulate it by indenting the select options ourselves. Luckily all of this activity happens well after the initial login - so we are safe, now that I changed the decorator to make sure user-agent is not null before doing anything with it. But it seems other applications might be affected by this - no? Thanks again - Richard -Original Message- From: Leon Rosenberg [mailto:[EMAIL PROTECTED] Sent: Sunday, October 09, 2005 1:45 PM To: Tomcat Users List; [EMAIL PROTECTED] Subject: Re: Tomcat 5.5.12 and user-agent header Hmm, I downloaded 5.5.12 and tried the agent-header specific code with it: public void processLogin(User user, HttpServletRequest req, HttpServletResponse res) { StringBuffer info = new StringBuffer(); info.append(login ); info.append(user.getUserName()); info.append( [); info.append(user.getUserId().getPlainPresentation()); info.append(] ); info.append(user.getEmail()); info.append( ); info.append(UserHelper.getGenderDescription(user.getGender())); info.append( ); info.append(UserHelper.getStatusDescription(user.getMembershipStatus())); info.append( ); info.append(req.getRemoteAddr()); info.append( / ); info.append(req.getRemoteHost()); info.append( Agent: ); info.append(req.getHeader(user-agent)); log.info(info); } outcome was: 2005-10-08 15:36:50,453 INFO - login leon [6] [EMAIL PROTECTED] male premium 127.0.0.1 / 127.0.0.1 Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7) Gecko/20040626 Firefox/0.8 which I think was same behaviour as before. I took tomcat out of the box (5.5.12 tar.gz) and only changed the http port. regards leon On 10/8/05, Richard Mixon [EMAIL PROTECTED] wrote: I am just using the standard HTTP connector. This is on my development workstation so I don't normally run JK and Apache, except for final testing. On the developer list I did see one mention of user-agent header, but on closer inspection it appeared to be for a completely different issue. Thanks - Richard -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Bill Barker Sent: Friday, October 07, 2005 10:13 PM To: tomcat-user@jakarta.apache.org Subject: Re: Tomcat 5.5.12 and user-agent header Richard Mixon [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I tested out my application on 5.5.12 yesterday and noticed one small anomally. I had a JSP in my sitemesh decorator default.jsp that ends up wrapping the login page for container managed authentication. This page had a statement String _userAgent = request.getHeader(user-agent).toLowerCase(); It gets a null-pointer exception
RE: Tomcat 5.5.12 and user-agent header
I am just using the standard HTTP connector. This is on my development workstation so I don't normally run JK and Apache, except for final testing. On the developer list I did see one mention of user-agent header, but on closer inspection it appeared to be for a completely different issue. Thanks - Richard -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Bill Barker Sent: Friday, October 07, 2005 10:13 PM To: tomcat-user@jakarta.apache.org Subject: Re: Tomcat 5.5.12 and user-agent header Richard Mixon [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I tested out my application on 5.5.12 yesterday and noticed one small anomally. I had a JSP in my sitemesh decorator default.jsp that ends up wrapping the login page for container managed authentication. This page had a statement String _userAgent = request.getHeader(user-agent).toLowerCase(); It gets a null-pointer exception in 5.5.12, but under 5.5.9 it runs fine. In 5.5.12, after the login succeeds then the user-agent headers appear to be there just fine, but not on the initial login page. Is this a known issue? It's certainly not a known issue. It would help a lot if you could tell us which Connector you are using at the time (e.g. HTTP/1.1, HTTP/1.1-APR, AJP/1.3, AJP/1.3-APR). Thank you - Richard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat 5.5.12 and user-agent header
I tested out my application on 5.5.12 yesterday and noticed one small anomally. I had a JSP in my sitemesh decorator default.jsp that ends up wrapping the login page for container managed authentication. This page had a statement String _userAgent = request.getHeader(user-agent).toLowerCase(); It gets a null-pointer exception in 5.5.12, but under 5.5.9 it runs fine. In 5.5.12, after the login succeeds then the user-agent headers appear to be there just fine, but not on the initial login page. Is this a known issue? Thank you - Richard
Problem with file upload corruption.
Sorry to kick this up. I know its a slightly obscure topic, and I'm hoping it may have rolled by someone knowledgable. I just tried using the Jakarta Commons File Upload instead of the Oreilly MultiPartRequest. I get the same results. No matter what kind of file I try uploading - it treats it as text: from a Windows machine all occurrences of 0x0D0A are converted to 0x0A. So contrary to the RFC saying it is a binary file upload, it appears to be doing a text upload - or I am really missing out on something. Thank you - Richard -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, August 29, 2005 7:03 PM To: tomcat-user@jakarta.apache.org Subject: Problem with file upload corruption. We have a JSP/servlet combo that uses the OReilly MultiPartRequest to upload a users HTML template for our application. Invariably they end up with some unusual characters in their template - sometimes from pasting in text from MS Word or other similar application. For some reason a single character (e.g. x092 a right single quotation mark) is turned into multiple special characters after it is uploaded. When we download it we use response.setContentType(application/octet-stream); and the mangled file downloads fine (i.e. without change) Here is an example - the right single quotation marka backward single quote comes right after the paragraph tag (p). BEFORE upload html ... pSome text. /html AFTER upload html ... p�Some text. /html I have read the file upload RFC 1867 until I'm blue in the face, and Googled on and off the servlet.com site. There were reported binary upload problems using the warp connector to connect Tomcat 4.0 and Apache. But we are using Tomcat 4.1.18. Any ideas or suggestion are appreciated. Thank you - Richard mail2web - Check your email from the web at http://mail2web.com/ . - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem with file upload corruption.
OK, my goof. In my frustration and hurry I did not read the RFC well enough. After re-reading the RFC yet one more time, it finally became clear. In case it helps anyone else, I'm posting what I learned here. Basically the browser is allowed/expected to set the encoding type. Under section 3.3 of RFC 1867: 3.3 use of multipart/form-data ... Each part should be labelled with an appropriate content-type if the media type is known (e.g., inferred from the file extension or operating system typing information) or as application/octet-stream. ... I kept expecting there to be some way to designate the file as either binary (don't change a thing, just upload it) or text (handle CRLF's and character set translation) - much like one does with an FTP tranfer. So I guess the best answer to my original dilema is to write a utility method/filter that inspects the uploaded HTML file for invalid characters and notifies the user if any are found. Hope this helps someone else - Richard -Original Message- From: Richard Mixon (qwest) [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 30, 2005 7:26 PM To: 'tomcat-user@jakarta.apache.org' Subject: Problem with file upload corruption. Sorry to kick this up. I know its a slightly obscure topic, and I'm hoping it may have rolled by someone knowledgable. I just tried using the Jakarta Commons File Upload instead of the Oreilly MultiPartRequest. I get the same results. No matter what kind of file I try uploading - it treats it as text: from a Windows machine all occurrences of 0x0D0A are converted to 0x0A. So contrary to the RFC saying it is a binary file upload, it appears to be doing a text upload - or I am really missing out on something. Thank you - Richard -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, August 29, 2005 7:03 PM To: tomcat-user@jakarta.apache.org Subject: Problem with file upload corruption. We have a JSP/servlet combo that uses the OReilly MultiPartRequest to upload a users HTML template for our application. Invariably they end up with some unusual characters in their template - sometimes from pasting in text from MS Word or other similar application. For some reason a single character (e.g. x092 a right single quotation mark) is turned into multiple special characters after it is uploaded. When we download it we use response.setContentType(application/octet-stream); and the mangled file downloads fine (i.e. without change) Here is an example - the right single quotation marka backward single quote comes right after the paragraph tag (p). BEFORE upload html ... pSome text. /html AFTER upload html ... p�Some text. /html I have read the file upload RFC 1867 until I'm blue in the face, and Googled on and off the servlet.com site. There were reported binary upload problems using the warp connector to connect Tomcat 4.0 and Apache. But we are using Tomcat 4.1.18. Any ideas or suggestion are appreciated. Thank you - Richard mail2web - Check your email from the web at http://mail2web.com/ . - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: configuration files for war deployments
Patrick, Sorry for the late response. You have received quite a few ideas, but I did not see one quite like what we do. We use the deployer utility to deploy our application and have customized (just added a task actually) the build.xml file to make system-specific changes to our war and then re-jar/war it. In case you are not familiar with the tomcat deployer it is a companion download. For example if you downloaded jakarta-tomcat-5.5.9.zip, there is a corresponding jakarta-tomcat-5.5.9-deployer.zip to download. The deployer is really just a few jar files with tomcat-specific ant tasks, a build.xml and and example deployer.properties file. The ant build file has targets to compile (including JSPs), undeploy and deploy an application to one or more tomcats. The deployer.properties file controls this if the defaults are not good. We just added a coupld of ant replace and copy tasks that modify various properties and xml files for the target host. It means that on each host that needs specific configuration you: - explode the war file - run ant compile undeploy deploy You now have a customized web application installed. Hope it helps - Richard -Original Message- From: Patrick Lacson [mailto:[EMAIL PROTECTED] Sent: Thursday, August 25, 2005 8:32 AM To: Tomcat User-List Subject: configuration files for war deployments hi All, If I were to deploy my application as a .war file, where do I place the .properties configuration files? I know there's the option of auto-expanding the war file at deployment, but is there a way to keep the war file unexpanded and provide an external .properties file for the web app to read from? Many thanks -- Patrick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Array as context parameter
Well, Understand that once you enter the domain of having someone edit an XML file, you are already into error prone territory. You might consider changing the parameter to specify a file name. The specified file could be formatted anyway you liked, but probably with one value on each line of the file. Just have context listener read this file at startup and place the array in the context. Hope this helps - Richard -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Konrad Billewicz Sent: Friday, August 19, 2005 12:29 AM To: tomcat-user@jakarta.apache.org Subject: Re: Array as context parameter Litty Preeth iamlitty at yahoo.com writes: Or u can use a comma separated list of strings and parse them using StringTokenizer. That sounds better. It's surely more user friendly. But the chance of an error during entering coma-separated values is bigger. It's easy to forget about coma or place dot. Are there any other solutions? Best regards, Konrad Billewicz - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat 5.5.10 jasper2 fails in deployer build.xml
I think I found a problem with the jakarta-tomcat-5.5.10-deployer package. When I run the compile task I get the following error: BUILD FAILED C:\jakarta-tomcat-5.5.10-deployer\build.xml:49: Could not create task or type of type: jasper2. Ant could not find the task or a class this task relies upon. Is this a known bug? I did not find it in Bugzilla, but the search interface is a bit strange to me. I looked in the c:\jakarta-tomcat-5.5.10-deployer\lib\catalina-ant.jar file and discovered that the catalina.tasks file is missing a definition for the jasper2 task like is found in c:\jakarta-tomcat-5.5.9-deployer\lib\catalina-ant.jar. Here are the contents of the 5.5.10 catalina.tasks file: # Pure catalina tasks deploy=org.apache.catalina.ant.DeployTask list=org.apache.catalina.ant.ListTask reload=org.apache.catalina.ant.ReloadTask sessions=org.apache.catalina.ant.SessionsTask resources=org.apache.catalina.ant.ResourcesTask roles=org.apache.catalina.ant.RolesTask start=org.apache.catalina.ant.StartTask stop=org.apache.catalina.ant.StopTask undeploy=org.apache.catalina.ant.UndeployTask validator=org.apache.catalina.ant.ValidatorTask #Jk Task jkstatus=org.apache.catalina.ant.JKStatusUpdateTask # Manager JMX jmxManagerSet=org.apache.catalina.ant.JMXSetTask jmxManagerGet=org.apache.catalina.ant.JMXGetTask jmxManagerQuery=org.apache.catalina.ant.JMXQueryTask Here are the contents of the 5.5.9 catalina.tasks file: # Pure catalina tasks deploy=org.apache.catalina.ant.DeployTask list=org.apache.catalina.ant.ListTask reload=org.apache.catalina.ant.ReloadTask resources=org.apache.catalina.ant.ResourcesTask roles=org.apache.catalina.ant.RolesTask start=org.apache.catalina.ant.StartTask stop=org.apache.catalina.ant.StopTask undeploy=org.apache.catalina.ant.UndeployTask validator=org.apache.catalina.ant.ValidatorTask jkstatus=org.apache.catalina.ant.JKStatusUpdateTask # Jasper tasks jasper2=org.apache.jasper.JspC I added the jasper2=org.apache.jasper.JspC line and its seems to work fine. Thank you - Richard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JspC compile exception in tomcat-deployer 5.5.10
Hello, I am using the jakarta-tomcat-5.5.10-deployer to deploy my customized war file to tomcat. When I have it do the "compile" target so it pre-compiles the JSP's I get theexception below (its sort of long). I've got the source and can see that it is happening as it processes the JSPs. But it givesno clue as to which JSP is causing the problem. Is there a way to turn on a trace that would list each file as it is processed? I've also looked in the output directory - but there are not class files at all. And the generated_web.xml is completely empty at this point. Here is how I've got the jasper2 task defined in my build.xml: jasper2 validateXml="false" uriroot="${webapp.path}" webXmlFragment="${webapp.path}/WEB-INF/generated_web.xml" addWebXmlMappings="true" outputDir="${webapp.path}/WEB-INF/classes" / Notice that I turned validateXml to false - otherwise I get the following message: [jasper2] org.xml.sax.SAXParseException: Document is invalid: no grammar found. I have compared and compared my web.xml to the spec and it seems to be OK. It complains about position 9 in the 3rd line. Line 3 follows, position 9 is the start of the "xmlns=" attribute: web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4"... which appears to be fine. Any ideas or help is appreciated. I have tried this a few months back in 5.5.7 but got the same results (worked fine in 5.0.19). I imagine its a problem either in one of my JSPs or in the web.xml - but cannot figure it out. Thanks in advance for any ideas. - Richard Exception from running "ant compile": Loaded from C:\jakarta-tomcat-5.5.10-deployer\lib\jasper-compiler.jar org/apache/jasper/compiler/AntCompiler.classClass org.apache.jasper.compiler.AntCompiler loaded from ant loader (parentFirst)Class org.apache.tools.ant.BuildListener loaded from parent loader (parentFirst)Couldn't load Resource commons-logging.propertiesCouldn't load Resource META-INF/services/org.apache.commons.logging.LogFactoryFinding class org.apache.log4j.LoggerFinding class org.apache.log4j.CategoryFinding class org.apache.log4j.spi.AppenderAttachableFinding class org.apache.commons.logging.impl.Log4JLoggerLoaded from C:\jakarta-tomcat-5.5.10-deployer\lib\commons-logging.jar org/apache/commons/logging/impl/Log4JLogger.classClass org.apache.commons.logging.impl.Log4JLogger loaded from ant loader (parentFirst)Finding class org.apache.log4j.CategoryFinding class org.apache.log4j.Category [jasper2] java.lang.NullPointerException [jasper2] at org.apache.jasper.JspCompilationContext.createCompiler(JspCompilationContext.java:220) [jasper2] at org.apache.jasper.JspC.processFile(JspC.java:913) [jasper2] at org.apache.jasper.JspC.execute(JspC.java:1061) [jasper2] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [jasper2] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [jasper2] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [jasper2] at java.lang.reflect.Method.invoke(Method.java:585) [jasper2] at org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:123) [jasper2] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275) [jasper2] at org.apache.tools.ant.Task.perform(Task.java:364) [jasper2] at org.apache.tools.ant.Target.execute(Target.java:341) [jasper2] at org.apache.tools.ant.Target.performTasks(Target.java:369) [jasper2] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216) [jasper2] at org.apache.tools.ant.Project.executeTarget(Project.java:1185) [jasper2] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40) [jasper2] at org.apache.tools.ant.Project.executeTargets(Project.java:1068) [jasper2] at org.apache.tools.ant.Main.runBuild(Main.java:668) [jasper2] at org.apache.tools.ant.Main.startAnt(Main.java:187) [jasper2] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246) [jasper2] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67) [jasper2] Error in class org.apache.jasper.JspC BUILD FAILEDC:\jakarta-tomcat-5.5.10-deployer\build.xml:49: org.apache.jasper.JasperException at org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:131) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275) at org.apache.tools.ant.Task.perform(Task.java:364) at org.apache.tools.ant.Target.execute(Target.java:341) at org.apache.tools.ant.Target.performTasks(Target.java:369) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216) at org.apache.tools.ant.Project.executeTarget(Project.java:1185) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40) at
RE: How to turn off perssitent sessions in Tomcat 4.1?
Hmm, I assume you have read the documentation on this: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/manager.html If so, have you tried leaving the manager element out? HTH - Richard -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, August 05, 2005 3:26 AM To: tomcat-user@jakarta.apache.org Subject: RE: How to turn off perssitent sessions in Tomcat 4.1? Can any one help me out in this issue? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, August 04, 2005 11:27 AM To: tomcat-user@jakarta.apache.org Subject: RE: How to turn off perssitent sessions in Tomcat 4.1? I am waiting for a good response. Can any body help me out in this? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 03, 2005 6:01 PM To: tomcat-user@jakarta.apache.org Subject: RE: How to turn off perssitent sessions in Tomcat 4.1? Hi Edgar, Thanks for the reply. But I am using Tomcat 4.1.29 and I tried this option (I mean, pathname= in Manager element of server.xml) in Tomcat 4.1.29, which is not successful. Is there any way to turn off session persistence in Tomcat 4.1 itself or I need to upgrade to Tomcat 5.0. In order to avoid the exception we have to make all the objects that is put in session to be serializable, right no?. I am using struts framework. So by default all form beans are serializable and all primitive data types are also serializable. Why Tomcat complains about CoyoteRequestFacade is not serializable? Please clarify my doubts. Advance thanks to all of u !!! -Original Message- From: Edgar Alves [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 03, 2005 5:00 PM To: Tomcat Users List Subject: Re: How to turn off perssitent sessions in Tomcat 4.1? Hi, On Tomcat 5.5 you can turn persistent session loading off by setting the SessionManager pathname attribute to . Hope that helps. -- Edgar Alves [EMAIL PROTECTED] wrote: Hi, I am using Apache+Tomcat 4.1.29 for running my application. When I am restarting Tomcat I am getting persistent session loading exception like this: 2004-03-11 13:52:18 StandardManager[] IOException while loading persisted sessions: java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.apache.coyote.tomcat4.CoyoteRequestFacade java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.apache.coyote.tomcat4.CoyoteRequestFacade at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1278) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845 ) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:164 6 ) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845 ) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:164 6 ) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324) at org.apache.catalina.session.StandardSession.readObject(StandardSession. j ava:1369) I am not using clustering. I want to turn off the session persistence in Tomcat 4.1.29? I have tried so many options with StandardManager in server.xml. But I was not successful. Please help me out in this? Regards AK - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:
RE: question about deployment (including executables in war)
Murad, I would not copy the files - but just change the permissions. No restart should be necessary that way - unless I'm missing something. However to answer your question, using the build.xml in jakarta-tomcat-5.5.9-deployer, I usually use the following command to restart the application: ant stop start It works for me. That said, I have seen cases where after I deploy and app and then do a start I get complaints ... Doing something like: Ant stop undeploy deploy start I finally figured that the deploy was issuing an implicit start, so I changed it to: ant stop undeploy deploy Hope this helps. - Richard -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Murad Nayal Sent: Wednesday, July 20, 2005 12:32 PM To: Tomcat Users List; Richard Mixon (qwest) Subject: Re: question about deployment (including executables in war) Many thanks Richard, I suppose that answers my question, albeit I was hoping there was something more elegant that can be done other than changing file permissions after installation. what is the correct way to reload applications after copying files into the installation directory? ant stop; ant start seem not to be designed for that judging from the complaints from tomcat I get in catalina.out!! thanks again Murad Nayal Richard Mixon (qwest) wrote: Murad/Alon, This has nothing to do with a SecurityManager. Murad is trying to run the executables on the server - from one of his servlets I assume. The problem is the fact that a war files is basically just a zip file. It does not maintain the file attributes that are specific to a particular operating system (e.g. execute, read-only, write, etc.). Other archive formats do this (e.g. tar and Windows backup archives). I believe the user's umask setting is probably used to set the permissions - but Tomcat might do something different. Regardless, even if Tomcat honors the umask setting, you would not want to change this such that all files were marked executable when the jar was uncompressed. I am not sure you have much option other than to have a custom ant script that alters the permissions after the files are deployed from the war file. The jakarta-tomcat-5.5.x-deployer has a deployment script (build.xml) that should be a good starting point. Hope this helps - Richard -Original Message- From: Alon Belman [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 19, 2005 4:44 PM To: Tomcat Users List; [EMAIL PROTECTED] Subject: Re: question about deployment (including executables in war) Murad, I'm not 100% sure what you're asking -- like what do you mean by jar strips the execute file permissions from my programs? -- but i'm assuming you cant do it. In fact, I will be more than a little alarmed if a packaged web app can include and run arbitrary executables unless specifically allowed to so by its server's SecurityManager, or if the server is running without a SecurityManager. That is, you cannot do it unless you configure it OUTSIDE your web application. Hope this helps, Alon On 7/17/05, Murad Nayal [EMAIL PROTECTED] wrote: Hi Everybody, I need to include executable programs as part of my web application. in development I created a directory WEB-INF/bin where I kept copies of the programs I need. problem is when I create a war file for my application, jar strips the execute file permissions from my programs. is there any way around this at all where I would still have my application packaged as a single war file with the necessary executables (with the correct permissions). many thanks Murad Nayal - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: question about deployment (including executables in war)
Murad/Alon, This has nothing to do with a SecurityManager. Murad is trying to run the executables on the server - from one of his servlets I assume. The problem is the fact that a war files is basically just a zip file. It does not maintain the file attributes that are specific to a particular operating system (e.g. execute, read-only, write, etc.). Other archive formats do this (e.g. tar and Windows backup archives). I believe the user's umask setting is probably used to set the permissions - but Tomcat might do something different. Regardless, even if Tomcat honors the umask setting, you would not want to change this such that all files were marked executable when the jar was uncompressed. I am not sure you have much option other than to have a custom ant script that alters the permissions after the files are deployed from the war file. The jakarta-tomcat-5.5.x-deployer has a deployment script (build.xml) that should be a good starting point. Hope this helps - Richard -Original Message- From: Alon Belman [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 19, 2005 4:44 PM To: Tomcat Users List; [EMAIL PROTECTED] Subject: Re: question about deployment (including executables in war) Murad, I'm not 100% sure what you're asking -- like what do you mean by jar strips the execute file permissions from my programs? -- but i'm assuming you cant do it. In fact, I will be more than a little alarmed if a packaged web app can include and run arbitrary executables unless specifically allowed to so by its server's SecurityManager, or if the server is running without a SecurityManager. That is, you cannot do it unless you configure it OUTSIDE your web application. Hope this helps, Alon On 7/17/05, Murad Nayal [EMAIL PROTECTED] wrote: Hi Everybody, I need to include executable programs as part of my web application. in development I created a directory WEB-INF/bin where I kept copies of the programs I need. problem is when I create a war file for my application, jar strips the execute file permissions from my programs. is there any way around this at all where I would still have my application packaged as a single war file with the necessary executables (with the correct permissions). many thanks Murad Nayal - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Controlling Tomcat Service From Ant
Yes, if your service name is tomcat you can do something similar to the following: exec dir=${src} executable=cmd.exe os=Windows 2000 output=dir.txt arg line=/c net start tomcat/ /exec exec dir=${src} executable=cmd.exe os=Windows 2000 output=dir.txt arg line=/c net stop tomcat/ /exec Check out the Ant exec task documentation. - Richard -Original Message- From: Jason W. Solinsky [mailto:[EMAIL PROTECTED] Sent: Sunday, July 10, 2005 10:26 AM To: tomcat-user@jakarta.apache.org Subject: Controlling Tomcat Service From Ant Is there anyway to effectively start or stop the Tomcat 5.5 windows service from within Ant? I tried exec dir=${tomcat.bin} executable=tomcat5.exe arg line=//SS//Tomcat5/ /exec but it produces an error message (although it works) and I don't know what the corresponding command would be to restart the service. Is there some standard way to accomplish this? Thanks, JWS - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Is Tomcat is an application server ?
I think for most practical purposes Tomcat is an application server. What Tomcat does not have is a builtin Enterprise Java Beans container - however Tomcat supports many other parts of the J2EE spec. Simply by the numbers, the vast majority of Java web applications do not use EJBs - so Tomcat is just fine for most users. EJBs are not necessary at all for building sophisticated and complex web applications. Tomcat offers load balancing and clustering - which used to be only offered by commercial application servers. That said, there are some advantages to EJBs that can make the additional complexity worth it. For some enterprise situations, you may want an application server that is fully compliant with the J2EE spec, such as Jboss, WebSphere, BEA or one of the other commercial packages. HTH - Richard -Original Message- From: Anto Paul [mailto:[EMAIL PROTECTED] Sent: Monday, June 20, 2005 11:02 PM To: Tomcat Users List Subject: Is Tomcat is an application server ? Hi all, Many might have asked this question but I need a more elaborate answer. Today I attended an interview and the interviewer insists that Tomcat versions above 4.x is an application server. Is that true ?. What are the points to support the argument ?. -- rgds Anto Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Is Tomcat is an application server ?
Antonio, I will be generous and not assume you are arguing for arguments sake - maybe just being a little too theoretical :) I gave you some real world examples. If you want some third party definitions, Google on the following: Application Server definitions And you will see that Tomcat is quite comfortably contained in all 9 of the definitions on that page. As far as the points you bring up: - Remoting implies distributing your objects across the network - a nice feature, but not often needed. Its talked about a lot - but for most applications its just not needed. - Our Hibernate-based Tomcat application use Hibernate and jta.jar for transaction services and it works quite well. We have most of the advantages of declarative transaction demarcation. - It is really nice to have a messenging service or message broker, but IMHO, the lack of such does not mean you cannot serve Java applications. Have a good day - Richard -Original Message- From: Anto Paul [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 21, 2005 12:09 AM To: Tomcat Users List Subject: Re: Is Tomcat is an application server ? On 6/21/05, Richard Mixon (qwest) [EMAIL PROTECTED] wrote: I think for most practical purposes Tomcat is an application server. What Tomcat does not have is a builtin Enterprise Java Beans container - however Tomcat supports many other parts of the J2EE spec. Simply by the numbers, the vast majority of Java web applications do not use EJBs - so Tomcat is just fine for most users. EJBs are not necessary at all for building sophisticated and complex web applications. Tomcat offers load balancing and clustering - which used to be only offered by commercial application servers. That said, there are some advantages to EJBs that can make the additional complexity worth it. For some enterprise situations, you may want an application server that is fully compliant with the J2EE spec, such as Jboss, WebSphere, BEA or one of the other commercial packages. But it is not providing any services like transaction service, messaging service, remoting. Without these how it can be considered as an application server ?. -- rgds Anto Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat keeps growing in size on Win32
Are you actually running out of memory? Or is the heap just growing? Garbage collection is a bit arbitrary and may not occur until there is a need. HTH - Richard -Original Message- From: Ed Hamilton [mailto:[EMAIL PROTECTED] Sent: Monday, June 13, 2005 4:39 PM To: 'Tomcat Users List' Subject: RE: Tomcat keeps growing in size on Win32 Thanks, Robson, for the reply. I have all the latest versions of everything: Tomcat: 5.5.9 JDSK: 1.5.0.03 JDBC: 3.18a Isapi Redirector: 1.2.13 There is no website/database activity, just tomcat running. I believe it's related to the other posting I made about every-10-seconds-tomcat-scans-directories. I believe I have it narrowed down to java.io.File.DeleteOnExit that tomcat uses in executePartialPut in DefaultServlet.java. Apparently, this java routine has a known problem on Win32 systems. I've been asked by one of the tomcat guys to get some hard evidence, but I don't have time to tear the tomcat source code apart looking for this and was hoping some of the other users out there are seeing the same problem. Regards all, Ed - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat keeps growing in size on Win32
Are you actually running out of memory? Or is the heap just growing? Garbage collection is a bit arbitrary and may not occur until there is a need. HTH - Richard -Original Message- From: Ed Hamilton [mailto:[EMAIL PROTECTED] Sent: Monday, June 13, 2005 4:39 PM To: 'Tomcat Users List' Subject: RE: Tomcat keeps growing in size on Win32 Thanks, Robson, for the reply. I have all the latest versions of everything: Tomcat: 5.5.9 JDSK: 1.5.0.03 JDBC: 3.18a Isapi Redirector: 1.2.13 There is no website/database activity, just tomcat running. I believe it's related to the other posting I made about every-10-seconds-tomcat-scans-directories. I believe I have it narrowed down to java.io.File.DeleteOnExit that tomcat uses in executePartialPut in DefaultServlet.java. Apparently, this java routine has a known problem on Win32 systems. I've been asked by one of the tomcat guys to get some hard evidence, but I don't have time to tear the tomcat source code apart looking for this and was hoping some of the other users out there are seeing the same problem. Regards all, Ed - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat keeps growing in size on Win32
Ed. Why don't you set a maximum heap size and see if it garbage collects when it hits that size. Sounds like your application does not need that much memory so try setting it to something like either: JAVA_OPTS=-Xms64m -Xmx128m Or CATALINA_OPTS=-Xms64m -Xmx128m This assumes you are starting Tomcat using the bin/catalina.bat script. This will start it off with 64MB and let it grow to about 128MB (probably a bit more in reality). It should garbage collect at that point. If you are running Java 1.5 you can use the included Jconsole tool to monitor memory usage. It will show you a saw tooth pattern if the garbage collection is working properly. HTH - Richard -Original Message- From: Ed Hamilton [mailto:[EMAIL PROTECTED] Sent: Monday, June 13, 2005 6:47 PM To: 'Tomcat Users List' Subject: RE: Tomcat keeps growing in size on Win32 Richard: Looking at Tomcat with the task manager, it grows unchecked from a boot value of about 45MB to however big I let it go; biggest I saw was 250MB after about 6 days. At that point it's affecting system performance and I have to reboot. I'm pretty sure the GC would have run in there somewhere. So, yes, the heap is growing, if that is what the task manager sees as Tomcat's memory usage climbing (I think so); it will do so until I run out of memory - I haven't let it get that far, though. Thanks, Ed -Original Message- From: Richard Mixon (qwest) [mailto:[EMAIL PROTECTED] Sent: Monday, June 13, 2005 5:15 PM To: 'Tomcat Users List' Subject: RE: Tomcat keeps growing in size on Win32 Are you actually running out of memory? Or is the heap just growing? Garbage collection is a bit arbitrary and may not occur until there is a need. HTH - Richard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat keeps growing in size on Win32
Ed. Why don't you set a maximum heap size and see if it garbage collects when it hits that size. Sounds like your application does not need that much memory so try setting it to something like either: JAVA_OPTS=-Xms64m -Xmx128m Or CATALINA_OPTS=-Xms64m -Xmx128m This assumes you are starting Tomcat using the bin/catalina.bat script. This will start it off with 64MB and let it grow to about 128MB (probably a bit more in reality). It should garbage collect at that point. If you are running Java 1.5 you can use the included Jconsole tool to monitor memory usage. It will show you a saw tooth pattern if the garbage collection is working properly. HTH - Richard -Original Message- From: Ed Hamilton [mailto:[EMAIL PROTECTED] Sent: Monday, June 13, 2005 6:47 PM To: 'Tomcat Users List' Subject: RE: Tomcat keeps growing in size on Win32 Richard: Looking at Tomcat with the task manager, it grows unchecked from a boot value of about 45MB to however big I let it go; biggest I saw was 250MB after about 6 days. At that point it's affecting system performance and I have to reboot. I'm pretty sure the GC would have run in there somewhere. So, yes, the heap is growing, if that is what the task manager sees as Tomcat's memory usage climbing (I think so); it will do so until I run out of memory - I haven't let it get that far, though. Thanks, Ed -Original Message- From: Richard Mixon (qwest) [mailto:[EMAIL PROTECTED] Sent: Monday, June 13, 2005 5:15 PM To: 'Tomcat Users List' Subject: RE: Tomcat keeps growing in size on Win32 Are you actually running out of memory? Or is the heap just growing? Garbage collection is a bit arbitrary and may not occur until there is a need. HTH - Richard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: apache2+mod_jk + ssl: howto
faisal mailto:[EMAIL PROTECTED] scribbled on Saturday, June 04, 2005 4:40 AM: i used mod_jk2 when i was integrating tomcat with apache2. i also tried my hands on mod_jk and i find mod_jk2 a bit simpler of the two. regarding SSL, ur gonna ve to enable SSL on both server. Not sure what you mean by this. However we only have our certificate configured under Apache (Apache 2.0.49 and Tomcat 5.5.7). Our web application does check to make sure that the HTTPS protocol was used - but there is nothing special we did in Tomcat to enable that. ... apache2 on fedora core 3 comes SSL ebabled so i did't ve to do anything there. my java web application used SSL for user logins so i had to configure my tomcat to enable SSL (java jeystore and tomcat server.xml and stuff.) be carefull when redirecting user requests to HTTP to SSL or SSL to HTTP port on ur tomcat. use Apache web server ports instead of tomcat's port(which are 80 for http and 443 for https.) how ur gonna integrate Apache web server - tomcat?? u dont. AJPConnetor13 does it for u. u only ve to configure ur apache server to use mod_jk2 for ur web app requests. tomcat handles everything out of box(atleast newer one which we uses.) -Original Message- From: jfc100 [mailto:[EMAIL PROTECTED] Sent: Saturday, June 04, 2005 1:54 PM To: tomcat-user Subject: apache2+mod_jk + ssl: howto Hi, My environment: linux 2.4.22, httpd2 running on its own machine with an appropriate mod_jk module, tomcat4.1.24+jboss3 running on a seperate machine. I have searched this list for an answer to my question but so far have come up empty handed. My question is simply, 'If I want to front an instance of tomcat with an instance of apache httpd and to enable my java webapps to use ssl, do I need to configure httpd for ssl or do I need to configure tomcat for ssl?'. Any help will be much appreciated. jfc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: apache2+mod_jk + ssl: howto
faisal mailto:[EMAIL PROTECTED] scribbled on Saturday, June 04, 2005 4:40 AM: i used mod_jk2 when i was integrating tomcat with apache2. i also tried my hands on mod_jk and i find mod_jk2 a bit simpler of the two. regarding SSL, ur gonna ve to enable SSL on both server. Not sure what you mean by this. However we only have our certificate configured under Apache (Apache 2.0.49 and Tomcat 5.5.7). Our web application does check to make sure that the HTTPS protocol was used - but there is nothing special we did in Tomcat to enable that. ... apache2 on fedora core 3 comes SSL ebabled so i did't ve to do anything there. my java web application used SSL for user logins so i had to configure my tomcat to enable SSL (java jeystore and tomcat server.xml and stuff.) be carefull when redirecting user requests to HTTP to SSL or SSL to HTTP port on ur tomcat. use Apache web server ports instead of tomcat's port(which are 80 for http and 443 for https.) how ur gonna integrate Apache web server - tomcat?? u dont. AJPConnetor13 does it for u. u only ve to configure ur apache server to use mod_jk2 for ur web app requests. tomcat handles everything out of box(atleast newer one which we uses.) -Original Message- From: jfc100 [mailto:[EMAIL PROTECTED] Sent: Saturday, June 04, 2005 1:54 PM To: tomcat-user Subject: apache2+mod_jk + ssl: howto Hi, My environment: linux 2.4.22, httpd2 running on its own machine with an appropriate mod_jk module, tomcat4.1.24+jboss3 running on a seperate machine. I have searched this list for an answer to my question but so far have come up empty handed. My question is simply, 'If I want to front an instance of tomcat with an instance of apache httpd and to enable my java webapps to use ssl, do I need to configure httpd for ssl or do I need to configure tomcat for ssl?'. Any help will be much appreciated. jfc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [Tomcat] Web Traffic Analisys Tool
Omar Adobati mailto:[EMAIL PROTECTED] scribbled on Sunday, May 22, 2005 2:45 AM: thank you for your replay, but I'm looking for anything written in java/jsp 'cose I need to use it with Tomcat, or with any other java/jsp container. Do you know anything about it? On 5/22/05, Michael Echerer [EMAIL PROTECTED] wrote: Omar Adobati wrote: Good Morning all, I'm looking for a free and good web traffic analyzer to use with tomcat 5.x but searching on the net I can't find anything good. Does anyone know a good tool? (if it exists) Thanks in advice What about analog, webalizer or awstats? http://awstats.sourceforge.net/docs/awstats_compare.html Omar, The web traffic analyzer software Michael referred to will work with any web server, not just one with a java/JSP container such as Tomcat. There is nothing java-specific about the traffic itself, just how the traffic is produced. Maybe we do not understand what you are trying to measure. Could you explain more? HTH - Richard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [Tomcat] Web Traffic Analisys Tool
Omar Adobati mailto:[EMAIL PROTECTED] scribbled on Sunday, May 22, 2005 2:45 AM: thank you for your replay, but I'm looking for anything written in java/jsp 'cose I need to use it with Tomcat, or with any other java/jsp container. Do you know anything about it? On 5/22/05, Michael Echerer [EMAIL PROTECTED] wrote: Omar Adobati wrote: Good Morning all, I'm looking for a free and good web traffic analyzer to use with tomcat 5.x but searching on the net I can't find anything good. Does anyone know a good tool? (if it exists) Thanks in advice What about analog, webalizer or awstats? http://awstats.sourceforge.net/docs/awstats_compare.html Omar, The web traffic analyzer software Michael referred to will work with any web server, not just one with a java/JSP container such as Tomcat. There is nothing java-specific about the traffic itself, just how the traffic is produced. Maybe we do not understand what you are trying to measure. Could you explain more? HTH - Richard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat webserver or appserver?
raja buddha mailto:[EMAIL PROTECTED] scribbled on Saturday, May 21, 2005 3:07 PM: Hi all. I am new to appache. I wanted to know where tomcat is webserver or appserver Raju Just to be clear, the Apache HTTP Web server (http://httpd.apache.org) is different than the Tomcat Java web application server (http://jakarta.apache.org/tomcat). Tomcat started as primarily a Java application server with basic HTTP server support. Today it offers pretty complete and sophisticated web server support - although not as complete as the standard Apache web server. As an application server, Tomcat does not support ALL of the J2EE spec, just the parts necessary for what are often called web applications - those primarily using servlet and JSP technologies with underlying database access. For example, you cannot deploy Enterprise Java Beans (Session beans or Entity beans) on Tomcat - but, IMHO, these are only needed for the largest and more sophisticated enterprise applications. The vast majority of web applications and web sites can run on Tomcat. If you really need EJB support you can look at Jboss, WebSphere, BEA or one of the other J2EE application servers. BTW, JBoss embeds a copy of Tomcat as its JSP/Servlet engine. Also, as a standard web (HTTP) server, Tomcat has basic support for CGI and some level of support for PHP (seach the archive for this list). Tomcat does not support the myriad of plugins, extension and modules that Apache or some of the other web servers do. Still most sites can easily be supported by Tomcat and the newer versions are very, very close in terms of performance for serving straight HTML pages. HTH - Richard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat webserver or appserver?
raja buddha mailto:[EMAIL PROTECTED] scribbled on Saturday, May 21, 2005 3:07 PM: Hi all. I am new to appache. I wanted to know where tomcat is webserver or appserver Raju Just to be clear, the Apache HTTP Web server (http://httpd.apache.org) is different than the Tomcat Java web application server (http://jakarta.apache.org/tomcat). Tomcat started as primarily a Java application server with basic HTTP server support. Today it offers pretty complete and sophisticated web server support - although not as complete as the standard Apache web server. As an application server, Tomcat does not support ALL of the J2EE spec, just the parts necessary for what are often called web applications - those primarily using servlet and JSP technologies with underlying database access. For example, you cannot deploy Enterprise Java Beans (Session beans or Entity beans) on Tomcat - but, IMHO, these are only needed for the largest and more sophisticated enterprise applications. The vast majority of web applications and web sites can run on Tomcat. If you really need EJB support you can look at Jboss, WebSphere, BEA or one of the other J2EE application servers. BTW, JBoss embeds a copy of Tomcat as its JSP/Servlet engine. Also, as a standard web (HTTP) server, Tomcat has basic support for CGI and some level of support for PHP (seach the archive for this list). Tomcat does not support the myriad of plugins, extension and modules that Apache or some of the other web servers do. Still most sites can easily be supported by Tomcat and the newer versions are very, very close in terms of performance for serving straight HTML pages. HTH - Richard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts
raja buddha mailto:[EMAIL PROTECTED] scribbled on Saturday, May 21, 2005 3:20 PM: Hi all , I am new to this group. Pls let me know to which email id i need to subscribe to post struts doubts. Raja, you should point your browser over to Struts project at http://struts.apache.org . First look at the Learning link: http://struts.apache.org/learning.html After reading that material if you still have questions you can go to: http://struts.apache.org/using.html#Questions HTH - Richard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts
raja buddha mailto:[EMAIL PROTECTED] scribbled on Saturday, May 21, 2005 3:20 PM: Hi all , I am new to this group. Pls let me know to which email id i need to subscribe to post struts doubts. Raja, you should point your browser over to Struts project at http://struts.apache.org . First look at the Learning link: http://struts.apache.org/learning.html After reading that material if you still have questions you can go to: http://struts.apache.org/using.html#Questions HTH - Richard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts
raja buddha mailto:[EMAIL PROTECTED] scribbled on Saturday, May 21, 2005 4:32 PM: Hi Please let me know what are all the discussion forums are there for struts. Prem Raja/Prem, In my original post I gave you that information. If you are asking what additional forms there are (i.e. not hosted by Struts/Apache) then I would suggest that you Google for Struts forums. HTH - Richard From: Richard Mixon (qwest) Reply-To: Tomcat Users List To: 'Tomcat Users List' Subject: RE: Struts Date: Sat, 21 May 2005 15:37:44 -0700 raja buddha scribbled on Saturday, May 21, 2005 3:20 PM: Hi all , I am new to this group. Pls let me know to which email id i need to subscribe to post struts doubts. Raja, you should point your browser over to Struts project at http://struts.apache.org . First look at the Learning link: http://struts.apache.org/learning.html After reading that material if you still have questions you can go to: http://struts.apache.org/using.html#Questions HTH - Richard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts
raja buddha mailto:[EMAIL PROTECTED] scribbled on Saturday, May 21, 2005 4:32 PM: Hi Please let me know what are all the discussion forums are there for struts. Prem Raja/Prem, In my original post I gave you that information. If you are asking what additional forms there are (i.e. not hosted by Struts/Apache) then I would suggest that you Google for Struts forums. HTH - Richard From: Richard Mixon (qwest) Reply-To: Tomcat Users List To: 'Tomcat Users List' Subject: RE: Struts Date: Sat, 21 May 2005 15:37:44 -0700 raja buddha scribbled on Saturday, May 21, 2005 3:20 PM: Hi all , I am new to this group. Pls let me know to which email id i need to subscribe to post struts doubts. Raja, you should point your browser over to Struts project at http://struts.apache.org . First look at the Learning link: http://struts.apache.org/learning.html After reading that material if you still have questions you can go to: http://struts.apache.org/using.html#Questions HTH - Richard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to do Downtime with a Apache/Tomcat webapp
Len, Sounds simple - but maybe I'm missing something. How do I do maintenance on the site context (under webapp) if the context is being used to show this simple page? It may end up being simplest to alter (or swap in) the Apache config file and do a reload. On my site the reload is pretty quick and I do not think it disrupts active Tomcat sessions (in other contexts). Thanks - Richard -Original Message- From: Len Popp [mailto:[EMAIL PROTECTED] Sent: Monday, May 16, 2005 8:33 AM To: Tomcat Users List Subject: Re: How to do Downtime with a Apache/Tomcat webapp I've been thinking about the same problem, but I haven't gotten around to working on it seriously. How about this: Instead of fiddling with the JkMount directives in Apache, swap the web.xml in your Tomcat app so it points to a minimal servlet that returns the Out of service page for all requests. Does that sound like it would work? It would be less disruptive because you don't have to restart Apache (if there's more to the web site than the one Tomcat app). Plus this will work with stand-alone Tomcat. On 5/15/05, Richard Mixon (qwest) [EMAIL PROTECTED] wrote: I'm curious how folks handle letting users know that their webapp is down when doing maintenance. We've got a pretty standard setup. Our informational/static site is served by Apache 2.0.x. We use mod_jk to link to a page in our webapplications, triggering CMA for authentication and login. We run Tomcat 5.5.x. Although we actually have Tomcat clustered, there are still times when we need to make the application unavailable. (i.e. doing database schema changes, etc.). I would like for a page to be displayed that says the application is temporarily not available. So, what's the best way to do this? One way I can think of is to modify the JkMount directives so that may context name was not mapped to Tomcat, but instead to a static page - the just do a restart. Trouble is some of our users have bookmarks into various pages/actions in the application - we would somehow have to mapp all pages that began with the context name to this single page. This sounds a bit messy. Is there a more straightforward way of doing this? Thank you - Richard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Len Popp - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to do Downtime with a Apache/Tomcat webapp
Len, Sounds simple - but maybe I'm missing something. How do I do maintenance on the site context (under webapp) if the context is being used to show this simple page? It may end up being simplest to alter (or swap in) the Apache config file and do a reload. On my site the reload is pretty quick and I do not think it disrupts active Tomcat sessions (in other contexts). Thanks - Richard -Original Message- From: Len Popp [mailto:[EMAIL PROTECTED] Sent: Monday, May 16, 2005 8:33 AM To: Tomcat Users List Subject: Re: How to do Downtime with a Apache/Tomcat webapp I've been thinking about the same problem, but I haven't gotten around to working on it seriously. How about this: Instead of fiddling with the JkMount directives in Apache, swap the web.xml in your Tomcat app so it points to a minimal servlet that returns the Out of service page for all requests. Does that sound like it would work? It would be less disruptive because you don't have to restart Apache (if there's more to the web site than the one Tomcat app). Plus this will work with stand-alone Tomcat. On 5/15/05, Richard Mixon (qwest) [EMAIL PROTECTED] wrote: I'm curious how folks handle letting users know that their webapp is down when doing maintenance. We've got a pretty standard setup. Our informational/static site is served by Apache 2.0.x. We use mod_jk to link to a page in our webapplications, triggering CMA for authentication and login. We run Tomcat 5.5.x. Although we actually have Tomcat clustered, there are still times when we need to make the application unavailable. (i.e. doing database schema changes, etc.). I would like for a page to be displayed that says the application is temporarily not available. So, what's the best way to do this? One way I can think of is to modify the JkMount directives so that may context name was not mapped to Tomcat, but instead to a static page - the just do a restart. Trouble is some of our users have bookmarks into various pages/actions in the application - we would somehow have to mapp all pages that began with the context name to this single page. This sounds a bit messy. Is there a more straightforward way of doing this? Thank you - Richard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Len Popp - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to do Downtime with a Apache/Tomcat webapp
Will, Thanks - that may be the simplest solution. It just seems errors prone (i.e. updating one of the httpd.conf files, but not the other). Still its appealing for my situation. I am going to better check out the reference Ed sent in an earlier post - that seems to have some potential. - Richard -Original Message- From: Will Hartung [mailto:[EMAIL PROTECTED] Sent: Monday, May 16, 2005 4:43 PM To: Tomcat Users List Subject: Re: How to do Downtime with a Apache/Tomcat webapp From: Richard Mixon (qwest) [EMAIL PROTECTED] Sent: Sunday, May 15, 2005 8:57 PM I'm curious how folks handle letting users know that their webapp is down when doing maintenance. We have an alternate httpd.conf file for Apache that is configured to send everybody to site down come back later static site, then we simply bounce Apache with the new config. It's is not particularly subtle, but we're not a 24x7 site so much, and it's more to let folks coming in know what's happening. But it's simple and quick. Regards, Will Hartung ([EMAIL PROTECTED]) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to do Downtime with a Apache/Tomcat webapp
Will, Thanks - that may be the simplest solution. It just seems errors prone (i.e. updating one of the httpd.conf files, but not the other). Still its appealing for my situation. I am going to better check out the reference Ed sent in an earlier post - that seems to have some potential. - Richard -Original Message- From: Will Hartung [mailto:[EMAIL PROTECTED] Sent: Monday, May 16, 2005 4:43 PM To: Tomcat Users List Subject: Re: How to do Downtime with a Apache/Tomcat webapp From: Richard Mixon (qwest) [EMAIL PROTECTED] Sent: Sunday, May 15, 2005 8:57 PM I'm curious how folks handle letting users know that their webapp is down when doing maintenance. We have an alternate httpd.conf file for Apache that is configured to send everybody to site down come back later static site, then we simply bounce Apache with the new config. It's is not particularly subtle, but we're not a 24x7 site so much, and it's more to let folks coming in know what's happening. But it's simple and quick. Regards, Will Hartung ([EMAIL PROTECTED]) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to do Downtime with a Apache/Tomcat webapp
Frank, Thanks - that's a neat feature to add. It does not work for my current requirement (the entire webapp is down at the time), but there are definite times when I want the webapp up and only limited access (e.g. checking out a just installed/upgraded application). - Richard -Original Message- From: Frank W. Zammetti [mailto:[EMAIL PROTECTED] Sent: Monday, May 16, 2005 12:36 PM To: Tomcat Users List Subject: Re: How to do Downtime with a Apache/Tomcat webapp I had a similar requirement in my app... We had a two-hour window per day when the app was unavailable because background tasks were processing. The server was still up, and so was the app technically, but it was not available. I wrote a filter to take care of this. I had a flag in application context to tell if the app was up or not too, so that if I had to make the app unavailable during a time when it normally was available, I just set the flag. I also defined a single user that was still allowed to get in (another context parameter). This works out great. -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com Len Popp wrote: I've been thinking about the same problem, but I haven't gotten around to working on it seriously. How about this: Instead of fiddling with the JkMount directives in Apache, swap the web.xml in your Tomcat app so it points to a minimal servlet that returns the Out of service page for all requests. Does that sound like it would work? It would be less disruptive because you don't have to restart Apache (if there's more to the web site than the one Tomcat app). Plus this will work with stand-alone Tomcat. On 5/15/05, Richard Mixon (qwest) [EMAIL PROTECTED] wrote: I'm curious how folks handle letting users know that their webapp is down when doing maintenance. We've got a pretty standard setup. Our informational/static site is served by Apache 2.0.x. We use mod_jk to link to a page in our webapplications, triggering CMA for authentication and login. We run Tomcat 5.5.x. Although we actually have Tomcat clustered, there are still times when we need to make the application unavailable. (i.e. doing database schema changes, etc.). I would like for a page to be displayed that says the application is temporarily not available. So, what's the best way to do this? One way I can think of is to modify the JkMount directives so that may context name was not mapped to Tomcat, but instead to a static page - the just do a restart. Trouble is some of our users have bookmarks into various pages/actions in the application - we would somehow have to mapp all pages that began with the context name to this single page. This sounds a bit messy. Is there a more straightforward way of doing this? Thank you - Richard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to do Downtime with a Apache/Tomcat webapp
Frank, Thanks - that's a neat feature to add. It does not work for my current requirement (the entire webapp is down at the time), but there are definite times when I want the webapp up and only limited access (e.g. checking out a just installed/upgraded application). - Richard -Original Message- From: Frank W. Zammetti [mailto:[EMAIL PROTECTED] Sent: Monday, May 16, 2005 12:36 PM To: Tomcat Users List Subject: Re: How to do Downtime with a Apache/Tomcat webapp I had a similar requirement in my app... We had a two-hour window per day when the app was unavailable because background tasks were processing. The server was still up, and so was the app technically, but it was not available. I wrote a filter to take care of this. I had a flag in application context to tell if the app was up or not too, so that if I had to make the app unavailable during a time when it normally was available, I just set the flag. I also defined a single user that was still allowed to get in (another context parameter). This works out great. -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com Len Popp wrote: I've been thinking about the same problem, but I haven't gotten around to working on it seriously. How about this: Instead of fiddling with the JkMount directives in Apache, swap the web.xml in your Tomcat app so it points to a minimal servlet that returns the Out of service page for all requests. Does that sound like it would work? It would be less disruptive because you don't have to restart Apache (if there's more to the web site than the one Tomcat app). Plus this will work with stand-alone Tomcat. On 5/15/05, Richard Mixon (qwest) [EMAIL PROTECTED] wrote: I'm curious how folks handle letting users know that their webapp is down when doing maintenance. We've got a pretty standard setup. Our informational/static site is served by Apache 2.0.x. We use mod_jk to link to a page in our webapplications, triggering CMA for authentication and login. We run Tomcat 5.5.x. Although we actually have Tomcat clustered, there are still times when we need to make the application unavailable. (i.e. doing database schema changes, etc.). I would like for a page to be displayed that says the application is temporarily not available. So, what's the best way to do this? One way I can think of is to modify the JkMount directives so that may context name was not mapped to Tomcat, but instead to a static page - the just do a restart. Trouble is some of our users have bookmarks into various pages/actions in the application - we would somehow have to mapp all pages that began with the context name to this single page. This sounds a bit messy. Is there a more straightforward way of doing this? Thank you - Richard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to do Downtime with a Apache/Tomcat webapp
Ed, Thank you - a very cool reference with a number of tricks/knowledge. - Richard -Original Message- From: Gmail User [mailto:[EMAIL PROTECTED] Sent: Monday, May 16, 2005 1:23 PM To: Tomcat Users List Subject: Re: How to do Downtime with a Apache/Tomcat webapp I believe this link has the info you are looking for. It discusses displaying error messages by Apache when the app server is down. http://wiki.apache.org/cocoon/ApacheModProxy Ed On Mon, 2005-05-16 at 11:33 -0400, Len Popp wrote: I've been thinking about the same problem, but I haven't gotten around to working on it seriously. How about this: Instead of fiddling with the JkMount directives in Apache, swap the web.xml in your Tomcat app so it points to a minimal servlet that returns the Out of service page for all requests. Does that sound like it would work? It would be less disruptive because you don't have to restart Apache (if there's more to the web site than the one Tomcat app). Plus this will work with stand-alone Tomcat. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to do Downtime with a Apache/Tomcat webapp
Ed, Thank you - a very cool reference with a number of tricks/knowledge. - Richard -Original Message- From: Gmail User [mailto:[EMAIL PROTECTED] Sent: Monday, May 16, 2005 1:23 PM To: Tomcat Users List Subject: Re: How to do Downtime with a Apache/Tomcat webapp I believe this link has the info you are looking for. It discusses displaying error messages by Apache when the app server is down. http://wiki.apache.org/cocoon/ApacheModProxy Ed On Mon, 2005-05-16 at 11:33 -0400, Len Popp wrote: I've been thinking about the same problem, but I haven't gotten around to working on it seriously. How about this: Instead of fiddling with the JkMount directives in Apache, swap the web.xml in your Tomcat app so it points to a minimal servlet that returns the Out of service page for all requests. Does that sound like it would work? It would be less disruptive because you don't have to restart Apache (if there's more to the web site than the one Tomcat app). Plus this will work with stand-alone Tomcat. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to do Downtime with a Apache/Tomcat webapp
I'm curious how folks handle letting users know that their webapp is down when doing maintenance. We've got a pretty standard setup. Our informational/static site is served by Apache 2.0.x. We use mod_jk to link to a page in our webapplications, triggering CMA for authentication and login. We run Tomcat 5.5.x. Although we actually have Tomcat clustered, there are still times when we need to make the application unavailable. (i.e. doing database schema changes, etc.). I would like for a page to be displayed that says the application is temporarily not available. So, what's the best way to do this? One way I can think of is to modify the JkMount directives so that may context name was not mapped to Tomcat, but instead to a static page - the just do a restart. Trouble is some of our users have bookmarks into various pages/actions in the application - we would somehow have to mapp all pages that began with the context name to this single page. This sounds a bit messy. Is there a more straightforward way of doing this? Thank you - Richard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to do Downtime with a Apache/Tomcat webapp
I'm curious how folks handle letting users know that their webapp is down when doing maintenance. We've got a pretty standard setup. Our informational/static site is served by Apache 2.0.x. We use mod_jk to link to a page in our webapplications, triggering CMA for authentication and login. We run Tomcat 5.5.x. Although we actually have Tomcat clustered, there are still times when we need to make the application unavailable. (i.e. doing database schema changes, etc.). I would like for a page to be displayed that says the application is temporarily not available. So, what's the best way to do this? One way I can think of is to modify the JkMount directives so that may context name was not mapped to Tomcat, but instead to a static page - the just do a restart. Trouble is some of our users have bookmarks into various pages/actions in the application - we would somehow have to mapp all pages that began with the context name to this single page. This sounds a bit messy. Is there a more straightforward way of doing this? Thank you - Richard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [ANN] Tomcat 5.5.9 voted stable
Christoph Kutzinski wrote: Yoav Shapira wrote: Please note that while all core features have been tested and voted stable, there is a known issue in this build related to the clustering module. The fix for this issue is available by itself at Bugzilla, and will be included in subsequent Tomcat releases. Again, this issue only impacts users of Tomcat's native clustering module. Where can I find information about this issue? I found nothing in the release notes. Probably the release notes were already cut before the fix was created. It is bug #34389. Here is the link: http://issues.apache.org/bugzilla/show_bug.cgi?id=34389 In the future just go to this link and search: http://issues.apache.org/bugzilla/ It is well documented under the support links. HTH - Richard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Apache - JK2 - Tomcat Question
Geoff Wiggs wrote: I have a 'newbie' jk2 / Tomcat question. I am running Tomcat behind Apache with mod_jk2 interfacing the two. snip Just so you are aware, jk2 is deprecated in favor of jk. As of version 1.2.10 of jk, most useful features in jk2 should be in jk. See http://jakarta.apache.org/tomcat/connectors-doc/ This does not mean you cannot use jk2, it just has little support if any. HTH - Richard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] Serialization (was RE: Clustering question)
Peter Crowther wrote: From: Dale, Matt [mailto:[EMAIL PROTECTED] Yes this is a problem. All objects contained within a serializable object must in turn be serializable themselves. Or marked as 'transient'. This omits them from serialization. If you mark them as transient, you may need need to implement a method (ReadObject I believe) that properly initializes the transient variables/objects. There is an earlier post on this list where I describe how to do this. I had a similar problem in that many of my classes had a Commons Logger object stored in them. This had to be re-instatiated correctly when the object was replicated. HTH - Richard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: webappclassloader
Its hard to tell - you need to tell us more - e.g. what version of Tomcat are you using. I have gotten similar messages when I used the deployer app to undeploy a webapp, but due to a lock on a file (i.e. a JSP file was open in a text editor) all of the files were not deleted by the deployer app. - Richard FRANCOIS Dufour wrote: hi to all finaly working realy nice on a .org but i got this comming out resource `/web-inf/classes/listeners/contextlistener.class`is missing? any idee of what it is? [EMAIL PROTECTED] administrateur http://monteregiechat.org - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JDBCRealm changes from Tomcat 5.0.x to 5.5.x
We are using form-based authentication. We changed to the DataSourceRealm last weekend and it appears (so far) to have solved the problem (again with TC 5.5.7 plus session replication patch). - Richard Darren Govoni wrote: I had similar problems, and was forced to revert back to Tomcat 5.0.x. Are you using HTTP or Form-based authentication to get the user credentials? On Tue, 2005-03-08 at 11:57 -0700, Richard Mixon (qwest) wrote: Has anything changed with the way that JDBCReal handles connection timeouts in Tomcat 5.5.7? We upgraded from Tomcat 5.0.19 to Tomcat 5.5.7 in production and are now getting JDBC connection errors when the site has not been accessed for a while. This is happening when a user tries to login - we use a JDBCRealm to authenticate the user. We had this problem a while back but fixed it by adding the autoReconnect parm, but now with Tomcat 5.5. we are having the problem again. We are using MySQL 4.1.7 and version 3.1.7 of the MySQL JDBC connector. Here is the realm specification: Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=com.mysql.jdbc.Driver connectionURL=jdbc:mysql://dbserver1:3306/webapp1?autoReconnect=tru eamp;autoCommit=true connectionName=user1 connectionPassword=password1 userTable=PoPerson userNameCol=userid userCredCol=password userRoleTable=PoPersonRole roleNameCol=roleName / Resource name=jdbc/webapp1 type=javax.sql.DataSource auth=Container maxActive=100 maxIdle=10 maxWait=1 defaultAutoCommit=true username=user1 password=password1 driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://dbserver1:3306/ltojsw?autoRecon nect=trueamp;autoCommit=true removeAbandoned=true removeAbandonedTimeout=60 logAbandoned=true / I also included the corresponding datasource defined for actual application access. The actual exception is below. Would using the DataSourceReal provide any help here? I was thinking that since it uses DBCP pooling maybe timeout recovery might be more robust. I am trying to duplicate the problem in development now, before trying the DataSourceRealm. Thank you all for any suggestions or solutions. - Richard Here is the exception: 16:50:00,269 ERROR [TP-Processor6] [/stars]:541 - Exception retrieving password for wazinger com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception: ** BEGIN NESTED EXCEPTION ** java.net.SocketException MESSAGE: Broken pipe STACKTRACE: java.net.SocketException: Broken pipe at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92) at java.net.SocketOutputStream.write(SocketOutputStream.java:136) at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123) at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2616) at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2547) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1512) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1622) at com.mysql.jdbc.Connection.execSQL(Connection.java:2376) at com.mysql.jdbc.Connection.execSQL(Connection.java:2297) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java: 1860) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:170 5) at org.apache.catalina.realm.JDBCRealm.getPassword(JDBCRealm.java:526) at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:399) at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:347) at org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAut henticator.java:256) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticator Base.java:391) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java 126) at org.apache.catalina.cluster.tcp.ReplicationValve.invoke(ReplicationValve .java:130) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java 105) at org.apache.catalina.valves.FastCommonAccessLogValve.invoke(FastCommonAcc essLogValve.java:481) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve. java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:1 48) at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:306) at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:385) at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:745) at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java: 675) at org.apache.jk.common.SocketConnection.runIt
RE: Being lost in the mailing list
Klaus, Was there a reason you did not use the preconfigured Java 1.4, Tomcat 5.0.19 and JK connectors that come with SuSE Pro 9.1? These are listed under the SuSE YAST Install Software panel. Just select RPM groups Productivity-Networking-Web-FrontEnds. The SuSE prepared README (/usr/share/doc/packages/jakarta-tomcat/README.SuSE) gives a great explanation of how to configure Apache and Tomcat. This is a bit different than just just expanding the archives, but you get the following benefits: 1) Tomcat is integrated into the Linux file structure (i.e. config files are under /etc/apache2, /etc/sysconfig/j2ee, etc; shared files are under /usr/share/tomcat, doc is under /usr/share/doc/packages/jakarta-tomcat,...) 2) Tomcat is installed as a daemon that can be stopped/started/restarted with rctomcat. 3) SuSE does provide security patches for their packages also that can be automatically applied with their Online Update utility. HTH - Richard -Original Message- From: Klaus-F. Kaal [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 08, 2005 12:52 AM To: Tomcat Users List Subject: Re: Being lost in the mailing list Hi Doug, sorry, that I had to shout out, but I can see that every specialist gets tons of eMails every day. And if he or she does not answer straight away to some mails, the others will be dumped in a bin and ... lost. And nobody answered by mails since days... Thanks for your reply. I have aquired a dedicated server with Suse 9.1 preconfigured. It came with Apache 2.0.48, which is working well. I installed - JDK 1.4 - Tomcat 5.0.28 - The latest binary package from mod_JK2 Apache and Tomcat are working well individually. The logs are showing, that Tomcat accepts mod_JK2 well and is prepared to communicate on port 8009. It also creates the /conf/auto/mod_jk.conf, which I show later in this text. Apache is not showing anything in the log. It just states that it did not find the document in its normal public_html space, when I try to call a JSP page. But, I havn't modified the log-level (by the way, where can I do that??). There are soo many how-to's which are all doing different things. I tried to find the essence from several. I must say at this point: I hate to compile packages when I can use binaries. So, I did not follow how-to's which asked me to do that. All other infos are given below. Can you do something with this info? Thanks for any help or hint! Klaus Parsons Technical Services schrieb: There are plenty. You have to be patient. And yes you can get lost. I have several times. Now, where was I? Oh! A few questions for you. Why are you using Apache? What how-to did you follow? Are you using mod-jk or mod-jk2 ? Doug - Original Message - From: Klaus-F. Kaal [EMAIL PROTECTED] To: Tomcat Users List tomcat-user@jakarta.apache.org Sent: Monday, March 07, 2005 6:58 PM Subject: Being lost in the mailing list Hi, I tired to get an answer to my serious questions for quite a while ( I assume, if a question is not answered within a few days, it will be lost ). This mailing-list did not react to my problems. Are there no knowledgeable people out there? To connect Apache to Tomcat should not be a real problem. I just need a little hint to be successful and - I swear - to help other people with my knowledge. But I feel lost. Are alle people circeling around exotic themes? Maybe someone just gives a link where to ask for anwers. Would be very kind and helful. Klaus - My previous questions - Apache still seems to ignore my mod_jk. _In my Tomcat log, I can see:_ INFO: JK2: ajp13 listening on /0.0.0.0:8009 06.03.2005 00:54:10 org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=5/43 config=/usr/tomcat/conf/jk2.properties _I included my automatically created mod_jk.conf into the httpd.conf:_ Include /usr/tomcat/conf/auto/mod_jk.conf This mod_jk.conf looks like this: IfModule !mod_jk.c LoadModule jk_module /usr/lib/apache2-prefork/mod_jk.so /IfModule JkWorkersFile /etc/apache2/workers2.properties JkLogFile /usr/tomcat/logs/mod_jk.log JkLogLevel emerg _The workers2.properties is here:_ [channel.socket:localhost:8009] port=8009 host=127.0.0.1 [ajp13:localhost:8009] channel=channel.socket:localhost:8009 [uri:/jsp-examples/*] worker=ajp13.localhost:8009 [uri:www.technologyserver.com/*.jsp] worker=ajp13:localhost:8009 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: tomcat load-balancing maintenance strategy?
Jim, Also check the archives for my post on restarting a downed Tomcat cluster member. This was not working well prior to Tomcat 5.5.8. When the instance was restarted it would throw exceptions trying to re-synchronize vi session replication. - Richard -Original Message- From: Randall Svancara [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 08, 2005 10:09 AM To: Tomcat Users List Subject: RE: tomcat load-balancing maintenance strategy? Yeah, but you still need to uncomment the cluster element in the server.xml. Also if you have a multi-homed server you need to bind multicast to a specific ip address. Not to mention that you need to set up mod_jk and apache to load balance. It is not just adding a trivial /distributable xml element into the web.xml that makes load balancing with session replication work. Anyway, just my thoughts on the matter Randall -Original Message- From: Ramu, Vinod [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 08, 2005 8:03 AM To: Tomcat Users List Subject: RE: tomcat load-balancing maintenance strategy? I thought /distributable XML element in web.xml does that automatically. -Original Message- From: Randall Svancara [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 08, 2005 9:40 AM To: Tomcat Users List Subject: RE: tomcat load-balancing maintenance strategy? You need to implement either in memory session replication or persist the session in a database or a shared file system. I have finally got my tomcat cluster working and session replication is functional. Randall -Original Message- From: Sng Wee Jim [mailto:[EMAIL PROTECTED] Sent: Monday, March 07, 2005 10:50 PM To: tomcat-user@jakarta.apache.org Subject: tomcat load-balancing maintenance strategy? Hi, I am load-balancing tomcat 5.0.28 using JK1.2 / AJP1.3. For discussion, let's assume I have 2 tomcats (TomcatA and TomcatB) load-balanced. When I shutdown one of the tomcats (Tomcat B), future requests for TomcatB is correctly redirected and handled by the TomcatA. However, the original session on TomcatB is not passed over to TomcatA, and a re-login is required. My question: 1. Is it possible to pass the session information to TomcatA before shutting down TomcatB? For eg. we want to perform servers upgrade, so we down TomcatB, upgrade it, start TomcatB, before doing the same to TomcatA. - Jim The information in this email is confidential and is intended solely for the addressee(s). Access to this email by anyone else is unauthorized. If you are not an intended recipient, please notify the sender of this email immediately. You should not copy, use or disseminate the information contained in the email. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of Capco. http://www.capco.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JDBCRealm changes from Tomcat 5.0.x to 5.5.x
Has anything changed with the way that JDBCReal handles connection timeouts in Tomcat 5.5.7? We upgraded from Tomcat 5.0.19 to Tomcat 5.5.7 in production and are now getting JDBC connection errors when the site has not been accessed for a while. This is happening when a user tries to login - we use a JDBCRealm to authenticate the user. We had this problem a while back but fixed it by adding the autoReconnect parm, but now with Tomcat 5.5. we are having the problem again. We are using MySQL 4.1.7 and version 3.1.7 of the MySQL JDBC connector. Here is the realm specification: Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=com.mysql.jdbc.Driver connectionURL=jdbc:mysql://dbserver1:3306/webapp1?autoReconnect=tru eamp;autoCommit=true connectionName=user1 connectionPassword=password1 userTable=PoPerson userNameCol=userid userCredCol=password userRoleTable=PoPersonRole roleNameCol=roleName / Resource name=jdbc/webapp1 type=javax.sql.DataSource auth=Container maxActive=100 maxIdle=10 maxWait=1 defaultAutoCommit=true username=user1 password=password1 driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://dbserver1:3306/ltojsw?autoRecon nect=trueamp;autoCommit=true removeAbandoned=true removeAbandonedTimeout=60 logAbandoned=true / I also included the corresponding datasource defined for actual application access. The actual exception is below. Would using the DataSourceReal provide any help here? I was thinking that since it uses DBCP pooling maybe timeout recovery might be more robust. I am trying to duplicate the problem in development now, before trying the DataSourceRealm. Thank you all for any suggestions or solutions. - Richard Here is the exception: 16:50:00,269 ERROR [TP-Processor6] [/stars]:541 - Exception retrieving password for wazinger com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception: ** BEGIN NESTED EXCEPTION ** java.net.SocketException MESSAGE: Broken pipe STACKTRACE: java.net.SocketException: Broken pipe at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92) at java.net.SocketOutputStream.write(SocketOutputStream.java:136) at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123) at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2616) at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2547) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1512) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1622) at com.mysql.jdbc.Connection.execSQL(Connection.java:2376) at com.mysql.jdbc.Connection.execSQL(Connection.java:2297) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java: 1860) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:170 5) at org.apache.catalina.realm.JDBCRealm.getPassword(JDBCRealm.java:526) at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:399) at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:347) at org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAut henticator.java:256) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticator Base.java:391) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java :126) at org.apache.catalina.cluster.tcp.ReplicationValve.invoke(ReplicationValve .java:130) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java :105) at org.apache.catalina.valves.FastCommonAccessLogValve.invoke(FastCommonAcc essLogValve.java:481) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve. java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:1 48) at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:306) at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:385) at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:745) at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java: 675) at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:868) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool .java:684) at java.lang.Thread.run(Thread.java:595) ** END NESTED EXCEPTION ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JDBCRealm changes from Tomcat 5.0.x to 5.5.x
Hassan, Could it be that you do not experience the long periods of inactivity on weekends that we do? This only happens on the weekend when we have low activity - sometimes one of the Tomcat instances (they are clustered) will not see a login request for about a half-day. During the week, the longest inactive period is usually about six hours. - Richard -Original Message- From: Hassan Schroeder [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 08, 2005 4:17 PM To: Tomcat Users List Subject: Re: JDBCRealm changes from Tomcat 5.0.x to 5.5.x Richard Mixon (qwest) wrote: We upgraded from Tomcat 5.0.19 to Tomcat 5.5.7 in production and are now getting JDBC connection errors when the site has not been accessed for a while. This is happening when a user tries to login - we use a JDBCRealm to authenticate the user. Would using the DataSourceReal provide any help here? I'm using a DataSourceRealm with 5.5.7 and not seeing any problems reconnecting at any time (MySQL 4.1.7 + Connector/J 3.1.6)... FWIW, -- Hassan Schroeder - [EMAIL PROTECTED] Webtuitive Design === (+1) 408-938-0567 === http://webtuitive.com dream. code. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JDBCRealm changes from Tomcat 5.0.x to 5.5.x
Remy, Thanks - but where do I get the new class file? - Richard -Original Message- From: Remy Maucherat [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 08, 2005 4:01 PM To: Tomcat Users List Subject: Re: JDBCRealm changes from Tomcat 5.0.x to 5.5.x On Tue, 08 Mar 2005 14:28:12 -0800, alexander dosher [EMAIL PROTECTED] wrote: i'm getting the same problem, w/MySQL 4.1.8 3.1.6 connector (except my error is Software caused connection abort rather than broken pipe - but same underlying cause, MySQL timing out the connection). autoReconnect doesn't work for me either. sounds like perhaps i should bail on 5.5.* go to 5.0 for a while? I'd be extremely glad if you could test this possibly fixed realm. Replace the existing class in server/lib/catalina-optional.jar. -- x Rémy Maucherat Developer Consultant JBoss Group (Europe) SàRL x - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat clustering and NotSerializableException
CoyoteRequestFacade is the first element in the stack trace - it is not the session stored object that is causing the NotSerializableException. As I said in my prior posting, to resolve this issue you need to: 1) Identify each object that you are explicitly storing in the session and make sure it directly or indirectly (through inheritance) specified that it implements Serializable. 2) Follow the chain from each session object to other objects that it references and make sure they are ALL marked as serializable (again - either directly or indirectly) That will fix your problem. These issues often do not come up until either you: 1. Try and use session replication. 2. Try to persist sessions to a datastore and access from a cluster. 3. Try to persist sessions across a restart of Tomcat. Also, please just reply to the list - not to the list and to the poster. HTH - Richard Sng Wee Jim wrote: But the stacktrace says java.io.NotSerializableException: org.apache.coyote.tomcat5.CoyoteRequestFacade at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:13 32) at Since CoyoteRequestFacade is a tomcat class, I assume it has to be fixed by the tomcat team. Unless the actual object that is not Serializable not CoyoteRequestFacade is available somewhere else... - Jim -Original Message- From: Richard Mixon (qwest) [mailto:[EMAIL PROTECTED] Sent: Monday, February 28, 2005 11:13 PM To: Tomcat Users List Subject: RE: Tomcat clustering and NotSerializableException As Matt said its probably your applications objects. When we switched to clustering I was surprised at how many of my session objects I needed to add serializable to. But it was easy work and quickl done. HTH - Richard Dale, Matt wrote: I would guess that this means you have an object in your session that does not implement the serializable interface. Ta Matt -Original Message- From: Sng Wee Jim [mailto:[EMAIL PROTECTED] Sent: 28 February 2005 09:21 To: tomcat-user@jakarta.apache.org Subject: Tomcat clustering and NotSerializableException Hi, I am using Tomcat 5.0.28 on MS Win2k server. After I have uncommented the Cluster element in server.xml, I get the following exceptions on the tomcat console for some actions that are using displaytag. Is it a tomcat bug, since org.apache.coyote.tomcat5.CoyoteRequestFacade is involved? (DeltaManager.java:813)- Unable to serialize delta request java.io.NotSerializableException: org.apache.coyote.tomcat5.CoyoteRequestFacade at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java 1332) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:13 04) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.jav a:1247) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278) at org.apache.catalina.cluster.session.DeltaRequest$AttributeInfo.writeE xternal(DeltaRequest.java:300) at org.apache.catalina.cluster.session.DeltaRequest.writeExternal(DeltaR equest.java:217) at org.apache.catalina.cluster.session.DeltaManager.unloadDeltaRequest(D eltaManager.java:393) at org.apache.catalina.cluster.session.DeltaManager.requestCompleted(Del taManager.java:782) at org.apache.catalina.cluster.tcp.ReplicationValve.invoke(ReplicationVa lve.java:203) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv eContext.java:102) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j ava:118) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv eContext.java:102) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav a:520) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal ve.java:109) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv eContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav a:520) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:16 0) at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:300) at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:374) at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:743) at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.ja va:675) at org.apache.jk.common.SocketConnection.runIt
RE: Tomcat Cluster
Randall, Below is the clustering section of my server.xml running under SuSE Linux (SLES9). Things to check I can think of: 1. Is your server multi-homed (more than one network adapter)? If so you must (at least from my experience) specify both mcastBindAddr and tcpListendAddress as shown below. In my case I'm using a dedicated adapter to connect the cluster over the private address space 192.168.11.x. Obviously the values are different for the Tomcat instance on each server. 2. If after reviewing this it still does not work you can test that multicasting is really working by using the utilities included in the JGroups jars. See: http://www.jgroups.org/javagroupsnew/docs/newuser/node15.html#ItDoesnt Work HTH - Richard SNIP Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster managerClassName=org.apache.catalina.cluster.session.DeltaMa nager expireSessionsOnShutdown=false useDirtyFlag=true notifyListenersOnReplication=true Membership className=org.apache.catalina.cluster.mcast.McastService mcastAddr=228.0.0.4 mcastPort=45564 mcastBindAddr=192.168.11.3 mcastFrequency=500 mcastDropTime=3000/ Receiver className=org.apache.catalina.cluster.tcp.ReplicationListener tcpListenAddress=192.168.11.3 tcpListenPort=4001 tcpSelectorTimeout=100 tcpThreadCount=6/ Sender className=org.apache.catalina.cluster.tcp.ReplicationTransmit ter replicationMode=pooled ackTimeout=15000/ Valve className=org.apache.catalina.cluster.tcp.ReplicationValve filter=.*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.html;.*\ .css;.*\.txt;/ Deployer className=org.apache.catalina.cluster.deploy.FarmWarDeployer tempDir=/tmp/war-temp/ deployDir=/home/tomcat1/jakarta-tomcat-5.5.7/webapps watchDir=/home/tomcat1/jakarta-tomcat-5.5.7-deployer/bu ild/webapp watchEnabled=false/ /Cluster SNIP -Original Message- From: Randall Svancara [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 01, 2005 8:47 AM To: Tomcat Users List Subject: RE: Tomcat Cluster Apparently this was too verbose for anyone to read. I simply just don't understand why each tomcat instance is failing to recognize any other instance in the cluster. Multicast messages are being broadcasted. Is there any configuration parameter I can turn on that will verify that each tomcat instance can see the other instances??? Thanks, Randall -Original Message- From: Randall Svancara [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 23, 2005 9:44 AM To: Tomcat Users List Subject: Tomcat Cluster I have attempted to configure a tomcat cluster using version 5.5.7 of tomcat. I have configured a simple tcp cluster in the server.xml. I have two tomcat instances installed on two different Linux servers (Fedora core 3, IPTAPLES is turned off, there is not firewall). I have apache and mod_jk set up on a third server. Multicast is enabled!!! When I start up each tomcat instance I receive the following message in the catalina.out file. -- Feb 23, 2005 9:21:49 AM org.apache.catalina.cluster.tcp.SimpleTcpCluster start INFO: Cluster is about to start Feb 23, 2005 9:21:49 AM org.apache.catalina.cluster.mcast.McastServiceImpl setupSocket INFO: Setting multihome multicast interface to:/10.111.22.163 Feb 23, 2005 9:21:49 AM org.apache.catalina.cluster.mcast.McastService start INFO: Sleeping for 2000 secs to establish cluster membership Feb 23, 2005 9:21:51 AM org.apache.catalina.cluster.deploy.FarmWarDeployer start INFO: Cluster FarmWarDeployer started. Feb 23, 2005 9:21:51 AM org.apache.catalina.cluster.session.DeltaManager start INFO: Starting clustering manager...:/testapp Feb 23, 2005 9:21:51 AM org.apache.catalina.cluster.session.DeltaManager start INFO: Manager[/testapp], skipping state transfer. No members active in cluster group. - The important thing to note here is that in the last line, I see INFO: Manager[/testapp], skipping state transfer. No members active in cluster group. At first I was thinking that multicast was not working properly. However, I was researching the Tomcat mailing list and found another thread discussing the same issue. I tried to use the tool, tomcat-replication.jar located on the CVS for tomcat. I can see the multicast sessions being generated between both servers using this tool. I also started up ethereal, the packet sniffer. I noticed that both servers are generating multicast packets. However after careful analysis of the packet information, I noticed that my servers were looking for 127.0.0.1/4001 for the receiver port. So I set the tcpListenAddress from auto to 10.111.22.163 This seemed to fix the problem with the multicast packets sending out the incorrect listener addresses. However, I am still getting the same error...
RE: skipping state transfer. No members active in cluster group
Randall, See my answer to your posting on the subject Tomcat Cluster. Both Tomcat 5.0.28 and Tomcat 5.5.7 should work on Linux - at least on SuSE Pro 9.2 and SLES9. However failover restart under session replication works much better on the Tomcat 5.5.8 that is available as alpha. You might do better with a single post - this seems to be a duplicate. - Richard -Original Message- From: Randall Svancara [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 01, 2005 8:50 AM To: Tomcat Users List Subject: RE: skipping state transfer. No members active in cluster group Apparently no one has had any luck with getting tomcat 5.5.7 to work on fedora core 3 in a clustered configuration. I am wondering if the problem is with Linux or with tomcat or a combination of both. Randall -Original Message- From: Randall Svancara [mailto:[EMAIL PROTECTED] Sent: Monday, February 28, 2005 10:27 AM To: Tomcat Users List Subject: skipping state transfer. No members active in cluster group I have a problem in my tomcat logs. I am using tomcat 5.5.7 and whenever I start up tomcat for the first time, I receive this error message. INFO: Manager[/testapp], skipping state transfer. No members active in cluster group. After the delta manager starts, I receive this error. Should I be concerned about this I have set distributable/ in my web.xml. My server.xml has all the clustering stuff enable. I have provided it below!! I have started up ethereal and I can see the multicast packets broadcasting. The data portion contains the ip address of the server. Everything looks like it should work. Randall Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster managerClassName=org.apache.catalina.cluster.session.DeltaManager expireSessionsOnShutdown=false useDirtyFlag=false notifyListenersOnReplication=true Membership className=org.apache.catalina.cluster.mcast.McastService mcastAddr=224.0.0.3 mcastPort=45564 mcastFrequency=500 mcastDropTime=3000 mcastBindAddress=10.111.22.163/ Receiver className=org.apache.catalina.cluster.tcp.ReplicationListener tcpListenAddress=10.111.22.163 tcpListenPort=4002 tcpSelectorTimeout=200 tcpThreadCount=6/ Sender className=org.apache.catalina.cluster.tcp.ReplicationTransmitter replicationMode=pooled ackTimeout=15000/ Valve className=org.apache.catalina.cluster.tcp.ReplicationValve filter=.*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.html;.*\.css;.*\.txt; / Deployer className=org.apache.catalina.cluster.deploy.FarmWarDeployer tempDir=/tmp/war-temp/ deployDir=/tmp/war-deploy/ watchDir=/tmp/war-listen/ watchEnabled=false/ /Cluster - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat clustering and NotSerializableException
If you specify transient on the HttpServletRequest property in your form bean (this does not seem like good design) you must make provisions when the form bean is de-serialized on the other end to initialize the property. See my post on this list for the subject titled RE: SOLVED - commons-logging logger instances - how to initialize in replicated session objectsr fo the details of one way to do this. HTH - Richard -Original Message- From: Sng Wee Jim [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 01, 2005 7:47 PM To: Tomcat Users List Subject: RE: Tomcat clustering and NotSerializableException Thanks to all that replied. Indeed a reference to the HttpServletRequest is held in my Struts form (session-scope). The problem went away once I added transient to the attribute. My concern is when the session is replicated to other tomcat instances, will a call to getRequest() always return null? - Jim -Original Message- From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 01, 2005 11:47 PM To: Tomcat Users List Subject: Re: Tomcat clustering and NotSerializableException As Richard says, don't store your request in the session, not a good idea. Richard Mixon (qwest) wrote: CoyoteRequestFacade is the first element in the stack trace - it is not the session stored object that is causing the NotSerializableException. As I said in my prior posting, to resolve this issue you need to: 1) Identify each object that you are explicitly storing in the session and make sure it directly or indirectly (through inheritance) specified that it implements Serializable. 2) Follow the chain from each session object to other objects that it references and make sure they are ALL marked as serializable (again - either directly or indirectly) That will fix your problem. These issues often do not come up until either you: 1. Try and use session replication. 2. Try to persist sessions to a datastore and access from a cluster. 3. Try to persist sessions across a restart of Tomcat. Also, please just reply to the list - not to the list and to the poster. HTH - Richard Sng Wee Jim wrote: But the stacktrace says java.io.NotSerializableException: org.apache.coyote.tomcat5.CoyoteRequestFacade at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1 3 32) at Since CoyoteRequestFacade is a tomcat class, I assume it has to be fixed by the tomcat team. Unless the actual object that is not Serializable not CoyoteRequestFacade is available somewhere else... - Jim -Original Message- From: Richard Mixon (qwest) [mailto:[EMAIL PROTECTED] Sent: Monday, February 28, 2005 11:13 PM To: Tomcat Users List Subject: RE: Tomcat clustering and NotSerializableException As Matt said its probably your applications objects. When we switched to clustering I was surprised at how many of my session objects I needed to add serializable to. But it was easy work and quickl done. HTH - Richard Dale, Matt wrote: I would guess that this means you have an object in your session that does not implement the serializable interface. Ta Matt -Original Message- From: Sng Wee Jim [mailto:[EMAIL PROTECTED] Sent: 28 February 2005 09:21 To: tomcat-user@jakarta.apache.org Subject: Tomcat clustering and NotSerializableException Hi, I am using Tomcat 5.0.28 on MS Win2k server. After I have uncommented the Cluster element in server.xml, I get the following exceptions on the tomcat console for some actions that are using displaytag. Is it a tomcat bug, since org.apache.coyote.tomcat5.CoyoteRequestFacade is involved? (DeltaManager.java:813)- Unable to serialize delta request java.io.NotSerializableException: org.apache.coyote.tomcat5.CoyoteRequestFacade at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java 1332) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:13 04) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.jav a:1247) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278) at org.apache.catalina.cluster.session.DeltaRequest$AttributeInfo.writeE xternal(DeltaRequest.java:300) at org.apache.catalina.cluster.session.DeltaRequest.writeExternal(DeltaR equest.java:217) at org.apache.catalina.cluster.session.DeltaManager.unloadDeltaRequest(D eltaManager.java:393) at org.apache.catalina.cluster.session.DeltaManager.requestCompleted(Del taManager.java:782) at org.apache.catalina.cluster.tcp.ReplicationValve.invoke(ReplicationVa lve.java:203) at org.apache.catalina.core.StandardValveContext.invokeNext
RE: Tomcat clustering and NotSerializableException
As Matt said its probably your applications objects. When we switched to clustering I was surprised at how many of my session objects I needed to add serializable to. But it was easy work and quickl done. HTH - Richard Dale, Matt wrote: I would guess that this means you have an object in your session that does not implement the serializable interface. Ta Matt -Original Message- From: Sng Wee Jim [mailto:[EMAIL PROTECTED] Sent: 28 February 2005 09:21 To: tomcat-user@jakarta.apache.org Subject: Tomcat clustering and NotSerializableException Hi, I am using Tomcat 5.0.28 on MS Win2k server. After I have uncommented the Cluster element in server.xml, I get the following exceptions on the tomcat console for some actions that are using displaytag. Is it a tomcat bug, since org.apache.coyote.tomcat5.CoyoteRequestFacade is involved? (DeltaManager.java:813)- Unable to serialize delta request java.io.NotSerializableException: org.apache.coyote.tomcat5.CoyoteRequestFacade at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java 1332) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:13 04) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.jav a:1247) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278) at org.apache.catalina.cluster.session.DeltaRequest$AttributeInfo.writeE xternal(DeltaRequest.java:300) at org.apache.catalina.cluster.session.DeltaRequest.writeExternal(DeltaR equest.java:217) at org.apache.catalina.cluster.session.DeltaManager.unloadDeltaRequest(D eltaManager.java:393) at org.apache.catalina.cluster.session.DeltaManager.requestCompleted(Del taManager.java:782) at org.apache.catalina.cluster.tcp.ReplicationValve.invoke(ReplicationVa lve.java:203) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv eContext.java:102) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j ava:118) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv eContext.java:102) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav a:520) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal ve.java:109) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv eContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav a:520) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:16 0) at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:300) at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:374) at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:743) at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.ja va:675) at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP ool.java:683) at java.lang.Thread.run(Thread.java:534) - Jim The information in this email is confidential and is intended solely for the addressee(s). Access to this email by anyone else is unauthorized. If you are not an intended recipient, please notify the sender of this email immediately. You should not copy, use or disseminate the information contained in the email. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of Capco. http://www.capco.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Architecture for application and web server
JBoss just did a free webinar that covered the topic pretty well and had some nice PowerPoint slides. You can access the recorded webcast here: https://jboss.webex.com/jboss/onstage/tool/record/viewrecording1.php?E ventID=136098785 But basically, Apache uses Tomcat's AJP protocol to talk with Tomcat, forwarding responses according to its mapping file and received responses that Apache in turn returns to the browser. HTH - Richard [EMAIL PROTECTED] wrote: Hi, Could anyone let me know the link where I could find the architecture of how tomcat (application server) and apache (web server) interact using the connector. I need a detailed description of how the communication generally takes place between them. Regards. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat clustering and NotSerializableException
Randall, I know that session replication works in Tomcat 5.5.7 and it may also works in 5.0.x (no experience). But to get failover restart to work properly (i.e. restarting a failed node) I had to use Tomcat 5.5.7 with a developer-supplied patch. This patch will be available with Tomcat 5.5.8. HTH- Richard Randall Svancara wrote: But do those session objects replicate to the other tomcat instances??? I have been testing session objects that implement java.io.serializable and I have not yet been able to see these objects when fail over occurs to another instance?? Thanks, Randall -Original Message- From: Richard Mixon (qwest) [mailto:[EMAIL PROTECTED] Sent: Monday, February 28, 2005 8:13 AM To: Tomcat Users List Subject: RE: Tomcat clustering and NotSerializableException As Matt said its probably your applications objects. When we switched to clustering I was surprised at how many of my session objects I needed to add serializable to. But it was easy work and quickl done. HTH - Richard Dale, Matt wrote: I would guess that this means you have an object in your session that does not implement the serializable interface. Ta Matt -Original Message- From: Sng Wee Jim [mailto:[EMAIL PROTECTED] Sent: 28 February 2005 09:21 To: tomcat-user@jakarta.apache.org Subject: Tomcat clustering and NotSerializableException Hi, I am using Tomcat 5.0.28 on MS Win2k server. After I have uncommented the Cluster element in server.xml, I get the following exceptions on the tomcat console for some actions that are using displaytag. Is it a tomcat bug, since org.apache.coyote.tomcat5.CoyoteRequestFacade is involved? (DeltaManager.java:813)- Unable to serialize delta request java.io.NotSerializableException: org.apache.coyote.tomcat5.CoyoteRequestFacade at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java 1332) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:13 04) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.jav a:1247) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278) at org.apache.catalina.cluster.session.DeltaRequest$AttributeInfo.writeE xternal(DeltaRequest.java:300) at org.apache.catalina.cluster.session.DeltaRequest.writeExternal(DeltaR equest.java:217) at org.apache.catalina.cluster.session.DeltaManager.unloadDeltaRequest(D eltaManager.java:393) at org.apache.catalina.cluster.session.DeltaManager.requestCompleted(Del taManager.java:782) at org.apache.catalina.cluster.tcp.ReplicationValve.invoke(ReplicationVa lve.java:203) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv eContext.java:102) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j ava:118) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv eContext.java:102) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav a:520) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal ve.java:109) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv eContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav a:520) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:16 0) at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:300) at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:374) at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:743) at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.ja va:675) at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP ool.java:683) at java.lang.Thread.run(Thread.java:534) - Jim The information in this email is confidential and is intended solely for the addressee(s). Access to this email by anyone else is unauthorized. If you are not an intended recipient, please notify the sender of this email immediately. You should not copy, use or disseminate the information contained in the email. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of Capco. http://www.capco.com
RE: Question for Tomcat Developers - How to Plug In Encryption for JDBC passwords
Edmon, I am not sure if I understand, but perhaps you should tak a look at Matt Raible's Appfuse application framework at: https://appfuse.dev.java.net/ His solution uses: - SSL (optional of course, just a servlet parameter); - Container Managed Authentication; - a custom login servlet that encrypts the passwords (SHA is the default, but algorithm can vary); - username and password stored in a database (the password is encrypted using SHA). The only exposure of the passwords might be in your web server access logs. If that too is a concern, you could also take a look at trying to do SHA encryption of the password on the client web browser using Javascript - not sure if that's feasible or not. The login servlet would then need to be adjusted appropriately (i.e. it would not need to do the SHA encryption). HTH - Richard Edmon Begoli wrote: Hi, I an using Tomcat 5.5.7, and I am planning on upgrading as needed. As we all know Tomcat enables me to configure JDBC resources that my app can use through the JNDI. My problem is that these passwords have to be stored as a plain text which is a very bitter pill in my environment. What is the Tomcat class that reads in those plain text values? I would like to override this behavior and to enable this class to read digests/encrypted passwords. I would also contribute this code to Tomcat code base if desired. Please advise, Edmon - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JDBC
Sounds like you need application logic to do this - probably in conjunction with using Tomcat's Container Managed Authentication (CMA). Tomcat can validate the username against a database (see JDBCRealm at http://jakarta.apache.org/tomcat/tomcat-5.5-doc/realm-howto.html#JDBCRea lm ). However after being authenticated you can issue request.getRemoteUser(); to determine which user logged in. Then you can control how their database queries are issued. HTH - Richard deepak suldhal wrote: Hi, This does not solved the problem, with this I can restrict access to user group or allow access. Once the user has access I need to know who he or she is so that I can query the database with respect to his or her user_id. And So how would I do this. Thanks D --- Hiroshi Iwatani [EMAIL PROTECTED] wrote: Write tomcat-users element in the tomcat-users.xml file. deepak suldhal wrote: Hi, I followed the JDBC document posted on Tomcat site. and it works fine. I am able to access the database and see the results. My question is. I have different users who will be using my application and I need to validate these users before I provide them acesss to database. How would I do this ?. Since tomcat has the user name and password already in the context, How would know which user is accessing. Thanks D __ Do you Yahoo!? Yahoo! Mail - You care about security. So do we. http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Hiroshi Iwatani *stop cruelty* Annual number of institutionally euthanized cats and dogs including kittens and puppies: US 5 million, JP 500 thousand. How about your country? *for our better karma* - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail - You care about security. So do we. http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Cluster: how to set mcast interface for dual LAN card? (SOLVED)
The tcpListenAddress (on the Receiver tag) may also need to be set to the correct interface/nic (rather than just auto). - Richard Joseph Lam wrote: I have tried that but still got some weird behavior (seems that it was able to send out broadcast with the proper interface but unable to listen broadcast...). So I gave up that an simply set a static route in the OS for mcast. But thanks anyway. Joseph On Tue, 22 Feb 2005, Filip Hanik - Dev Lists wrote: there is an attribute mcastBindAddr that allows you to bind to the interface. Joseph Lam wrote: Hi, If I have two LAN cards and I want my Tomcat to mcast through one of them, what parameter should I set? Regards, Joseph - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Under Tomcat 5.5.7 how to get Username xxx successfully authenticated
Under Tomcat 5.0.19 I had a logger statement in my application context that created a log file. This log file contained, among other things, a line each time a user successfully/unsuccessfully logged in, similar to: 2005-02-20 07:09:20 JDBCRealm[/stars]: Username xxx successfully authenticated or 2005-02-20 07:09:20 JDBCRealm[/stars]: Username xxx NOT successfully authenticated I understand that under Tomcat 5.5.7 much of the logging is now handled by commons-logging and log4j. Is there still a way to get the above information? I have enabled logging using the instructions in the Tomcat documentation at http://jakarta.apache.org/tomcat/tomcat-5.5-doc/logging.html but do not really get what I am looking for (maybe I do not know what specific logger statements to put in). Thanks - Richard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat 5.5.7 cannot connect to mysql datasource - what changed?
Tom, thanks - finally figured out the username error. And thanks on the password. - Richard Tom A wrote: Richard, In your context file change userName=ltojsw to username=ltojsw (and of course change your passwd now that it's on the 'net ;-) This is why you see the error: Access denied for user ''@'kingfishS11' I just tried to find some docs to make sure I'm right but I can't see anything under the 5.5 documentation :-S Hope this helps Tom. On Mon, 21 Feb 2005 07:32:29 -0700, Richard Mixon (qwest) [EMAIL PROTECTED] wrote: -Original Message- From: Richard Mixon (qwest) [mailto:[EMAIL PROTECTED] Sent: 21 February, 2005 7:53 AM To: tomcat-user@jakarta.apache.org Subject: Tomcat 5.5.7 cannot connect to mysql datasource - what changed? We have been using Sun Java 1.4.2, Tomcat 5.0.19, MySQL 4.1.7, MySQL Connector/J 3.0.15 with Hibernate 2.1.7c with no problems. This is on both Windows XP Pro SP2 (development) and SuSE Linux SLES9 (test and production). In order to get failover to work the way we wanted we upgraded to Tomcat 5.5.7 and Sun Java 1.5. The main change in our application was the new format for data soruces in the application context. No problem on Windows XP. We've tried to install on one of our Linux servers and are having no end of grief getting a DB connection to properly happen. Any help or ideas would be much appreciated. I've included the application context and the catalina log error messages below. Thanks in advance - Richard ***- APPLICATION CONTEXT: Context path=/stars docBase=stars debug=99 reloadable=true privileged=true antiResourceLocking=false antiJARLocking=true Logger className=org.apache.catalina.logger.FileLogger prefix=stars. suffix=.log timestamp=true/ Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=com.mysql.jdbc.Driver connectionURL=jdbc:mysql://192.168.11.3:3306/ltojsw?autoReconnec t=trueamp;autoCommit=true connectionName=ltojsw connectionPassword=586579 userTable=PoAssociate userNameCol=userid userCredCol=password userRoleTable=PoUserRole roleNameCol=roleName / Resource name=jdbc/stars type=javax.sql.DataSource auth=Container maxActive=100 maxIdle=10 maxWait=1 defaultAutoCommit=true userName=ltojsw password=586579 driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://192.168.11.3:3306/ltojsw?aut oReconnect=trueamp;autoCommit=true removeAbandoned=true removeAbandonedTimeout=60 logAbandoned=true / /Context ***- CATALINA ERROR MESSAGES: SNIP 19:37:27,642 INFO [http-8080-Processor25] DatasourceConnectionProvider:51 - Using datasource: java:comp/env/jdbc/stars 19:37:27,648 INFO [http-8080-Processor25] TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended) AbandonedObjectPool is used ([EMAIL PROTECTED]) LogAbandoned: true RemoveAbandoned: true RemoveAbandonedTimeout: 60 19:37:41,696 WARN [http-8080-Processor25] SettingsFactory:107 - Could not obtain connection metadata org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Server connection failure during transaction. Due to underlying exception: 'java.sql.SQLException: Access denied for user ''@'kingfishS11' (using password: YES)'. ** BEGIN NESTED EXCEPTION ** java.sql.SQLException MESSAGE: Access denied for user ''@'kingfishS11' (using password: YES) STACKTRACE: java.sql.SQLException: Access denied for user ''@'kingfishS11' (using password: YES) SNIP - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED
RE: Tomcat 5.5.7 - error trying to replicate session on Linux
BTW, Each of my two servers has two network cards: a) One facing the internet; b) the second is a private connection between the two servers. The second connection is intended for session replication. Also, I did not specify an mcastBindAddr - though it probably should be specified as the second network card. Thanks - Richard Mixon -Original Message- From: Richard Mixon (qwest) [mailto:[EMAIL PROTECTED] Sent: Monday, February 21, 2005 10:14 PM To: tomcat-user@jakarta.apache.org Subject: Tomcat 5.5.7 - error trying to replicate session on Linux OK, we still have one more issue with our Tomcat cluster as we move to our Linux environment. For some reason, both instances (jvmRoute=srv1 and jvmRoute=srv2) see each other at startup. We see that they each join the cluster just fine. But when the first request comes through we get an exception timeout trying to replicate. Of course it works fine in our Windows development environment, but now we are moving to our testing and production environments - SuSE Linux SLES9. Any ideas and suggestions are much appreciated. The catalina.log messages for both Tomcat instances are below. Thanks - Richard CLUSTER MEMBER 2 (jvmRoute=srv1): INFO: Server startup in 7332 ms Feb 21, 2005 9:02:58 PM org.apache.catalina.cluster.tcp.SimpleTcpCluster memberAdded INFO: Replication member added:org.apache.catalina.cluster.mcast.McastMember[tcp://140.99.50.58:4 001,140.99.50.58,4001, alive=2] 21:03:36,258 INFO [TP-Processor3] UserCounterListener:137 - Before increment, User Count: 0 21:03:36,262 INFO [TP-Processor3] UserCounterListener:140 - After increment, User Count: 1 21:03:36,263 INFO [TP-Processor3] UserCounterListener:73 - sessionCreated - Session info: id: '6615ABC7BD43B096AB54C031B7BE02C5.srv1'; createdAt '21:03:36'; lastAccessedAt '21:03:36'; currentTime '21:03:36; session count: '1 21:03:36,264 INFO [TP-Processor3] UserCounterListener:76 - sessionCreated - Session info: id: '6615ABC7BD43B096AB54C031B7BE02C5.srv1'; createdAt '21:03:36'; lastAccessedAt '21:03:36'; currentTime '21:03:36; session count: '1 21:05:14,482 INFO [TP-Processor2] UserCounterListener:137 - Before increment, User Count: 1 21:05:14,483 INFO [TP-Processor2] UserCounterListener:140 - After increment, User Count: 2 21:05:14,484 INFO [TP-Processor2] UserCounterListener:73 - sessionCreated - Session info: id: '61B3F35D9B0AAAE46F75AAA19FFC7D1B.srv1'; createdAt '21:05:14'; lastAccessedAt '21:05:14'; currentTime '21:05:14; session count: '2 21:05:14,485 INFO [TP-Processor2] UserCounterListener:76 - sessionCreated - Session info: id: '61B3F35D9B0AAAE46F75AAA19FFC7D1B.srv1'; createdAt '21:05:14'; lastAccessedAt '21:05:14'; currentTime '21:05:14; session count: '2 Feb 21, 2005 9:06:45 PM org.apache.catalina.cluster.tcp.ReplicationTransmitter sendMessageData WARNING: Unable to send replicated message, is server down? java.net.ConnectException: Connection timed out at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:364) at java.net.Socket.connect(Socket.java:507) at java.net.Socket.connect(Socket.java:457) at java.net.Socket.init(Socket.java:365) at java.net.Socket.init(Socket.java:207) at org.apache.catalina.cluster.tcp.SocketSender.connect(SocketSender.java:1 10) at org.apache.catalina.cluster.tcp.SocketSender.sendMessage(SocketSender.ja va:157) at org.apache.catalina.cluster.tcp.PooledSocketSender.sendMessage(PooledSoc ketSender.java:147) at org.apache.catalina.cluster.tcp.ReplicationTransmitter.sendMessageData(R eplicationTransmitter.java:247) at org.apache.catalina.cluster.tcp.ReplicationTransmitter.sendMessage(Repli cationTransmitter.java:281) at org.apache.catalina.cluster.tcp.SimpleTcpCluster.send(SimpleTcpCluster.j ava:454) at org.apache.catalina.cluster.tcp.SimpleTcpCluster.send(SimpleTcpCluster.j ava:467) at org.apache.catalina.cluster.session.DeltaManager.createSession(DeltaMana ger.java:290) at org.apache.catalina.cluster.session.DeltaManager.createSession(DeltaMana ger.java:239) at org.apache.catalina.connector.Request.doGetSession(Request.java:2199) at org.apache.catalina.connector.Request.getSessionInternal(Request.java:21 50) at org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAut henticator.java:230) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticator Base.java:446) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java :126) at org.apache.catalina.cluster.tcp.ReplicationValve.invoke(ReplicationValve .java:130
RE: Tomcat 5.5.7 - error trying to replicate session on Linux [SOLVED]
OK, I just had to re-read the comments in server.xml and think about my setup a bit more. It still seems like it should have worked the other way [shrug]. Basically I had to tell the cluster setup to use only the network adapters that represent the private link between the two servers (ignoring the other NIC that is my outlet to the Internet). Anyway I changed server.xml as follows: 1) Added mcastBindAddr to thee Membership tag. 2) Changed tcpListentAddress from auto to the actual NIC that I wanted it to listen on. Here's the cluster section of my server.xml in case anyone can benefit from it: Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster managerClassName=org.apache.catalina.cluster.session.D eltaManager expireSessionsOnShutdown=false useDirtyFlag=true notifyListenersOnReplication=true Membership className=org.apache.catalina.cluster.mcast.McastServic e mcastAddr=228.0.0.4 mcastPort=45564 mcastBindAddr=192.168.11.3 mcastFrequency=500 mcastDropTime=3000/ Receiver className=org.apache.catalina.cluster.tcp.ReplicationLi stener tcpListenAddress=192.168.11.3 tcpListenPort=4001 tcpSelectorTimeout=100 tcpThreadCount=6/ Sender className=org.apache.catalina.cluster.tcp.ReplicationTr ansmitter replicationMode=pooled ackTimeout=15000/ Valve className=org.apache.catalina.cluster.tcp.ReplicationValve filter=.*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.ht ml;.*\.css;.*\.txt;/ Deployer className=org.apache.catalina.cluster.deploy.FarmWarDeployer tempDir=/tmp/war-temp/ deployDir=/home/ltojsw/jakarta-tomcat-5.5.7/webap ps watchDir=/home/ltojsw/jakarta-tomcat-5.5.7-deploy er/build/webapp watchEnabled=false/ /Cluster --- Richard Richard Mixon (qwest) wrote: OK, we still have one more issue with our Tomcat cluster as we move to our Linux environment. For some reason, both instances (jvmRoute=srv1 and jvmRoute=srv2) see each other at startup. We see that they each join the cluster just fine. But when the first request comes through we get an exception timeout trying to replicate. Of course it works fine in our Windows development environment, but now we are moving to our testing and production environments - SuSE Linux SLES9. Any ideas and suggestions are much appreciated. The catalina.log messages for both Tomcat instances are below. Thanks - Richard CLUSTER MEMBER 2 (jvmRoute=srv1): INFO: Server startup in 7332 ms Feb 21, 2005 9:02:58 PM org.apache.catalina.cluster.tcp.SimpleTcpCluster memberAdded INFO: Replication member added:org.apache.catalina.cluster.mcast.McastMember[tcp://140.99.50.58:4 001,140.99.50.58,4001, alive=2] 21:03:36,258 INFO [TP-Processor3] UserCounterListener:137 - Before increment, User Count: 0 21:03:36,262 INFO [TP-Processor3] UserCounterListener:140 - After increment, User Count: 1 21:03:36,263 INFO [TP-Processor3] UserCounterListener:73 - sessionCreated - Session info: id: '6615ABC7BD43B096AB54C031B7BE02C5.srv1'; createdAt '21:03:36'; lastAccessedAt '21:03:36'; currentTime '21:03:36; session count: '1 21:03:36,264 INFO [TP-Processor3] UserCounterListener:76 - sessionCreated - Session info: id: '6615ABC7BD43B096AB54C031B7BE02C5.srv1'; createdAt '21:03:36'; lastAccessedAt '21:03:36'; currentTime '21:03:36; session count: '1 21:05:14,482 INFO [TP-Processor2] UserCounterListener:137 - Before increment, User Count: 1 21:05:14,483 INFO [TP-Processor2] UserCounterListener:140 - After increment, User Count: 2 21:05:14,484 INFO [TP-Processor2] UserCounterListener:73 - sessionCreated - Session info: id: '61B3F35D9B0AAAE46F75AAA19FFC7D1B.srv1'; createdAt '21:05:14'; lastAccessedAt '21:05:14'; currentTime '21:05:14; session count: '2 21:05:14,485 INFO [TP-Processor2] UserCounterListener:76 - sessionCreated - Session info: id: '61B3F35D9B0AAAE46F75AAA19FFC7D1B.srv1'; createdAt '21:05:14'; lastAccessedAt '21:05:14'; currentTime '21:05:14; session count: '2 Feb 21, 2005 9:06:45 PM org.apache.catalina.cluster.tcp.ReplicationTransmitter sendMessageData WARNING: Unable to send replicated message, is server down? java.net.ConnectException: Connection timed out at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:364) at java.net.Socket.connect(Socket.java:507
RE: Tomcat 5.5.7 cannot connect to mysql datasource - what changed?
Shakeel, Thanks for the suggestion but we were already using DBCP 1.2.1. I downloaded it and tried it again, but get the same error. Any other ideas why the username would not be passed correctly when creating the datasource/pool? -Original Message- From: Shakeel Ahmad [mailto:[EMAIL PROTECTED] Sent: Sunday, February 20, 2005 10:43 PM To: Tomcat Users List Subject: RE: Tomcat 5.5.7 cannot connect to mysql datasource - what changed? Wel we did the same to upgrade our product all went wel except for the connector. Then after some research I found that mysql-connector-java-3.1.6-bin.jar was the missing part. But your trace also shows that the PoolableConnectionFactory is not being created may be try commons-dbcp-1.2.1.jar if not already upgraded. Best Regards, S H A K E E L A H M A D http://members.fortunecity.com/javaclub/shakeel.htm Voice: 00923002723316 Senior Software Engineer. NorthStar Technologies. www.globalnorthstar.com EE(Computer Engineering), UET Lahore, Pakistan. SCJP,SCWCD SCBCD Sun Microsystems, Inc. Brain Bench Certified Java Programmer. -Original Message- From: Richard Mixon (qwest) [mailto:[EMAIL PROTECTED] Sent: 21 February, 2005 10:24 AM To: Tomcat Users List Subject: RE: Tomcat 5.5.7 cannot connect to mysql datasource - what changed? Actually I tried MySQL Connector/J 3.0.15, and then updated to the latest 3.1.7. Each was placed in in $CATALINA_HOME/common/lib and tried - same result/error message. -Original Message- From: Shakeel Ahmad [mailto:[EMAIL PROTECTED] Sent: Sunday, February 20, 2005 10:22 PM To: Tomcat Users List Subject: RE: Tomcat 5.5.7 cannot connect to mysql datasource - what changed? Have you changed the corresponding mysql connector jar file ? -Original Message- From: Richard Mixon (qwest) [mailto:[EMAIL PROTECTED] Sent: 21 February, 2005 7:53 AM To: tomcat-user@jakarta.apache.org Subject: Tomcat 5.5.7 cannot connect to mysql datasource - what changed? We have been using Sun Java 1.4.2, Tomcat 5.0.19, MySQL 4.1.7, MySQL Connector/J 3.0.15 with Hibernate 2.1.7c with no problems. This is on both Windows XP Pro SP2 (development) and SuSE Linux SLES9 (test and production). In order to get failover to work the way we wanted we upgraded to Tomcat 5.5.7 and Sun Java 1.5. The main change in our application was the new format for data soruces in the application context. No problem on Windows XP. We've tried to install on one of our Linux servers and are having no end of grief getting a DB connection to properly happen. Any help or ideas would be much appreciated. I've included the application context and the catalina log error messages below. Thanks in advance - Richard ***- APPLICATION CONTEXT: Context path=/stars docBase=stars debug=99 reloadable=true privileged=true antiResourceLocking=false antiJARLocking=true Logger className=org.apache.catalina.logger.FileLogger prefix=stars. suffix=.log timestamp=true/ Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=com.mysql.jdbc.Driver connectionURL=jdbc:mysql://192.168.11.3:3306/ltojsw?autoReconnec t=trueamp;autoCommit=true connectionName=ltojsw connectionPassword=586579 userTable=PoAssociate userNameCol=userid userCredCol=password userRoleTable=PoUserRole roleNameCol=roleName / Resourcename=jdbc/stars type=javax.sql.DataSource auth=Container maxActive=100 maxIdle=10 maxWait=1 defaultAutoCommit=true userName=ltojsw password=586579 driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://192.168.11.3:3306/ltojsw?aut oReconnect=trueamp;autoCommit=true removeAbandoned=true removeAbandonedTimeout=60 logAbandoned=true / /Context ***- CATALINA ERROR MESSAGES: SNIP 19:37:27,642 INFO [http-8080-Processor25] DatasourceConnectionProvider:51 - Using datasource: java:comp/env/jdbc/stars 19:37:27,648 INFO [http-8080-Processor25] TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended) AbandonedObjectPool is used ([EMAIL PROTECTED]) LogAbandoned: true RemoveAbandoned: true RemoveAbandonedTimeout: 60 19:37:41,696 WARN [http-8080-Processor25] SettingsFactory:107 - Could not obtain connection metadata org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Server connection failure during transaction. Due to underlying exception: 'java.sql.SQLException: Access denied for user ''@'kingfishS11' (using password: YES)'. ** BEGIN NESTED EXCEPTION ** java.sql.SQLException MESSAGE: Access denied for user ''@'kingfishS11' (using password: YES) STACKTRACE: java.sql.SQLException: Access denied for user
RE: Tomcat 5.5.7 cannot connect to mysql datasource - what changed?
I am able to connect fine using the mysql client - either locally or remotely. It is just with the web application using the JDBC driver that it is not working. Yes, maybe I'm at the point of having to do a simple JDBC application to figure this out - though it seems silly given my application works in Tomcat 5.0.19, but not in Tomcat 5.5.7. Thanks - Richard -Original Message- From: Shakeel Ahmad [mailto:[EMAIL PROTECTED] Sent: Monday, February 21, 2005 6:39 AM To: Tomcat Users List Subject: RE: Tomcat 5.5.7 cannot connect to mysql datasource - what changed? Try to hard code user name as the error shows '' as a user name. Also you can write a simple stand alone java program other than your web application to figure out exact problem. More things more problems. Less things quick findings, might help. By the way is your new MySQL communicating to you via any front end tool like SQL Yog or MySQL Front etc. Best Regards, S H A K E E L A H M A D http://members.fortunecity.com/javaclub/shakeel.htm Voice: 00923002723316 Senior Software Engineer. NorthStar Technologies. www.globalnorthstar.com EE(Computer Engineering), UET Lahore, Pakistan. SCJP,SCWCD SCBCD Sun Microsystems, Inc. Brain Bench Certified Java Programmer. -Original Message- From: Richard Mixon (qwest) [mailto:[EMAIL PROTECTED] Sent: 21 February, 2005 6:16 PM To: Tomcat Users List Subject: RE: Tomcat 5.5.7 cannot connect to mysql datasource - what changed? Shakeel, Thanks for the suggestion but we were already using DBCP 1.2.1. I downloaded it and tried it again, but get the same error. Any other ideas why the username would not be passed correctly when creating the datasource/pool? -Original Message- From: Shakeel Ahmad [mailto:[EMAIL PROTECTED] Sent: Sunday, February 20, 2005 10:43 PM To: Tomcat Users List Subject: RE: Tomcat 5.5.7 cannot connect to mysql datasource - what changed? Wel we did the same to upgrade our product all went wel except for the connector. Then after some research I found that mysql-connector-java-3.1.6-bin.jar was the missing part. But your trace also shows that the PoolableConnectionFactory is not being created may be try commons-dbcp-1.2.1.jar if not already upgraded. Best Regards, S H A K E E L A H M A D http://members.fortunecity.com/javaclub/shakeel.htm Voice: 00923002723316 Senior Software Engineer. NorthStar Technologies. www.globalnorthstar.com EE(Computer Engineering), UET Lahore, Pakistan. SCJP,SCWCD SCBCD Sun Microsystems, Inc. Brain Bench Certified Java Programmer. -Original Message- From: Richard Mixon (qwest) [mailto:[EMAIL PROTECTED] Sent: 21 February, 2005 10:24 AM To: Tomcat Users List Subject: RE: Tomcat 5.5.7 cannot connect to mysql datasource - what changed? Actually I tried MySQL Connector/J 3.0.15, and then updated to the latest 3.1.7. Each was placed in in $CATALINA_HOME/common/lib and tried - same result/error message. -Original Message- From: Shakeel Ahmad [mailto:[EMAIL PROTECTED] Sent: Sunday, February 20, 2005 10:22 PM To: Tomcat Users List Subject: RE: Tomcat 5.5.7 cannot connect to mysql datasource - what changed? Have you changed the corresponding mysql connector jar file ? -Original Message- From: Richard Mixon (qwest) [mailto:[EMAIL PROTECTED] Sent: 21 February, 2005 7:53 AM To: tomcat-user@jakarta.apache.org Subject: Tomcat 5.5.7 cannot connect to mysql datasource - what changed? We have been using Sun Java 1.4.2, Tomcat 5.0.19, MySQL 4.1.7, MySQL Connector/J 3.0.15 with Hibernate 2.1.7c with no problems. This is on both Windows XP Pro SP2 (development) and SuSE Linux SLES9 (test and production). In order to get failover to work the way we wanted we upgraded to Tomcat 5.5.7 and Sun Java 1.5. The main change in our application was the new format for data soruces in the application context. No problem on Windows XP. We've tried to install on one of our Linux servers and are having no end of grief getting a DB connection to properly happen. Any help or ideas would be much appreciated. I've included the application context and the catalina log error messages below. Thanks in advance - Richard ***- APPLICATION CONTEXT: Context path=/stars docBase=stars debug=99 reloadable=true privileged=true antiResourceLocking=false antiJARLocking=true Logger className=org.apache.catalina.logger.FileLogger prefix=stars. suffix=.log timestamp=true/ Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=com.mysql.jdbc.Driver connectionURL=jdbc:mysql://192.168.11.3:3306/ltojsw?autoReconnec t=trueamp;autoCommit=true connectionName=ltojsw connectionPassword=586579 userTable=PoAssociate userNameCol=userid userCredCol=password userRoleTable=PoUserRole roleNameCol=roleName / Resourcename=jdbc/stars type=javax.sql.DataSource auth=Container maxActive=100
RE: Tomcat 5.5.7 cannot connect to mysql datasource - what changed? New approach
Sorry to repost - but, except for some great suggestions from Shakeel, I have not made much progress on this. To my way of thinking this seems maddenly simple - either a config error or possibly bug. But what? So my first place to start is to try and see where it is that the userName property get mangled or swallowed. I've double checkd and it is correctly specified in my context.xml But by the time the failure occurs, it is a null or empty string. So, how can I enable logging on my DBCP datasource so that I can see where the connection userName property gets trashed? I've tried putting org.apache.commons.dbcp in my log4j.properties, but do not seem to get any additional output. Once I can see if things are passed correctly here, I'll look at the MySQL Connector/J logging (although it is not obvious how to do this). Any suggestions? Thanks - Richard -Original Message- From: Richard Mixon (qwest) [mailto:[EMAIL PROTECTED] Sent: Sunday, February 20, 2005 7:53 PM To: tomcat-user@jakarta.apache.org Subject: Tomcat 5.5.7 cannot connect to mysql datasource - what changed? We have been using Sun Java 1.4.2, Tomcat 5.0.19, MySQL 4.1.7, MySQL Connector/J 3.0.15 with Hibernate 2.1.7c with no problems. This is on both Windows XP Pro SP2 (development) and SuSE Linux SLES9 (test and production). In order to get failover to work the way we wanted we upgraded to Tomcat 5.5.7 and Sun Java 1.5. The main change in our application was the new format for data soruces in the application context. No problem on Windows XP. We've tried to install on one of our Linux servers and are having no end of grief getting a DB connection to properly happen. Any help or ideas would be much appreciated. I've included the application context and the catalina log error messages below. Thanks in advance - Richard ***- APPLICATION CONTEXT: Context path=/stars docBase=stars debug=99 reloadable=true privileged=true antiResourceLocking=false antiJARLocking=true Logger className=org.apache.catalina.logger.FileLogger prefix=stars. suffix=.log timestamp=true/ Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=com.mysql.jdbc.Driver connectionURL=jdbc:mysql://192.168.11.3:3306/ltojsw?autoReconnec t=trueamp;autoCommit=true connectionName=ltojsw connectionPassword=586579 userTable=PoAssociate userNameCol=userid userCredCol=password userRoleTable=PoUserRole roleNameCol=roleName / Resourcename=jdbc/stars type=javax.sql.DataSource auth=Container maxActive=100 maxIdle=10 maxWait=1 defaultAutoCommit=true userName=ltojsw password=586579 driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://192.168.11.3:3306/ltojsw?aut oReconnect=trueamp;autoCommit=true removeAbandoned=true removeAbandonedTimeout=60 logAbandoned=true / /Context ***- CATALINA ERROR MESSAGES: SNIP 19:37:27,642 INFO [http-8080-Processor25] DatasourceConnectionProvider:51 - Using datasource: java:comp/env/jdbc/stars 19:37:27,648 INFO [http-8080-Processor25] TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended) AbandonedObjectPool is used ([EMAIL PROTECTED]) LogAbandoned: true RemoveAbandoned: true RemoveAbandonedTimeout: 60 19:37:41,696 WARN [http-8080-Processor25] SettingsFactory:107 - Could not obtain connection metadata org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Server connection failure during transaction. Due to underlying exception: 'java.sql.SQLException: Access denied for user ''@'kingfishS11' (using password: YES)'. ** BEGIN NESTED EXCEPTION ** java.sql.SQLException MESSAGE: Access denied for user ''@'kingfishS11' (using password: YES) STACKTRACE: java.sql.SQLException: Access denied for user ''@'kingfishS11' (using password: YES) SNIP - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat 5.5.7 cannot connect to mysql datasource - what changed? New approach [SOLVED]
OK, yes it turned out to be one of those dumb configuration errors - BUT also a difference in how Tomcat 5.5.7 (or maybe is is Commons DBCP 1.2.1) behaves under Windows versus Linux. I had camelcased the username property in the context.xml Resource tag as userName. This worked under Windows, but NOT for Linux. Anyway, all seems to be working great now that I used just plain username. Thanks for the earlier help and suggestions. - Richard Richard Mixon (qwest) wrote: We have been using Sun Java 1.4.2, Tomcat 5.0.19, MySQL 4.1.7, MySQL Connector/J 3.0.15 with Hibernate 2.1.7c with no problems. This is on both Windows XP Pro SP2 (development) and SuSE Linux SLES9 (test and production). In order to get failover to work the way we wanted we upgraded to Tomcat 5.5.7 and Sun Java 1.5. The main change in our application was the new format for data soruces in the application context. No problem on Windows XP. We've tried to install on one of our Linux servers and are having no end of grief getting a DB connection to properly happen. Any help or ideas would be much appreciated. I've included the application context and the catalina log error messages below. Thanks in advance - Richard ***- APPLICATION CONTEXT: Context path=/stars docBase=stars debug=99 reloadable=true privileged=true antiResourceLocking=false antiJARLocking=true Logger className=org.apache.catalina.logger.FileLogger prefix=stars. suffix=.log timestamp=true/ Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=com.mysql.jdbc.Driver connectionURL=jdbc:mysql://192.168.11.3:3306/ltojsw?autoReconnec t=trueamp;autoCommit=true connectionName=ltojsw connectionPassword=586579 userTable=PoAssociate userNameCol=userid userCredCol=password userRoleTable=PoUserRole roleNameCol=roleName / Resource name=jdbc/stars type=javax.sql.DataSource auth=Container maxActive=100 maxIdle=10 maxWait=1 defaultAutoCommit=true userName=ltojsw password=586579 driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://192.168.11.3:3306/ltojsw?aut oReconnect=trueamp;autoCommit=true removeAbandoned=true removeAbandonedTimeout=60 logAbandoned=true / /Context ***- CATALINA ERROR MESSAGES: SNIP 19:37:27,642 INFO [http-8080-Processor25] DatasourceConnectionProvider:51 - Using datasource: java:comp/env/jdbc/stars 19:37:27,648 INFO [http-8080-Processor25] TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended) AbandonedObjectPool is used ([EMAIL PROTECTED]) LogAbandoned: true RemoveAbandoned: true RemoveAbandonedTimeout: 60 19:37:41,696 WARN [http-8080-Processor25] SettingsFactory:107 - Could not obtain connection metadata org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Server connection failure during transaction. Due to underlying exception: 'java.sql.SQLException: Access denied for user ''@'kingfishS11' (using password: YES)'. ** BEGIN NESTED EXCEPTION ** java.sql.SQLException MESSAGE: Access denied for user ''@'kingfishS11' (using password: YES) STACKTRACE: java.sql.SQLException: Access denied for user ''@'kingfishS11' (using password: YES) SNIP - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Richard Mixon (qwest) wrote: Sorry to repost - but, except for some great suggestions from Shakeel, I have not made much progress on this. To my way of thinking this seems maddenly simple - either a config error or possibly bug. But what? So my first place to start is to try and see where it is that the userName property get mangled or swallowed. I've double checkd and it is correctly specified in my context.xml But by the time the failure occurs, it is a null or empty string. So, how can I enable logging on my DBCP datasource so that I can see where the connection userName property gets trashed? I've tried putting org.apache.commons.dbcp in my log4j.properties, but do not seem to get any additional output. Once I can see if things are passed correctly here, I'll look at the MySQL Connector/J logging (although it is not obvious how to do this). Any suggestions? Thanks - Richard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat 5.5.7 - error trying to replicate session on Linux
OK, we still have one more issue with our Tomcat cluster as we move to our Linux environment. For some reason, both instances (jvmRoute=srv1 and jvmRoute=srv2) see each other at startup. We see that they each join the cluster just fine. But when the first request comes through we get an exception timeout trying to replicate. Of course it works fine in our Windows development environment, but now we are moving to our testing and production environments - SuSE Linux SLES9. Any ideas and suggestions are much appreciated. The catalina.log messages for both Tomcat instances are below. Thanks - Richard CLUSTER MEMBER 2 (jvmRoute=srv1): INFO: Server startup in 7332 ms Feb 21, 2005 9:02:58 PM org.apache.catalina.cluster.tcp.SimpleTcpCluster memberAdded INFO: Replication member added:org.apache.catalina.cluster.mcast.McastMember[tcp://140.99.50.58:4 001,140.99.50.58,4001, alive=2] 21:03:36,258 INFO [TP-Processor3] UserCounterListener:137 - Before increment, User Count: 0 21:03:36,262 INFO [TP-Processor3] UserCounterListener:140 - After increment, User Count: 1 21:03:36,263 INFO [TP-Processor3] UserCounterListener:73 - sessionCreated - Session info: id: '6615ABC7BD43B096AB54C031B7BE02C5.srv1'; createdAt '21:03:36'; lastAccessedAt '21:03:36'; currentTime '21:03:36; session count: '1 21:03:36,264 INFO [TP-Processor3] UserCounterListener:76 - sessionCreated - Session info: id: '6615ABC7BD43B096AB54C031B7BE02C5.srv1'; createdAt '21:03:36'; lastAccessedAt '21:03:36'; currentTime '21:03:36; session count: '1 21:05:14,482 INFO [TP-Processor2] UserCounterListener:137 - Before increment, User Count: 1 21:05:14,483 INFO [TP-Processor2] UserCounterListener:140 - After increment, User Count: 2 21:05:14,484 INFO [TP-Processor2] UserCounterListener:73 - sessionCreated - Session info: id: '61B3F35D9B0AAAE46F75AAA19FFC7D1B.srv1'; createdAt '21:05:14'; lastAccessedAt '21:05:14'; currentTime '21:05:14; session count: '2 21:05:14,485 INFO [TP-Processor2] UserCounterListener:76 - sessionCreated - Session info: id: '61B3F35D9B0AAAE46F75AAA19FFC7D1B.srv1'; createdAt '21:05:14'; lastAccessedAt '21:05:14'; currentTime '21:05:14; session count: '2 Feb 21, 2005 9:06:45 PM org.apache.catalina.cluster.tcp.ReplicationTransmitter sendMessageData WARNING: Unable to send replicated message, is server down? java.net.ConnectException: Connection timed out at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:364) at java.net.Socket.connect(Socket.java:507) at java.net.Socket.connect(Socket.java:457) at java.net.Socket.init(Socket.java:365) at java.net.Socket.init(Socket.java:207) at org.apache.catalina.cluster.tcp.SocketSender.connect(SocketSender.java:1 10) at org.apache.catalina.cluster.tcp.SocketSender.sendMessage(SocketSender.ja va:157) at org.apache.catalina.cluster.tcp.PooledSocketSender.sendMessage(PooledSoc ketSender.java:147) at org.apache.catalina.cluster.tcp.ReplicationTransmitter.sendMessageData(R eplicationTransmitter.java:247) at org.apache.catalina.cluster.tcp.ReplicationTransmitter.sendMessage(Repli cationTransmitter.java:281) at org.apache.catalina.cluster.tcp.SimpleTcpCluster.send(SimpleTcpCluster.j ava:454) at org.apache.catalina.cluster.tcp.SimpleTcpCluster.send(SimpleTcpCluster.j ava:467) at org.apache.catalina.cluster.session.DeltaManager.createSession(DeltaMana ger.java:290) at org.apache.catalina.cluster.session.DeltaManager.createSession(DeltaMana ger.java:239) at org.apache.catalina.connector.Request.doGetSession(Request.java:2199) at org.apache.catalina.connector.Request.getSessionInternal(Request.java:21 50) at org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAut henticator.java:230) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticator Base.java:446) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java :126) at org.apache.catalina.cluster.tcp.ReplicationValve.invoke(ReplicationValve .java:130) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java :105) at org.apache.catalina.valves.FastCommonAccessLogValve.invoke(FastCommonAcc essLogValve.java:481) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve. java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:1 48) at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:306) at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:385) at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:745)
Tomcat 5.5.7 cannot connect to mysql datasource - what changed?
We have been using Sun Java 1.4.2, Tomcat 5.0.19, MySQL 4.1.7, MySQL Connector/J 3.0.15 with Hibernate 2.1.7c with no problems. This is on both Windows XP Pro SP2 (development) and SuSE Linux SLES9 (test and production). In order to get failover to work the way we wanted we upgraded to Tomcat 5.5.7 and Sun Java 1.5. The main change in our application was the new format for data soruces in the application context. No problem on Windows XP. We've tried to install on one of our Linux servers and are having no end of grief getting a DB connection to properly happen. Any help or ideas would be much appreciated. I've included the application context and the catalina log error messages below. Thanks in advance - Richard ***- APPLICATION CONTEXT: Context path=/stars docBase=stars debug=99 reloadable=true privileged=true antiResourceLocking=false antiJARLocking=true Logger className=org.apache.catalina.logger.FileLogger prefix=stars. suffix=.log timestamp=true/ Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=com.mysql.jdbc.Driver connectionURL=jdbc:mysql://192.168.11.3:3306/ltojsw?autoReconnec t=trueamp;autoCommit=true connectionName=ltojsw connectionPassword=586579 userTable=PoAssociate userNameCol=userid userCredCol=password userRoleTable=PoUserRole roleNameCol=roleName / Resourcename=jdbc/stars type=javax.sql.DataSource auth=Container maxActive=100 maxIdle=10 maxWait=1 defaultAutoCommit=true userName=ltojsw password=586579 driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://192.168.11.3:3306/ltojsw?aut oReconnect=trueamp;autoCommit=true removeAbandoned=true removeAbandonedTimeout=60 logAbandoned=true / /Context ***- CATALINA ERROR MESSAGES: SNIP 19:37:27,642 INFO [http-8080-Processor25] DatasourceConnectionProvider:51 - Using datasource: java:comp/env/jdbc/stars 19:37:27,648 INFO [http-8080-Processor25] TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended) AbandonedObjectPool is used ([EMAIL PROTECTED]) LogAbandoned: true RemoveAbandoned: true RemoveAbandonedTimeout: 60 19:37:41,696 WARN [http-8080-Processor25] SettingsFactory:107 - Could not obtain connection metadata org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Server connection failure during transaction. Due to underlying exception: 'java.sql.SQLException: Access denied for user ''@'kingfishS11' (using password: YES)'. ** BEGIN NESTED EXCEPTION ** java.sql.SQLException MESSAGE: Access denied for user ''@'kingfishS11' (using password: YES) STACKTRACE: java.sql.SQLException: Access denied for user ''@'kingfishS11' (using password: YES) SNIP - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat 5.5.7 cannot connect to mysql datasource - what changed?
Actually I tried MySQL Connector/J 3.0.15, and then updated to the latest 3.1.7. Each was placed in in $CATALINA_HOME/common/lib and tried - same result/error message. -Original Message- From: Shakeel Ahmad [mailto:[EMAIL PROTECTED] Sent: Sunday, February 20, 2005 10:22 PM To: Tomcat Users List Subject: RE: Tomcat 5.5.7 cannot connect to mysql datasource - what changed? Have you changed the corresponding mysql connector jar file ? -Original Message- From: Richard Mixon (qwest) [mailto:[EMAIL PROTECTED] Sent: 21 February, 2005 7:53 AM To: tomcat-user@jakarta.apache.org Subject: Tomcat 5.5.7 cannot connect to mysql datasource - what changed? We have been using Sun Java 1.4.2, Tomcat 5.0.19, MySQL 4.1.7, MySQL Connector/J 3.0.15 with Hibernate 2.1.7c with no problems. This is on both Windows XP Pro SP2 (development) and SuSE Linux SLES9 (test and production). In order to get failover to work the way we wanted we upgraded to Tomcat 5.5.7 and Sun Java 1.5. The main change in our application was the new format for data soruces in the application context. No problem on Windows XP. We've tried to install on one of our Linux servers and are having no end of grief getting a DB connection to properly happen. Any help or ideas would be much appreciated. I've included the application context and the catalina log error messages below. Thanks in advance - Richard ***- APPLICATION CONTEXT: Context path=/stars docBase=stars debug=99 reloadable=true privileged=true antiResourceLocking=false antiJARLocking=true Logger className=org.apache.catalina.logger.FileLogger prefix=stars. suffix=.log timestamp=true/ Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=com.mysql.jdbc.Driver connectionURL=jdbc:mysql://192.168.11.3:3306/ltojsw?autoReconnec t=trueamp;autoCommit=true connectionName=ltojsw connectionPassword=586579 userTable=PoAssociate userNameCol=userid userCredCol=password userRoleTable=PoUserRole roleNameCol=roleName / Resourcename=jdbc/stars type=javax.sql.DataSource auth=Container maxActive=100 maxIdle=10 maxWait=1 defaultAutoCommit=true userName=ltojsw password=586579 driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://192.168.11.3:3306/ltojsw?aut oReconnect=trueamp;autoCommit=true removeAbandoned=true removeAbandonedTimeout=60 logAbandoned=true / /Context ***- CATALINA ERROR MESSAGES: SNIP 19:37:27,642 INFO [http-8080-Processor25] DatasourceConnectionProvider:51 - Using datasource: java:comp/env/jdbc/stars 19:37:27,648 INFO [http-8080-Processor25] TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended) AbandonedObjectPool is used ([EMAIL PROTECTED]) LogAbandoned: true RemoveAbandoned: true RemoveAbandonedTimeout: 60 19:37:41,696 WARN [http-8080-Processor25] SettingsFactory:107 - Could not obtain connection metadata org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Server connection failure during transaction. Due to underlying exception: 'java.sql.SQLException: Access denied for user ''@'kingfishS11' (using password: YES)'. ** BEGIN NESTED EXCEPTION ** java.sql.SQLException MESSAGE: Access denied for user ''@'kingfishS11' (using password: YES) STACKTRACE: java.sql.SQLException: Access denied for user ''@'kingfishS11' (using password: YES) SNIP - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Need simple app to test tc5 session failover - please
Dan, I just spent a couple of weeks working with Filip Hanik to get session replication and failover working correctly on Tomcat 5.5.7 (at least for the specifics of my situation). Failover was working fine, though I did have to use a special listener to handle the replication of the jvmRoute suffix with MOD_JK properly. What was not working was when one restarted the failed node - some exceptions would occur and it would not pick up the load properly. I wrote a simple test case application that just updated a counter in an object stored in the session each time a request was submitted. The application is tiny, but the supporting jar files make the zip file about 4mb in size. If you can receive such a large email attachment let me know and I'll send it directly to you. Let me know - Richard Dan Carwin wrote: Hello Tomcat users and creators. Thank you all for helping out. Can anyone point to me a simple app that I can use to test if tomcat 5 session failover is working? I don't think any of the standard tomcat examples will work. I tried numguess, but my guess count gets reset to 1 each time I fail over. I'm not a java programmer so I'm not able to write my own test app. I do know from the docs page that an app has to meet (at least) the following two requirements: 1. All your session attributes must implement java.io.Serializable 2. Make sure your web.xml has the distributable/ element I'm using tomcat 5.0.30 on linux. I have just set up jk-based load balancing and uncommented the cluster section in the server.xml. Thanks very much, [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat 5.5.7 deployer ExceptionInInitializer error
When I use the client deployer to compile my web app I am getting this error under SuSE Linux (SLES9). Under Windows XP it deploys fine. It seems sort of puzzling as to why the deployer is running the Struts org.apache.struts.util.MessageResources.getMessageResources during a compile. Here is a the output: [EMAIL PROTECTED]:~/tc55-deployer echo $JAVA_HOME /usr/java/jdk1.5.0_01 [EMAIL PROTECTED]:~/tc55-deployer echo $ANT_HOME /opt/apache-ant-1.6.2 [EMAIL PROTECTED]:~/tc55-deployer $ANT_HOME/bin/ant compile Buildfile: build.xml clean: compile: [copy] Copying 625 files to /home/ltojsw/tc55-deployer/build/webapp/stars [jasper2] log4j:WARN No appenders could be found for logger (org.apache.jasper.compiler.JspRuntimeContext). [jasper2] log4j:WARN Please initialize the log4j system properly. BUILD FAILED /home/ltojsw/tc55-deployer/build.xml:45: java.lang.ExceptionInInitializerError Total time: 8 seconds The stack trace is below (running ant with -verbose flag). Any idea would fix this? Thank you - Richard [jasper2] Error in class org.apache.jasper.JspC BUILD FAILED /home/ltojsw/tc55-deployer/build.xml:45: java.lang.ExceptionInInitializerError at org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:131) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275) at org.apache.tools.ant.Task.perform(Task.java:364) at org.apache.tools.ant.Target.execute(Target.java:341) at org.apache.tools.ant.Target.performTasks(Target.java:369) at org.apache.tools.ant.Project.executeTarget(Project.java:1214) at org.apache.tools.ant.Project.executeTargets(Project.java:1062) at org.apache.tools.ant.Main.runBuild(Main.java:673) at org.apache.tools.ant.Main.startAnt(Main.java:188) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55) Caused by: java.lang.ExceptionInInitializerError at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:164) at org.apache.strutsel.taglib.html.ELFormTagBeanInfo.class$(ELFormTagBeanIn fo.java:41) at org.apache.strutsel.taglib.html.ELFormTagBeanInfo.getPropertyDescriptors (ELFormTagBeanInfo.java:41) at java.beans.Introspector.getTargetPropertyInfo(Introspector.java:475) at java.beans.Introspector.getBeanInfo(Introspector.java:385) at java.beans.Introspector.getBeanInfo(Introspector.java:155) at org.apache.jasper.compiler.Generator$TagHandlerInfo.init(Generator.jav a:3676) at org.apache.jasper.compiler.Generator$GenerateVisitor.getTagHandlerInfo(G enerator.java:2098) at org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.jav a:1579) at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441) at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163) at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213) at org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.jav a:1685) at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441) at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163) at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213) at org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.jav a:1685) at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441) at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163) at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213) at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219) at org.apache.jasper.compiler.Node$Root.accept(Node.java:456) at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163) at org.apache.jasper.compiler.Generator.generate(Generator.java:3268) at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:189) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:286) at org.apache.jasper.JspC.processFile(JspC.java:854) at org.apache.jasper.JspC.execute(JspC.java:989) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:123) ... 10 more Caused by: java.lang.NullPointerException at org.apache.struts.util.MessageResources.getMessageResources(MessageResou rces.java:498) at org.apache.struts.taglib.html.FormTag.clinit(FormTag.java:95) ... 44 more --- Nested Exception --- java.lang.ExceptionInInitializerError at
Tomcat 5.5.7 deployer ExceptionInInitializer error in Struts getMessageResources
Anybody have any ideas? I have googled this list and others and so far no clues Thank you - Richard -Original Message- From: Richard Mixon (qwest) [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 15, 2005 1:31 AM To: TomcatUsers Subject: Tomcat 5.5.7 deployer ExceptionInInitializer error When I use the client deployer to compile my web app I am getting this error under SuSE Linux (SLES9). Under Windows XP it deploys fine. It seems sort of puzzling as to why the deployer is running the Struts org.apache.struts.util.MessageResources.getMessageResources during a compile. Here is a the output: [EMAIL PROTECTED]:~/tc55-deployer echo $JAVA_HOME /usr/java/jdk1.5.0_01 [EMAIL PROTECTED]:~/tc55-deployer echo $ANT_HOME /opt/apache-ant-1.6.2 [EMAIL PROTECTED]:~/tc55-deployer $ANT_HOME/bin/ant compile Buildfile: build.xml clean: compile: [copy] Copying 625 files to /home/ltojsw/tc55-deployer/build/webapp/stars [jasper2] log4j:WARN No appenders could be found for logger (org.apache.jasper.compiler.JspRuntimeContext). [jasper2] log4j:WARN Please initialize the log4j system properly. BUILD FAILED /home/ltojsw/tc55-deployer/build.xml:45: java.lang.ExceptionInInitializerError Total time: 8 seconds The stack trace is below (running ant with -verbose flag). Any idea would fix this? Thank you - Richard [jasper2] Error in class org.apache.jasper.JspC BUILD FAILED /home/ltojsw/tc55-deployer/build.xml:45: java.lang.ExceptionInInitializerError at org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:131) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275) at org.apache.tools.ant.Task.perform(Task.java:364) at org.apache.tools.ant.Target.execute(Target.java:341) at org.apache.tools.ant.Target.performTasks(Target.java:369) at org.apache.tools.ant.Project.executeTarget(Project.java:1214) at org.apache.tools.ant.Project.executeTargets(Project.java:1062) at org.apache.tools.ant.Main.runBuild(Main.java:673) at org.apache.tools.ant.Main.startAnt(Main.java:188) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55) Caused by: java.lang.ExceptionInInitializerError at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:164) at org.apache.strutsel.taglib.html.ELFormTagBeanInfo.class$(ELFormTagBeanIn fo.java:41) at org.apache.strutsel.taglib.html.ELFormTagBeanInfo.getPropertyDescriptors (ELFormTagBeanInfo.java:41) at java.beans.Introspector.getTargetPropertyInfo(Introspector.java:475) at java.beans.Introspector.getBeanInfo(Introspector.java:385) at java.beans.Introspector.getBeanInfo(Introspector.java:155) at org.apache.jasper.compiler.Generator$TagHandlerInfo.init(Generator.jav a:3676) at org.apache.jasper.compiler.Generator$GenerateVisitor.getTagHandlerInfo(G enerator.java:2098) at org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.jav a:1579) at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441) at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163) at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213) at org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.jav a:1685) at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441) at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163) at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213) at org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.jav a:1685) at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441) at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163) at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213) at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219) at org.apache.jasper.compiler.Node$Root.accept(Node.java:456) at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163) at org.apache.jasper.compiler.Generator.generate(Generator.java:3268) at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:189) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:286) at org.apache.jasper.JspC.processFile(JspC.java:854) at org.apache.jasper.JspC.execute(JspC.java:989) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:123) ... 10 more Caused
RE: Tomcat 5.5.7 deployer ExceptionInInitializer error in Struts getMessageResources
: [echo] Customizing /home/user1/tc55-deployer/build/webapp/stars/META-INF/stars.xml [move] Moving 1 files to /home/user1/tc55-deployer/stars/META-INF [echo] Changing hibernate.connection.driver_class to com.mysql.jdbc.Driver [copy] Copying 1 file to /home/user1/tc55-deployer/stars/META-INF [copy] Copying /home/user1/tc55-deployer/stars/META-INF/context.xml_bak to /home/user1/tc55-deployer/stars/META-INF/context.xml [echo] Customizing stars/WEB-INF/web.xml [move] Moving 1 files to /home/user1/tc55-deployer/stars/WEB-INF [copy] Copying 1 file to /home/user1/tc55-deployer/stars/WEB-INF [echo] Customizing stars/WEB-INF/classes/treecache.xml [move] Moving 1 files to /home/user1/tc55-deployer/stars/WEB-INF/classes [copy] Copying 1 file to /home/user1/tc55-deployer/stars/WEB-INF/classes [echo] Set location to redirect user to when logging off [move] Moving 1 files to /home/user1/tc55-deployer/stars/WEB-INF [copy] Copying 1 file to /home/user1/tc55-deployer/stars/WEB-INF [echo] l4j.error.mail: true; [echo] customizeLog4jProperties: true; customizeContext2: [echo] Customizing /home/user1/tc55-deployer/build/webapp/stars/WEB-INF/classes/log4j.prope rties [move] Moving 1 files to /home/user1/tc55-deployer/stars/WEB-INF/classes [copy] Copying 1 file to /home/user1/tc55-deployer/stars/WEB-INF/classes compile: [copy] Copying 620 files to /home/user1/tc55-deployer/build/webapp/stars [jasper2] java.lang.NullPointerException [jasper2] at org.apache.jasper.JspCompilationContext.createCompiler(JspCompilationCon text.java:220) [jasper2] at org.apache.jasper.JspC.processFile(JspC.java:847) [jasper2] at org.apache.jasper.JspC.execute(JspC.java:989) [jasper2] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [jasper2] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:39) [jasper2] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25) [jasper2] at java.lang.reflect.Method.invoke(Method.java:585) [jasper2] at org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:123) [jasper2] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275) [jasper2] at org.apache.tools.ant.Task.perform(Task.java:364) [jasper2] at org.apache.tools.ant.Target.execute(Target.java:341) [jasper2] at org.apache.tools.ant.Target.performTasks(Target.java:369) [jasper2] at org.apache.tools.ant.Project.executeTarget(Project.java:1214) [jasper2] at org.apache.tools.ant.Project.executeTargets(Project.java:1062) [jasper2] at org.apache.tools.ant.Main.runBuild(Main.java:673) [jasper2] at org.apache.tools.ant.Main.startAnt(Main.java:188) [jasper2] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196) [jasper2] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55) BUILD FAILED /home/user1/tc55-deployer/build.xml:56: org.apache.jasper.JasperException Total time: 4 seconds user1:~/tc55-deployer -Original Message- From: sven morales [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 15, 2005 1:31 PM To: Tomcat Users List Subject: Re: Tomcat 5.5.7 deployer ExceptionInInitializer error in Struts getMessageResources Hi, What do you mean by Under Windows XP it deploys fine. ? I thought your problem is compiling? This deployer (manager webapps) compiles okay in XP and not in SuSE? aka_sergio --- Richard Mixon (qwest) [EMAIL PROTECTED] wrote: Anybody have any ideas? I have googled this list and others and so far no clues Thank you - Richard -Original Message- From: Richard Mixon (qwest) [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 15, 2005 1:31 AM To: TomcatUsers Subject: Tomcat 5.5.7 deployer ExceptionInInitializer error When I use the client deployer to compile my web app I am getting this error under SuSE Linux (SLES9). Under Windows XP it deploys fine. It seems sort of puzzling as to why the deployer is running the Struts org.apache.struts.util.MessageResources.getMessageResources during a compile. Here is a the output: [EMAIL PROTECTED]:~/tc55-deployer echo $JAVA_HOME /usr/java/jdk1.5.0_01 [EMAIL PROTECTED]:~/tc55-deployer echo $ANT_HOME /opt/apache-ant-1.6.2 [EMAIL PROTECTED]:~/tc55-deployer $ANT_HOME/bin/ant compile Buildfile: build.xml clean: compile: [copy] Copying 625 files to /home/ltojsw/tc55-deployer/build/webapp/stars [jasper2] log4j:WARN No appenders could be found for logger (org.apache.jasper.compiler.JspRuntimeContext). [jasper2] log4j:WARN Please initialize the log4j system properly. BUILD FAILED /home/ltojsw/tc55-deployer/build.xml:45: java.lang.ExceptionInInitializerError Total time: 8 seconds The stack trace is below (running ant with -verbose flag). Any idea would fix this? Thank you - Richard [jasper2
RE: Tomcat 5.5.7 deployer ExceptionInInitializer error in Struts getMessageResources
) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275) at org.apache.tools.ant.Task.perform(Task.java:364) at org.apache.tools.ant.Target.execute(Target.java:341) at org.apache.tools.ant.Target.performTasks(Target.java:369) at org.apache.tools.ant.Project.executeTarget(Project.java:1214) at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:386) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275) at org.apache.tools.ant.Task.perform(Task.java:364) at org.apache.tools.ant.Target.execute(Target.java:341) at org.apache.tools.ant.Target.performTasks(Target.java:369) at org.apache.tools.ant.Project.executeTarget(Project.java:1214) at org.apache.tools.ant.Project.executeTargets(Project.java:1062) at org.apache.tools.ant.Main.runBuild(Main.java:673) at org.apache.tools.ant.Main.startAnt(Main.java:188) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55) Caused by: org.apache.jasper.JasperException at org.apache.jasper.JspC.processFile(JspC.java:881) at org.apache.jasper.JspC.execute(JspC.java:989) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:123) ... 16 more --- Nested Exception --- org.apache.jasper.JasperException at org.apache.jasper.JspC.processFile(JspC.java:881) at org.apache.jasper.JspC.execute(JspC.java:989) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:123) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275) at org.apache.tools.ant.Task.perform(Task.java:364) at org.apache.tools.ant.Target.execute(Target.java:341) at org.apache.tools.ant.Target.performTasks(Target.java:369) at org.apache.tools.ant.Project.executeTarget(Project.java:1214) at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:386) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275) at org.apache.tools.ant.Task.perform(Task.java:364) at org.apache.tools.ant.Target.execute(Target.java:341) at org.apache.tools.ant.Target.performTasks(Target.java:369) at org.apache.tools.ant.Project.executeTarget(Project.java:1214) at org.apache.tools.ant.Project.executeTargets(Project.java:1062) at org.apache.tools.ant.Main.runBuild(Main.java:673) at org.apache.tools.ant.Main.startAnt(Main.java:188) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55) Total time: 34 seconds c:\EclipseProjects\workspace\stars -Original Message- From: Richard Mixon (qwest) [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 15, 2005 1:58 PM To: Tomcat Users List Subject: RE: Tomcat 5.5.7 deployer ExceptionInInitializer error in Struts getMessageResources Sven, Sorry I was unclear. I should have said that under Windows XP it compiles fine. Same version of Tomcat (5.5.7), Ant (1.6.2) and similar versions of Java: XP: c:\EclipseProjects\workspace\starsjava -version java version 1.5.0_01 Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_01-b08) Java HotSpot(TM) Client VM (build 1.5.0_01-b08, mixed mode, sharing) SuSE Linux user1:~/tc55-deployer java -version java version 1.5.0_01 Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_01-b08) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_01-b08, mixed mode) user1:~/tc55-deployer What is even weirder (which probably means it is just a config issue somewhere) is that when I set up a log4j.properties file to see if that will illuminate the problem in jasper, I get a different exception (NPE). I've attached two runs below that show where this happens. Thank you - Richard user1:~ cd tc55-deployer/ user1:~ export ANT_HOME=/opt/apache-ant-1.6.2 user1:~ . /etc/sysconfig/tc55 user1:~ . setJava $SETJAVA_OPTS user1:~/tc55-deployer java -version java version 1.5.0_01 Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_01-b08) Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_01-b08, mixed mode) user1:~/tc55-deployer user1:~/tc55-deployer pwd /home/user1/tc55-deployer user1:~/tc55-deployer $ANT_HOME/bin/ant
RE: SOLVED - commons-logging logger instances - how to initialize in replicated session objects
In case anyone else ends up with similar problems trying to get session replication to work for objects that have a commons logging (or other similar) non-serializable instance variable), here's how I solved it. I created the following abstract class with the two methods readObject and readObjectNoData (not sure this one is really needed). All of my classes that might bet saved in a session and be replicated drive directly/indirectly from this class. I was hoping for something a bit more elegant, but it works for now. Thanks Trond for the idea. Any comments or criticisms are welcome. Thanks - Richard package com.acme.common.util; import java.io.Serializable; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /**Loggable Object Class. * pAbstract class to derive business and utility * objects from that require logging support and that * may be serialized (e.g. for Session replication, etc.). */ public abstract class LoggableObject implements Serializable { private static final long serialVersionUID = 1L; public transient Log log = LogFactory.getLog(getClass().getName()); private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException, ClassNotFoundException { stream.defaultReadObject(); // Let default behaviour occur (i.e. handle non-static, non-transient fields) if (log == null) { // Initialize log instance if it is null log = LogFactory.getLog(getClass().getName()); } } private void readObjectNoData() throws java.io.ObjectStreamException { if (log == null) { // Initialize log instance if it is null log = LogFactory.getLog(getClass().getName()); } } } -Original Message- From: Richard Mixon (qwest) [mailto:[EMAIL PROTECTED] Sent: Saturday, February 12, 2005 6:43 AM To: Tomcat Users List Subject: RE: commons-logging logger instances - how to initialize in replicated session objects Thanks Trond, I had forgotten about readObject.That may be a better option than creating yet another utility method. Trond G. Ziarkowski wrote: Hi, I'm maybe stepping out of my territory here, but I think that static members are not serialized/deserialized. To re-initialize your static logger maybe you should try to implement the readObject(java.io.ObjectInputStream in) method from the java.io.Serializable interface something like this: readObject(...) { super.readObject(...); log = LogFactory.getLog(...); } Hope this is of some help Trond - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat 5.5.7 webapp not reload after META-INF/context.xml change
Tevor, Not sure if I have much to add, so much as just clarifying what you are asking. Its of interest to me also. If you are using the tomcat-deployer app, then file tomcat/webapps/your-webapp/META-INF/context.xml normally gets deployed to tomcat/conf/Catalina/localhost/your-webapp.xml. I realize that the tomcat/conf/context.xml specifies that META-INF/context.xml is a watched resource and if changed it should reload the webapp. But are you also expecting it to redeploy META-INF/context.xml to conf/Catalina/localhost/your-webapp.xml ?? I cannot see how that could happen. OTOH, this may just reflect my rather narrow use of Tomcat 5.x - always using tomcat-deployer to deploy my applications. Maybe someone else that know more can comment and we will both learn a bit. HTH - Richard -Original Message- From: Trevor Baker [mailto:[EMAIL PROTECTED] Sent: Sunday, February 13, 2005 7:30 PM To: tomcat-user@jakarta.apache.org Subject: Tomcat 5.5.7 webapp not reload after META-INF/context.xml change Hi, I have an unpacked ROOT webapp and if I change the web.xml for it, the webapp gets reloaded. However if I change the META-INF/context.xml for it, it doesn't get reloaded. It's a WatchedResource too like web.xml. All I'm doing is changing a context-param value in context.xml (as a trivial example to explain my issue). When I change context.xml, I get this in the log: Feb 13, 2005 6:11:39 PM org.apache.catalina.startup.HostConfig checkResources INFO: Reloading context [] So it looks like it should be reloaded, but it doesn't. In: http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/context.html There is: snip WatchedResource - The auto deployer will monitor the specified static resource of the web application for updates, and will reload the web application if is is updated. The content of this element must be a string. /snip So I'm not dreaming. I've also tried restaring the webapp with the manager webapp and still no change. Anyone else have the same issue? Am I doing something wrong? Otherwise I'm going to enter it as a bug. thanks, Trev __ Post your free ad now! http://personals.yahoo.ca - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: commons-logging logger instances - how to initialize in replicated session objects
Thanks Trond, I had forgotten about readObject.That may be a better option than creating yet another utility method. Trond G. Ziarkowski wrote: Hi, I'm maybe stepping out of my territory here, but I think that static members are not serialized/deserialized. To re-initialize your static logger maybe you should try to implement the readObject(java.io.ObjectInputStream in) method from the java.io.Serializable interface something like this: readObject(...) { super.readObject(...); log = LogFactory.getLog(...); } Hope this is of some help Trond - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
commons-logging logger instances - how to initialize in replicated session objects
I have been working with Filip Hanik to get failover/session replication working for my application. Finally it is working quite well. Hooray for Filip! However it did uncover one issue with the way I was handling the commons-logging logger instances in my business objects that I store in the HTTP session at times. Given the following class: public class MyBusinessObject1 implements Serializable { private static Log log = LogFactory.getLog(ClassMeasurementFilter.class); SNIP public void setShowXAxisAsPercentages(boolean showXAxisAsPercentages) { this.showXAxisAsPercentages = showXAxisAsPercentages; if (log == null) { log = LogFactory.getLog(ClassMeasurementFilter.class); log.info(setShowXAxisAsPercentages - log was null); } if (log.isDebugEnabled()) log.debug(setShowXAxisAsPercentages set to +this.showXAxisAsPercentages); } SNIP I had to put the if (log == null) check in because when the objects were replicated to another cluster instance and failover occured I would get an NPE on the log variable. Obviously having to put this if (log == null) check in is very awkward and error prone. Other approaches include creating a utility method in the base class for my business objects. I'm not sure if this will give me the logger per class that I've been used to so that I can readily identify where log messages come from. Are there any other approaches anyone would suggest? Thank you - Richard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
XML/URI issue on Tomcat 5.5.7 and/or Java version issue
) at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(Tiles RequestProcessor.java:316) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java: 231) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1158) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:173) at com.ltoj.webapp.filter.BreadCrumbFilter.doFilter(BreadCrumbFilter.java:9 4) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:173) at com.ltoj.webapp.filter.ActionFilter.doFilter(ActionFilter.java:431) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:173) at com.atlassian.util.profiling.filters.ProfilingFilter.doFilter(ProfilingF ilter.java:132) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv e.java:214) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv e.java:178) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticator Base.java:482) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java :126) at org.apache.catalina.cluster.tcp.ReplicationValve.invoke(ReplicationValve .java:130) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java :105) at org.apache.catalina.valves.FastCommonAccessLogValve.invoke(FastCommonAcc essLogValve.java:481) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:526 ) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve. java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:1 48) at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:306) at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:385) at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:745) at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java: 675) at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:868) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool .java:684) at java.lang.Thread.run(Thread.java:534) -Original Message- From: James Shaw [mailto:[EMAIL PROTECTED] Sent: Thursday, February 03, 2005 6:53 AM To: Batik Users Subject: Re: Error FOP/BATIK ... PDFXMLHandler:253 - svg graphic could not be built Richard Mixon (qwest) wrote: My build of FOP from 2004/05/29 works fine on Sun Java 1.4.1_02 with Tomcat 5.0.19, but when I move toSun Java 1.5.1 and Tomcat 5.5.7 I get the URI I/O error listed below. This build included a Batik.jar with files dates 10/11/2003. Not sure this is particularly helpful, but I have come across similar IO problems running Eclipse with Java 1.5. I understand the problem is related to file locking and is an issue specific to the new version of Java. Unfortunately, my solution was to revert to 1.4. James Shaw - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Error FOP/BATIK ... PDFXMLHandler:253 - svg graphic could not be built
Bingo! That was it. I changed it from file:// to file:/// and all works now. You earlier mentioned that might be it - but I was so focused on the fact that it worked on Java 1.4.1 that I figured I had it correctly. That is weird though that moving past Java 1.4.1 breaks this. Thank you once again, very much - Richard Thomas DeWeese wrote: Hi Richard, What is 'imageURLProtocol' I'm guessing it's file:// I think it should be either file:/// or file:/. Richard Mixon (qwest) wrote: Thomas DeWeese wrote: Richard Mixon (qwest) wrote: I checked my SVG markup and am not sure how I would change this as I'm using an xlink:href. Here is an example: xlink:href=images/allTimeBest/c:out value=${cmSummary.allTimeBestIcon}/ This means that it is using the base URL for the document to resolve the image reference. The base URL for the document would be provided when you parse the document. I have set the base directory as follows: String httpBaseDir = .; imageURLProtocol = getInitParameter(imageURLProtocol); String baseDir = this.getServletContext().getRealPath(httpBaseDir); userAgent = new FOUserAgent(); userAgent.setBaseURL(imageURLProtocol+baseDir); log.info(init - setting httpBaseDir='+httpBaseDir+', baseDir='+baseDir+'); Here is the output from the last log statement: 09:20:23,646 INFO [main] SVG2PDFServlet:112 - init - setting httpBaseDir='.', baseDir='c:\jakarta-tomcat-5.5.7\webapps\stars\.' I think I am setting this base directory correctly. Maybe not? 09:20:56,146 ERROR [TP-Processor2] PDFXMLHandler:253 - svg graphic could not be built: file://c:/jakarta-tomcat-5.5.7/webapps/stars/.:-1 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Jakarta Tomcat Connector - Load Balancing
Derek Greer wrote: Thanks. I don't recall reading this in any of the documentation. Can you explain what setting this actually does? Derek Mladen Turk wrote: Derek Greer wrote: I'm trying to use the Tomcat Connector to do load balancing through the IIS filter, however the sessions do not seem to be 'sticky. According to the documentation, the session is set to sticky by default. Even so, after seeing non-sticky behavior I set my lb worker explicitly (i.e. worker.lbworker.sticky_session=1). Why is this not working? Could be various reasons, but the first one is: Did you set the jvmRoute to match the worker names? It is documented both in the server.xml, in the JK doc and in the Tomcat configuration documentation. e.g - http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/engine.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JK, Session Replication/Clustering, SSL and failover in Tomcat 5
It appears that you are using the deprecated JK2, not JK 1.2.8 that this thread is discussing. Please start a new thread with the appropriate title and you might get better responses. - Richard sulaiman jrar wrote: I am having problem doing sessionreplication apache give me this problem [Mon Jan 31 07:51:02 2005] [notice] config.update(): done config: [Mon Jan 31 07:51:02 2005] [notice] config.update(): done channel.socket:localhost:8009 [Mon Jan 31 07:51:02 2005] [notice] config.update(): done ajp13:localhost:8009 [Mon Jan 31 07:51:02 2005] [notice] config.update(): done channel.socket:localhost:8011 [Mon Jan 31 07:51:02 2005] [notice] config.update(): done ajp13:localhost:8011 [Mon Jan 31 07:51:02 2005] [notice] config.setAttribute() Error setting lb:balanced timeout 90 [Mon Jan 31 07:51:02 2005] [notice] config.setAttribute() Error setting lb:balanced attempts 3 [Mon Jan 31 07:51:02 2005] [notice] config.setAttribute() Error setting lb:balanced recovery 90 [Mon Jan 31 07:51:02 2005] [notice] config.setAttribute() Error setting lb:balanced StickySession 0 [Mon Jan 31 07:51:02 2005] [notice] config.setAttribute() Error setting lb:balanced noworksMsg Server busy please retry after some time [Mon Jan 31 07:51:02 2005] [notice] config.update(): done lb:balanced [Mon Jan 31 07:51:02 2005] [notice] config.update(): done shm [Mon Jan 31 07:51:02 2005] [notice] config.update(): done uri:/SessionRepTest/* [Mon Jan 31 07:51:02 2005] [notice] config.update(): done status: [Mon Jan 31 07:51:02 2005] [notice] config.update(): done uri:/jkstatus/* my worker.properties [logger] level=DEBUG [config:] file=/etc/httpd/conf/workers.properties debug=0 #Socket communication balace for Tomcat1 [channel.socket:localhost:8009] host=localhost port=8009 tomcatId=Tomcat1 group=lb:balanced lb_factor=1 route=Tomcat1Route [ajp13:localhost:8009] channel=channel.socket:Tomcat1 #Socket communication balace for Tomcat2 [channel.socket:localhost:8011] host=localhost port=8011 tomcatId=Tomcat2 group=lb:balanced lb_factor=1 route=Tomcat2Route [ajp13:localhost:8011] channel=channel.socket:Tomcat2 #load balancing [lb:balanced] worker=ajp13:localhost:8009 worker=ajp13:localhost:8011 timeout=90 attempts=3 recovery=90 StickySession=0 noworksMsg=Server busy please retry after some time [shm] file=/etc/httpd/conf/jk2.shm size=100 [uri:/SessionRepTest/*] context=/SessionRepTest info=Display status information and checks the config file for changes. [status:] [uri:/jkstatus/*] group=status workers.properties 65L, 951C my server.xml !-- Example Server Configuration File -- !-- Note that component elements are nested corresponding to their parent-child relationships with each other -- Server port=8006 shutdown=SHUTDOWN debug=0 Listener className=org.apache.catalina.mbeans.ServerLifecycleListener debug=0/ Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener debug=0/ !-- Global JNDI resources -- GlobalNamingResources !-- Test entry for demonstration purposes -- Environment name=simpleValue type=java.lang.Integer value=30/ !-- Editable user database that can also be used by UserDatabaseRealm to authenticate users -- Resource name=UserDatabase auth=Container type=org.apache.catalina.UserDatabase description=User database that can be updated and saved /Resource ResourceParams name=UserDatabase parameter namefactory/name valueorg.apache.catalina.users.MemoryUserDatabaseFactory/value /parameter parameter namepathname/name valueconf/tomcat-users.xml/value /parameter /ResourceParams /GlobalNamingResources Engine name=Standalone defaultHost=Tomcat2 debug=0 jvmRoute=Tomcat2Route Host name=Tomcat2 debug=0 appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster managerClassName=org.apache.catalina.cluster.session.DeltaManager expireSessionsOnShutdown=false useDirtyFlag=true Membership className=org.apache.catalina.cluster.mcast.McastService mcastAddr=228.0.0.4 mcastPort=45564 mcastFrequency=500 mcastDropTime=3000/ Receiver className=org.apache.catalina.cluster.tcp.ReplicationListener tcpListenAddress=auto tcpListenPort=4001 tcpSelectorTimeout=100 tcpThreadCount=6/ Sender className=org.apache.catalina.cluster.tcp.ReplicationTransmitter replicationMode=pooled/ Valve className=org.apache.catalina.cluster.tcp.ReplicationValve filter=.*\.gif;.*\.js;.*\.jpg;.*\.htm;.*\.html;.*\.txt;/
RE: Updating webapps in a running production cluster.
Roberto Cosenza wrote: Sorry if I insist with this post. Has anybody succeeded in updating a webapp in a tomcat cluster without loosing (any)requests? I´m wondering if this is possible at all with tomcat. If we don´t provide a solution we are forced to switch to an other servlet container :- Does anybody know if moving to Jboss, with tomcat as a servlet container, will help? Roberto, The short answer is yes, if you use Tomcat 5.x session replication and failover loadbalancing such as the JK connector. Please check the thread titled: JK, Session Replication/Clustering, SSL and failover in Tomcat 5 - it documents some of the configuration needed for this to happen. I have tested this and when one Tomcat instance fails, all sessions and requests fail over seamlessly - the user is not prompted login again, etc. That said, I am having a problem on session synchronization when the failed or shutdown instance is restarted and needs to replicate all of the sessions back. Filip Hanik is looking into this further. HTH - Richard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Updating webapps in a running production cluster.
Roberto Cosenza wrote: I do mean mod_jk2. Could this be the problem? /roberto Yes - jk2 is deprecated. From what I understand jk 1.2.8 has all significant function of jk2 and is much more stable/reliable. I am not sure whether it has the jkstatus function however. BTW, My tests that showed failover working fine were performed with the Tomcat 5.5.7 from Jan. 19th, 2005. - Richard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Updating webapps in a running production cluster.
Peter, I used the Jan 19th version of Tomcat 5.5.7, Apache 2.0.52 (build for ssl), jk 1.2.8, Windows XP SP2 and Sun JRE 1.5 SP1. - Richard Peter Rossbach wrote: Hello, with which tomcat version you test this, please try the new 5.5.7 and tell us the result! :-) Please tell us your env, Apache, mod_jk JDK, OS Thanx Peter PS: You can find my cluster dev template at http://tomcat.objektpark.org/examples/05_02_tomcat_example.tar.gz, Sorry the docs are german and it works with tomcat 5.5.5m jdk 5, apache 2.0.52, mod_jk 1.2.8 on Windows/Linux Roberto Cosenza schrieb: Sorry if I insist with this post. Has anybody succeeded in updating a webapp in a tomcat cluster without loosing (any)requests? I´m wondering if this is possible at all with tomcat. If we don´t provide a solution we are forced to switch to an other servlet container :- Does anybody know if moving to Jboss, with tomcat as a servlet container, will help? Thanx - Original Message - From: Roberto Cosenza [EMAIL PROTECTED] To: Tomcat Users List tomcat-user@jakarta.apache.org Sent: Thursday, January 20, 2005 8:59 PM Subject: Re: Updating webapps in a running production cluster. We have done some testing in this direction. Two tomcat in a cluster, with session replication. Shutdown B, update B, restart B Shutdown A, update A, restartAB What we experience is that, when shutting down any of the two servers. 1) Few requests are lost (let's say, on our machine, for 0.30 seconds?) 2) Objects stored in the session disappear temporarly, causing eventually annoing npe's. We were wondering if it is possible to achieve an higher reliability but we didn not succeed. /roberto - Original Message - From: Derrick Koes [EMAIL PROTECTED] To: Tomcat Users List tomcat-user@jakarta.apache.org Sent: Thursday, January 20, 2005 8:46 PM Subject: RE: Updating webapps in a running production cluster. This is how we update apps in time critical situations. Shut one down and update. Bring it back up. Shut the next down and update. Bring it back up and so on. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Where is jkstatus function in jk version 1.2.8?
I understand that the jk 1.2.8 connector supercedes the deprecated jk2 connector. I had read previous posting that indicated version 1.2.8 of jk contained equivalent or better function/features than jk2. However the jk2 connector contains documentation on a jkstatus administration interface that seems to offer monitoring and (maybe) some management functions. I do not see this in the jk documentation. Is that feature there? Thanks - Richard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JK, Session Replication/Clustering, SSL and failover in Tomcat 5
Peter Rossbach wrote: That true, I add the JvmRouteBinderValve to the codebase to switch the Session to other node after failure. It works with Tomcat 5.5.5 Config: a) Add Valve at your conf/Catalina/localhost/context.xml.default or context.xml Context Valve className=org.objektpark.catalina.cluster.session.JvmRouteBinderValve / /Context b) add the Cluster Message Sender: Host name=localhost .. Listener className=org.apache.catalina.cluster.session.JvmRouteSessionIDBinderLi fecycleListener / Cluster ... /Host c) you can detect the cluster node change with the first failed request: request.getAttribute(JvmRouteOrignalSessionID) and get the orginal SessionID with old JVMRoute request.getSession().getId() has the new SessionID. I hope this help Peter, Thanks - I was able to figure it out with a bit of trial and errors. It is failing over fine now. Filip is looking into a problem on restart of a failed node now (see my subsequent posts). Thank you again - Richard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: catalina.out
Edao Aliye wrote: Hi all, Is there any way i can tell tomcat to limit the file catalina.out in $CATALINA_HOME/logs to for example 2MB in Tomcat 5.5.4?? Please help! Thanks in advance It's in the 5.5 documentation how to limit log size and to rotate: http://jakarta.apache.org/tomcat/tomcat-5.5-doc/logging.html - Richard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: catalina.out
Edao Aliye wrote: Hi Richared, The problem I have ist not localhost_log That works pretty good. Hier ist my configuration: ++ more log4j.properties log4j.rootLogger=info, R log4j.appender.R=org.apache.log4j.RollingFileAppender log4j.appender.R.File=${CATALINA_HOME}/logs/tomcat.log log4j.appender.R.MaxFileSize=2MB log4j.appender.R.MaxBackupIndex=50 log4j.appender.R.layout=org.apache.log4j.PatternLayout log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhos t]=INFO, R ++ My Problem is the file catalina.out which is defined in catalina.sh. Any idea? Thnak you very MUCH. Sorry, I had just done the log4j and was trying to find a question to match my answer/hammer. What I did notice is that when I put in the log4j logging, a lot of my catalina.out output is now going to tomcat.log, which is size controlled. Did you see the same? Also, IIRC my application log.debug, log.warn, log.info statements are directed to catalina.out using a separate log4j.properties in my application's WEB-INF/classes directory. You can use this to cut down on the volume of your catalinat.out probably. Otherwise, I cannot think of a good solution to just truncate the catalina.out. Depending on the OS you are running under you might be able to try and rename/truncate he file periodically, but that is not very clean. - Richard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: logging remote IP address
Mark wrote: I'm just tring to see if http request that came from one IP address has more then 1 client behind it. I've seen on some webpages that My IP is displayed as both external and internal - so it means it's doable - but the question is how to get this info in Tomcat. A major purpose of a NAT style firewall is to hide the private ip addresses behind the firewall. If it allowed this information out it would be a security compromise - the network topology behind the firewall is to be kept secret. I may be wrong, but I believe any web page you have been to that also showed in the browser/client's internal private IP address must have had a plugin - either an ActiveX or other type of plugin was probably involved. HTH - Richard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: loadbalancing with mod_jk 1.2.8
John, From what I gather, this is the purpose of the properties local_worker and local_worker_only properties in the workers.properties file. They are documented at the bottom of this page: http://jakarta.apache.org/tomcat/connectors-doc/config/workers.html Unfortunately the explanation is not clear - partially due to the English. I say this somewhat apologetically - realizing of course that the writers command of English if probably far, far better than my command of their native language. From what I do understand: 1) At the point that you decide to do maintenance on one machine, you need to change your workers.properties and set local_worker=0 for that particular machine. 2) Then do a reload on your Apache configuration. 3) JK will then stop directing new traffic to the designated machine. 4) After all sessions have expired or quiesced you can stop that Tomcat instance and do the maintenance. The above scenario may work for some, but not for my case. I have users that may work on a session for several hours sometimes. So I need to use JK and Tomcat session replication which is supposed to let you use the ant stop command and have all traffic immediately handled by the other Tomcat instances. There is a separate active thread on this issue. I see Filip just mentioned a new valve JvmRouteBinderValve that may help solve my problem. Hope this helps - Richard -Original Message- From: John Smith [mailto:[EMAIL PROTECTED] Sent: Thursday, January 27, 2005 2:12 AM To: Tomcat Users List Subject: Re: loadbalancing with mod_jk 1.2.8 I do know how to stop TC, I said the whole idea for people to know I was thinking about an HA set up using Apache + TC instances The part I am most interested in is,namely; how to make the connector at run time NOT send NEW connections to one the tomcat instances being used for loadbalancing - Original Message - From: Graham Bleach [EMAIL PROTECTED] To: Tomcat Users List tomcat-user@jakarta.apache.org Sent: Wednesday, January 26, 2005 6:04 PM Subject: Re: loadbalancing with mod_jk 1.2.8 On Wed, Jan 26, 2005 at 01:41:25PM -0500, John Smith wrote: Is there any way to make the connector at run time to NOT send NEW connections to one the tomcat instances being used for loadbalancing, and then reload this TC instances once all sessions to it have timed out? If you stop the tomcat instance with the command $CATALINA_HOME/bin/catalina.sh stop I believe tomcat waits for threads to finish what they are doing before it actually terminates. G -- Privacy is a transient notion. It started when people stopped believing that God could see everything and stopped when governments realised there was a vacancy to be filled. -- Roger Needham - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JK, Session Replication/Clustering, SSL and failover in Tomcat 5
Filip, Thank you - that appears to be what I need. Unfortunately the only documentation I can find is at: http://jakarta.apache.org/tomcat/tomcat-5.5-doc/catalina/docs/api/org/ apache/catalina/cluster/session/JvmRouteBinderValve.html BEGIN-QUOTE Valve to handle Tomcat jvmRoute takeover using mod_jk module after node failure. After a node crashed the next request going to other cluster node. Now the answering from apache is slower ( make some error handshaking. Very bad with apache at my windows.). We rewrite now the cookie jsessionid information to the backup cluster node. After the next response all client request goes direct to the backup node. The change sessionid send also to all other cluster nodes. Well, now the session stickyness work directly to the backup node and traffic don't go back too restarted cluster nodes! At all cluster node you must configure the JvmRouteSessionIDBinderListener with JvmRouteSessionIDBinderListenerLifecycle Add this Valve to your clustered application or setup it to context default conf/enginename/hostname/context.xml.default for all host application Context Valve className=org.apache.catalina.cluster.session.JvmRouteBinderValve / /Context END-QUOTE I put the valve statement in my conf/context.xml. But this does not seem to be enough. But where can I find information on configuring the JvmRouteSessionIDBinderListener with JvmRouteSessionIDBinderListenerLifecycle? Thank you - Richard Mixon -Original Message- From: Filip Hanik - Dev [mailto:[EMAIL PROTECTED] Sent: Thursday, January 27, 2005 7:29 AM To: Tomcat Users List Cc: [EMAIL PROTECTED] Subject: Re: JK, Session Replication/Clustering, SSL and failover in Tomcat 5 yes, There is code that takes care of that scenario, I believe it was peter who coded it. There is a valve called JvmRouteBinderValve that peter wrote, that you enable for your context. It will rewrite the session id for, and broadbast it to the cluster. Filip - Original Message - From: Richard Mixon (qwest) [EMAIL PROTECTED] To: Tomcat Users List tomcat-user@jakarta.apache.org Sent: Wednesday, January 26, 2005 6:44 PM Subject: RE: JK, Session Replication/Clustering, SSL and failover in Tomcat 5 Filip, Pen does not really help me out. My problem is JK I am pretty sure. It is appending .srv1 to the session. When srv1 is stopped, it detects this on the next request and routes the request to srv2. However I notice in the JK output that it now has .srv2 appended to the session, which of course does not exist, and I get prompted to re-logon. Below is the debug output from JK showing the failover attempt. Any other suggestion? Thank you - Richard [Wed Jan 26 17:15:57 2005] [6040:2256] [debug] map_uri_to_worker::jk_uri_worker_map.c (700): Attempting to map URI '/stars/gridAction.do' from 1 maps [Wed Jan 26 17:15:57 2005] [6040:2256] [debug] map_uri_to_worker::jk_uri_worker_map.c (718): Attempting to map context URI '/stars/*' [Wed Jan 26 17:15:57 2005] [6040:2256] [debug] map_uri_to_worker::jk_uri_worker_map.c (755): Found a context match loadbalancer - /stars/ [Wed Jan 26 17:15:57 2005] [6040:2256] [debug] jk_handler::mod_jk.c (1715): Into handler jakarta-servlet worker=loadbalancer r-proxyreq=0 [Wed Jan 26 17:15:57 2005] [6040:2256] [debug] wc_get_worker_for_name::jk_worker.c (92): found a worker loadbalancer [Wed Jan 26 17:15:57 2005] [6040:2256] [debug] init_ws_service::mod_jk.c (479): agsp=443 agsn=redfishsoftware.swamp.home hostn=redfishsoftware.swamp.home shostn=redfishsoftware.swamp.home cbsport=0 sport=0 claport=443 [Wed Jan 26 17:15:57 2005] [6040:2256] [debug] service::jk_lb_worker.c (465): service sticky_session=1 [Wed Jan 26 17:15:57 2005] [6040:2256] [debug] get_most_suitable_worker::jk_lb_worker.c (372): total sessionid is EE9EF7748256B50E03C48A3F3735DE59.srv1. [Wed Jan 26 17:15:57 2005] [6040:2256] [debug] get_most_suitable_worker::jk_lb_worker.c (383): searching worker for partial sessionid EE9EF7748256B50E03C48A3F3735DE59.srv1. [Wed Jan 26 17:15:57 2005] [6040:2256] [debug] get_suitable_worker::jk_lb_worker.c (275): searching for sticky worker (srv1) [Wed Jan 26 17:15:57 2005] [6040:2256] [debug] get_suitable_worker::jk_lb_worker.c (282): found candidate worker srv1 (0) for match with sticky (srv1) [Wed Jan 26 17:15:57 2005] [6040:2256] [debug] get_suitable_worker::jk_lb_worker.c (290): found candidate worker srv1 (0) with previous load 100 in search with sticky (srv1) [Wed Jan 26 17:15:57 2005] [6040:2256] [debug] get_suitable_worker::jk_lb_worker.c (343): found worker srv1 with new load 100 in search with sticky (srv1) [Wed Jan 26 17:15:57 2005] [6040:2256] [debug] ajp_get_endpoint::jk_ajp_common.c (2016): time elapsed since last request = 76 seconds [Wed Jan 26 17:15:57 2005] [6040:2256] [debug] service::jk_lb_worker.c (482): service worker=srv1 jvm_route=srv1 rc=1 [Wed Jan 26 17:15:57 2005] [6040:2256] [debug] ajp_marshal_into_msgb
RE: JK, Session Replication/Clustering, SSL and failover in Tomcat 5
started. INFO main org.apache.catalina.cluster.session.JvmRouteBinderValve - JvmRouteBinderValve started INFO main org.apache.catalina.cluster.session.JvmRouteBinderValve - JvmRouteBinderValve started INFO main org.apache.catalina.cluster.session.JvmRouteBinderValve - JvmRouteBinderValve started DEBUG TP-Processor3 org.apache.catalina.cluster.session.JvmRouteBinderValve - No Cluster DeltaManager [EMAIL PROTECTED] at /stars INFO Cluster-MembershipReceiver org.apache.catalina.cluster.tcp.SimpleTcpCluster - Received member disappeared:org.apache.catalina.cluster.mcast.McastMember[tcp://192.168. 1.140:4001,192.168.1.140,4001, alive=258218] TOMCAT LOG - SRV2 END Thank you again - Richard -Original Message- From: Filip Hanik - Dev [mailto:[EMAIL PROTECTED] Sent: Thursday, January 27, 2005 9:02 AM To: Tomcat Users List Cc: [EMAIL PROTECTED] Subject: Re: JK, Session Replication/Clustering, SSL and failover in Tomcat 5 Try to configure the JvmRouteSessionIDBinderLifecycleListener like any other Lifecycle listener, Server Listener className=o.a.c.c.s.JvmRouteSessionIDBinderLifecycleListener/ Filip - Original Message - From: Richard Mixon (qwest) [EMAIL PROTECTED] To: Tomcat Users List tomcat-user@jakarta.apache.org Cc: [EMAIL PROTECTED] Sent: Thursday, January 27, 2005 9:37 AM Subject: RE: JK, Session Replication/Clustering, SSL and failover in Tomcat 5 Filip, Thank you - that appears to be what I need. Unfortunately the only documentation I can find is at: http://jakarta.apache.org/tomcat/tomcat-5.5-doc/catalina/docs/api/org/ apache/catalina/cluster/session/JvmRouteBinderValve.html BEGIN-QUOTE Valve to handle Tomcat jvmRoute takeover using mod_jk module after node failure. After a node crashed the next request going to other cluster node. Now the answering from apache is slower ( make some error handshaking. Very bad with apache at my windows.). We rewrite now the cookie jsessionid information to the backup cluster node. After the next response all client request goes direct to the backup node. The change sessionid send also to all other cluster nodes. Well, now the session stickyness work directly to the backup node and traffic don't go back too restarted cluster nodes! At all cluster node you must configure the JvmRouteSessionIDBinderListener with JvmRouteSessionIDBinderListenerLifecycle Add this Valve to your clustered application or setup it to context default conf/enginename/hostname/context.xml.default for all host application Context Valve className=org.apache.catalina.cluster.session.JvmRouteBinderValve / /Context END-QUOTE I put the valve statement in my conf/context.xml. But this does not seem to be enough. But where can I find information on configuring the JvmRouteSessionIDBinderListener with JvmRouteSessionIDBinderListenerLifecycle? Thank you - Richard Mixon -Original Message- From: Filip Hanik - Dev [mailto:[EMAIL PROTECTED] Sent: Thursday, January 27, 2005 7:29 AM To: Tomcat Users List Cc: [EMAIL PROTECTED] Subject: Re: JK, Session Replication/Clustering, SSL and failover in Tomcat 5 yes, There is code that takes care of that scenario, I believe it was peter who coded it. There is a valve called JvmRouteBinderValve that peter wrote, that you enable for your context. It will rewrite the session id for, and broadbast it to the cluster. Filip - Original Message - From: Richard Mixon (qwest) [EMAIL PROTECTED] To: Tomcat Users List tomcat-user@jakarta.apache.org Sent: Wednesday, January 26, 2005 6:44 PM Subject: RE: JK, Session Replication/Clustering, SSL and failover in Tomcat 5 Filip, Pen does not really help me out. My problem is JK I am pretty sure. It is appending .srv1 to the session. When srv1 is stopped, it detects this on the next request and routes the request to srv2. However I notice in the JK output that it now has .srv2 appended to the session, which of course does not exist, and I get prompted to re-logon. Below is the debug output from JK showing the failover attempt. Any other suggestion? Thank you - Richard [Wed Jan 26 17:15:57 2005] [6040:2256] [debug] map_uri_to_worker::jk_uri_worker_map.c (700): Attempting to map URI '/stars/gridAction.do' from 1 maps [Wed Jan 26 17:15:57 2005] [6040:2256] [debug] map_uri_to_worker::jk_uri_worker_map.c (718): Attempting to map context URI '/stars/*' [Wed Jan 26 17:15:57 2005] [6040:2256] [debug] map_uri_to_worker::jk_uri_worker_map.c (755): Found a context match loadbalancer - /stars/ [Wed Jan 26 17:15:57 2005] [6040:2256] [debug] jk_handler::mod_jk.c (1715): Into handler jakarta-servlet worker=loadbalancer r-proxyreq=0 [Wed Jan 26 17:15:57 2005] [6040:2256] [debug] wc_get_worker_for_name::jk_worker.c (92): found a worker loadbalancer [Wed Jan 26 17:15:57 2005] [6040:2256] [debug] init_ws_service::mod_jk.c (479): agsp=443 agsn=redfishsoftware.swamp.home hostn=redfishsoftware.swamp.home shostn
RE: JK, Session Replication/Clustering, SSL and failover in Tomcat 5
- JvmRouteBinderValve started INFO main org.apache.catalina.cluster.session.JvmRouteBinderValve - JvmRouteBinderValve started INFO main org.apache.catalina.cluster.session.JvmRouteBinderValve - JvmRouteBinderValve started INFO Cluster-MembershipReceiver org.apache.catalina.cluster.tcp.SimpleTcpCluster - Received member disappeared:org.apache.catalina.cluster.mcast.McastMember[tcp://192.168. 1.140:4001,192.168.1.140,4001, alive=126093] DEBUG TP-Processor3 org.apache.catalina.cluster.session.JvmRouteBinderValve - No Cluster DeltaManager [EMAIL PROTECTED] at /stars TOMCAT LOG - SRV1 END - Richard -Original Message- From: Richard Mixon (qwest) [mailto:[EMAIL PROTECTED] Sent: Thursday, January 27, 2005 11:26 AM To: Richard Mixon (qwest); Tomcat Users List Cc: Filip Hanik - Dev [EMAIL PROTECTED] Subject: RE: JK, Session Replication/Clustering, SSL and failover in Tomcat 5 Never mind. Sorry for the dumb questions, its in my application ontext. - Richard -Original Message- From: Richard Mixon (qwest) [mailto:[EMAIL PROTECTED] Sent: Thursday, January 27, 2005 11:09 AM To: Tomcat Users List Cc: Filip Hanik - Dev [EMAIL PROTECTED] Subject: RE: JK, Session Replication/Clustering, SSL and failover in Tomcat 5 Filip, Yes you did say that earlier. However I do not reference PersistentManager anywhere in my server.xml. How is it getting enable? Here is the clustering part if my server.xml (I can send the entire server.xml if necessary). Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster managerClassName=org.apache.catalina.cluster.session.D eltaManager expireSessionsOnShutdown=true useDirtyFlag=true notifyListenersOnReplication=true Membership className=org.apache.catalina.cluster.mcast.McastServic e mcastAddr=228.0.0.4 mcastPort=45564 mcastFrequency=500 mcastDropTime=3000/ Receiver className=org.apache.catalina.cluster.tcp.ReplicationLi stener tcpListenAddress=auto tcpListenPort=4001 tcpSelectorTimeout=100 tcpThreadCount=6/ Sender className=org.apache.catalina.cluster.tcp.ReplicationTr ansmitter replicationMode=pooled ackTimeout=15000/ Valve className=org.apache.catalina.cluster.tcp.ReplicationValve filter=.*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.ht ml;.*\.css;.*\.txt;/ Deployer className=org.apache.catalina.cluster.deploy.FarmWarDeployer tempDir=c:/jakarta-tomcat-5.5.7/temp deployDir=c:/jakarta-tomcat-5.5.7/webapps watchDir=c:/jakarta-tomcat-5.5.7-deployer/build/w ebapp watchEnabled=false/ /Cluster Thank you - Richard -Original Message- From: Filip Hanik - Dev [mailto:[EMAIL PROTECTED] Sent: Thursday, January 27, 2005 10:34 AM To: Tomcat Users List Cc: [EMAIL PROTECTED] Subject: Re: JK, Session Replication/Clustering, SSL and failover in Tomcat 5 As mentioned, you can't have the persistence manager, with clustering. DEBUG TP-Processor3 org.apache.catalina.cluster.session.JvmRouteBinderValve - No Cluster DeltaManager [EMAIL PROTECTED] at /stars - Original Message - From: Richard Mixon (qwest) [EMAIL PROTECTED] To: Tomcat Users List tomcat-user@jakarta.apache.org Sent: Thursday, January 27, 2005 10:55 AM Subject: RE: JK, Session Replication/Clustering, SSL and failover in Tomcat 5 Filip/all, Thank you - with your suggestion I was able to get it configured as follows: 1) After the Server line in server.xml I added Listener className=org.apache.catalina.cluster.session.JvmRouteSessionIDBinderLi fecycleListener / 2) I added to the conf/context.xml this line: Valve className=org.apache.catalina.cluster.session.JvmRouteBinderValve / All starts fine. But I still get prompted to logon when the failover occurs from srv1 to srv2. Here are the Tomcat logs (I have mostly just the cluster logging enabled. Can you see anything that is not correct? TOMCAT LOG - SRV1 BEGIN DEBUG main org.apache.catalina.cluster.tcp.ReplicationTransmitter - Setting replcation mode to pooled DEBUG main org.apache.catalina.cluster.tcp.ReplicationValve - Loading request filters=.*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.html;.*\.css;.*\.txt; DEBUG main org.apache.catalina.cluster.tcp.ReplicationValve - Request filter=.*\.gif DEBUG main org.apache.catalina.cluster.tcp.ReplicationValve - Request filter=.*\.js DEBUG main org.apache.catalina.cluster.tcp.ReplicationValve - Request filter=.*\.jpg DEBUG main org.apache.catalina.cluster.tcp.ReplicationValve - Request filter=.*\.png DEBUG main org.apache.catalina.cluster.tcp.ReplicationValve - Request filter=.*\.htm DEBUG main org.apache.catalina.cluster.tcp.ReplicationValve
RE: JK, Session Replication/Clustering, SSL and failover in Tomcat 5
Never mind. Sorry for the dumb questions, its in my application ontext. - Richard -Original Message- From: Richard Mixon (qwest) [mailto:[EMAIL PROTECTED] Sent: Thursday, January 27, 2005 11:09 AM To: Tomcat Users List Cc: Filip Hanik - Dev [EMAIL PROTECTED] Subject: RE: JK, Session Replication/Clustering, SSL and failover in Tomcat 5 Filip, Yes you did say that earlier. However I do not reference PersistentManager anywhere in my server.xml. How is it getting enable? Here is the clustering part if my server.xml (I can send the entire server.xml if necessary). Cluster className=org.apache.catalina.cluster.tcp.SimpleTcpCluster managerClassName=org.apache.catalina.cluster.session.D eltaManager expireSessionsOnShutdown=true useDirtyFlag=true notifyListenersOnReplication=true Membership className=org.apache.catalina.cluster.mcast.McastServic e mcastAddr=228.0.0.4 mcastPort=45564 mcastFrequency=500 mcastDropTime=3000/ Receiver className=org.apache.catalina.cluster.tcp.ReplicationLi stener tcpListenAddress=auto tcpListenPort=4001 tcpSelectorTimeout=100 tcpThreadCount=6/ Sender className=org.apache.catalina.cluster.tcp.ReplicationTr ansmitter replicationMode=pooled ackTimeout=15000/ Valve className=org.apache.catalina.cluster.tcp.ReplicationValve filter=.*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.ht ml;.*\.css;.*\.txt;/ Deployer className=org.apache.catalina.cluster.deploy.FarmWarDeployer tempDir=c:/jakarta-tomcat-5.5.7/temp deployDir=c:/jakarta-tomcat-5.5.7/webapps watchDir=c:/jakarta-tomcat-5.5.7-deployer/build/w ebapp watchEnabled=false/ /Cluster Thank you - Richard -Original Message- From: Filip Hanik - Dev [mailto:[EMAIL PROTECTED] Sent: Thursday, January 27, 2005 10:34 AM To: Tomcat Users List Cc: [EMAIL PROTECTED] Subject: Re: JK, Session Replication/Clustering, SSL and failover in Tomcat 5 As mentioned, you can't have the persistence manager, with clustering. DEBUG TP-Processor3 org.apache.catalina.cluster.session.JvmRouteBinderValve - No Cluster DeltaManager [EMAIL PROTECTED] at /stars - Original Message - From: Richard Mixon (qwest) [EMAIL PROTECTED] To: Tomcat Users List tomcat-user@jakarta.apache.org Sent: Thursday, January 27, 2005 10:55 AM Subject: RE: JK, Session Replication/Clustering, SSL and failover in Tomcat 5 Filip/all, Thank you - with your suggestion I was able to get it configured as follows: 1) After the Server line in server.xml I added Listener className=org.apache.catalina.cluster.session.JvmRouteSessionIDBinderLi fecycleListener / 2) I added to the conf/context.xml this line: Valve className=org.apache.catalina.cluster.session.JvmRouteBinderValve / All starts fine. But I still get prompted to logon when the failover occurs from srv1 to srv2. Here are the Tomcat logs (I have mostly just the cluster logging enabled. Can you see anything that is not correct? TOMCAT LOG - SRV1 BEGIN DEBUG main org.apache.catalina.cluster.tcp.ReplicationTransmitter - Setting replcation mode to pooled DEBUG main org.apache.catalina.cluster.tcp.ReplicationValve - Loading request filters=.*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.html;.*\.css;.*\.txt; DEBUG main org.apache.catalina.cluster.tcp.ReplicationValve - Request filter=.*\.gif DEBUG main org.apache.catalina.cluster.tcp.ReplicationValve - Request filter=.*\.js DEBUG main org.apache.catalina.cluster.tcp.ReplicationValve - Request filter=.*\.jpg DEBUG main org.apache.catalina.cluster.tcp.ReplicationValve - Request filter=.*\.png DEBUG main org.apache.catalina.cluster.tcp.ReplicationValve - Request filter=.*\.htm DEBUG main org.apache.catalina.cluster.tcp.ReplicationValve - Request filter=.*\.html DEBUG main org.apache.catalina.cluster.tcp.ReplicationValve - Request filter=.*\.css DEBUG main org.apache.catalina.cluster.tcp.ReplicationValve - Request filter=.*\.txt INFO main org.apache.catalina.cluster.tcp.SimpleTcpCluster - Cluster is about to start DEBUG main org.apache.catalina.cluster.tcp.SimpleTcpCluster - Invoking addValve on StandardEngine[Catalina].StandardHost[localhost] with class=org.apache.catalina.cluster.tcp.ReplicationValve DEBUG main org.apache.catalina.cluster.tcp.ReplicationListener - Starting replication listener on address:192.168.1.140 INFO main org.apache.catalina.cluster.mcast.McastService - Sleeping for 2000 secs to establish cluster membership INFO main org.apache.catalina.cluster.deploy.FarmWarDeployer - Cluster FarmWarDeployer started. INFO main org.apache.catalina.cluster.session.JvmRouteBinderValve