Re: tomcat can not connect to MySql
Tomcat 5.5.9 OS Windows Server 2003 , Windows XP Mysql 5.0 tomcat and mysql on the same server javax.transaction.SystemException com.met.data.factory.user.UserFactory.getUser(UserFactory.java:694) com.met.action.LoginAction.execute(LoginAction.java:56) org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194) org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) javax.servlet.http.HttpServlet.service(HttpServlet.java:709) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) com.met.filter.CharsetFilter.doFilter(CharsetFilter.java:31) any connection closed after open it -- Fatemeh David Smith-2 wrote: Can you provide some specifics of your environment? Tomcat version OS Mysql version (both driver and server) Both tomcat and mysql on the same machine? If not, any firewalls that might be timing out a connection? How long does it run before it doesn't work? Can you post the full stack trace of your exception including root cause? In your design, are you holding on to connections or closing them as soon as you are done talking to the db? Mysql server does timeout connections after 8 hours by default. If you are using tomcat's database pooling, this can be fixed with the simple addition of a validation query in the config. In any case, it's best practice for the code querying the db to close connections as soon as reasonably possible and not keep them open. --David - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/tomcat-can-not-connect-to-MySql-tf4500426.html#a12843354 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tomcat can not connect to MySql
also i have to say that i use hibernate 3 to connect to Mysql thanks for your attention -- Fatemeh fdehghani wrote: Tomcat 5.5.9 OS Windows Server 2003 , Windows XP Mysql 5.0 tomcat and mysql on the same server javax.transaction.SystemException com.met.data.factory.user.UserFactory.getUser(UserFactory.java:694) com.met.action.LoginAction.execute(LoginAction.java:56) org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194) org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) javax.servlet.http.HttpServlet.service(HttpServlet.java:709) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) com.met.filter.CharsetFilter.doFilter(CharsetFilter.java:31) any connection closed after open it -- Fatemeh David Smith-2 wrote: Can you provide some specifics of your environment? Tomcat version OS Mysql version (both driver and server) Both tomcat and mysql on the same machine? If not, any firewalls that might be timing out a connection? How long does it run before it doesn't work? Can you post the full stack trace of your exception including root cause? In your design, are you holding on to connections or closing them as soon as you are done talking to the db? Mysql server does timeout connections after 8 hours by default. If you are using tomcat's database pooling, this can be fixed with the simple addition of a validation query in the config. In any case, it's best practice for the code querying the db to close connections as soon as reasonably possible and not keep them open. --David - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/tomcat-can-not-connect-to-MySql-tf4500426.html#a12845323 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to control encoding of response.sendRedirect? (Tomcat 5.5.17)
Thanks to all that responded, that helped me a lot to make sense from it all. On 22/09/2007, at 10:27 AM, Mark Thomas wrote: Check the HTTP spec. I am pretty sure (but haven't checked) that the headers must always be in ISO-8859-1. Yes, the RFC2616 says: message-header = field-name : [ field-value ] field-name = token field-value = *( field-content | LWS ) field-content = the OCTETs making up the field-value and consisting of either *TEXT or combinations of token, separators, and quoted-string [...] Words of *TEXT MAY contain characters from character sets other than ISO-8859-1 [22] only when encoded according to the rules of RFC 2047 I assumed that where ever a Java-String was converted into bytes there would be some place to specify the encoding. Here in sendRedirect the encoding is implicitly ISO-8859-1. I passed sendRedirect a String with characters outside ISO-8859-1 out of curiosity and it gives no error but the 'Location'-header contains something other then String#getBytes(ISO-8859-1) would give. Anyway you should not do that... From: Adrian Sutton [EMAIL PROTECTED] This is correct, however you can URL encode the URL with UTF-8 to get unicode characters to pass through safely. Most modern user agents handle UTF-8 encoded URLs correctly. ...and always encode the URL before calling sendRedirect. In case of sendRedirect aka the 'Location'-header I hope that the browsers will just pass the URL unchanged, at least if the encoded URL is in the ASCII-Range?! Martin Gainty wrote: good point http://java.sun.com/developer/technicalArticles/Intl/HTTPCharset/index-011206.html Thanks again, a very valuable link for my issue. I already had bad feelings about the URIEncoding in the connector, since it was not container independent. I will try to implement that suggestion. I use Struts2 so I will have to do this somewhere in an interceptor or look for something that is already there for the problem. I wonder if this only applies to URL-parameters, like the name PARAMETER_ENCODING suggests or also on the path of the URL that may contain the UTF-8 characters in my case. Best regards, Alex - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tomcat can not connect to MySql
did you check the listener to make sure the MySQL listener is actually listening? netstat -a | grep 3306 if you run your mysql client with the same parameters that your webpp is using mysql [EMAIL PROTECTED] Username -p password DBName can you connect? M-- - Original Message - Wrom: XRQBGJSNBOHMKHJYFMYXOEAIJJPHSCRTNHGSWZID To: users@tomcat.apache.org Sent: Sunday, September 23, 2007 3:08 AM Subject: Re: tomcat can not connect to MySql Tomcat 5.5.9 OS Windows Server 2003 , Windows XP Mysql 5.0 tomcat and mysql on the same server javax.transaction.SystemException com.met.data.factory.user.UserFactory.getUser(UserFactory.java:694) com.met.action.LoginAction.execute(LoginAction.java:56) org.apache.struts.action.RequestProcessor.processActionPerform(RequestProces sor.java:419) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194) org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) javax.servlet.http.HttpServlet.service(HttpServlet.java:709) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) com.met.filter.CharsetFilter.doFilter(CharsetFilter.java:31) any connection closed after open it -- Fatemeh David Smith-2 wrote: Can you provide some specifics of your environment? Tomcat version OS Mysql version (both driver and server) Both tomcat and mysql on the same machine? If not, any firewalls that might be timing out a connection? How long does it run before it doesn't work? Can you post the full stack trace of your exception including root cause? In your design, are you holding on to connections or closing them as soon as you are done talking to the db? Mysql server does timeout connections after 8 hours by default. If you are using tomcat's database pooling, this can be fixed with the simple addition of a validation query in the config. In any case, it's best practice for the code querying the db to close connections as soon as reasonably possible and not keep them open. --David - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/tomcat-can-not-connect-to-MySql-tf4500426.html#a128433 54 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Warn:Parameters: Invalid chunk ignored
I have a jsp page,and there is a button in it,when I click this button,it will call Javascript,and redirect another page,my code is follows: ... functioin test(){ document.forms[0].action=a.do; document.forms[0].submit(); } ... s:form table tda href=javascript:test() Test/a/td /tr /table /s:form ... When I run above page,it can redirect the page successly,but Tomcat6 say Warn:Parameters: Invalid chunk ignored,why raise above warning information,why to correct my code to get rid of this warning? Thanks!
Re: UTF8
hi, What happens if you escape every char in the XML file? This is you replace character number nnn to #nnn; (quotes for clarity.) The number has to be the ISO-10646 of the character and, lucky for you, this is the case of Javas internal encoding. Regards, lg On 9/22/07, Amnon Lahav [EMAIL PROTECTED] wrote: hi , i'm using tomcat 5.5 and jdk5 allso using commons.fileupload , when uploading a XML that contains hebrew fonts i can't seem to get it in utf8 in the servlet tough JSP is configured to utf8 with : %@ page language=java contentType=text/html; charset=UTF-8 pageEncoding=UTF-8 % !DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; meta http-equiv=content-type content=text/html; charset=UTF-8 i suspect that i might be getting in utf 8 but maybe it differs from java's UTF8 (that's impossible isn't it ?) because when i try to convert using new String(stringByte,UTF-8) it returns the same while with other encodings in can see in debug content changes ... i'm realy at a jam here people i have a deadline adn i can't seem to fix this silly bug any ideas ? when i open the xml with firefox and check properties it says windows-1255 but when i try using the getbytes method to init stringByte it doesn't matter , i had this problem once with tomcat but it was with a simple textarea input and then i just converted to utf8 like i described above from iso-8859-1 but now i can't seem to do that .. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with nsapi_connector.so and HTTP 304 response from JBoss
Hi Matt, I tried with SJSWS 6 sp11 on Solaris 8 together with nsapi redirector 1.2.25. I could reproduce the problem, and I could fix it with a small variation of your configuration, which seems syntactically invalid: Your original configuration: Object name=jboss ObjectType fn=force-type type=text/plain 3=Service fn=jk_service method=* worker=balance1 /Object Object name=lb_status ObjectType fn=force-type type=text/plain 3=Service fn=jk_service method=* worker=mystatus /Object Mine: Object name=jboss ObjectType fn=force-type type=text/plain Service fn=jk_service method=* worker=worker1 /Object Observe the new line before the Service and simply 'Service' instead of '3=Service' (and most likely the same fix for lb_status). HTH Rainer - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Single Sign-On across multiple webapps
Greeting Tomcat gurus, I'm experiencing some problems implementing SSO across two webapps. Basically we have a main website which presently uses FORM authentication with a JAASRealm – this works fine for the website. However we now want to add a forum, specifically JForum ( www.jforum.net ) as it supports SSO. Ideally we want to install it as a separate webapp. By default JForum supports SSO by calling request.getRemoteUser(). But if the user is authenticated in the first webapp. For the main website we have context.xml in website/META-INF/, with crossContext enabled and the JAASRealm specified. A quick note about the JAAS setup, I don't know whether this has any implications regarding SSO - The JAASRealm has useContextClassLoader set to false, therefore the LoginModule is a class of the website, not a .jar in the Tomcat shared library. With crossContext enabled in the main webapp, calling getRemoteUser() in the jforum webapp returns null and I'm not sure why. Essentially my question is how do I enable cross-context sessions? Indeed, if I set a session attribute in one webapp, how do I access it in from another webapp period? Is this the way to do it: Set attribute in webapp1: request.getSession().getServletContext().getContext(/webapp2).setAttribute(test, Hello); Access attribute in webapp2: request.getSession().getServletContext().getContext(/webapp2).getAttribute(test); Thanks for your time. Alan. -- View this message in context: http://www.nabble.com/Single-Sign-On-across-multiple-webapps-tf4505100.html#a12848283 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
could two tomcat servers have mutual authentication?
I setup a tomcat server 1 using client authentication, and deployed a webservice on it. So, when invoke the webservice, a certification is needed. In server 2 , I want a servlet to invoke the webservice in server 1. could server 2 automatically provide its certification to tomcat 1 when invoke webservice?
Re: 答复: could two tomcat servers have m utual authentication?
quanxin zhu wrote: I am using certification for client authentication, so yale CAS is not what I want. My point is that, does tomcat provide the function, that when invoke other tomcat's webservice, it could provide its certification to other tomcat servers? There is no functionality to do this automatically. You would have to hand code this. Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Single Sign-On across multiple webapps
From: A Sunley [mailto:[EMAIL PROTECTED] Subject: Single Sign-On across multiple webapps I'm experiencing some problems implementing SSO across two webapps. You make no mention of having read the Tomcat documentation for SSO, let alone enabling it: http://tomcat.apache.org/tomcat-6.0-doc/config/host.html#Single%20Sign%2 0On (Adjust the above for whatever version of Tomcat you're using, which you didn't bother to mention.) Does that help resolve your problem? - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: 答复: could two tomcat servers have mutual authentication?
Thanks for your reply Could you explain it in detail? where could I find the instruction to modify the code to implement this function? Any suggestion? I have another questions, when navigate a servlet using browser, the tomcat server could trasfer the certification to browser automatically, why cannot it transfer the certification to other tomcat servers for authentication? zhu quan xin 2007/9/24, Mark Thomas [EMAIL PROTECTED]: quanxin zhu wrote: I am using certification for client authentication, so yale CAS is not what I want. My point is that, does tomcat provide the function, that when invoke other tomcat's webservice, it could provide its certification to other tomcat servers? There is no functionality to do this automatically. You would have to hand code this. Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ??: could two tomcat servers have mutual authentication?
quanxin zhu wrote: Could you explain it in detail? You have written the code to call a web service. You need to write additional code to pass a certificate. where could I find the instruction to modify the code to implement this function? Goggle woudl be a good place to start. I have another questions, when navigate a servlet using browser, the tomcat server could trasfer the certification to browser automatically, why cannot it transfer the certification to other tomcat servers for authentication? Because in Tomcat to browser communciation Tomcat is acting as the server and Tomcat includes code to pass the certificate to the client in this case. When you write a servlet that calls a web service, your servlet is acting as a client and you have to hand code the SSL aspects in the same way as every other aspect of the web service client. Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ??: could two tomcat servers have mutual authentication?
quanxin zhu wrote: Could you explain it in detail? You have written the code to call a web service. You need to write additional code to pass a certificate. where could I find the instruction to modify the code to implement this function? Goggle woudl be a good place to start. I have another questions, when navigate a servlet using browser, the tomcat server could trasfer the certification to browser automatically, why cannot it transfer the certification to other tomcat servers for authentication? Because in Tomcat to browser communciation Tomcat is acting as the server and Tomcat includes code to pass the certificate to the client in this case. When you write a servlet that calls a web service, your servlet is acting as a client and you have to hand code the SSL aspects in the same way as every other aspect of the web service client. Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]