Apache mod_jk and Tomcat
Dear list, we use Apache 1.3, Tomcat 4.1 and mod_jk The first request to my jsp-page shows an Internal Server Error The second Request and all following requests are handled corretly. Is there a possibility to set a timeout for mod_jk? I tried some configurations with Apache.Timeout and Tomcat.Connector.timeout - but with no success. somebody an idea? regards Carsten - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: help with tomcat 5 - mod_jk2 - apache 2
Hi, perhaps it is only a typo, but stickSession=1 is wrong should be stickySession=1 Another thing is naming of jvmRoute=localhost:1009. We didn't include port here. The jk2.properties file is empty in our configuration. hope this helps a bit. Carsten fix wrote: Hey there, I've been searching for a long time know and can't seem to find a solution. I'm settin up a new production server (pIV 4 gig mem) and wanted to run 1 apache in front of several tomcat instances. I've set the whole thing up and it works almost, only the stickySession attribute isn't getting picked up right or something. If I try to access our application I get switched between the 2 instances. here is my workers2.properties file: [shm] info=Scoreboard. Required for reconfiguration and status with multiprocess serversfile=/tmp/jk2.shm size=100 [lb:lb_01] info=Default load balancer. debug=0 stickSession=1 [channel.socket:localhost:11009] tomcatId=localhost:11009 lb_factor=100 group=lb_01 [channel.socket:localhost:12009] tomcatId=localhost:12009 lb_factor=100 group=lb_01 [status:status] info=Status worker, displays runtime informations [uri:/jkstatus/*] info=Display status information and checks the config file for changes. group=status:status [uri:/jsp-examples/*] info=Map all the JSP examples group=lb_01 [uri:/servlets-examples/*] info=Map all the servlet examples group=lb_01 [uri:/loadtest/*] info=testing the load balancer group=lb_01 one tomcat instance jk2.properties ## 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=11009 # 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 server.xml (what is off importance) Engine name=Standalone defaultHost=localhost debug=0 jvmRoute=localhost:11009 Connector port=11009 enableLookups=false redirectPort=8443 debug=0 protocol=AJP/1.3 / 1 thing what's not totaly clear to me is why you have an jk2.properties file and still have to configure the AJP connector. I initialy thought this was because the AJP connector worked with TCP and the jk2.properties was for the UNIX sockets but I think I messed that one up. :) I'm running tomcat5 latest release and the apache 2 from debian testing. It is the worker version. I checked it with apache2 -l and i got this core.c mod_access.c mod_auth.c mod_log_config.c mod_logio.c mod_env.c mod_setenvif.c worker.c http_core.c mod_mime.c mod_status.c mod_autoindex.c mod_negotiation.c mod_dir.c mod_userdir.c mod_alias.c mod_so.c this is correct no? these mods are enabled: cgi.load cgid.conf cgid.load jk2.load ssl.conf ssl.load usertrack.load Has anybody had this problem before? I already spent a few houres on google and rewrote my properties file several times but always the same result. some last info: Apache/2.0.49 (Debian GNU/Linux) mod_jk2/2.0.4 mod_ssl/2.0.49 OpenSSL/0.9.7d Server at 10.0.0.192 Port 80 thank you - 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]
Problem with ServletFilter
Hello, I have a Problem with ServletFilters. I am using a CacheFilter originally from Jason Falkner. This CacheFilter wraps ServletWrapper and writes outpustream to a ByteArrayStream and finally this bytearraystream is written to disk. Installing has been very easy and FIlter is working. But: every page I tested (page size from 14k to 150k) is truncated. Truncation is already in the ByteArray. The JSP-Page originally contained include directives which I evetually removed but same result. I am using tomcat 4.1.29 and mod_jk and Apache 2.0 (same result with Apache 1.3) so any idea or any suggestion? -- Mit freundlichen Grüßen Dipl.Inform. Carsten Lex Geschäftsführer DeepWeb GmbH DeepWeb GmbH Universität, Gebäude 30 66123 Saarbrücken Tel.: 0681 - 302 6308 Mobil: 0163 - 33 37 002 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem passing a param to a servlet
Hi Kieran, use java.net.URLEncoder.encode(tic=3,tac-4,toe=8,UTF-8); to encode your parameters before writing to HTML when you receive Parameter then you have to use java.net.URLDecoder.decode(request.getParameter(strgame),UTF-8) Carsten Kieran Buckley (AT/LMI) wrote: Hi, I am trying to pass a parameter string of structure , tic=3,tac-4,toe=8 into a servlet like as follows: a href=/myservlet?strgame=tic=3,tac=4,toe=8 I had this working on a windowns platform before I realised I should have escaped the equals sign some way.Solaris platform tomcat threw a null pointer exception in handling this value for the parameter strhgame.Is there a way for the subsequent equals to be escaped so they can be seen as part of the value? Thanks, Kieran - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Mit freundlichen Grüßen Dipl.Inform. Carsten Lex Geschäftsführer DeepWeb GmbH DeepWeb GmbH Universität, Gebäude 30 66123 Saarbrücken Tel.: 0681 - 302 6308 Mobil: 0163 - 33 37 002 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with ServletFilter
Hi Jake, flushing the writer solved the problem. thanks a lot Carsten Jacob Kjome wrote: At 11:30 AM 6/24/2004 +0200, you wrote: Hello, I have a Problem with ServletFilters. I am using a CacheFilter originally from Jason Falkner. This CacheFilter wraps ServletWrapper and writes outpustream to a ByteArrayStream and finally this bytearraystream is written to disk. Installing has been very easy and FIlter is working. But: every page I tested (page size from 14k to 150k) is truncated. Truncation is already in the ByteArray. Are you flushing the writer in the wrapper? Hmm... Dont' have time to go into details. I'll just past a useful working wrapper and helper class here... package com.acme.servlet.filter; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponseWrapper; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.PrintWriter; public class GenericResponseWrapper extends HttpServletResponseWrapper { private ByteArrayOutputStream output; private PrintWriter writer; private int origStatus = 0; private int contentLength = 0; private String contentType; public GenericResponseWrapper(HttpServletResponse response) { super(response); output = new ByteArrayOutputStream(); } public byte[] toByteArray() { if (writer != null) writer.flush(); return output.toByteArray(); } public String toString() { if (writer != null) writer.flush(); return output.toString(); } public ServletOutputStream getOutputStream() { return new FilterServletOutputStream(output); } public PrintWriter getWriter() { writer = new PrintWriter(getOutputStream(), true); return writer; } public void sendError(int sc) throws IOException { super.sendError(sc); this.origStatus = sc; } public void sendError(int sc, String message) throws IOException { super.sendError(sc, message); this.origStatus = sc; } public int getStatus() { return this.origStatus; } public void setContentLength(int length) { this.contentLength = length; super.setContentLength(length); } public int getContentLength() { return this.contentLength; } public void setContentType(String type) { this.contentType = type; super.setContentType(type); } public String getContentType() { return this.contentType; } } package com.acme.servlet.filter; import javax.servlet.ServletOutputStream; import java.io.DataOutputStream; import java.io.IOException; import java.io.OutputStream; public class FilterServletOutputStream extends ServletOutputStream { private DataOutputStream stream = null; public FilterServletOutputStream(OutputStream output) { stream = new DataOutputStream(output); } public void write(int b) throws IOException { stream.write(b); } public void write(byte[] b) throws IOException { stream.write(b); } public void write(byte[] b, int off, int len) throws IOException { stream.write(b, off, len); } } Jake The JSP-Page originally contained include directives which I evetually removed but same result. I am using tomcat 4.1.29 and mod_jk and Apache 2.0 (same result with Apache 1.3) so any idea or any suggestion? -- Mit freundlichen Grüßen Dipl.Inform. Carsten Lex Geschäftsführer DeepWeb GmbH DeepWeb GmbH Universität, Gebäude 30 66123 Saarbrücken Tel.: 0681 - 302 6308 Mobil: 0163 - 33 37 002 - 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: HTTPRequest object returns null for getRemoteHost()
Hi, by default enableLookups is enabled (==true) You can add the parameter enableLookups=true to a Connector, then getRemoteHost() gives you the desired information Carsten Surendra Kumar wrote: Hi Everyone I am using Tomcat 4.1.29 and the getRemoteHost() call from HttpServletRequest is returning null. Do i need to need to configure anything for this api to work ? Thanks Surendra -- Mit freundlichen Grüßen Dipl.Inform. Carsten Lex Geschäftsführer DeepWeb GmbH DeepWeb GmbH Universität, Gebäude 30 66123 Saarbrücken Tel.: 0681 - 302 6308 Mobil: 0163 - 33 37 002 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problems with Virtual Hosts
Hi, I installed Apache 2.0.49 and Tomcat 5.0.24. JK-Version is 2.04 My Problem is as follows: if I enter www.test.de:8080 then everything is working fine. But when I try www.test.de then tomcat invokes the default-Host (localhost). So for me it seems Apache doesn't pass the domain-name to tomcat. Has somebody an idea? thx Carsten - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]