Re: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
Thank-you for your e-mail. Please note that i will be away from the office starting Wednesday June 29th, returning Thursday July 7th, with no access to email. In my absence, kindly contact Cheri Dueck at [EMAIL PROTECTED] Kind Regards, Natasha Hasmani Senior Event Manager - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
Thank-you for your e-mail. Please note that i will be away from the office starting Wednesday June 29th, returning Thursday July 7th, with no access to email. In my absence, kindly contact Cheri Dueck at [EMAIL PROTECTED] Kind Regards, Natasha Hasmani Senior Event Manager - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
Thank-you for your e-mail. Please note that i will be away from the office starting Wednesday June 29th, returning Thursday July 7th, with no access to email. In my absence, kindly contact Cheri Dueck at [EMAIL PROTECTED] Kind Regards, Natasha Hasmani Senior Event Manager - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
Thank-you for your e-mail. Please note that i will be away from the office starting Wednesday June 29th, returning Thursday July 7th, with no access to email. In my absence, kindly contact Cheri Dueck at [EMAIL PROTECTED] Kind Regards, Natasha Hasmani Senior Event Manager - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
On Thu, Jun 30, 2005 at 06:02:22PM +0200, Mladen Turk wrote: Jeanfrancois Arcand wrote: Actually, on Solaris the big winner is ChannelNioSocket. It wins the performance race easily now. Too bad that NIO on Windows s*cks. I guess that JFA was right, and non-blocking sockets is the way to go. He he. We shall see :) :-). Just take a look at the GlassFish module called appserv-http-engine on java.net (http://weblogs.java.net/blog/jfarcand/). I'm sure you will like it :-). And I'm sure this community can come with something even better Well I'm sure only of the following: 1. Blocking sockets outperforms NIO 2. NIO scales better So the ideal would be to have them both at once. Perhaps one day the Sun will accept some of my ideas and allow to intermix the blocking and nonblocking IO. That sounds great! Nice idea. Never thought about it. Let's say... something like a hybrid solution... that would be interesting. -Vicenç Until then, well, I have 64 bit JVM and a 1GB RAM for couple of bucks, and APR of course :) Regards, Mladen. - 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: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
Vicenc Beltran Querol wrote: That sounds great! Nice idea. Never thought about it. Let's say... something like a hybrid solution... that would be interesting. I got used to useless statements coming from you. I see a trend now. Rémy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
[EMAIL PROTECTED] wrote: billbarker2005/06/29 19:49:38 With a 16K bufferSize, the APR connector is no longer the clear winner in performance. For BC, it's currently disabled by default, but it's easy enough to change that after some more testing. Yes, I can see performance is better too. It's also possible that taking the APR code, and rewriting it with regular Java IO would also yield slightly better results (regular HTTP is still a little faster than APR HTTP - some VMs make the difference very small, but the VM I use for testing is definitely not the best for JNI). Now that I've looked at it a lot, however, I dislike the Java AJP impl, as it's way overengineered in comparison to what it required by the current Tomcat. Rémy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
Remy Maucherat schrieb: [EMAIL PROTECTED] wrote: billbarker2005/06/29 19:49:38 With a 16K bufferSize, the APR connector is no longer the clear winner in performance. For BC, it's currently disabled by default, but it's easy enough to change that after some more testing. Yes, I can see performance is better too. It's also possible that taking the APR code, and rewriting it with regular Java IO would also yield slightly better results (regular HTTP is still a little faster than APR HTTP - some VMs make the difference very small, but the VM I use for testing is definitely not the best for JNI). Now that I've looked at it a lot, however, I dislike the Java AJP impl, as it's way overengineered in comparison to what it required by the current Tomcat. Very true I don't like this part of the source. I think we can implement the AJP integration simpler and extract the jk2 mbeans and mx4j JMX integration. Peter Rémy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- J2EE Systemarchitekt und Tomcat Experte http://objektpark.de/ http://tomcat.objektpark.org/ http://centaurus.sourceforge.net/ Am Josephsschacht 72, 44879 Bochum, Deutschland Telefon: (49) 234 9413228 Mobil:(49) 175 1660884 E-Mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
- Original Message - From: Remy Maucherat [EMAIL PROTECTED] To: Tomcat Developers List tomcat-dev@jakarta.apache.org Sent: Thursday, June 30, 2005 3:39 AM Subject: Re: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java [EMAIL PROTECTED] wrote: billbarker2005/06/29 19:49:38 With a 16K bufferSize, the APR connector is no longer the clear winner in performance. For BC, it's currently disabled by default, but it's easy enough to change that after some more testing. Yes, I can see performance is better too. It's also possible that taking the APR code, and rewriting it with regular Java IO would also yield slightly better results (regular HTTP is still a little faster than APR HTTP - some VMs make the difference very small, but the VM I use for testing is definitely not the best for JNI). Actually, on Solaris the big winner is ChannelNioSocket. It wins the performance race easily now. Too bad that NIO on Windows s*cks. I guess that JFA was right, and non-blocking sockets is the way to go. Now that I've looked at it a lot, however, I dislike the Java AJP impl, as it's way overengineered in comparison to what it required by the current Tomcat. Hey, I like the overengineering ;-). Yeah, Costin got a little ambitious here before deciding to just use Coyote. On the other hand, when Mladen wants you to implement unix sockets for AJP/APR, ChannelUn is going to start to look good ;-). Rémy This message is intended only for the use of the person(s) listed above as the intended recipient(s), and may contain information that is PRIVILEGED and CONFIDENTIAL. If you are not an intended recipient, you may not read, copy, or distribute this message or any attachment. If you received this communication in error, please notify us immediately by e-mail and then delete all copies of this message and any attachments. In addition you should be aware that ordinary (unencrypted) e-mail sent through the Internet is not secure. Do not send confidential or sensitive information, such as social security numbers, account numbers, personal identification numbers and passwords, to us via ordinary (unencrypted) e-mail. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
Bill Barker wrote: Actually, on Solaris the big winner is ChannelNioSocket. It wins the performance race easily now. Too bad that NIO on Windows s*cks. I guess that JFA was right, and non-blocking sockets is the way to go. He he. We shall see :) Now that I've looked at it a lot, however, I dislike the Java AJP impl, as it's way overengineered in comparison to what it required by the current Tomcat. Hey, I like the overengineering ;-). Yeah, Costin got a little ambitious here before deciding to just use Coyote. On the other hand, when Mladen wants you to implement unix sockets for AJP/APR, ChannelUn is going to start to look good ;-). Well, ChannelUn is obsolete because there is no need to add the additional JNI wrapper, because we already have one. Both unix sockets and NT pipes will be supported, by adding a single param 'localAddress' or something. The platform local socket AF_UNIX or NTPIPE will be used depending on the platform itself. Regards, Mladen. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
Bill Barker wrote: Actually, on Solaris the big winner is ChannelNioSocket. It wins the performance race easily now. Too bad that NIO on Windows s*cks. I guess that JFA was right, and non-blocking sockets is the way to go. Lol, sure, I'll think about it ;) Hey, I like the overengineering ;-). Yeah, Costin got a little ambitious here before deciding to just use Coyote. On the other hand, when Mladen wants you to implement unix sockets for AJP/APR, ChannelUn is going to start to look good ;-). Well, face it: the only thing which saves all this code is that it's there, and working (ChannelSocket is, at least). Besides this, a lot of it is complexity which didn't turn out to be needed. Rémy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
Mladen Turk wrote: Bill Barker wrote: Actually, on Solaris the big winner is ChannelNioSocket. It wins the performance race easily now. Too bad that NIO on Windows s*cks. I guess that JFA was right, and non-blocking sockets is the way to go. He he. We shall see :) :-). Just take a look at the GlassFish module called appserv-http-engine on java.net (http://weblogs.java.net/blog/jfarcand/). I'm sure you will like it :-). And I'm sure this community can come with something even better -- Jeanfrancois Now that I've looked at it a lot, however, I dislike the Java AJP impl, as it's way overengineered in comparison to what it required by the current Tomcat. Hey, I like the overengineering ;-). Yeah, Costin got a little ambitious here before deciding to just use Coyote. On the other hand, when Mladen wants you to implement unix sockets for AJP/APR, ChannelUn is going to start to look good ;-). Well, ChannelUn is obsolete because there is no need to add the additional JNI wrapper, because we already have one. Both unix sockets and NT pipes will be supported, by adding a single param 'localAddress' or something. The platform local socket AF_UNIX or NTPIPE will be used depending on the platform itself. Regards, Mladen. - 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: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
Jeanfrancois Arcand wrote: :-). Just take a look at the GlassFish module called appserv-http-engine on java.net (http://weblogs.java.net/blog/jfarcand/). I'm sure you will like it :-). And I'm sure this community can come with something even better Yes, I do like parts of it: I'd say 80% of it is just a cool cut paste of my HTTP code. Rémy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
Jeanfrancois Arcand wrote: Actually, on Solaris the big winner is ChannelNioSocket. It wins the performance race easily now. Too bad that NIO on Windows s*cks. I guess that JFA was right, and non-blocking sockets is the way to go. He he. We shall see :) :-). Just take a look at the GlassFish module called appserv-http-engine on java.net (http://weblogs.java.net/blog/jfarcand/). I'm sure you will like it :-). And I'm sure this community can come with something even better Well I'm sure only of the following: 1. Blocking sockets outperforms NIO 2. NIO scales better So the ideal would be to have them both at once. Perhaps one day the Sun will accept some of my ideas and allow to intermix the blocking and nonblocking IO. Until then, well, I have 64 bit JVM and a 1GB RAM for couple of bucks, and APR of course :) Regards, Mladen. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
Remy Maucherat wrote: Jeanfrancois Arcand wrote: :-). Just take a look at the GlassFish module called appserv-http-engine on java.net (http://weblogs.java.net/blog/jfarcand/). I'm sure you will like it :-). And I'm sure this community can come with something even better Yes, I do like parts of it: I'd say 80% of it is just a cool cut paste of my HTTP code. LOL :-) Don't know what formula you used to get 80% (might be more :-)) , but why would I re-write something that works pretty well :-). Coyote/http11 was well designed, so was easy to extends. I got rid of the thread pool and replaced the front end with an nio non blocking approach, similar to what you did for APR. -- Jeanfrancois Rémy - 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: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
Jeanfrancois Arcand wrote: LOL :-) Don't know what formula you used to get 80% (might be more :-)) , but why would I re-write something that works pretty well :-). Coyote/http11 was well designed, so was easy to extends. I got rid of the thread pool and replaced the front end with an nio non blocking approach, similar to what you did for APR. Well, all I know is that I only very casually looked at it, and that I should probably not do anything more. For all I know of Sun, you guys might well have patents for it in the pipe, and even if you don't, I am not allowed to reuse the code (and likely not reimplement it after looking at it either). So you can tease me all you want about looking at it in depth: forget it, I will not :) Rémy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
; -SocketConnection(ChannelSocket wajp, MsgContext ep) { -this.wajp=wajp; -this.ep=ep; + public Object[] getInitData() { + return null; + } + + public void runIt(Object perTh[]) { + wajp.processConnection(ep); + ep = null; + } } - -public Object[] getInitData() { -return null; -} - -public void runIt(Object perTh[]) { -wajp.processConnection(ep); -ep = null; -} } + 1.47 +1 -0 jakarta-tomcat-connectors/jk/java/org/apache/jk/common/HandlerRequest.java Index: HandlerRequest.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/common/HandlerRequest.java,v retrieving revision 1.46 retrieving revision 1.47 diff -u -r1.46 -r1.47 --- HandlerRequest.java 20 May 2005 05:52:02 - 1.46 +++ HandlerRequest.java 30 Jun 2005 02:49:38 - 1.47 @@ -313,6 +313,7 @@ msg.reset(); msg.appendByte(AjpConstants.JK_AJP13_CPONG_REPLY); ep.getSource().send( msg, ep ); +ep.getSource().flush( msg, ep ); // Server needs to get it return OK; case HANDLE_THREAD_END: 1.19 +1 -0 jakarta-tomcat-connectors/jk/java/org/apache/jk/common/JkInputStream.java Index: JkInputStream.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/common/JkInputStream.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- JkInputStream.java20 May 2005 05:52:02 - 1.18 +++ JkInputStream.java30 Jun 2005 02:49:38 - 1.19 @@ -214,6 +214,7 @@ log.debug(refillReadBuffer + Thread.currentThread()); mc.getSource().send(bodyMsg, mc); +mc.getSource().flush(bodyMsg, mc); // Server needs to get it // In JNI mode, response will be in bodyMsg. In TCP mode, response need to be // read 1.50 +1 -0 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java Index: JkMain.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java,v retrieving revision 1.49 retrieving revision 1.50 diff -u -r1.49 -r1.50 --- JkMain.java 17 Apr 2005 03:41:08 - 1.49 +++ JkMain.java 30 Jun 2005 02:49:38 - 1.50 @@ -486,6 +486,7 @@ replacements.put(soTimeout, channelSocket.soTimeout); replacements.put(timeout, channelSocket.timeout); replacements.put(address, channelSocket.address); +replacements.put(bufferSize, channelSocket.bufferSize); replacements.put(tomcatAuthentication, request.tomcatAuthentication); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
[EMAIL PROTECTED] wrote: Give Remy something meaningful to benchmark against ;-). Mladen did all the preliminary tests using the HTTP example server that is in the mustang sources, which is a similar comparison. It also has extra GC vs Remy's ChannelAprSocket. ... which will never exist ;) I don't think the way AJP connections are currently processed makes this suitable for this kind of usage, as the GC would likely be too high. Did you test it ? I'll implement the APRized AJP using the same infrastructure (AprEndpoint) and architecture as the HTTP connector, which means socket only. Right now, I'm having more fun trying to add sendfile support (with ranges support). I'll have to make small changes in DefaultServlet to enable it, but nothing that would imapct the default behavior, of course. Rémy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
- Original Message - From: Remy Maucherat [EMAIL PROTECTED] To: Tomcat Developers List tomcat-dev@jakarta.apache.org Sent: Sunday, April 17, 2005 12:22 PM Subject: Re: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java [EMAIL PROTECTED] wrote: Give Remy something meaningful to benchmark against ;-). Mladen did all the preliminary tests using the HTTP example server that is in the mustang sources, which is a similar comparison. It also has extra GC vs Remy's ChannelAprSocket. ... which will never exist ;) I don't think the way AJP connections are currently processed makes this suitable for this kind of usage, as the GC would likely be too high. Did you test it ? On Solaris, threads are really cheap, so ChannelSocket would alway win anyway (just on the context-switching alone :). And, yes, the GC is too high. The only use-case for ChannelNioSocket would be a system where you are forced to set a connectionTimeout for ChannelSocket to keep Tomcat happy, and what that is telling you is that you really need a better OS. I admit that it was somewhat of a vanity project (like a lot of stuff in Jk :), but since almost nobody knows Jk-Coyote well enough to enable it, it seemed harmless. I also have no problem yanking it if all it's going to do is to create tomcat-user questions. I'll implement the APRized AJP using the same infrastructure (AprEndpoint) and architecture as the HTTP connector, which means socket only. Right now, I'm having more fun trying to add sendfile support (with ranges support). I'll have to make small changes in DefaultServlet to enable it, but nothing that would imapct the default behavior, of course. Rémy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message is intended only for the use of the person(s) listed above as the intended recipient(s), and may contain information that is PRIVILEGED and CONFIDENTIAL. If you are not an intended recipient, you may not read, copy, or distribute this message or any attachment. If you received this communication in error, please notify us immediately by e-mail and then delete all copies of this message and any attachments. In addition you should be aware that ordinary (unencrypted) e-mail sent through the Internet is not secure. Do not send confidential or sensitive information, such as social security numbers, account numbers, personal identification numbers and passwords, to us via ordinary (unencrypted) e-mail. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
timed out ) =0 ) log.info( connection timeout reached); else log.error( Error, processing connection, ex); return false; } return true; } void unregister(MsgContext ep) { try{ close(ep); } catch(Exception e) { log.error(Error closing connection, e); } try{ Request req = (Request)ep.getRequest(); if( req != null ) { ObjectName roname = (ObjectName)ep.getNote(JMXRequestNote); if( roname != null ) { Registry.getRegistry(null, null).unregisterComponent(roname); } req.getRequestProcessor().setGlobalProcessor(null); } } catch( Exception ee) { log.error( Error, releasing connection,ee); } } void register(MsgContext ep) { Socket s = (Socket)ep.getNote(socketNote); try { s.getChannel().register(selector, SelectionKey.OP_READ, this); } catch(IOException iex) { log.error(Unable to register connection,iex); unregister(ep); } } } protected class Poller implements ThreadPoolRunnable { Poller() { } public Object[] getInitData() { return null; } public void runIt(Object perTh[]) { while(running) { try { int ns = selector.select(); if(log.isTraceEnabled()) log.trace(Selecting +ns+ channels); if(ns 0) { Set sels = selector.selectedKeys(); Iterator it = sels.iterator(); while(it.hasNext()) { SelectionKey sk = (SelectionKey)it.next(); SocketConnection sc = (SocketConnection)sk.attachment(); if(sk.isValid()) { sk.cancel(); // somebody else's problem now tp.runIt(sc); } } } } catch(ClosedSelectorException cse) { log.debug(Selector is closed); return; } catch(IOException iex) { log.warn(IO Error in select,iex); } } } } } 1.49 +1 -0 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java Index: JkMain.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java,v retrieving revision 1.48 retrieving revision 1.49 diff -u -r1.48 -r1.49 --- JkMain.java 11 Jan 2005 13:37:45 - 1.48 +++ JkMain.java 17 Apr 2005 03:41:08 - 1.49 @@ -84,6 +84,7 @@ { JkMain.jkMain=this; modules.put(channelSocket, org.apache.jk.common.ChannelSocket); +modules.put(channelNioSocket, org.apache.jk.common.ChannelNioSocket); modules.put(channelUnix, org.apache.jk.common.ChannelUn); modules.put(channelJni, org.apache.jk.common.ChannelJni); modules.put(apr, org.apache.jk.apr.AprImpl); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
billbarker2004/10/10 16:43:20 Modified:jk/java/org/apache/jk/server JkMain.java Log: Make the 'jk2.properties' file entirely optional. By default, no properties file is read. Configuration should be done on the Connector element. To get the previous behavior, you need to have: Connector protocol=AJP/1.3 propertiesFile=conf/jk2.properties / Revision ChangesPath 1.47 +44 -24 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java Index: JkMain.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java,v retrieving revision 1.46 retrieving revision 1.47 diff -u -r1.46 -r1.47 --- JkMain.java 24 Feb 2004 08:48:41 - 1.46 +++ JkMain.java 10 Oct 2004 23:43:20 - 1.47 @@ -115,7 +115,7 @@ } System.setProperty(java.protocol.handler.pkgs, value); } catch(Exception ex ) { -ex.printStackTrace(); +log.info(Error adding SSL Protocol Handler,ex); } } @@ -126,10 +126,8 @@ */ public void setPropertiesFile( String p ) { propFile=p; -try { -props.load( new FileInputStream(propFile) ); -} catch(IOException ex ){ -ex.printStackTrace(); +if( started ) { +loadPropertiesFile(); } } @@ -147,6 +145,9 @@ if( jkHome.equals( n ) ) { setJkHome( v ); } +if( propertiesFile.equals( n ) ) { +setPropertiesFile( v ); +} props.put( n, v ); if( started ) { processProperty( n, v ); @@ -248,23 +249,10 @@ if( home==null ) { log.info( Can't find home, jk2.properties not loaded); } -if( home != null ) { -File hF=new File(home); -File conf=new File( home, conf ); -if( ! conf.exists() ) -conf=new File( home, etc ); +if(log.isDebugEnabled()) +log.debug(Starting Jk2, base dir= + home ); +loadPropertiesFile(); -propsF=new File( conf, jk2.properties ); - -if( propsF.exists() ) { -log.debug(Starting Jk2, base dir= + home + conf= + propsF ); -setPropertiesFile( propsF.getAbsolutePath()); -} else { -log.debug(Starting Jk2, base dir= + home ); -if( log.isDebugEnabled() ) -log.debug( No properties file found + propsF ); -} -} String initHTTPS = (String)props.get(class.initHTTPS); if(true.equalsIgnoreCase(initHTTPS)) { initHTTPSUrls(); @@ -435,22 +423,54 @@ jkMain.init(); jkMain.start(); } catch( Exception ex ) { -ex.printStackTrace(); +log.warn(Error running,ex); } } // Private methods + +private boolean checkPropertiesFile() { +if(propFile == null) { +return false; +} +propsF = new File(propFile); +if(!propsF.isAbsolute()) { +String home = getWorkerEnv().getJkHome(); +if( home == null ) { +return false; +} +propsF = new File(home, propFile); +} +return propsF.exists(); +} + +private void loadPropertiesFile() { +if(!checkPropertiesFile()) { +return; +} + +try { +props.load( new FileInputStream(propsF) ); +} catch(IOException ex ){ +log.warn(Unable to load properties from +propsF,ex); +} +} + public void saveProperties() { if( !saveProperties) return; +if(propsF == null) { +log.warn(No properties file specified. Unable to save); +return; +} // Temp - to check if it works -String outFile=propFile + .save; +File outFile= new File(propsF.getParentFile(), propsF.getName()+.save); log.debug(Saving properties + outFile ); try { props.save( new FileOutputStream(outFile), AUTOMATICALLY GENERATED ); } catch(IOException ex ){ -ex.printStackTrace(); +log.warn(Unable to save to +outFile,ex); } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
hgomez 2004/02/23 05:09:30 Modified:jk/java/org/apache/jk/server JkMain.java Log: oups tab police Revision ChangesPath 1.45 +2 -2 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java Index: JkMain.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java,v retrieving revision 1.44 retrieving revision 1.45 diff -u -r1.44 -r1.45 --- JkMain.java 23 Feb 2004 13:07:58 - 1.44 +++ JkMain.java 23 Feb 2004 13:09:30 - 1.45 @@ -502,8 +502,8 @@ static { replacements.put(port,channelSocket.port); replacements.put(maxThreads, channelSocket.maxThreads); - replacements.put(minSpareThreads, channelSocket.minSpareThreads); - replacements.put(maxSpareThreads, channelSocket.maxSpareThreads); +replacements.put(minSpareThreads, channelSocket.minSpareThreads); +replacements.put(maxSpareThreads, channelSocket.maxSpareThreads); replacements.put(backlog, channelSocket.backlog); replacements.put(tcpNoDelay, channelSocket.tcpNoDelay); replacements.put(soTimeout, channelSocket.soTimeout); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java JkCoyoteHandler.java
Remy Maucherat a écrit : [EMAIL PROTECTED] wrote: hgomez 2003/09/18 09:21:02 Modified:jk/java/org/apache/jk/common Shm.java JniHandler.java MsgAjp.java ChannelShm.java WorkerDummy.java ChannelUn.java ChannelJni.java jk/java/org/apache/ajp/tomcat4 Ajp13Processor.java Ajp13Request.java Ajp13Connector.java JkServlet.java jk/java/org/apache/ajp/tomcat33 Ajp14Interceptor.java jk/java/org/apache/jk/apr TomcatStarter.java jk/java/org/apache/jk/config GeneratorJk1.java GeneratorApache2.java GeneratorJk2.java WebXml2Jk.java jk/java/org/apache/ajp AjpHandler.java NegociationHandler.java Ajp13Packet.java RequestHandler.java Ajp13.java jk/java/org/apache/jk/core MsgContext.java Msg.java jk/java/org/apache/ajp/tomcat4/config ApacheConfig.java jk/java/org/apache/jk/server JkMain.java JkCoyoteHandler.java Log: Last batch of clean import. More next week (if Remy didn't drop my commiter status before ;) I'm not root, I can't do that ;-) Anyway, it's weird, I thought I had done it already. Eclipse sucks (or I misconfigured it, which is likely) :) I'm using Eclipse 2.1.1 and the settings is to : Prefs/Java/Compiler : Unused Locale Variables and Unused Imports should be set to Warning ;) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java JkCoyoteHandler.java
org.apache.tomcat.util.buf.*; -import org.apache.tomcat.util.http.HttpMessages; -import org.apache.tomcat.util.buf.HexUtils; +import org.apache.tomcat.util.buf.ByteChunk; +import org.apache.tomcat.util.buf.MessageBytes; /** 1.5 +10 -4 jakarta-tomcat-connectors/jk/java/org/apache/ajp/tomcat4/config/ApacheConfig.java Index: ApacheConfig.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/ajp/tomcat4/config/ApacheConfig.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- ApacheConfig.java 23 Dec 2002 03:00:57 - 1.4 +++ ApacheConfig.java 18 Sep 2003 16:21:01 - 1.5 @@ -58,10 +58,16 @@ */ package org.apache.ajp.tomcat4.config; -import org.apache.catalina.*; -import java.io.*; -import java.util.*; -import javax.servlet.*; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.Date; +import java.util.Hashtable; + +import org.apache.catalina.Context; +import org.apache.catalina.Host; + /* The idea is to keep all configuration in server.xml and the normal apache config files. We don't want people to touch apache ( or IIS, NES ) config files unless they 1.42 +16 -8 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java Index: JkMain.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java,v retrieving revision 1.41 retrieving revision 1.42 diff -u -r1.41 -r1.42 --- JkMain.java 2 Sep 2003 00:17:40 - 1.41 +++ JkMain.java 18 Sep 2003 16:21:02 - 1.42 @@ -59,17 +59,25 @@ package org.apache.jk.server; -import java.io.*; -import java.util.*; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.PrintStream; +import java.util.Enumeration; +import java.util.Hashtable; +import java.util.Properties; +import java.util.StringTokenizer; +import java.util.Vector; -import org.apache.jk.core.*; +import javax.management.MBeanRegistration; +import javax.management.MBeanServer; +import javax.management.ObjectName; -import org.apache.tomcat.util.IntrospectionUtils; import org.apache.commons.modeler.Registry; -import javax.management.ObjectName; -import javax.management.MBeanServer; -import javax.management.MBeanRegistration; -import javax.management.MalformedObjectNameException; +import org.apache.jk.core.JkHandler; +import org.apache.jk.core.WorkerEnv; +import org.apache.tomcat.util.IntrospectionUtils; /** Main class used to startup and configure jk. It manages the conf/jk2.properties file * and is the target of JMX proxy. 1.45 +26 -15 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java Index: JkCoyoteHandler.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkCoyoteHandler.java,v retrieving revision 1.44 retrieving revision 1.45 diff -u -r1.44 -r1.45 --- JkCoyoteHandler.java 7 Sep 2003 18:05:15 - 1.44 +++ JkCoyoteHandler.java 18 Sep 2003 16:21:02 - 1.45 @@ -59,24 +59,35 @@ package org.apache.jk.server; -import java.io.*; -import java.net.*; -import java.util.*; -import java.security.*; -import java.security.cert.*; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.net.InetAddress; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; -import org.apache.jk.core.*; -import org.apache.jk.common.*; - -import org.apache.tomcat.util.buf.*; -import org.apache.tomcat.util.log.*; -import org.apache.tomcat.util.http.*; -import org.apache.tomcat.util.net.SSLSupport; +import javax.management.MBeanServer; +import javax.management.ObjectName; -import org.apache.coyote.*; import org.apache.commons.modeler.Registry; -import javax.management.ObjectName; -import javax.management.MBeanServer; +import org.apache.coyote.ActionCode; +import org.apache.coyote.ActionHook; +import org.apache.coyote.Adapter; +import org.apache.coyote.ProtocolHandler; +import org.apache.coyote.Request; +import org.apache.coyote.Response; +import org.apache.jk.common.HandlerRequest; +import org.apache.jk.common.JkInputStream; +import org.apache.jk.common.MsgAjp; +import org.apache.jk.core.JkHandler; +import org.apache.jk.core.Msg; +import org.apache.jk.core.MsgContext; +import org.apache.jk.core.WorkerEnv; +import org.apache.tomcat.util.buf.ByteChunk; +import
Re: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java JkCoyoteHandler.java
[EMAIL PROTECTED] wrote: hgomez 2003/09/18 09:21:02 Modified:jk/java/org/apache/jk/common Shm.java JniHandler.java MsgAjp.java ChannelShm.java WorkerDummy.java ChannelUn.java ChannelJni.java jk/java/org/apache/ajp/tomcat4 Ajp13Processor.java Ajp13Request.java Ajp13Connector.java JkServlet.java jk/java/org/apache/ajp/tomcat33 Ajp14Interceptor.java jk/java/org/apache/jk/apr TomcatStarter.java jk/java/org/apache/jk/config GeneratorJk1.java GeneratorApache2.java GeneratorJk2.java WebXml2Jk.java jk/java/org/apache/ajp AjpHandler.java NegociationHandler.java Ajp13Packet.java RequestHandler.java Ajp13.java jk/java/org/apache/jk/core MsgContext.java Msg.java jk/java/org/apache/ajp/tomcat4/config ApacheConfig.java jk/java/org/apache/jk/server JkMain.java JkCoyoteHandler.java Log: Last batch of clean import. More next week (if Remy didn't drop my commiter status before ;) I'm not root, I can't do that ;-) Anyway, it's weird, I thought I had done it already. Eclipse sucks (or I misconfigured it, which is likely) :) Remy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
billbarker2003/07/01 23:30:23 Modified:jk/java/org/apache/jk/server JkMain.java Log: I know I've said it a hundred times before, and I'll probably say it a hundred times again: Compile, then commit. Revision ChangesPath 1.40 +1 -1 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java Index: JkMain.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java,v retrieving revision 1.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- JkMain.java 2 Jul 2003 03:42:30 - 1.39 +++ JkMain.java 2 Jul 2003 06:30:23 - 1.40 @@ -287,7 +287,7 @@ log.debug( No properties file found + propsF ); } } -String initHTTPS = props.get(class.initHTTPS); +String initHTTPS = (String)props.get(class.initHTTPS); if(true.equalsIgnoreCase(initHTTPS)) { initHTTPSUrls(); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
ERROR: There is no such list JKMAIN.JAVA here. SOLUTION: Send a message to [EMAIL PROTECTED] with a subject of 'info' (no quotes) for a list of available mailing lists. -- Sincerely, the Minimalist - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
ERROR: There is no such list JKMAIN.JAVA here. SOLUTION: Send a message to [EMAIL PROTECTED] with a subject of 'info' (no quotes) for a list of available mailing lists. -- Sincerely, the Minimalist - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
billbarker2003/07/01 23:33:17 Modified:jk/java/org/apache/jk/server Tag: coyote_10 JkMain.java Log: The beauty of cut-and paste is that I can be brain-dead in multiple locations ;-). Revision ChangesPath No revision No revision 1.32.2.2 +1 -1 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java Index: JkMain.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java,v retrieving revision 1.32.2.1 retrieving revision 1.32.2.2 diff -u -r1.32.2.1 -r1.32.2.2 --- JkMain.java 2 Jul 2003 03:44:32 - 1.32.2.1 +++ JkMain.java 2 Jul 2003 06:33:16 - 1.32.2.2 @@ -282,7 +282,7 @@ log.warn( No properties file found + propsF ); } } -String initHTTPS = props.get(class.initHTTPS); +String initHTTPS = (String)props.get(class.initHTTPS); if(true.equalsIgnoreCase(initHTTPS)) { initHTTPSUrls(); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
ERROR: There is no such list JKMAIN.JAVA here. SOLUTION: Send a message to [EMAIL PROTECTED] with a subject of 'info' (no quotes) for a list of available mailing lists. -- Sincerely, the Minimalist - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
ERROR: There is no such list JKMAIN.JAVA here. SOLUTION: Send a message to [EMAIL PROTECTED] with a subject of 'info' (no quotes) for a list of available mailing lists. -- Sincerely, the Minimalist - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
Ok, I tried asking nice, and just got a machine-response. Could whoever is currently Moderator for this list helpfully allow minimalist to unsubscribe ;-). - Original Message - From: Minimalist Manager [EMAIL PROTECTED] To: Tomcat Developers List [EMAIL PROTECTED] Sent: Tuesday, July 01, 2003 11:45 PM Subject: Re: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java ERROR: There is no such list JKMAIN.JAVA here. SOLUTION: Send a message to [EMAIL PROTECTED] with a subject of 'info' (no quotes) for a list of available mailing lists. -- Sincerely, the Minimalist - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message is intended only for the use of the person(s) listed above as the intended recipient(s), and may contain information that is PRIVILEGED and CONFIDENTIAL. If you are not an intended recipient, you may not read, copy, or distribute this message or any attachment. If you received this communication in error, please notify us immediately by e-mail and then delete all copies of this message and any attachments. In addition you should be aware that ordinary (unencrypted) e-mail sent through the Internet is not secure. Do not send confidential or sensitive information, such as social security numbers, account numbers, personal identification numbers and passwords, to us via ordinary (unencrypted) e-mail. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
ERROR: There is no such list JKMAIN.JAVA here. SOLUTION: Send a message to [EMAIL PROTECTED] with a subject of 'info' (no quotes) for a list of available mailing lists. -- Sincerely, the Minimalist - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
ERROR: There is no such list JKMAIN.JAVA here. SOLUTION: Send a message to [EMAIL PROTECTED] with a subject of 'info' (no quotes) for a list of available mailing lists. -- Sincerely, the Minimalist - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
Clearly you guys make it way to easy to subscribe to the list. ;) -Paul Bill Barker wrote: Ok, I tried asking nice, and just got a machine-response. Could whoever is currently Moderator for this list helpfully allow minimalist to unsubscribe ;-). - Original Message - From: Minimalist Manager [EMAIL PROTECTED] To: Tomcat Developers List [EMAIL PROTECTED] Sent: Tuesday, July 01, 2003 11:45 PM Subject: Re: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java ERROR: There is no such list JKMAIN.JAVA here. SOLUTION: Send a message to [EMAIL PROTECTED] with a subject of 'info' (no quotes) for a list of available mailing lists. -- Sincerely, the Minimalist - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message is intended only for the use of the person(s) listed above as the intended recipient(s), and may contain information that is PRIVILEGED and CONFIDENTIAL. If you are not an intended recipient, you may not read, copy, or distribute this message or any attachment. If you received this communication in error, please notify us immediately by e-mail and then delete all copies of this message and any attachments. In addition you should be aware that ordinary (unencrypted) e-mail sent through the Internet is not secure. Do not send confidential or sensitive information, such as social security numbers, account numbers, personal identification numbers and passwords, to us via ordinary (unencrypted) e-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: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
ERROR: There is no such list JKMAIN.JAVA here. SOLUTION: Send a message to [EMAIL PROTECTED] with a subject of 'info' (no quotes) for a list of available mailing lists. -- Sincerely, the Minimalist - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
ERROR: There is no such list JKMAIN.JAVA here. SOLUTION: Send a message to [EMAIL PROTECTED] with a subject of 'info' (no quotes) for a list of available mailing lists. -- Sincerely, the Minimalist - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
Title: RE: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java Impressively fast fix. Seeing what you've fixed, I can now reinterpret the Sun documentation and see what was going on. Thanks. PJDM -- Peter Mayne Technology Consultant Spherion Technology Solutions Level 1, 243 Northbourne Avenue, Lyneham, ACT, 2602 T: 61 2 62689727 F: 61 2 62689777 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, 2 July 2003 4:33 PM To: [EMAIL PROTECTED] Subject: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java billbarker 2003/07/01 23:33:17 Modified: jk/java/org/apache/jk/server Tag: coyote_10 JkMain.java Log: The beauty of cut-and paste is that I can be brain-dead in multiple locations ;-). Revision Changes Path No revision No revision 1.32.2.2 +1 -1 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java Index: JkMain.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/serv er/JkMain.java,v retrieving revision 1.32.2.1 retrieving revision 1.32.2.2 diff -u -r1.32.2.1 -r1.32.2.2 --- JkMain.java 2 Jul 2003 03:44:32 - 1.32.2.1 +++ JkMain.java 2 Jul 2003 06:33:16 - 1.32.2.2 @@ -282,7 +282,7 @@ log.warn( No properties file found + propsF ); } } - String initHTTPS = props.get(class.initHTTPS); + String initHTTPS = (String)props.get(class.initHTTPS); if(true.equalsIgnoreCase(initHTTPS)) { initHTTPSUrls(); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] The information contained in this email and any attachments to it: (a) may be confidential and if you are not the intended recipient, any interference with, use, disclosure or copying of this material is unauthorised and prohibited; and (b) may contain personal information of the recipient and/or the sender as defined under the Privacy Act 1988 (Cth). Consent is hereby given by the recipient(s) to collect, hold and use such information and any personal information contained in a response to this email, for any reasonable purpose in the ordinary course of Spherion's business, including forwarding this email internally or disclosing it to a third party. All personal information collected by Spherion will be handled in accordance with Spherion's Privacy Policy. If you have received this email in error, please notify the sender and delete it. (c) you agree not to employ or arrange employment for any candidate(s) supplied in this email and any attachments without first entering into a contractual agreement with Spherion. You further agree not to divulge any information contained in this document to any person(s) or entities without the express permission of Spherion. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
ERROR: There is no such list ERVER here. SOLUTION: Send a message to [EMAIL PROTECTED] with a subject of 'info' (no quotes) for a list of available mailing lists. -- Sincerely, the Minimalist - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
ERROR: There is no such list ERVER here. SOLUTION: Send a message to [EMAIL PROTECTED] with a subject of 'info' (no quotes) for a list of available mailing lists. -- Sincerely, the Minimalist - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
billbarker2003/07/01 20:42:30 Modified:jk/java/org/apache/jk/server JkMain.java Log: Require that the user explicitly configure that they want Tomcat to register the (deprecated) SSL handler. The previous behavior of register-always was just pure evil. At best it did nothing (if JSSE isn't installed, or you are using a non-Sun 1.4.x vendor), at worst it breaks apps. It also hasn't been necessary for Tomcat internals in any versions 3.3-5.0 for a very long time (none of them use java.net.URL to construct the redirect-URL). It also creates problems if you are using Sun's 1.4.x JVM, since the handler it installs is deprecated. Reported By: Mayne, Peter [EMAIL PROTECTED] Revision ChangesPath 1.39 +5 -1 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java Index: JkMain.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java,v retrieving revision 1.38 retrieving revision 1.39 diff -u -r1.38 -r1.39 --- JkMain.java 3 May 2003 01:13:35 - 1.38 +++ JkMain.java 2 Jul 2003 03:42:30 - 1.39 @@ -130,7 +130,6 @@ modules.put(container,org.apache.jk.common.HandlerRequest); modules.put(modjk,org.apache.jk.common.ModJkMX); -initHTTPSUrls(); } public static JkMain getJkMain() { @@ -288,6 +287,11 @@ log.debug( No properties file found + propsF ); } } +String initHTTPS = props.get(class.initHTTPS); +if(true.equalsIgnoreCase(initHTTPS)) { +initHTTPSUrls(); +} + long t2=System.currentTimeMillis(); initTime=t2-t1; } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
billbarker2003/07/01 20:44:32 Modified:jk/java/org/apache/jk/server Tag: coyote_10 JkMain.java Log: Port patch from HEAD branch. Revision ChangesPath No revision No revision 1.32.2.1 +4 -1 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java Index: JkMain.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java,v retrieving revision 1.32 retrieving revision 1.32.2.1 diff -u -r1.32 -r1.32.2.1 --- JkMain.java 13 Nov 2002 00:19:00 - 1.32 +++ JkMain.java 2 Jul 2003 03:44:32 - 1.32.2.1 @@ -126,7 +126,6 @@ modules.put(request,org.apache.jk.common.HandlerRequest); modules.put(container,org.apache.jk.common.HandlerRequest); -initHTTPSUrls(); } public static JkMain getJkMain() { @@ -282,6 +281,10 @@ if( log.isWarnEnabled() ) log.warn( No properties file found + propsF ); } +} +String initHTTPS = props.get(class.initHTTPS); +if(true.equalsIgnoreCase(initHTTPS)) { +initHTTPSUrls(); } long t2=System.currentTimeMillis(); initTime=t2-t1; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
costin 2003/04/02 16:53:51 Modified:jk/java/org/apache/jk/server JkMain.java Log: jk2.properties is not required. Revision ChangesPath 1.36 +3 -4 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java Index: JkMain.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java,v retrieving revision 1.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- JkMain.java 4 Mar 2003 18:14:34 - 1.35 +++ JkMain.java 3 Apr 2003 00:53:51 - 1.36 @@ -255,8 +255,6 @@ if(null != out) { PrintStream outS=new PrintStream(new FileOutputStream(out)); System.setOut(outS); -// if( stderr==null ) -// System.setErr(out); } if(null != err) { PrintStream errS=new PrintStream(new FileOutputStream(err)); @@ -282,8 +280,8 @@ setPropertiesFile( propsF.getAbsolutePath()); } else { log.debug(Starting Jk2, base dir= + home ); -if( log.isWarnEnabled() ) -log.warn( No properties file found + propsF ); +if( log.isDebugEnabled() ) +log.debug( No properties file found + propsF ); } } long t2=System.currentTimeMillis(); @@ -329,6 +327,7 @@ // or be chained to create one of the standard handlers String handlers[]=defaultHandlers; +// backward compat String workers=props.getProperty( handler.list, null ); if( workers!=null ) { handlers= split( workers, ,); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
costin 2003/03/04 10:14:35 Modified:jk/java/org/apache/jk/server JkMain.java Log: Add the class name - for easier config Revision ChangesPath 1.35 +1 -0 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java Index: JkMain.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java,v retrieving revision 1.34 retrieving revision 1.35 diff -u -r1.34 -r1.35 --- JkMain.java 20 Jan 2003 23:48:40 - 1.34 +++ JkMain.java 4 Mar 2003 18:14:34 - 1.35 @@ -127,6 +127,7 @@ modules.put(shm, org.apache.jk.common.Shm); modules.put(request,org.apache.jk.common.HandlerRequest); modules.put(container,org.apache.jk.common.HandlerRequest); +modules.put(modjk,org.apache.jk.common.ModJkMX); initHTTPSUrls(); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
costin 2002/11/12 16:19:00 Modified:jk/java/org/apache/jk/server JkMain.java Log: Eliminate the .save file - it is not used and confusing. ( can be re-enabled in jk2.properties ) Revision ChangesPath 1.32 +7 -0 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java Index: JkMain.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- JkMain.java 31 Oct 2002 00:56:35 - 1.31 +++ JkMain.java 13 Nov 2002 00:19:00 - 1.32 -112,6 +112,7 Properties modules=new Properties(); boolean modified=false; boolean started=false; +boolean saveProperties=false; public JkMain() { -168,6 +169,10 return propFile; } +public void setSaveProperties( boolean b ) { +saveProperties=b; +} + /** Set a name/value as a jk2 property */ public void setProperty( String n, String v ) { -442,6 +447,8 // Private methods public void saveProperties() { +if( !saveProperties) return; + // Temp - to check if it works String outFile=propFile + .save; log.debug(Saving properties + outFile ); -- To unsubscribe, e-mail: mailto:tomcat-dev-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
costin 2002/10/30 16:56:36 Modified:jk/java/org/apache/jk/server JkMain.java Log: Added support for coyote properties and 'shortcuts'. This should solve a number of problems where information was not passed from server.xml to jk. Long term we should just consolidate all the config - but that'll take a bit more time. PR: 12686 Revision ChangesPath 1.31 +36 -1 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java Index: JkMain.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- JkMain.java 3 Oct 2002 19:31:31 - 1.30 +++ JkMain.java 31 Oct 2002 00:56:35 - 1.31 -451,8 +451,44 ex.printStackTrace(); } } + +// translate top-level keys ( from coyote or generic ) into component keys +static Hashtable replacements=new Hashtable(); +static { +replacements.put(port,channelSocket.port); +replacements.put(maxThreads, channelSocket.maxThreads); +replacements.put(backlog, channelSocket.backlog); +replacements.put(tcpNoDelay, channelSocket.tcpNoDelay); +replacements.put(soTimeout, channelSocket.soTimeout); +replacements.put(timeout, channelSocket.timeout); +replacements.put(address, channelSocket.address); +} + +private void preProcessProperties() { +Enumeration keys=props.keys(); +Vector v=new Vector(); + +while( keys.hasMoreElements() ) { +String key=(String)keys.nextElement(); +Object newName=replacements.get(key); +if( newName !=null ) { +v.addElement(key); +} +} +keys=v.elements(); +while( keys.hasMoreElements() ) { +String key=(String)keys.nextElement(); +Object propValue=props.getProperty( key ); +String replacement=(String)replacements.get(key); +props.put(replacement, propValue); +if( log.isDebugEnabled()) +log.debug(Substituting + key + + replacement + + +propValue); +} +} private void processProperties() { +preProcessProperties(); Enumeration keys=props.keys(); while( keys.hasMoreElements() ) { -480,7 +516,6 } propName=name.substring( lastDot+1); } else { -// No . - global property, will be used in substitutions return; } -- To unsubscribe, e-mail: mailto:tomcat-dev-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
costin 2002/10/03 12:31:31 Modified:jk/java/org/apache/jk/server JkMain.java Log: If only Ajp connector is used, nobody will initialize the https: handler and redirects for https sites will fail ( a URL constructor is used somewhere ). PR: 11657 Submitted by: [EMAIL PROTECTED] Revision ChangesPath 1.30 +20 -0 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java Index: JkMain.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- JkMain.java 9 Aug 2002 20:54:23 - 1.29 +++ JkMain.java 3 Oct 2002 19:31:31 - 1.30 @@ -124,12 +124,32 @@ modules.put(shm, org.apache.jk.common.Shm); modules.put(request,org.apache.jk.common.HandlerRequest); modules.put(container,org.apache.jk.common.HandlerRequest); + +initHTTPSUrls(); } public static JkMain getJkMain() { return jkMain; } +private static String DEFAULT_HTTPS=com.sun.net.ssl.internal.www.protocol; +private void initHTTPSUrls() { +try { +// 11657: if only ajp is used, https: redirects need to work ( at least for 1.3+) +String value = System.getProperty(java.protocol.handler.pkgs); +if (value == null) { +value = DEFAULT_HTTPS; +} else if (value.indexOf(DEFAULT_HTTPS) = 0 ) { +return; // already set +} else { +value += | + DEFAULT_HTTPS; +} +System.setProperty(java.protocol.handler.pkgs, value); +} catch(Exception ex ) { +ex.printStackTrace(); +} +} + // Setting /** Load a .properties file into and set the values -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
I doesnt have any problems with redirs with Coyote/jk2 using https in IIS, AFAIK the only use URL class had, was to try to get a absolute RUL or something like that, with a Method Craig did many time ago this should be unnecssary... I wonder how do you did the tests? Saludos , Ignacio J. Ortega -Mensaje original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Enviado el: 3 de octubre de 2002 21:32 Para: [EMAIL PROTECTED] Asunto: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java costin 2002/10/03 12:31:31 Modified:jk/java/org/apache/jk/server JkMain.java Log: If only Ajp connector is used, nobody will initialize the https: handler and redirects for https sites will fail ( a URL constructor is used somewhere ). PR: 11657 Submitted by: [EMAIL PROTECTED] Revision ChangesPath 1.30 +20 -0 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java Index: JkMain.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/serv er/JkMain.java,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- JkMain.java 9 Aug 2002 20:54:23 - 1.29 +++ JkMain.java 3 Oct 2002 19:31:31 - 1.30 @@ -124,12 +124,32 @@ modules.put(shm, org.apache.jk.common.Shm); modules.put(request,org.apache.jk.common.HandlerRequest); modules.put(container,org.apache.jk.common.HandlerRequest); + +initHTTPSUrls(); } public static JkMain getJkMain() { return jkMain; } +private static String DEFAULT_HTTPS=com.sun.net.ssl.internal.www.protocol; +private void initHTTPSUrls() { +try { +// 11657: if only ajp is used, https: redirects need to work ( at least for 1.3+) +String value = System.getProperty(java.protocol.handler.pkgs); +if (value == null) { +value = DEFAULT_HTTPS; +} else if (value.indexOf(DEFAULT_HTTPS) = 0 ) { +return; // already set +} else { +value += | + DEFAULT_HTTPS; +} + System.setProperty(java.protocol.handler.pkgs, value); +} catch(Exception ex ) { +ex.printStackTrace(); +} +} + // Setting /** Load a .properties file into and set the values -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
- Original Message - From: Ignacio J. Ortega [EMAIL PROTECTED] To: 'Tomcat Developers List' [EMAIL PROTECTED] Sent: Thursday, October 03, 2002 1:36 PM Subject: RE: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java I doesnt have any problems with redirs with Coyote/jk2 using https in IIS, AFAIK the only use URL class had, was to try to get a absolute RUL or something like that, with a Method Craig did many time ago this should be unnecssary... I wonder how do you did the tests? It seems that o.a.c.tomcat4/5.CoyoteResponse is using java.net.URL instead of Craig's o.a.c.u.URL or (the same class for 3.3) o.a.t.u.net.URL. AFAIK, changing the import statement in CoyoteResponse should remove the need for JSSE with Coyote/jk2 for TC 4/5 (3.3 shouldn't be affected). Saludos , Ignacio J. Ortega -Mensaje original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Enviado el: 3 de octubre de 2002 21:32 Para: [EMAIL PROTECTED] Asunto: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java costin 2002/10/03 12:31:31 Modified:jk/java/org/apache/jk/server JkMain.java Log: If only Ajp connector is used, nobody will initialize the https: handler and redirects for https sites will fail ( a URL constructor is used somewhere ). PR: 11657 Submitted by: [EMAIL PROTECTED] Revision ChangesPath 1.30 +20 -0 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java Index: JkMain.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/serv er/JkMain.java,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- JkMain.java 9 Aug 2002 20:54:23 - 1.29 +++ JkMain.java 3 Oct 2002 19:31:31 - 1.30 @@ -124,12 +124,32 @@ modules.put(shm, org.apache.jk.common.Shm); modules.put(request,org.apache.jk.common.HandlerRequest); modules.put(container,org.apache.jk.common.HandlerRequest); + +initHTTPSUrls(); } public static JkMain getJkMain() { return jkMain; } +private static String DEFAULT_HTTPS=com.sun.net.ssl.internal.www.protocol; +private void initHTTPSUrls() { +try { +// 11657: if only ajp is used, https: redirects need to work ( at least for 1.3+) +String value = System.getProperty(java.protocol.handler.pkgs); +if (value == null) { +value = DEFAULT_HTTPS; +} else if (value.indexOf(DEFAULT_HTTPS) = 0 ) { +return; // already set +} else { +value += | + DEFAULT_HTTPS; +} + System.setProperty(java.protocol.handler.pkgs, value); +} catch(Exception ex ) { +ex.printStackTrace(); +} +} + // Setting /** Load a .properties file into and set the values -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
De: Bill Barker [mailto:[EMAIL PROTECTED]] Enviado el: 3 de octubre de 2002 22:52 It seems that o.a.c.tomcat4/5.CoyoteResponse is using java.net.URL instead of Craig's o.a.c.u.URL or (the same class for 3.3) o.a.t.u.net.URL. AFAIK, changing the import statement in CoyoteResponse should remove the need for JSSE with Coyote/jk2 for TC 4/5 (3.3 shouldn't be affected). Ok.. this should be fixed too, but i doenst understand why it works for me using Coyote/JK2.. because i have the JSSE jars on my ext dir simply? Saludos , Ignacio J. Ortega -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
Bill Barker wrote: I doesnt have any problems with redirs with Coyote/jk2 using https in IIS, AFAIK the only use URL class had, was to try to get a absolute RUL or something like that, with a Method Craig did many time ago this should be unnecssary... I wonder how do you did the tests? It seems that o.a.c.tomcat4/5.CoyoteResponse is using java.net.URL instead of Craig's o.a.c.u.URL or (the same class for 3.3) o.a.t.u.net.URL. AFAIK, changing the import statement in CoyoteResponse should remove the need for JSSE with Coyote/jk2 for TC 4/5 (3.3 shouldn't be affected). Unless some other piece of code is using URLs. I think it is safer to just set the system property - I don't think it can hurt anyone, and it would allow https:// URLs to work. And it'll eliminate a difference between running tomcat standalone and with a web server. If you think it's a better idea to findfix the uses of URL - I can roll back. Costin -Mensaje original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Enviado el: 3 de octubre de 2002 21:32 Para: [EMAIL PROTECTED] Asunto: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java costin 2002/10/03 12:31:31 Modified:jk/java/org/apache/jk/server JkMain.java Log: If only Ajp connector is used, nobody will initialize the https: handler and redirects for https sites will fail ( a URL constructor is used somewhere ). PR: 11657 Submitted by: [EMAIL PROTECTED] Revision ChangesPath 1.30 +20 -0 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java Index: JkMain.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/serv er/JkMain.java,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- JkMain.java 9 Aug 2002 20:54:23 - 1.29 +++ JkMain.java 3 Oct 2002 19:31:31 - 1.30 @@ -124,12 +124,32 @@ modules.put(shm, org.apache.jk.common.Shm); modules.put(request,org.apache.jk.common.HandlerRequest); modules.put(container,org.apache.jk.common.HandlerRequest); + +initHTTPSUrls(); } public static JkMain getJkMain() { return jkMain; } +private static String DEFAULT_HTTPS=com.sun.net.ssl.internal.www.protocol; +private void initHTTPSUrls() { +try { +// 11657: if only ajp is used, https: redirects need to work ( at least for 1.3+) +String value = System.getProperty(java.protocol.handler.pkgs); +if (value == null) { +value = DEFAULT_HTTPS; +} else if (value.indexOf(DEFAULT_HTTPS) = 0 ) { +return; // already set +} else { +value += | + DEFAULT_HTTPS; +} + System.setProperty(java.protocol.handler.pkgs, value); +} catch(Exception ex ) { +ex.printStackTrace(); +} +} + // Setting /** Load a .properties file into and set the values -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Costin -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
- Original Message - From: Costin Manolache [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, October 03, 2002 2:37 PM Subject: Re: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java Bill Barker wrote: I doesnt have any problems with redirs with Coyote/jk2 using https in IIS, AFAIK the only use URL class had, was to try to get a absolute RUL or something like that, with a Method Craig did many time ago this should be unnecssary... I wonder how do you did the tests? It seems that o.a.c.tomcat4/5.CoyoteResponse is using java.net.URL instead of Craig's o.a.c.u.URL or (the same class for 3.3) o.a.t.u.net.URL. AFAIK, changing the import statement in CoyoteResponse should remove the need for JSSE with Coyote/jk2 for TC 4/5 (3.3 shouldn't be affected). Unless some other piece of code is using URLs. I think it is safer to just set the system property - I don't think it can hurt anyone, and it would allow https:// URLs to work. And it'll eliminate a difference between running tomcat standalone and with a web server. If you think it's a better idea to findfix the uses of URL - I can roll back. This seems to be the only place in j-t-c it's being used (at least with a quick check). I was planning to fix it if only because I'd rather continue not having to install JSSE. A little less selfish reason is that it also keeps people from complaining that weird things like: response.sendRedirect(response.encodeURL(news://)); aren't working. ;-) I agree that you're patch is harmless, and is a fall-back for systems with JSSE installed. Personally, I don't see any reason to roll back. Costin -Mensaje original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Enviado el: 3 de octubre de 2002 21:32 Para: [EMAIL PROTECTED] Asunto: cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java costin 2002/10/03 12:31:31 Modified:jk/java/org/apache/jk/server JkMain.java Log: If only Ajp connector is used, nobody will initialize the https: handler and redirects for https sites will fail ( a URL constructor is used somewhere ). PR: 11657 Submitted by: [EMAIL PROTECTED] Revision ChangesPath 1.30 +20 -0 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java Index: JkMain.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/serv er/JkMain.java,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- JkMain.java 9 Aug 2002 20:54:23 - 1.29 +++ JkMain.java 3 Oct 2002 19:31:31 - 1.30 @@ -124,12 +124,32 @@ modules.put(shm, org.apache.jk.common.Shm); modules.put(request,org.apache.jk.common.HandlerRequest); modules.put(container,org.apache.jk.common.HandlerRequest); + +initHTTPSUrls(); } public static JkMain getJkMain() { return jkMain; } +private static String DEFAULT_HTTPS=com.sun.net.ssl.internal.www.protocol; +private void initHTTPSUrls() { +try { +// 11657: if only ajp is used, https: redirects need to work ( at least for 1.3+) +String value = System.getProperty(java.protocol.handler.pkgs); +if (value == null) { +value = DEFAULT_HTTPS; +} else if (value.indexOf(DEFAULT_HTTPS) = 0 ) { +return; // already set +} else { +value += | + DEFAULT_HTTPS; +} + System.setProperty(java.protocol.handler.pkgs, value); +} catch(Exception ex ) { +ex.printStackTrace(); +} +} + // Setting /** Load a .properties file into and set the values -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Costin -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
costin 2002/07/24 15:13:06 Modified:jk/java/org/apache/jk/server JkMain.java Log: Changed the default to include only the socket and base modules. For anything else you must explicitely edit jk2.properties. The reason for the change - many people seem confused about the messages about jni.so library, and this require additional actions ( i.e. install the .so ) anyway. Also replaced some printlns with log. Revision ChangesPath 1.28 +8 -3 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java Index: JkMain.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- JkMain.java 2 Jul 2002 19:58:27 - 1.27 +++ JkMain.java 24 Jul 2002 22:13:06 - 1.28 @@ -228,13 +228,18 @@ } } -static String defaultHandlers[]= { apr, +static String defaultHandlers[]= { request, + container, + channelSocket}; +/* + static String defaultHandlers[]= { apr, shm, request, container, channelSocket, channelJni, channelUnix}; +*/ public void stop() { @@ -435,7 +440,7 @@ JkHandler handler; String classN=modules.getProperty(type); if( classN == null ) { -System.err.println(No class name for + fullName + + type ); +log.error(No class name for + fullName + + type ); return null; } try { @@ -463,7 +468,7 @@ String name= k.substring( plen ); String propValue=props.getProperty( k ); -System.out.println(Register + name + + propValue ); +if( log.isDebugEnabled()) log.debug(Register + name + + propValue ); modules.put( name, propValue ); } } -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
costin 2002/07/02 12:58:27 Modified:jk/java/org/apache/jk/common ChannelSocket.java jk/java/org/apache/jk/server JkMain.java Log: Add support for the daemon setting. Minor fix in JkMain Revision ChangesPath 1.17 +11 -0 jakarta-tomcat-connectors/jk/java/org/apache/jk/common/ChannelSocket.java Index: ChannelSocket.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/common/ChannelSocket.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- ChannelSocket.java2 Jul 2002 16:57:30 - 1.16 +++ ChannelSocket.java2 Jul 2002 19:58:27 - 1.17 @@ -201,6 +201,17 @@ public int getInstanceId() { return port-startPort; } + +/** If set to false, the thread pool will be created in + * non-daemon mode, and will prevent main from exiting + */ +public void setDaemon( boolean b ) { +tp.setDaemon( b ); +} + +public void getDaemon() { +return tp.getDaemon(); +} /* */ ServerSocket sSocket; 1.27 +1 -0 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java Index: JkMain.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- JkMain.java 5 Jun 2002 21:24:29 - 1.26 +++ JkMain.java 2 Jul 2002 19:58:27 - 1.27 @@ -208,6 +208,7 @@ // XXX use IntrospectionUtil to find myself this.guessHome(); } +home=wEnv.getJkHome(); if( home != null ) { File hF=new File(home); File conf=new File( home, conf ); -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
costin 2002/06/05 14:24:29 Modified:jk/java/org/apache/jk/server JkMain.java Log: Added a definition for the mx handler, to make it easy to configure. Revision ChangesPath 1.26 +1 -0 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java Index: JkMain.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- JkMain.java 7 May 2002 20:33:00 - 1.25 +++ JkMain.java 5 Jun 2002 21:24:29 - 1.26 @@ -119,6 +119,7 @@ modules.put(channelUnix, org.apache.jk.common.ChannelUn); modules.put(channelJni, org.apache.jk.common.ChannelJni); modules.put(apr, org.apache.jk.apr.AprImpl); +modules.put(mx, org.apache.jk.common.JkMX); modules.put(shm, org.apache.jk.common.Shm); modules.put(request,org.apache.jk.common.HandlerRequest); modules.put(container,org.apache.jk.common.HandlerRequest); -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
remm02/05/04 13:14:43 Modified:jk/java/org/apache/jk/server JkMain.java Log: - Only log an info if JNI init is not successful. Revision ChangesPath 1.24 +1 -1 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java Index: JkMain.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- JkMain.java 25 Apr 2002 23:13:24 - 1.23 +++ JkMain.java 4 May 2002 20:14:42 - 1.24 @@ -284,7 +284,7 @@ wEnv.getHandler(i).init(); } catch( IOException ex) { if( apr.equals(wEnv.getHandler(i).getName() )) { -log.error( APR error, disabling jni components: + ex.toString()); +log.info( APR error, disabling jni components: + ex.toString()); } else { log.error( error initializing + wEnv.getHandler(i).getName(), ex ); } -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
costin 02/04/18 10:48:00 Modified:jk/java/org/apache/jk/server JkMain.java Log: Added comments on the format used for properties. Added method to save the properties file ( for now in a separate location ) whenever a property is changed after startup ( by JMX or another admin application ). Removed the need to specify the class name for the known components ( we do know them, no need for the user to do that ). Try to load all components - if they don't have the needed resources ( native libs, etc ) they'll just report so and do nothing. Made the format closer to what's used in mod_jk ( except ':' can't be used since it's a delimiter, etc ). It seems implementing the ini format in java is not much easier than C ... Revision ChangesPath 1.18 +163 -50 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java Index: JkMain.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- JkMain.java 13 Apr 2002 05:53:30 - 1.17 +++ JkMain.java 18 Apr 2002 17:48:00 - 1.18 @@ -70,9 +70,38 @@ import org.apache.tomcat.util.http.*; import org.apache.tomcat.util.IntrospectionUtils; -/** Main class used to startup jk. +/** Main class used to startup and configure jk. It manages the conf/jk2.properties file + * and is the target of JMX proxy. * - * It is also useable standalone for testing or as a minimal socket server. + * It implements a policy of save-on-change - whenever a property is changed at + * runtime the jk2.properties file will be overriden. + * + * You can edit the config file when tomcat is stoped ( or if you don't use JMX or + * other admin tools ). + * + * The format of jk2.properties: + * dl + * dtTYPE[.LOCALNAME].PROPERTY_NAME=VALUE + * ddSet a property on the associated component. TYPE will be used to + * find the class name and instantiate the component. LOCALNAME allows + * multiple instances. In JMX mode, TYPE and LOCALNAME will form the + * JMX name ( eventually combined with a 'jk2' component ) + * + * dtNAME=VALUE + * ddDefine global properties to be used in ${} substitutions + * + * dtclass.COMPONENT_TYPE=JAVA_CLASS_NAME + * ddAdds a new 'type' of component. We predefine all known types. + * /dl + * + * Instances are created the first time a component name is found. In addition, + * 'handler.list' property will override the list of 'default' components that are + * loaded automatically. + * + * Note that the properties file is just one (simplistic) way to configure jk. We hope + * to see configs based on registry, LDAP, db, etc. ( XML is not necesarily better ) + * + * @author Costin Manolache */ public class JkMain { @@ -80,8 +109,19 @@ String propFile; Properties props=new Properties(); +Properties modules=new Properties(); +boolean modified=false; +boolean started=false; + public JkMain() { +modules.put(channelSocket, org.apache.jk.common.ChannelSocket); +modules.put(channelUnix, org.apache.jk.common.ChannelUn); +modules.put(channelJni, org.apache.jk.common.ChannelJni); +modules.put(apr, org.apache.jk.apr.AprImpl); +modules.put(shm, org.apache.jk.common.Shm); +modules.put(request,org.apache.jk.common.HandlerRequest); +modules.put(container,org.apache.jk.common.HandlerRequest); } // Setting @@ -104,6 +144,10 @@ setJkHome( v ); } props.put( n, v ); +if( started ) { +processProperty( n, v ); +saveProperties(); +} } /** @@ -182,49 +226,45 @@ } } +static String defaultHandlers[]= { apr, + shm, + request, + container }; public void start() throws IOException { -if( props.get( handler.request.className )==null ) -props.put( handler.request.className, - org.apache.jk.common.HandlerRequest ); - -if( props.get( handler.channel.className )==null ) -props.put( handler.channel.className, - org.apache.jk.common.ChannelSocket ); - // We must have at least 3 handlers: // channel is the 'transport' // request is the request processor or 'global' chain // container is the 'provider' // Additional handlers may exist and be used internally // or be chained
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
costin 02/04/18 10:57:53 Modified:jk/java/org/apache/jk/core WorkerEnv.java jk/java/org/apache/jk/server JkMain.java Log: Move the start method from WorkerEnv to JkMain, eliminate all the unused code from WorkerEnv. WorkerEnv is just a store for the components and a 'note manager'. Revision ChangesPath 1.6 +3 -36 jakarta-tomcat-connectors/jk/java/org/apache/jk/core/WorkerEnv.java Index: WorkerEnv.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/core/WorkerEnv.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- WorkerEnv.java20 Feb 2002 23:39:02 - 1.5 +++ WorkerEnv.java18 Apr 2002 17:57:53 - 1.6 @@ -63,6 +63,7 @@ import java.security.*; import org.apache.jk.common.*; +import org.apache.jk.apr.*; /** * The controller object. It manages all other jk objects, acting as the root of @@ -79,9 +80,6 @@ Hashtable properties; -Object webapps[]=new Object[20]; -int webappCnt=0; - public static final int ENDPOINT_NOTE=0; public static final int REQUEST_NOTE=1; int noteId[]=new int[4]; @@ -102,16 +100,6 @@ } } -public int addWebapp( Object wa ) { -if( webappCnt = webapps.length ) { -Object newWebapps[]=new Object[ webapps.length + 20 ]; -System.arraycopy( webapps, 0, newWebapps, 0, webapps.length); -webapps=newWebapps; -} -webapps[webappCnt]=wa; -return webappCnt++; -} - public void setJkHome( String s ) { home=s; } @@ -120,14 +108,6 @@ return home; } -public Object getWebapp( int i ) { -return webapps[i]; -} - -public int getWebappCount() { -return webappCnt; -} - public final Object getNote(int i ) { return notes[i]; } @@ -168,21 +148,8 @@ return handlersTable[id]; } -public void start() throws IOException { -for( int i=0; ihandlerCount; i++ ) { -//Enumeration en=handlersMap.keys(); -// while( en.hasMoreElements() ) { -// String n=(String)en.nextElement(); -// JkHandler w=(JkHandler)handlersMap.get(n); -if( handlersTable[i] != null ) -handlersTable[i].init(); -} -} - -private static final int dL=0; -private static void d(String s ) { -System.err.println( WorkerEnv: + s ); +public final int getHandlerCount() { +return handlerCount; } - } 1.19 +15 -2 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java Index: JkMain.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- JkMain.java 18 Apr 2002 17:48:00 - 1.18 +++ JkMain.java 18 Apr 2002 17:57:53 - 1.19 @@ -259,8 +259,21 @@ // Process properties - and add aditional handlers. processProperties(); - -wEnv.start(); + +for( int i=0; iwEnv.getHandlerCount(); i++ ) { +if( wEnv.getHandler(i) != null ) { +try { +wEnv.getHandler(i).init(); +} catch( IOException ex) { +if( apr.equals(wEnv.getHandler(i).getName() )) { +log.error( WorkerEnv: APR not initialized + ex.toString()); +} else { +log.error( WorkerEnv: error initializing + wEnv.getHandler(i).getName(), ex ); +} +} +} +} + started=true; long initTime=System.currentTimeMillis() - start_time; -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
costin 02/04/18 12:13:02 Modified:jk/java/org/apache/jk/core WorkerEnv.java jk/java/org/apache/jk/server JkMain.java Log: Add the localId. Revision ChangesPath 1.7 +9 -0 jakarta-tomcat-connectors/jk/java/org/apache/jk/core/WorkerEnv.java Index: WorkerEnv.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/core/WorkerEnv.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- WorkerEnv.java18 Apr 2002 17:57:53 - 1.6 +++ WorkerEnv.java18 Apr 2002 19:13:01 - 1.7 @@ -92,12 +92,21 @@ // base dir for the jk webapp String home; +int localId=0; public WorkerEnv() { for( int i=0; inoteId.length; i++ ) { noteId[i]=7; noteName[i]=new String[20]; } +} + +public void setLocalId(int id) { +localId=id; +} + +public int getLocalId() { +return localId; } public void setJkHome( String s ) { 1.20 +3 -2 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java Index: JkMain.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- JkMain.java 18 Apr 2002 17:57:53 - 1.19 +++ JkMain.java 18 Apr 2002 19:13:02 - 1.20 @@ -229,7 +229,8 @@ static String defaultHandlers[]= { apr, shm, request, - container }; + container, + channelSocket}; public void start() throws IOException { @@ -278,7 +279,7 @@ long initTime=System.currentTimeMillis() - start_time; this.saveProperties(); -log.info(Jk running... init time= + initTime + ms); +log.info(Jk running ID= + wEnv.getLocalId() + ... init time= + initTime + ms); } // Usefull methods -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
costin 02/04/12 22:53:30 Modified:jk/java/org/apache/jk/server JkMain.java Log: 2 more command line params to allow out/err redirection. Rename a method to avoid confusing IntrospectionUtil Revision ChangesPath 1.17 +25 -3 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java Index: JkMain.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- JkMain.java 11 Apr 2002 05:46:51 - 1.16 +++ JkMain.java 13 Apr 2002 05:53:30 - 1.17 @@ -131,11 +131,33 @@ public void setJkHome( String s ) { wEnv.setJkHome(s); } + +String out; +String err; + +public void setOut( String s ) { +this.out=s; +} +public void setErr( String s ) { +this.err=s; +} + // Initialization public void init() throws IOException { +if(null != out) { +PrintStream outS=new PrintStream(new FileOutputStream(out)); +System.setOut(outS); +// if( stderr==null ) +// System.setErr(out); +} +if(null != err) { +PrintStream errS=new PrintStream(new FileOutputStream(err)); +System.setErr(errS); +} + String home=wEnv.getJkHome(); if( home==null ) { // XXX use IntrospectionUtil to find myself @@ -215,7 +237,7 @@ /* A bit of magic to support workers.properties without giving up the clean get/set */ -public void setProperty( Object target, String name, String val ) { +public void setBeanProperty( Object target, String name, String val ) { if( val!=null ) val=IntrospectionUtils.replaceProperties( val, props ); if( log.isDebugEnabled()) @@ -232,7 +254,7 @@ log.debug( setProperty + handlerN + + name + = + val ); Object target=wEnv.getHandler( handlerN ); -setProperty( target, name, val ); +setBeanProperty( target, name, val ); } public long getStartTime() { @@ -284,7 +306,7 @@ String propValue=props.getProperty( k ); if( className.equals( name ) ) continue; -this.setProperty( o, name, propValue ); +this.setBeanProperty( o, name, propValue ); } } -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
costin 02/04/10 15:15:10 Modified:jk/java/org/apache/jk/server JkMain.java Log: Revision ChangesPath 1.14 +1 -1 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java Index: JkMain.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- JkMain.java 10 Apr 2002 20:43:41 - 1.13 +++ JkMain.java 10 Apr 2002 22:15:10 - 1.14 @@ -136,7 +136,7 @@ String home=wEnv.getJkHome(); if( home==null ) { // XXX use IntrospectionUtil to find myself -jkMain.guessHome(); +this.guessHome(); } if( home != null ) { File hF=new File(home); -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
costin 02/04/10 22:46:51 Modified:jk/java/org/apache/jk/apr AprImpl.java jk/java/org/apache/jk/common ChannelUn.java jk/java/org/apache/jk/server JkMain.java Log: Update the name, few fixes to get the substitution working Revision ChangesPath 1.5 +1 -1 jakarta-tomcat-connectors/jk/java/org/apache/jk/apr/AprImpl.java Index: AprImpl.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/apr/AprImpl.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- AprImpl.java 10 Apr 2002 23:53:11 - 1.4 +++ AprImpl.java 11 Apr 2002 05:46:51 - 1.5 @@ -80,7 +80,7 @@ // Use load() try { System.loadLibrary( apr ); -System.loadLibrary( jni_connect ); +System.loadLibrary( jkjni ); } catch( Throwable ex ) { ok=false; ex.printStackTrace(); 1.9 +3 -1 jakarta-tomcat-connectors/jk/java/org/apache/jk/common/ChannelUn.java Index: ChannelUn.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/common/ChannelUn.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- ChannelUn.java10 Apr 2002 23:53:11 - 1.8 +++ ChannelUn.java11 Apr 2002 05:46:51 - 1.9 @@ -152,8 +152,10 @@ } unixListenSocket=apr.unSocketListen( gPool, file, 10 ); if (unixListenSocket0) -throw(new IOException(Cannot create listening socket)); +throw(new IOException(Cannot create listening socket + file)); +log.info(Listening on unix socket: + file ); + // Run a thread that will accept connections. tp.start(); AprAcceptor acceptAjp=new AprAcceptor( this ); 1.16 +8 -5 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java Index: JkMain.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- JkMain.java 10 Apr 2002 23:53:11 - 1.15 +++ JkMain.java 11 Apr 2002 05:46:51 - 1.16 @@ -102,9 +102,8 @@ public void setProperty( String n, String v ) { if( jkHome.equals( n ) ) { setJkHome( v ); -} else { -props.put( n, v ); -} +} +props.put( n, v ); } /** @@ -217,19 +216,23 @@ up the clean get/set */ public void setProperty( Object target, String name, String val ) { +if( val!=null ) +val=IntrospectionUtils.replaceProperties( val, props ); if( log.isDebugEnabled()) log.debug( setProperty + target + + name + = + val ); + IntrospectionUtils.setProperty( target, name, val ); } /* * Set a handler property */ -public void setProperty( String handlerN, String name, String val ) { +public void setPropertyString( String handlerN, String name, String val ) { if( log.isDebugEnabled() ) log.debug( setProperty + handlerN + + name + = + val ); Object target=wEnv.getHandler( handlerN ); -IntrospectionUtils.setProperty( target, name, val ); + +setProperty( target, name, val ); } public long getStartTime() { -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
costin 02/02/20 15:43:43 Modified:jk/java/org/apache/jk/server JkMain.java Log: Use commons-logging. Revision ChangesPath 1.12 +23 -24 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java Index: JkMain.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- JkMain.java 6 Feb 2002 20:33:54 - 1.11 +++ JkMain.java 20 Feb 2002 23:43:43 - 1.12 @@ -130,11 +130,6 @@ wEnv.setJkHome(s); } -public void setDebug( int i ) { -dL=i; -d(set debug + i ); -} - // Initialization public void init() throws IOException @@ -146,12 +141,16 @@ if( home != null ) { File hF=new File(home); File conf=new File( home, conf ); +if( ! conf.exists() ) +conf=new File( home, etc ); + File propsF=new File( conf, jk2.properties ); if( propsF.exists() ) { setPropertiesFile( propsF.getAbsolutePath()); } else { -if( dL 0 ) d( No properties file found + propsF ); +if( log.isWarnEnabled() ) +log.warn( No properties file found + propsF ); } } } @@ -177,15 +176,18 @@ String workers=props.getProperty( handler.list, channel,request,container ); Vector workerNamesV= split( workers, ,); -if( dL 0 ) d(workers: + workers + + workerNamesV.size() ); +if( log.isDebugEnabled() ) +log.debug(workers: + workers + + workerNamesV.size() ); + for( int i=0; iworkerNamesV.size(); i++ ) { String name= (String)workerNamesV.elementAt( i ); -if( dL 0 ) d(Configuring + name ); +if( log.isDebugEnabled() ) +log.debug(Configuring + name ); JkHandler w=wEnv.getHandler( name ); if( w==null ) w=(JkHandler)newInstance( handler, name, null ); if( w==null ) { -d(Can't create handler for name + name ); +log.warn(Can't create handler for name + name ); continue; } @@ -196,7 +198,7 @@ wEnv.start(); long initTime=System.currentTimeMillis() - start_time; -d(Jk running... init time= + initTime + ms); +log.info(Jk running... init time= + initTime + ms); } // Usefull methods @@ -209,9 +211,8 @@ up the clean get/set */ public void setProperty( Object target, String name, String val ) { -/* XXX we need an improved IntrospectionUtils, to report error - without d() */ -d( setProperty + target + + name + = + val ); +if( log.isDebugEnabled()) +log.debug( setProperty + target + + name + = + val ); IntrospectionUtils.setProperty( target, name, val ); } @@ -219,7 +220,8 @@ * Set a handler property */ public void setProperty( String handlerN, String name, String val ) { -d( setProperty + handlerN + + name + = + val ); +if( log.isDebugEnabled() ) +log.debug( setProperty + handlerN + + name + = + val ); Object target=wEnv.getHandler( handlerN ); IntrospectionUtils.setProperty( target, name, val ); } @@ -282,15 +284,16 @@ private Object newInstance( String type, String name, String def ) throws IOException { +String classN=null; try { -String classN=props.getProperty( type + . + name + .className, +classN=props.getProperty( type + . + name + .className, def ); if( classN== null ) return null; Class channelclass = Class.forName(classN); return channelclass.newInstance(); -} catch (Exception ex) { +} catch (Throwable ex) { ex.printStackTrace(); -throw new IOException(Cannot create channel class); +throw new IOException(Cannot create channel class + classN); } } @@ -313,15 +316,11 @@ home=IntrospectionUtils.guessInstall( jk2.home,jk2.home, tomcat-jk2.jar, CNAME ); if( home != null ) { -if( dL -1 ) d(Guessed home + home ); +log.info(Guessed home + home
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
costin 02/02/06 10:22:45 Modified:jk/java/org/apache/jk/server JkMain.java Log: Update for the simplified model ( handler-centric ) Read conf/jk2.properties and use if for configuration. It is very similar ( or identical ) with workers.properties - we want the C code to read it easily ( same code will be used ), that simplifies a lot in the model and eliminates duplication of config ( right now you need to change both server.xml and workers.properties ). If we want to use one of the alternate config mechanisms, we'll generate jk2.properties to get the same effect. Revision ChangesPath 1.8 +139 -71 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java Index: JkMain.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- JkMain.java 26 Jan 2002 17:23:19 - 1.7 +++ JkMain.java 6 Feb 2002 18:22:45 - 1.8 @@ -81,14 +81,15 @@ String propFile; Properties props=new Properties(); -Worker defaultWorker; -String jkHome; - public JkMain() { } - -public void setPropFile( String p ) { +// Setting + +/** Load a .properties file into and set the values + * into jk2 configuration. + */ +public void setPropertiesFile( String p ) { propFile=p; try { props.load( new FileInputStream(propFile) ); @@ -97,91 +98,106 @@ } } +/** Set a name/value as a jk2 property + */ public void setProperty( String n, String v ) { props.put( n, v ); } - + /** * Set the codechannelClassName/code that will used to connect to * httpd. */ public void setChannelClassName(String name) { -props.put( channel.default.className,name); +props.put( handler.channel.className,name); } /** - * Set the codechannelClassName/code that will used to connect to - * httpd. + * Set the codeworkerClassName/code that will handle the request. + * ( sort of 'pivot' in axis :-) */ public void setWorkerClassName(String name) { -props.put( worker.default.className,name); -} - -public void setDefaultWorker( Worker w ) { -defaultWorker=w; +props.put( handler.container.className,name); } +/** Set the base dir of jk2. ( including WEB-INF if in a webapp ). + * We'll try to guess it from classpath if none is set ( for + * example on command line ), but if in a servlet environment + * you need to use Context.getRealPath or a system property or + * set it expliciltey. + */ public void setJkHome( String s ) { -jkHome=s; +wEnv.setJkHome(s); } -private Object newInstance( String type, String name, String def ) -throws IOException + +// Initialization + +public void init() throws IOException { -try { -String classN=props.getProperty( type + . + name + .className, - def ); -Class channelclass = Class.forName(classN); -return channelclass.newInstance(); -} catch (Exception ex) { -ex.printStackTrace(); -throw new IOException(Cannot create channel class); +String home=wEnv.getJkHome(); +if( home==null ) { +// XXX use IntrospectionUtil to find myself +} +if( home != null ) { +File hF=new File(home); +File conf=new File( home, conf ); +File propsF=new File( conf, jk2.properties ); + +if( propsF.exists() ) { +setPropertiesFile( propsF.getAbsolutePath()); +} else { +if( dL 0 ) d( No properties file found + propsF ); +} } } + public void start() throws IOException { -String workers=props.getProperty( worker.list, default ); +if( props.get( handler.request.className )==null ) +props.put( handler.request.className, + org.apache.jk.common.HandlerRequest ); + +if( props.get( handler.channel.className )==null ) +props.put( handler.channel.className, + org.apache.jk.common.ChannelSocket ); + +// We must have at least 3 handlers: +// channel is the 'transport' +// request is the request processor or 'global' chain
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
costin 02/02/06 12:24:09 Modified:jk/java/org/apache/jk/server JkMain.java Log: Added the start time and a message to tune the initialization of jk Revision ChangesPath 1.9 +8 -0 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java Index: JkMain.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- JkMain.java 6 Feb 2002 18:22:45 - 1.8 +++ JkMain.java 6 Feb 2002 20:24:09 - 1.9 @@ -190,6 +190,8 @@ } wEnv.start(); +long initTime=System.currentTimeMillis() - start_time; +d(Jk running... init time= + initTime + ms); } // Usefull methods @@ -217,7 +219,13 @@ IntrospectionUtils.setProperty( target, name, val ); } +public long getStartTime() { +return start_time; +} + // Main + +static long start_time=System.currentTimeMillis(); public static void main(String args[]) { try { -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
costin 02/02/06 12:24:45 Modified:jk/java/org/apache/jk/server JkMain.java Log: Forgot to save. Revision ChangesPath 1.10 +1 -1 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java Index: JkMain.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- JkMain.java 6 Feb 2002 20:24:09 - 1.9 +++ JkMain.java 6 Feb 2002 20:24:45 - 1.10 @@ -191,7 +191,7 @@ wEnv.start(); long initTime=System.currentTimeMillis() - start_time; -d(Jk running... init time= + initTime + ms); +d(Jk running... init time= + initTime + ms); } // Usefull methods -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
costin 02/02/06 12:33:54 Modified:jk/java/org/apache/jk/common ChannelSocket.java jk/java/org/apache/jk/server JkMain.java Log: Set the default port, improve the arg parsing for JkMain ( used for debugging and tunning mostly, but since a lot of time is spent on that it should be nice ) Revision ChangesPath 1.5 +1 -1 jakarta-tomcat-connectors/jk/java/org/apache/jk/common/ChannelSocket.java Index: ChannelSocket.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/common/ChannelSocket.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- ChannelSocket.java6 Feb 2002 17:43:08 - 1.4 +++ ChannelSocket.java6 Feb 2002 20:33:54 - 1.5 @@ -96,7 +96,7 @@ */ public class ChannelSocket extends Channel { -int port; +int port=8009; InetAddress inet; int serverTimeout; boolean tcpNoDelay; 1.11 +12 -6 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java Index: JkMain.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- JkMain.java 6 Feb 2002 20:24:45 - 1.10 +++ JkMain.java 6 Feb 2002 20:33:54 - 1.11 @@ -130,6 +130,10 @@ wEnv.setJkHome(s); } +public void setDebug( int i ) { +dL=i; +d(set debug + i ); +} // Initialization @@ -173,9 +177,10 @@ String workers=props.getProperty( handler.list, channel,request,container ); Vector workerNamesV= split( workers, ,); - +if( dL 0 ) d(workers: + workers + + workerNamesV.size() ); for( int i=0; iworkerNamesV.size(); i++ ) { String name= (String)workerNamesV.elementAt( i ); +if( dL 0 ) d(Configuring + name ); JkHandler w=wEnv.getHandler( name ); if( w==null ) w=(JkHandler)newInstance( handler, name, null ); @@ -232,8 +237,9 @@ if( args.length == 1 ( -?.equals(args[0]) || -h.equals( args[0])) ) { System.out.println(Usage: ); -System.out.println( JkMain [workers.properties]); +System.out.println( JkMain [args]); System.out.println(); +System.out.println( Each bean setter corresponds to an arg ( like -debug 10 )); System.out.println( System properties:); System.out.println(jk2.homeBase dir of jk2); return; @@ -241,11 +247,11 @@ JkMain jkMain=new JkMain(); +IntrospectionUtils.processArgs( jkMain, args, new String[] {}, +null, new Hashtable()); + jkMain.guessHome(); -if( args.length 0 ) -jkMain.setPropertiesFile(args[0]); - jkMain.init(); jkMain.start(); } catch( Exception ex ) { @@ -312,7 +318,7 @@ } } -private static final int dL=0; +private static int dL=0; private static void d(String s ) { System.err.println( JkMain: + s ); } -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java
costin 02/01/26 09:23:19 Modified:jk/java/org/apache/jk/server JkMain.java Log: Get a worker.properties-like functionality for JkMain. It should be able to read the same file as mod_jk, so we have to configure the port in a single file instead of 2. It can now add dynamically workers and channels, no need to hardcode it. Revision ChangesPath 1.7 +97 -32 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java Index: JkMain.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- JkMain.java 21 Jan 2002 20:11:52 - 1.6 +++ JkMain.java 26 Jan 2002 17:23:19 - 1.7 @@ -68,6 +68,7 @@ import org.apache.tomcat.util.buf.*; import org.apache.tomcat.util.http.*; +import org.apache.tomcat.util.IntrospectionUtils; /** Main class used for testing jk core and common code and tunning. * @@ -78,20 +79,17 @@ { WorkerEnv wEnv=new WorkerEnv(); String propFile; -Properties props; +Properties props=new Properties(); Worker defaultWorker; String jkHome; -Class channelclass; - public JkMain() { } public void setPropFile( String p ) { propFile=p; -props=new Properties(); try { props.load( new FileInputStream(propFile) ); } catch(IOException ex ){ @@ -99,8 +97,24 @@ } } -public void setProperties( Properties p ) { -props=p; +public void setProperty( String n, String v ) { +props.put( n, v ); +} + +/** + * Set the codechannelClassName/code that will used to connect to + * httpd. + */ +public void setChannelClassName(String name) { +props.put( channel.default.className,name); +} + +/** + * Set the codechannelClassName/code that will used to connect to + * httpd. + */ +public void setWorkerClassName(String name) { +props.put( worker.default.className,name); } public void setDefaultWorker( Worker w ) { @@ -111,47 +125,98 @@ jkHome=s; } -public void setChannelClass( Class c ) { -channelclass = c; -} - -public void start() throws IOException { -Channel csocket=null; +private Object newInstance( String type, String name, String def ) +throws IOException +{ try { -csocket=(Channel)channelclass.newInstance(); +String classN=props.getProperty( type + . + name + .className, + def ); +Class channelclass = Class.forName(classN); +return channelclass.newInstance(); } catch (Exception ex) { ex.printStackTrace(); throw new IOException(Cannot create channel class); } +} + +public void start() throws IOException +{ +String workers=props.getProperty( worker.list, default ); +Vector workerNamesV= split( workers, ,); -// Set file. -if( jkHome==null ) -csocket.setFile( /tmp/tomcatUnixSocket ); -else -csocket.setFile( jkHome + /WEB-INF/tomcatUnixSocket ); -csocket.setJkHome( jkHome ); - -// Set port number. -csocket.setPort( 8009 ); +for( int i=0; iworkerNamesV.size(); i++ ) { +String name= (String)workerNamesV.elementAt( i ); +Worker w=(Worker)newInstance( worker, name, + org.apache.jk.common.WorkerDummy); + +processProperties( w, worker.+ name + . ); -wEnv.addChannel( csocket ); +wEnv.addWorker( name, w ); +} + +defaultWorker = wEnv.getWorker( default ); -if( defaultWorker == null ) -defaultWorker=new WorkerDummy(); +// XXX alternatives, setters, etc +String channels=props.getProperty( channel.list, default ); +Vector channelNamesV= split( channels, ,); + +for( int i=0; ichannelNamesV.size(); i++ ) { +String name= (String)channelNamesV.elementAt( i ); +Channel ch=(Channel)newInstance( channel, name, + org.apache.jk.common.ChannelSocket); +processProperties( ch, channel.+ name + . ); + +if( jkHome != null ) +this.setProperty( ch, jkHome, jkHome ); + +wEnv.addChannel( name, ch ); +ch.setWorker( defaultWorker ); +} + +// channel
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java JkServlet.java
costin 02/01/11 20:25:14 Modified:jk/java/org/apache/jk/server JkMain.java JkServlet.java Log: Few fixes. 4.x can't be starte from a servlet ( I tried with 4.1 as well, no luck ) but it uses server.xml Revision ChangesPath 1.4 +11 -2 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java Index: JkMain.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- JkMain.java 6 Jan 2002 08:50:56 - 1.3 +++ JkMain.java 12 Jan 2002 04:25:14 - 1.4 @@ -82,7 +82,8 @@ Properties props; Worker defaultWorker; - +String jkHome; + public JkMain() { } @@ -104,10 +105,18 @@ public void setDefaultWorker( Worker w ) { defaultWorker=w; } + +public void setJkHome( String s ) { +jkHome=s; +} public void start() throws IOException { ChannelUn csocket=new ChannelUn(); -csocket.setFile( /tmp/tomcatApr ); +// if( jkHome==null ) +csocket.setFile( /tmp/tomcatUnixSocket ); +// else +// csocket.setFile( jkHome + /WEB-INF/tomcatUnixSocket ); +csocket.setJkHome( jkHome ); /* ChannelSocket csocket=new ChannelSocket(); csocket.setPort( 8009 ); */ 1.3 +35 -7 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkServlet.java Index: JkServlet.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkServlet.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- JkServlet.java6 Jan 2002 08:50:56 - 1.2 +++ JkServlet.java12 Jan 2002 04:25:14 - 1.3 @@ -85,7 +85,8 @@ /* Parameters for the ajp channel */ String port; String host; /* If it starts with '/' we'll use ud */ -ServletContext sctx; +protected ServletContext sctx; +protected ServletConfig sconf; public JkServlet() { @@ -93,6 +94,10 @@ protected Properties servletConfig2properties(ServletConfig conf ) { Properties props=new Properties(); +if( conf==null ) { +d(No config ); +return props; +} Enumeration paramNE=conf.getInitParameterNames(); while( paramNE.hasMoreElements() ){ String s=(String)paramNE.nextElement(); @@ -105,9 +110,14 @@ public void init(ServletConfig conf) throws ServletException { -super.init(conf); -sctx=conf.getServletContext(); -getServletAdapter(); +try { +super.init(conf); +sconf=conf; +sctx=conf.getServletContext(); +getServletAdapter(); +} catch( Throwable t ) { +t.printStackTrace(); +} } /* Ok, this is a bit hacky - there is ( or I couldn't find ) any clean @@ -119,7 +129,7 @@ the internals. */ private void getServletAdapter() { -try40(); +//try40(); try33(); } @@ -132,8 +142,8 @@ return; } t33.initializeContainer( getServletConfig()); -} catch( Exception ex ) { -ex.printStackTrace(); +} catch( Throwable ex ) { +d(3.3 intialization failed + ex.toString()); } } @@ -159,6 +169,24 @@ ex.printStackTrace(); // ignore it - what would you expect, we pass dummy objects } +} catch( Exception ex ) { +ex.printStackTrace(); +} +} + +protected JkMain jkMain; + +protected void initJkMain(ServletConfig cfg, Worker defaultWorker) { +jkMain=new JkMain(); +jkMain.setProperties( servletConfig2properties( cfg )); +jkMain.setDefaultWorker( defaultWorker ); + +String jkHome=cfg.getServletContext().getRealPath(/); +d(Setting jkHome + jkHome ); +jkMain.setJkHome( jkHome ); + +try { +jkMain.start(); } catch( Exception ex ) { ex.printStackTrace(); } -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java JkServlet.java
costin 02/01/06 00:50:56 Modified:jk/java/org/apache/jk/server JkMain.java JkServlet.java Log: JkServlet is now functional. For 3.3 you can just add jk or a symlink to modules. For 4.0 you just need to add the declaration for the 'trusted' app in server.xml _and_ copy the jar files in servler/lib ( that will not be needed in 4.1 ). The 3.3 impl is working ( at least simple servlets/jsps). I still have some lines to add to the 4.0 impl ( but it starts fine and receives the request ). Revision ChangesPath 1.3 +34 -7 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java Index: JkMain.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- JkMain.java 5 Jan 2002 10:03:43 - 1.2 +++ JkMain.java 6 Jan 2002 08:50:56 - 1.3 @@ -78,27 +78,53 @@ public class JkMain { WorkerEnv wEnv=new WorkerEnv(); +String propFile; +Properties props; + +Worker defaultWorker; public JkMain() { } - +public void setPropFile( String p ) { +propFile=p; +props=new Properties(); +try { +props.load( new FileInputStream(propFile) ); +} catch(IOException ex ){ +ex.printStackTrace(); +} +} + +public void setProperties( Properties p ) { +props=p; +} + +public void setDefaultWorker( Worker w ) { +defaultWorker=w; +} + public void start() throws IOException { -ChannelSocket csocket=new ChannelSocket(); +ChannelUn csocket=new ChannelUn(); +csocket.setFile( /tmp/tomcatApr ); +/* ChannelSocket csocket=new ChannelSocket(); csocket.setPort( 8009 ); +*/ /* ChannelUnixSocket csocket=new ChannelUnixSocket(); // JFC tests -wEnv.addChannel( csocket ); */ +wEnv.addChannel( csocket ); + +if( defaultWorker == null ) +defaultWorker=new WorkerDummy(); -WorkerDummy wdummy=new WorkerDummy(); -csocket.setWorker( wdummy ); -wEnv.addWorker( wdummy ); +csocket.setWorker( defaultWorker ); +wEnv.addWorker( defaultWorker ); HandlerRequest hReq=new HandlerRequest(); wEnv.addHandler( hReq ); -hReq.setWorker( wdummy ); +hReq.setWorker( defaultWorker ); HandlerEcho hEcho=new HandlerEcho(); wEnv.addHandler( hEcho ); @@ -118,6 +144,7 @@ String propFile=args[0]; JkMain jkMain=new JkMain(); +jkMain.setPropFile(propFile); jkMain.start(); } catch( Exception ex ) { ex.printStackTrace(); 1.2 +102 -1 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkServlet.java Index: JkServlet.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkServlet.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- JkServlet.java31 Dec 2001 19:09:59 - 1.1 +++ JkServlet.java6 Jan 2002 08:50:56 - 1.2 @@ -78,9 +78,110 @@ * It'll just start/init jk and use a dummy endpoint ( i.e. no servlet * container ). */ -public class JkServlet +public class JkServlet extends HttpServlet { +String password; +String user; +/* Parameters for the ajp channel */ +String port; +String host; /* If it starts with '/' we'll use ud */ +ServletContext sctx; + public JkServlet() { } + +protected Properties servletConfig2properties(ServletConfig conf ) { +Properties props=new Properties(); +Enumeration paramNE=conf.getInitParameterNames(); +while( paramNE.hasMoreElements() ){ +String s=(String)paramNE.nextElement(); +String v=conf.getInitParameter(s); + +props.put( s, v ); +} +return props; +} + + +public void init(ServletConfig conf) throws ServletException { +super.init(conf); +sctx=conf.getServletContext(); +getServletAdapter(); +} + +/* Ok, this is a bit hacky - there is ( or I couldn't find ) any clean + way to access tomcat40 internals without implementing the interface, + and that will brake 3.3 ( and probably other things ). + + It does seem to work for 4.0, and in future we can add a tomcat40 valve/whatever + that will provide an Attribute for 'trusted' apps
cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/server JkMain.java JkServlet.java
costin 01/12/31 11:09:59 Added: jk/java/org/apache/jk/server JkMain.java JkServlet.java Log: JkServlet will be the main entry point into Jk2. It'll use the normal web.xml to get the config data, do initial config and call a second servlet, specific to each container. The container-specific servlet will use specific methods to access the containers internals ( attribute for 3.3, extend internal servlet in 4.x). It should work like the other 'special' servlets ( the admin in 3.3, manager in 4.x ). It seems the 4.0 problem can be resolved by just copying the jars in lib/server ( while keeping the 'trusted' webapp ). In 4.1 or 3.3 it should work as any other 'trusted' webapp. I haven't played yet with the new manager, but any deploy tool that supports web.xml editing should be useable to configure jk. JkMain is used to test the current code. Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/java/org/apache/jk/server/JkMain.java Index: JkMain.java === /* * * * The Apache Software License, Version 1.1 * * Copyright (c) 1999 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. The end-user documentation included with the redistribution, if *any, must include the following acknowlegement: * This product includes software developed by the *Apache Software Foundation (http://www.apache.org/). *Alternately, this acknowlegement may appear in the software itself, *if and wherever such third-party acknowlegements normally appear. * * 4. The names The Jakarta Project, Tomcat, and Apache Software *Foundation must not be used to endorse or promote products derived *from this software without prior written permission. For written *permission, please contact [EMAIL PROTECTED] * * 5. Products derived from this software may not be called Apache *nor may Apache appear in their names without prior written *permission of the Apache Group. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * http://www.apache.org/. * * [Additional notices, if required by prior licensing conditions] * */ package org.apache.jk.server; import java.io.*; import java.net.*; import java.util.*; import org.apache.jk.core.*; import org.apache.jk.common.*; import org.apache.tomcat.util.net.*; import org.apache.tomcat.util.buf.*; import org.apache.tomcat.util.http.*; /** Main class used for testing jk core and common code and tunning. * * It'll just start/init jk and use a dummy endpoint ( i.e. no servlet * container ). */ public class JkMain { WorkerEnv wEnv=new WorkerEnv(); public JkMain() { } public void start() throws IOException { ChannelSocket csocket=new ChannelSocket(); csocket.setPort( 8009 ); wEnv.addChannel( csocket ); WorkerDummy wdummy=new WorkerDummy(); csocket.setWorker( wdummy ); wEnv.addWorker( wdummy ); HandlerRequest hReq=new HandlerRequest(); wEnv.addHandler( hReq ); hReq.setWorker( wdummy ); HandlerEcho