DO NOT REPLY [Bug 37471] - Can not delete a Context from Admin Tool

2005-11-23 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=37471





--- Additional Comments From [EMAIL PROTECTED]  2005-11-23 11:54 ---
(In reply to comment #2)
> Deleting a Context is not a good idea anyways: a Context is a Web 
> Application. 
> It should be stopped and undeployed from the Manager, not deleted from the 
> Admin
> webapp.
You can provide a logical delete , the the corresponding entries in the
config.xml should get deleted and the web application should not be . I think
this is expected  from the user . 

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 37605] New: - Cannot log in to Tomcat Manager

2005-11-23 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=37605

   Summary: Cannot log in to Tomcat Manager
   Product: Tomcat 5
   Version: 5.5.12
  Platform: Other
OS/Version: other
Status: NEW
  Severity: normal
  Priority: P2
 Component: Unknown
AssignedTo: tomcat-dev@jakarta.apache.org
ReportedBy: [EMAIL PROTECTED]


I have just installed Tomcat 5.5.12 onto a new XP machine (SP2) with Java 
1.5.0_05.  There were no errors in the install and tomcat has started okay.  
However I cannot get to the Tomcat Manager HTML.  When I try to access it, It 
Prompts me for the login.  I type in the user as "admin" with no password and 
it just comes back to the prompt.  Just above the the space to enter the 
username, in the "Connect to Localhost" dialog box is the letters "XDB".  The 
firewall has been turned off on this PC and the popup blocker is NOT turned on.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 37605] - Cannot log in to Tomcat Manager

2005-11-23 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=37605


[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||INVALID




--- Additional Comments From [EMAIL PROTECTED]  2005-11-23 13:57 ---
Bugzilla is not a support forum

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 26372] - java.lang.ThreadDeath when trying to reload an application

2005-11-23 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=26372





--- Additional Comments From [EMAIL PROTECTED]  2005-11-23 14:37 ---
Tomcat developers, do you still insist that this bug is invalid even though it
has  4 duplicates?

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 26372] - java.lang.ThreadDeath when trying to reload an application

2005-11-23 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=26372


[EMAIL PROTECTED] changed:

   What|Removed |Added

 CC||[EMAIL PROTECTED]




-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 26372] - java.lang.ThreadDeath when trying to reload an application

2005-11-23 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=26372





--- Additional Comments From [EMAIL PROTECTED]  2005-11-23 15:13 ---
(In reply to comment #35)
> Tomcat developers, do you still insist that this bug is invalid even though it
> has  4 duplicates?

Still in whine mode ? Obviously, duplicates never make something invalid,
especially since the 4 duplicates were filed by the same person. Duh.

I have another small tweak which removes the exception in some cases (trading
this for a stack trace, possible CL failure, and some memory leaking), but the
fact remains that the setup you are using for logging is broken. Apparently you
don't feel concerned.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r348448 - /tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/loader/WebappClassLoader.java

2005-11-23 Thread remm
Author: remm
Date: Wed Nov 23 06:20:32 2005
New Revision: 348448

URL: http://svn.apache.org/viewcvs?rev=348448&view=rev
Log:
- Modify the way a stopped classloader behaves if accessed, as part of my
  previous CL work.
- Log the illegal access attempt.
- findClass will of return a CNFE.

Modified:

tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/loader/WebappClassLoader.java

Modified: 
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/loader/WebappClassLoader.java
URL: 
http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/loader/WebappClassLoader.java?rev=348448&r1=348447&r2=348448&view=diff
==
--- 
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/loader/WebappClassLoader.java
 (original)
+++ 
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/loader/WebappClassLoader.java
 Wed Nov 23 06:20:32 2005
@@ -835,6 +835,11 @@
 if (log.isDebugEnabled())
 log.debug("findClass(" + name + ")");
 
+// Cannot load anything from local repositories if class loader is 
stopped
+if (!started) {
+throw new ClassNotFoundException(name);
+}
+
 // (1) Permission to define this class when using a SecurityManager
 if (securityManager != null) {
 int i = name.lastIndexOf('.');
@@ -1227,10 +1232,13 @@
 log.debug("loadClass(" + name + ", " + resolve + ")");
 Class clazz = null;
 
-// Don't load classes if class loader is stopped
+// Log access to stopped classloader
 if (!started) {
-log.info(sm.getString("webappClassLoader.stopped", name));
-throw new ThreadDeath();
+try {
+throw new IllegalStateException();
+} catch (IllegalStateException e) {
+log.info(sm.getString("webappClassLoader.stopped", name), e);
+}
 }
 
 // (0) Check our previously loaded local class cache



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: SVN oddities with "current" link

2005-11-23 Thread Remy Maucherat

Costin Manolache wrote:

Container, jasper and build are a good start. I think connectors
should be included too.

Servletapi is obviously different, and even in the current build it's
downloaded as a jar AFAIK.

You can still have separate releases and release cycles for different
components - even if they
reside in the same SVN tree ( or even same java/ source tree ). As we
learned, labels are cheap,
so there's no problem if you release and label different things.

I hope more components could follow the 'separate release' model -
/admin and most webapps,
many other things that could be modules. At least in 6.x timeframe.


Yes, I can testify it's easier to work with, and it only took me a few 
minutes to put together (warning: it's APR only, JNDI is removed, etc, 
so a full Tomcat repository has to be more complex to build), the setup 
in Eclipse only takes a few minutes, and building is faster (no webapps, 
though).


http://anonsvn.labs.jboss.com/trunk/labs/jbossweb/

Rémy

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Tomcat Crash with apr when RequestProcessor accessed

2005-11-23 Thread Peter Rossbach

Hey,

A customer report today a very strange tomcat crash to me and
I can simulate this bugs with following releases and OS's:

Tested with Suse 9.3, Tomcat 5.5.12 /Apr 1.2.2 / openssl 0.9.8, jdk 1.5.0_03
Also tested with current SVN Head and fresh build tcnative from head
and Tomcat 5.5.12 / Maldens tcnative 1.1.0 dll / Windows XP

Start Tomcat with APR Http Connector and JSR 160 JMX Adaptor
request some pages via http Connector
start jconsole / open Mbeans tab
Open RequestProcessor tree
Open one off the RequestInfo MBeans

Result: -- jvm crashed --

Tomcat 5.5.12 ---
INFO   | jvm 1| 2005/11/23 13:08:28 | INFO: Server startup in 1430 ms
INFO   | jvm 1| 2005/11/23 13:09:08 | 23.11.2005 13:09:08 
org.objektpark.catalina.session.LogSessionListener sessionCreated
INFO   | jvm 1| 2005/11/23 13:09:08 | INFO: sessionCreated: 
EC3D6BA963E5EB26F1EA68EED9098A9A.node01

INFO   | jvm 1| 2005/11/23 13:09:16 | #
INFO   | jvm 1| 2005/11/23 13:09:16 | # An unexpected error has been 
detected by HotSpot Virtual Machine:

INFO   | jvm 1| 2005/11/23 13:09:16 | #
INFO   | jvm 1| 2005/11/23 13:09:16 | #  SIGSEGV (0xb) at 
pc=0x4678fc63, pid=8355, tid=1189579696

INFO   | jvm 1| 2005/11/23 13:09:16 | #
INFO   | jvm 1| 2005/11/23 13:09:16 | # Java VM: Java HotSpot(TM) 
Client VM (1.5.0_03-b07 mixed mode, sharing)

INFO   | jvm 1| 2005/11/23 13:09:16 | # Problematic frame:
INFO   | jvm 1| 2005/11/23 13:09:16 | # C  [libapr-1.so.0+0x16c63]  
apr_socket_addr_get+0x93

INFO   | jvm 1| 2005/11/23 13:09:16 | #
INFO   | jvm 1| 2005/11/23 13:09:16 | # An error report file with 
more information is saved as hs_err_pid8355.log

INFO   | jvm 1| 2005/11/23 13:09:16 | #
INFO   | jvm 1| 2005/11/23 13:09:16 | # If you would like to submit 
a bug report, please visit:
INFO   | jvm 1| 2005/11/23 13:09:16 | #   
http://java.sun.com/webapps/bugreport/crash.jsp

INFO   | jvm 1| 2005/11/23 13:09:16 | #
ERROR  | wrapper  | 2005/11/23 13:09:16 | JVM exited unexpectedly.
STATUS | wrapper  | 2005/11/23 13:09:30 | Launching a JVM...

=
crurrent Tomcat svn head with fresh build tcnative

INFO   | jvm 1| 2005/11/23 15:51:32 | INFO: sessionCreated: 
4ABBA4F2ABCBD8E2DF5857CC375FD8CC.node01

INFO   | jvm 1| 2005/11/23 15:52:16 | #
INFO   | jvm 1| 2005/11/23 15:52:16 | # An unexpected error has been 
detected by HotSpot Virtual Machine:

INFO   | jvm 1| 2005/11/23 15:52:16 | #
INFO   | jvm 1| 2005/11/23 15:52:16 | #  SIGSEGV (0xb) at 
pc=0x46799c63, pid=12382, tid=1190149040

INFO   | jvm 1| 2005/11/23 15:52:16 | #
INFO   | jvm 1| 2005/11/23 15:52:16 | # Java VM: Java HotSpot(TM) 
Client VM (1.5.0_03-b07 mixed mode, sharing)

INFO   | jvm 1| 2005/11/23 15:52:16 | # Problematic frame:
INFO   | jvm 1| 2005/11/23 15:52:16 | # C  [libapr-1.so.0+0x16c63]  
apr_socket_addr_get+0x93

INFO   | jvm 1| 2005/11/23 15:52:16 | #
INFO   | jvm 1| 2005/11/23 15:52:16 | # An error report file with 
more information is saved as hs_err_pid12382.log

INFO   | jvm 1| 2005/11/23 15:52:16 | #
INFO   | jvm 1| 2005/11/23 15:52:16 | # If you would like to submit 
a bug report, please visit:
INFO   | jvm 1| 2005/11/23 15:52:16 | #   
http://java.sun.com/webapps/bugreport/crash.jsp

INFO   | jvm 1| 2005/11/23 15:52:16 | #
ERROR  | wrapper  | 2005/11/23 15:52:16 | JVM exited unexpectedly.
STATUS | wrapper  | 2005/11/23 15:52:30 | Launching a JVM...



Here a part of the core dump
#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
#  SIGSEGV (0xb) at pc=0x4678fc63, pid=8355, tid=1189579696
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_03-b07 mixed mode, sharing)
# Problematic frame:
# C  [libapr-1.so.0+0x16c63]  apr_socket_addr_get+0x93
#

---  T H R E A D  ---

Current thread (0x08070c68):  JavaThread "RMI TCP 
Connection(3)-127.0.0.2" daemon [_thread_in_native, id=8389]


siginfo:si_signo=11, si_errno=0, si_code=1, si_addr=0x0028

Registers:
EAX=0x, EBX=0x467991e0, ECX=0x0001, EDX=0x
ESP=0x46e77214, EBP=0x46e7722c, ESI=0x, EDI=0x46e77244
EIP=0x4678fc63, CR2=0x0028, EFLAGS=0x00010246

Top of Stack: (sp=0x46e77214)
0x46e77214:   46e77304 082e0b94 082e0b94 4676516c
0x46e77224:   69cb9728 08070c68 46e7724c 466a21ad
0x46e77234:   46e77244 0001  466a2180
0x46e77244:    69cb9730 46e77284 438bf42b
0x46e77254:   08070d24 46e7728c 0001 086501f8
0x46e77264:    46e77268 69cb9728 46e7729c
0x46e77274:   69cb99d8  69cb9730 46e77294
0x46e77284:   46e772bc 438b99fa 69cb9980 438bd589

Instructions: (pc=0x4678fc63)
0x4678fc53:   c0 8d 65 f4 5b 5e 5f 5d c3 8d 74 26 00 48 75 5a
0x4678fc63:   8b 4e 28 85 c9 75 06 8b 46 14 eb e1 90 8b 46 14

Stack: [0x46df8000,0x46e79000),  sp=0x46e77214,  free space=508k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, 
C=native code)

C  [libapr-1.so.0+0x16c63]  apr_socket_addr_get+0x93
C  [libtc

Re: Tomcat Crash with apr when RequestProcessor accessed

2005-11-23 Thread Remy Maucherat

Peter Rossbach wrote:

Hey,

A customer report today a very strange tomcat crash to me and
I can simulate this bugs with following releases and OS's:

Tested with Suse 9.3, Tomcat 5.5.12 /Apr 1.2.2 / openssl 0.9.8, jdk 
1.5.0_03

Also tested with current SVN Head and fresh build tcnative from head
and Tomcat 5.5.12 / Maldens tcnative 1.1.0 dll / Windows XP

Start Tomcat with APR Http Connector and JSR 160 JMX Adaptor
request some pages via http Connector
start jconsole / open Mbeans tab
Open RequestProcessor tree
Open one off the RequestInfo MBeans


Can you give the full stack trace just to be sure ?

This seems a bit evident though: the HTTP connector has guards for 
(socket != null) and the APR HTTP connector would need equivalent 
(socket != 0). Woops, bad Java to APR translation.


Rémy

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r348470 - /tomcat/connectors/trunk/http11/src/java/org/apache/coyote/http11/Http11AprProcessor.java

2005-11-23 Thread remm
Author: remm
Date: Wed Nov 23 08:06:10 2005
New Revision: 348470

URL: http://svn.apache.org/viewcvs?rev=348470&view=rev
Log:
- Fix crash when a socket is used outside of the process method (for example
  through JMX). I would assume a crash would occur with a socket which had 
  its associated memory pool deallocated.

Modified:

tomcat/connectors/trunk/http11/src/java/org/apache/coyote/http11/Http11AprProcessor.java

Modified: 
tomcat/connectors/trunk/http11/src/java/org/apache/coyote/http11/Http11AprProcessor.java
URL: 
http://svn.apache.org/viewcvs/tomcat/connectors/trunk/http11/src/java/org/apache/coyote/http11/Http11AprProcessor.java?rev=348470&r1=348469&r2=348470&view=diff
==
--- 
tomcat/connectors/trunk/http11/src/java/org/apache/coyote/http11/Http11AprProcessor.java
 (original)
+++ 
tomcat/connectors/trunk/http11/src/java/org/apache/coyote/http11/Http11AprProcessor.java
 Wed Nov 23 08:06:10 2005
@@ -19,7 +19,6 @@
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.io.InterruptedIOException;
-import java.net.InetAddress;
 import java.util.StringTokenizer;
 import java.util.regex.Pattern;
 import java.util.regex.PatternSyntaxException;
@@ -216,7 +215,7 @@
 /**
  * Socket associated with the current connection.
  */
-protected long socket;
+protected long socket = 0;
 
 
 /**
@@ -907,6 +906,7 @@
 // Recycle
 inputBuffer.recycle();
 outputBuffer.recycle();
+this.socket = 0;
 
 return openSocket;
 
@@ -1003,7 +1003,7 @@
 } else if (actionCode == ActionCode.ACTION_REQ_HOST_ADDR_ATTRIBUTE) {
 
 // Get remote host address
-if (remoteAddr == null) {
+if (remoteAddr == null && (socket != 0)) {
 try {
 long sa = Address.get(Socket.APR_REMOTE, socket);
 remoteAddr = Address.getip(sa);
@@ -1016,7 +1016,7 @@
 } else if (actionCode == ActionCode.ACTION_REQ_LOCAL_NAME_ATTRIBUTE) {
 
 // Get local host name
-if (localName == null) {
+if (localName == null && (socket != 0)) {
 try {
 long sa = Address.get(Socket.APR_LOCAL, socket);
 localName = Address.getnameinfo(sa, 0);
@@ -1029,7 +1029,7 @@
 } else if (actionCode == ActionCode.ACTION_REQ_HOST_ATTRIBUTE) {
 
 // Get remote host name
-if (remoteHost == null) {
+if (remoteHost == null && (socket != 0)) {
 try {
 long sa = Address.get(Socket.APR_REMOTE, socket);
 remoteHost = Address.getnameinfo(sa, 0);
@@ -1042,7 +1042,7 @@
 } else if (actionCode == ActionCode.ACTION_REQ_LOCAL_ADDR_ATTRIBUTE) {
 
 // Get local host address
-if (localAddr == null) {
+if (localAddr == null && (socket != 0)) {
 try {
 long sa = Address.get(Socket.APR_LOCAL, socket);
 Sockaddr addr = new Sockaddr();
@@ -1060,7 +1060,7 @@
 } else if (actionCode == ActionCode.ACTION_REQ_REMOTEPORT_ATTRIBUTE) {
 
 // Get remote port
-if (remotePort == -1) {
+if (remotePort == -1 && (socket != 0)) {
 try {
 long sa = Address.get(Socket.APR_REMOTE, socket);
 Sockaddr addr = Address.getInfo(sa);
@@ -1074,7 +1074,7 @@
 } else if (actionCode == ActionCode.ACTION_REQ_LOCALPORT_ATTRIBUTE) {
 
 // Get local port
-if (localPort == -1) {
+if (localPort == -1 && (socket != 0)) {
 try {
 long sa = Address.get(Socket.APR_LOCAL, socket);
 Sockaddr addr = new Sockaddr();



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: SVN oddities with "current" link

2005-11-23 Thread Costin Manolache
Yes, that's what I'm talking about - but on the tomcat svn :-).

Can we do the same here ? Only for HEAD ( or at least for 6.0 ), so
moving forward we could
keep things simpler.

BTW - a nice facility in eclipse and ant is the exclude, so the tree
can include multiple connectors, and multiple features - but still
have full flexibility in what is released and in what packaging.

What do you mean by "JNDI removed" - removed from the classloader and
file servlet ? That would be really nice ( at least like an option ) 
:-) What is the license on your changes ? Anything that can be
contributed back ?

Costin

> Yes, I can testify it's easier to work with, and it only took me a few
> minutes to put together (warning: it's APR only, JNDI is removed, etc,
> so a full Tomcat repository has to be more complex to build), the setup
> in Eclipse only takes a few minutes, and building is faster (no webapps,
> though).
>
> http://anonsvn.labs.jboss.com/trunk/labs/jbossweb/
>
> 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]



svn commit: r348476 - /tomcat/connectors/trunk/http11/src/java/org/apache/coyote/http11/Http11AprProcessor.java

2005-11-23 Thread remm
Author: remm
Date: Wed Nov 23 08:15:53 2005
New Revision: 348476

URL: http://svn.apache.org/viewcvs?rev=348476&view=rev
Log:
- Do the same with SSL.

Modified:

tomcat/connectors/trunk/http11/src/java/org/apache/coyote/http11/Http11AprProcessor.java

Modified: 
tomcat/connectors/trunk/http11/src/java/org/apache/coyote/http11/Http11AprProcessor.java
URL: 
http://svn.apache.org/viewcvs/tomcat/connectors/trunk/http11/src/java/org/apache/coyote/http11/Http11AprProcessor.java?rev=348476&r1=348475&r2=348476&view=diff
==
--- 
tomcat/connectors/trunk/http11/src/java/org/apache/coyote/http11/Http11AprProcessor.java
 (original)
+++ 
tomcat/connectors/trunk/http11/src/java/org/apache/coyote/http11/Http11AprProcessor.java
 Wed Nov 23 08:15:53 2005
@@ -1090,8 +1090,8 @@
 
 } else if (actionCode == ActionCode.ACTION_REQ_SSL_ATTRIBUTE ) {
 
-try {
-if (ssl) {
+if (ssl && (socket != 0)) {
+try {
 // Cipher suite
 Object sslO = SSLSocket.getInfoS(socket, 
SSL.SSL_INFO_CIPHER);
 if (sslO != null) {
@@ -1127,14 +1127,14 @@
 request.setAttribute
 (AprEndpoint.SESSION_ID_KEY, sslO);
 }
+} catch (Exception e) {
+log.warn(sm.getString("http11processor.socket.ssl"), e);
 }
-} catch (Exception e) {
-log.warn(sm.getString("http11processor.socket.ssl"), e);
 }
 
 } else if (actionCode == ActionCode.ACTION_REQ_SSL_CERTIFICATE) {
 
-if (ssl) {
+if (ssl && (socket != 0)) {
  // Consume and buffer the request body, so that it does not
  // interfere with the client's handshake messages
 InputFilter[] inputFilters = inputBuffer.getFilters();



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat Crash with apr when RequestProcessor accessed

2005-11-23 Thread Remy Maucherat

Peter Rossbach wrote:

Hey,

A customer report today a very strange tomcat crash to me and
I can simulate this bugs with following releases and OS's:

Tested with Suse 9.3, Tomcat 5.5.12 /Apr 1.2.2 / openssl 0.9.8, jdk 
1.5.0_03

Also tested with current SVN Head and fresh build tcnative from head
and Tomcat 5.5.12 / Maldens tcnative 1.1.0 dll / Windows XP

Start Tomcat with APR Http Connector and JSR 160 JMX Adaptor
request some pages via http Connector
start jconsole / open Mbeans tab
Open RequestProcessor tree
Open one off the RequestInfo MBeans


Let me know if my change fixes the problem, as I didn't even try to 
reproduce the problem (and during the time I was using it with the APR 
connector, neither the status servlet nor the JMX proxy crashed on me).


I did add guard code like there was in the HTTP connector, which 
critical here as these are pointers.


Rémy

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat Crash with apr when RequestProcessor accessed

2005-11-23 Thread Peter Rossbach

Hey Remy,

I have tested your patch (suse 9.3) and it fix the jvm crash problem.
Currently I have only tested with http apr connector.

Many thanks
Peter

Remy Maucherat schrieb:


Peter Rossbach wrote:


Hey,

A customer report today a very strange tomcat crash to me and
I can simulate this bugs with following releases and OS's:

Tested with Suse 9.3, Tomcat 5.5.12 /Apr 1.2.2 / openssl 0.9.8, jdk 
1.5.0_03

Also tested with current SVN Head and fresh build tcnative from head
and Tomcat 5.5.12 / Maldens tcnative 1.1.0 dll / Windows XP

Start Tomcat with APR Http Connector and JSR 160 JMX Adaptor
request some pages via http Connector
start jconsole / open Mbeans tab
Open RequestProcessor tree
Open one off the RequestInfo MBeans



Let me know if my change fixes the problem, as I didn't even try to 
reproduce the problem (and during the time I was using it with the APR 
connector, neither the status servlet nor the JMX proxy crashed on me).


I did add guard code like there was in the HTTP connector, which 
critical here as these are pointers.


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: Tomcat Crash with apr when RequestProcessor accessed

2005-11-23 Thread Remy Maucherat

Peter Rossbach wrote:

Hey Remy,

I have tested your patch (suse 9.3) and it fix the jvm crash problem.
Currently I have only tested with http apr connector.


Cool. AJP can't have the issue (the action method doesn't make any 
socket access).


Rémy

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: SVN oddities with "current" link

2005-11-23 Thread Remy Maucherat

Costin Manolache wrote:

Yes, that's what I'm talking about - but on the tomcat svn :-).

Can we do the same here ? Only for HEAD ( or at least for 6.0 ), so
moving forward we could
keep things simpler.

BTW - a nice facility in eclipse and ant is the exclude, so the tree
can include multiple connectors, and multiple features - but still
have full flexibility in what is released and in what packaging.

What do you mean by "JNDI removed" - removed from the classloader and
file servlet ? That would be really nice ( at least like an option ) 
:-) What is the license on your changes ? Anything that can be

contributed back ?


I mean I removed (parts of) the code to support datasources, etc, all of 
which are provided by JBoss. I don't know what the license is supposed 
to be at the moment. At the moment, there's nothing to contribute back. 
I'll try to continue committing interesting things in the future.


Rémy

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 37612] New: - Jasper's Validator does not include full path of file being compiled in error message

2005-11-23 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=37612

   Summary: Jasper's Validator does not include full path of file
being compiled in error message
   Product: Tomcat 5
   Version: 5.0.12
  Platform: All
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: Jasper
AssignedTo: tomcat-dev@jakarta.apache.org
ReportedBy: [EMAIL PROTECTED]


When JspC fails due to a validation error, the message created by
Validator.validateXmlView and dispatched to the errorDispatcher does not include
the full path of the file.
This means that the fix for bug 28604 is not complete.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 37612] - Jasper's Validator does not include full path of file being compiled in error message

2005-11-23 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=37612





--- Additional Comments From [EMAIL PROTECTED]  2005-11-23 18:22 ---
Created an attachment (id=17020)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=17020&action=view)
fix for this bug

this patch fixes the problem.
It is a patch against 5.5.12.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r348506 - /tomcat/container/tc5.5.x/webapps/docs/changelog.xml

2005-11-23 Thread remm
Author: remm
Date: Wed Nov 23 10:03:53 2005
New Revision: 348506

URL: http://svn.apache.org/viewcvs?rev=348506&view=rev
Log:
- Changelog update.

Modified:
tomcat/container/tc5.5.x/webapps/docs/changelog.xml

Modified: tomcat/container/tc5.5.x/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/webapps/docs/changelog.xml?rev=348506&r1=348505&r2=348506&view=diff
==
--- tomcat/container/tc5.5.x/webapps/docs/changelog.xml (original)
+++ tomcat/container/tc5.5.x/webapps/docs/changelog.xml Wed Nov 23 10:03:53 2005
@@ -85,7 +85,7 @@
   
   
 Update messages and stack traces for classloading errors which may 
occur when removing
-a web application. (remm)
+a web application, and for stopped web applications. (remm)
   
   
 37319: Fix catalina.bat reference to CATALINA_BASE for 
logging.properties.  Thanks
@@ -132,6 +132,10 @@
   
   Connection Timeout is normal, so reduce logging to DEBUG 
(billbarker) 
   
+  
+Fix crash which could occur with the HTTP APR connector when accessing 
request JMX objects
+outside of the processing of the said request (remm)
+  
 
   
   



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Feature Request: set maxSpareThreads and minSpareThreads and see a next strange APR Connector behaviour

2005-11-23 Thread Peter Rossbach
Why we can set maxSpareThreads and minSpareThreads at APR Http and APR 
AJP threadpools?


I have seen another strange behaviour:

After a small load 10 requests and two hour no request the
AJP and HTTP Server sockets are closed and threadspools are not running 
anymore (running jmx attribute say false).


When signal the process a shutdown. I see following message inside the log:

INFO   | jvm 2| 2005/11/23 22:00:01 | 23.11.2005 22:00:01 
org.apache.coyote.ajp.AjpAprProtocol pause
INFO   | jvm 2| 2005/11/23 22:00:01 | INFO: Pausing Coyote AJP/1.3 
on ajp-20012
INFO   | jvm 2| 2005/11/23 22:00:02 | 23.11.2005 22:00:02 
org.apache.catalina.core.StandardService stop

INFO   | jvm 2| 2005/11/23 22:00:02 | INFO: Stopping service Catalina
INFO   | jvm 2| 2005/11/23 22:00:02 | 23.11.2005 22:00:02 
org.apache.catalina.connector.MapperListener destroy
INFO   | jvm 2| 2005/11/23 22:00:02 | WARNUNG: Error unregistering 
MBeanServerDelegate

INFO   | jvm 2| 2005/11/23 22:00:02 | java.lang.NullPointerException
INFO   | jvm 2| 2005/11/23 22:00:02 |   at 
org.apache.catalina.connector.MapperListener.destroy(MapperListener.java:161)
INFO   | jvm 2| 2005/11/23 22:00:02 |   at 
org.apache.catalina.connector.Connector.stop(Connector.java:1132)
INFO   | jvm 2| 2005/11/23 22:00:02 |   at 
org.apache.catalina.core.StandardService.stop(StandardService.java:521)
INFO   | jvm 2| 2005/11/23 22:00:02 |   at 
org.apache.catalina.core.StandardServer.stop(StandardServer.java:734)
INFO   | jvm 2| 2005/11/23 22:00:02 |   at 
org.apache.catalina.startup.Catalina.stop(Catalina.java:601)
INFO   | jvm 2| 2005/11/23 22:00:02 |   at 
org.apache.catalina.startup.Catalina.start(Catalina.java:576)
INFO   | jvm 2| 2005/11/23 22:00:02 |   at 
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO   | jvm 2| 2005/11/23 22:00:02 |   at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
INFO   | jvm 2| 2005/11/23 22:00:02 |   at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
INFO   | jvm 2| 2005/11/23 22:00:02 |   at 
java.lang.reflect.Method.invoke(Method.java:585)
INFO   | jvm 2| 2005/11/23 22:00:02 |   at 
org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:275)
INFO   | jvm 2| 2005/11/23 22:00:02 |   at 
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
INFO   | jvm 2| 2005/11/23 22:00:02 |   at 
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO   | jvm 2| 2005/11/23 22:00:02 |   at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
INFO   | jvm 2| 2005/11/23 22:00:02 |   at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
INFO   | jvm 2| 2005/11/23 22:00:02 |   at 
java.lang.reflect.Method.invoke(Method.java:585)
INFO   | jvm 2| 2005/11/23 22:00:02 |   at 
org.tanukisoftware.wrapper.WrapperStartStopApp.run(WrapperStartStopApp.java:159)
INFO   | jvm 2| 2005/11/23 22:00:02 |   at 
java.lang.Thread.run(Thread.java:595)
INFO   | jvm 2| 2005/11/23 22:00:02 | 23.11.2005 22:00:02 
org.apache.coyote.http11.Http11AprProtocol destroy
INFO   | jvm 2| 2005/11/23 22:00:02 | INFO: Stopping Coyote HTTP/1.1 
on http-20011
INFO   | jvm 2| 2005/11/23 22:00:02 | 23.11.2005 22:00:02 
org.apache.catalina.connector.Connector stop
INFO   | jvm 2| 2005/11/23 22:00:02 | SCHWERWIEGEND: Coyote 
connector has not been started


---
I have looked inside MapperListener Code
   public void destroy() {
   try {

   ObjectName objectName = new ObjectName(
   "JMImplementation:type=MBeanServerDelegate");
   mBeanServer.removeNotificationListener(objectName, this);
   } catch (Exception e) {
   log.warn("Error unregistering MBeanServerDelegate", e);
   }
   }

But the only chance to get a NPE is that MapperListener was not 
initialized!!


Very strange,
Peter




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 37018] - Document how to use tomcat-SSL with a pkcs11 token

2005-11-23 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=37018


[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |NEEDINFO




--- Additional Comments From [EMAIL PROTECTED]  2005-11-23 22:51 ---
Ralf, I'm not sure how to document this beyond simply pointing to the (good)
URLs you provide...

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 37070] - Servlets not recognized as MBeans

2005-11-23 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=37070


[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |NEEDINFO




--- Additional Comments From [EMAIL PROTECTED]  2005-11-23 22:56 ---
The workaround depends on what you want to do: can you do the MBean stuff in a
non-Servlet class?  What is your use-case?

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 36569] - Redirects produce illegal URL's

2005-11-23 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=36569


[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |NEEDINFO




--- Additional Comments From [EMAIL PROTECTED]  2005-11-23 23:07 ---
Mmmm.. The Servlet Spec already says all URLs passed to sendRedirect should
first be passed to encodeRedirectURL.  That method, in Tomcat, calls
org.apache.catalina.connector.Response#isEncodeable, which in doIsEncodeable
tries to construct a URL and returns false if there's a MalformedURLException. 
In theory we could do something with this MalformedURLException, but the Servlet
Spec API for encodeRedirectURL doesn't allow for declared exceptions, so it
would have to be a runtime exception, which seems like an ugly surprise for our
users.

I'll stew about this a bit more as time permits, but alternative ideas 
welcome...

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 36569] - Redirects produce illegal URL's

2005-11-23 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=36569





--- Additional Comments From [EMAIL PROTECTED]  2005-11-23 23:45 ---
One thought is that if sendRedirect gets a malformed URL, it can redirect to an
error page that says that there was an invalid redirect.  This is similar to
redirecting to a special page if a jsp can't be compiled or if an uncaught
exception is thrown by a servlet.

This doesn't solve the problem, but it does make it very clear when it happens.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Feature Request: set maxSpareThreads and minSpareThreads and see a next strange APR Connector behaviour

2005-11-23 Thread Remy Maucherat

Peter Rossbach wrote:
Why we can set maxSpareThreads and minSpareThreads at APR Http and APR 
AJP threadpools?


Because of interdependencies with the regular connector. It won't do 
anything.



I have seen another strange behaviour:

After a small load 10 requests and two hour no request the
AJP and HTTP Server sockets are closed and threadspools are not running 
anymore (running jmx attribute say false).


It works fine for me, and I've noted reliability was fine. If 
reliability is in doubt, it's the same as always, get a thread dump.


That exception can't be caused by the fact that one connector is used 
rather than another, anyway.


Rémy

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r348655 - /tomcat/sandbox/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java

2005-11-23 Thread costin
Author: costin
Date: Wed Nov 23 21:20:50 2005
New Revision: 348655

URL: http://svn.apache.org/viewcvs?rev=348655&view=rev
Log:
Refactoring - leave only the core methods, no ThreadPool or specific
code. 

Modified:
tomcat/sandbox/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java

Modified: tomcat/sandbox/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java
URL: 
http://svn.apache.org/viewcvs/tomcat/sandbox/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java?rev=348655&r1=348654&r2=348655&view=diff
==
--- tomcat/sandbox/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java 
(original)
+++ tomcat/sandbox/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java Wed Nov 
23 21:20:50 2005
@@ -17,21 +17,17 @@
 package org.apache.tomcat.util.net;
 
 import java.io.IOException;
-import java.io.InterruptedIOException;
-import java.net.BindException;
 import java.net.InetAddress;
 import java.net.ServerSocket;
 import java.net.Socket;
 import java.net.SocketException;
-import java.security.AccessControlException;
-import java.util.Stack;
-import java.util.Vector;
+import java.util.ArrayList;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.tomcat.util.res.StringManager;
 import org.apache.tomcat.util.threads.ThreadPool;
-import org.apache.tomcat.util.threads.ThreadPoolRunnable;
+import org.apache.tomcat.util.threads.ThreadPool.ThreadPoolListener;
 
 /* Similar with MPM module in Apache2.0. Handles all the details related with
"tcp server" functionality - thread management, accept policy, etc.
@@ -60,98 +56,123 @@
 
 static Log log=LogFactory.getLog(PoolTcpEndpoint.class );
 
-private StringManager sm = 
+protected StringManager sm = 
 StringManager.getManager("org.apache.tomcat.util.net.res");
 
-private static final int BACKLOG = 100;
-private static final int TIMEOUT = 1000;
+protected static final int BACKLOG = 100;
+protected static final int TIMEOUT = 1000;
 
-private final Object threadSync = new Object();
+protected int backlog = BACKLOG;
+protected int serverTimeout = TIMEOUT;
 
-private int backlog = BACKLOG;
-private int serverTimeout = TIMEOUT;
+protected InetAddress inet;
+protected int port;
 
-private InetAddress inet;
-private int port;
+protected ServerSocket serverSocket;
 
-private ServerSocketFactory factory;
-private ServerSocket serverSocket;
-
-private volatile boolean running = false;
-private volatile boolean paused = false;
-private boolean initialized = false;
-private boolean reinitializing = false;
-static final int debug=0;
+protected volatile boolean running = false;
+protected volatile boolean paused = false;
+protected boolean initialized = false;
+protected boolean reinitializing = false;
 
 protected boolean tcpNoDelay=false;
 protected int linger=100;
 protected int socketTimeout=-1;
-private boolean lf = true;
-
 
 // -- Leader follower fields
 
 
 TcpConnectionHandler handler;
-ThreadPoolRunnable listener;
-ThreadPool tp;
+// -- Master slave fields
 
+protected int curThreads = 0;
+protected int maxThreads = 20;
+protected int maxSpareThreads = 20;
+protected int minSpareThreads = 20;
+protected String type;
+
+protected String name = "EP"; // base name for threads
 
-// -- Master slave fields
+protected int threadPriority;
 
-/* The background thread. */
-private Thread thread = null;
-/* Available processors. */
-private Stack workerThreads = new Stack();
-private int curThreads = 0;
-private int maxThreads = 20;
-/* All processors which have been created. */
-private Vector created = new Vector();
+protected boolean daemon = true;
 
+private ArrayList listeners = new ArrayList();
 
 public PoolTcpEndpoint() {
-   tp = new ThreadPool();
 }
 
-public PoolTcpEndpoint( ThreadPool tp ) {
-this.tp=tp;
+public static PoolTcpEndpoint getEndpoint(String type) {
+String cn = null;
+if( "apr".equals( type )) {
+cn = "org.apache.tomcat.util.net.AprEndpoint";
+}
+if( "lf".equals( type )) {
+cn = "org.apache.tomcat.util.net.LeaderFollowerEndpoint";
+}
+if( "acc".equals( type )) {
+cn = "org.apache.tomcat.util.net.AcceptorEndpoint";
+}
+if( "ms".equals( type )) {
+cn = "org.apache.tomcat.util.net.MasterSlaveEndpoint";
+}
+PoolTcpEndpoint res = null; 
+if( cn != null ) {
+try {
+Class c = Class.forName( cn );
+res = (PoolTcpEndpoint)c.newInstance();
+} catch( Throwable t ) {
+throw new RuntimeException("Can't create endpoint " + cn);
+}
+}

svn commit: r348656 - in /tomcat/sandbox/java/org/apache/tomcat/util/net: LeaderFollowerEndpoint.java MasterSlaveEndpoint.java

2005-11-23 Thread costin
Author: costin
Date: Wed Nov 23 21:22:10 2005
New Revision: 348656

URL: http://svn.apache.org/viewcvs?rev=348656&view=rev
Log:
Moved all the functionality from PoolTcpEndpoint in 2 separate classes. It was 
a mess, impossible
to understand what thread is created and how. As a result, MasterSlave seems to 
not be actually using ThreadPools -
only LeaderFollower. 


Added:
tomcat/sandbox/java/org/apache/tomcat/util/net/LeaderFollowerEndpoint.java
tomcat/sandbox/java/org/apache/tomcat/util/net/MasterSlaveEndpoint.java

Added: 
tomcat/sandbox/java/org/apache/tomcat/util/net/LeaderFollowerEndpoint.java
URL: 
http://svn.apache.org/viewcvs/tomcat/sandbox/java/org/apache/tomcat/util/net/LeaderFollowerEndpoint.java?rev=348656&view=auto
==
--- tomcat/sandbox/java/org/apache/tomcat/util/net/LeaderFollowerEndpoint.java 
(added)
+++ tomcat/sandbox/java/org/apache/tomcat/util/net/LeaderFollowerEndpoint.java 
Wed Nov 23 21:22:10 2005
@@ -0,0 +1,386 @@
+/*
+ *  Copyright 1999-2004 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.tomcat.util.net;
+
+import java.io.IOException;
+import java.io.InterruptedIOException;
+import java.net.BindException;
+import java.net.Socket;
+import java.net.SocketException;
+import java.security.AccessControlException;
+import java.util.Stack;
+
+import org.apache.tomcat.util.threads.ThreadPool;
+import org.apache.tomcat.util.threads.ThreadPoolRunnable;
+
+/* Similar with MPM module in Apache2.0. Handles all the details related with
+   "tcp server" functionality - thread management, accept policy, etc.
+   It should do nothing more - as soon as it get a socket ( and all socket 
options
+   are set, etc), it just handle the stream to 
ConnectionHandler.processConnection. (costin)
+*/
+
+
+
+/**
+ * Handle incoming TCP connections.
+ * 
+ * Each thread in the pool accepts, then process a request. A spare thread
+ * will take over the accept.
+ *
+ * TODO: can we have all threads in the pool blocked on accept ? 
+ *
+ * @author James Duncan Davidson [EMAIL PROTECTED]
+ * @author Jason Hunter [EMAIL PROTECTED]
+ * @author James Todd [EMAIL PROTECTED]
+ * @author [EMAIL PROTECTED]
+ * @author Gal Shachor [EMAIL PROTECTED]
+ * @author Yoav Shapira <[EMAIL PROTECTED]>
+ */
+public class LeaderFollowerEndpoint extends PoolTcpEndpoint { // implements 
Endpoint {
+
+private final Object threadSync = new Object();
+
+private ServerSocketFactory factory;
+
+
+// -- Leader follower fields
+
+
+TcpConnectionHandler handler;
+ThreadPoolRunnable listener;
+ThreadPool tp;
+
+
+// -- Master slave fields
+
+/* The background thread. */
+//private Thread thread = null;
+/* Available processors. */
+private Stack workerThreads = new Stack();
+
+
+public LeaderFollowerEndpoint() {
+   tp = new ThreadPool();
+}
+
+public LeaderFollowerEndpoint( ThreadPool tp ) {
+this.tp=tp;
+}
+
+//  Configuration 
+
+public void setMaxThreads(int maxThreads) {
+   if( maxThreads > 0)
+   tp.setMaxThreads(maxThreads);
+}
+
+public int getMaxThreads() {
+return tp.getMaxThreads();
+}
+
+public void setMaxSpareThreads(int maxThreads) {
+   if(maxThreads > 0) 
+   tp.setMaxSpareThreads(maxThreads);
+}
+
+public int getMaxSpareThreads() {
+return tp.getMaxSpareThreads();
+}
+
+public void setMinSpareThreads(int minThreads) {
+   if(minThreads > 0) 
+   tp.setMinSpareThreads(minThreads);
+}
+
+public int getMinSpareThreads() {
+return tp.getMinSpareThreads();
+}
+
+public void setThreadPriority(int threadPriority) {
+  tp.setThreadPriority(threadPriority);
+}
+
+public int getThreadPriority() {
+  return tp.getThreadPriority();
+}
+
+public void setServerSocketFactory(  ServerSocketFactory factory ) {
+   this.factory=factory;
+}
+
+   ServerSocketFactory getServerSocketFactory() {
+   return factory;
+   }
+
+   public String getStrategy() {
+return "lf";
+   }
+
+public void setStrategy(String strategy) {
+}
+
+public int getCurrentThreadsBusy() {
+return curThreads - workerThreads.size();
+}
+
+//  Public methods 

svn commit: r348657 - /tomcat/sandbox/java/org/apache/tomcat/util/net/SimpleEndpoint.java

2005-11-23 Thread costin
Author: costin
Date: Wed Nov 23 21:24:26 2005
New Revision: 348657

URL: http://svn.apache.org/viewcvs?rev=348657&view=rev
Log:
New Endpoint - as simple as possible, no 'spare threads' or recycling. This is 
a good
fit for embedded - where footprint is more important and you don't expect huge 
loads. It 
also makes it easy to organize the code.

Note that all the SSL code is gone too ( both here and in base class ) - so 
same approach as Apr could
be taken. Instead of having SslImpl and all the other classes, that will be 
specific to the endpoint.


Added:
tomcat/sandbox/java/org/apache/tomcat/util/net/SimpleEndpoint.java

Added: tomcat/sandbox/java/org/apache/tomcat/util/net/SimpleEndpoint.java
URL: 
http://svn.apache.org/viewcvs/tomcat/sandbox/java/org/apache/tomcat/util/net/SimpleEndpoint.java?rev=348657&view=auto
==
--- tomcat/sandbox/java/org/apache/tomcat/util/net/SimpleEndpoint.java (added)
+++ tomcat/sandbox/java/org/apache/tomcat/util/net/SimpleEndpoint.java Wed Nov 
23 21:24:26 2005
@@ -0,0 +1,379 @@
+/*
+ *  Copyright 1999-2004 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.tomcat.util.net;
+
+import java.io.IOException;
+import java.io.InterruptedIOException;
+import java.net.BindException;
+import java.net.ServerSocket;
+import java.net.Socket;
+import java.net.SocketException;
+import java.security.AccessControlException;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+
+/**
+ * Very simple endpoint - no thread pool, no recycling, etc.
+ * 
+ * Relies the JVM thread pool, if any. 
+ * 
+ * Used for embedded use cases, where you wouldn't expect a huge load, and
+ * memory is important ( no caching or keeping around objects ).
+ *
+ * Note that ServerSocket and the whole SSL machinery is also gone - instead
+ * use a subclass that extends this and knows about ssl. We may add it back, 
but
+ * needs to be fixed.
+ * 
+ * @author Costin Manolache ( [EMAIL PROTECTED] )
+ */
+public class SimpleEndpoint extends PoolTcpEndpoint { 
+
+static Log log=LogFactory.getLog(SimpleEndpoint.class );
+
+private final Object threadSync = new Object();
+
+/* The background thread. */
+private Thread thread = null;
+
+public SimpleEndpoint() {
+}
+
+
+//  Public methods 
+
+public void initEndpoint() throws IOException, InstantiationException {
+try {
+if(serverSocket==null) {
+try {
+if (inet == null) {
+serverSocket = new ServerSocket(port, backlog);
+} else {
+serverSocket = new ServerSocket(port, backlog, inet);
+}
+} catch ( BindException be ) {
+throw new BindException(be.getMessage() + ":" + port);
+}
+}
+if( serverTimeout >= 0 )
+serverSocket.setSoTimeout( serverTimeout );
+
+thread = new Thread(this, "SimpleEP");
+thread.setDaemon(daemon);
+if( getThreadPriority() > 0 ) {
+thread.setPriority(getThreadPriority());
+}
+thread.setDaemon(true);
+thread.start();
+
+} catch( IOException ex ) {
+throw ex;
+}
+initialized = true;
+}
+
+public void startEndpoint() throws IOException, InstantiationException {
+if (!initialized) {
+initEndpoint();
+}
+running = true;
+paused = false;
+
+}
+
+public void pauseEndpoint() {
+if (running && !paused) {
+paused = true;
+unlockAccept();
+}
+}
+
+public void resumeEndpoint() {
+if (running) {
+paused = false;
+}
+}
+
+public void stopEndpoint() {
+if (running) {
+running = false;
+if (serverSocket != null) {
+closeServerSocket();
+}
+initialized=false ;
+}
+}
+
+protected void closeServerSocket() {
+if (!paused)
+unlockAccept();
+try {
+if( serverSocket!=null)
+serverSocket.close();
+} catch(Exception e) {
+log.err

svn commit: r348659 - /tomcat/sandbox/java/org/apache/tomcat/util/net/AcceptorEndpoint.java

2005-11-23 Thread costin
Author: costin
Date: Wed Nov 23 21:27:02 2005
New Revision: 348659

URL: http://svn.apache.org/viewcvs?rev=348659&view=rev
Log:
New endpoint - it's a long time since I had this planned, now I got the chance.

I think this is the _RIGHT_ way to do the pool and threading - not run any 
benchmark, but I have 
a feeling it will be good ( in particular on MP machines !). 

Each thread is accepting - the kernel decides who gets to process the request ( 
may accept at 
the same time on multiple CPUs AFAIK ) - no thread switching or lock or 
anything.

I'll use this as a base for the NIO stuff

Added:
tomcat/sandbox/java/org/apache/tomcat/util/net/AcceptorEndpoint.java

Added: tomcat/sandbox/java/org/apache/tomcat/util/net/AcceptorEndpoint.java
URL: 
http://svn.apache.org/viewcvs/tomcat/sandbox/java/org/apache/tomcat/util/net/AcceptorEndpoint.java?rev=348659&view=auto
==
--- tomcat/sandbox/java/org/apache/tomcat/util/net/AcceptorEndpoint.java (added)
+++ tomcat/sandbox/java/org/apache/tomcat/util/net/AcceptorEndpoint.java Wed 
Nov 23 21:27:02 2005
@@ -0,0 +1,164 @@
+/*
+ *  Copyright 1999-2004 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.tomcat.util.net;
+
+import java.io.IOException;
+import java.net.Socket;
+
+import org.apache.tomcat.util.threads.ThreadWithAttributes;
+
+
+/** All threads blocked in accept(). New thread created on demand.
+ * No use of ThreadPool or ServerSocketFactory.
+ * 
+ * 
+ */
+public class AcceptorEndpoint extends SimpleEndpoint { 
+
+private final Object threadSync = new Object();
+
+// -- Leader follower fields
+
+// -- Master slave fields
+
+/* The background thread. */
+private Thread thread = null;
+
+// active acceptors
+private int acceptors=0;
+
+public AcceptorEndpoint() {
+}
+
+//  Configuration 
+
+public String getStrategy() {
+return "ms";
+}
+
+public void setStrategy(String strategy) {
+}
+
+public int getCurrentThreadsBusy() {
+return curThreads;
+}
+
+//  Public methods 
+
+public void startEndpoint() throws IOException, InstantiationException {
+if (!initialized) {
+initEndpoint();
+}
+if( maxSpareThreads == minSpareThreads ) {
+maxSpareThreads = minSpareThreads + 4;
+}
+running = true;
+paused = false;
+checkSpares();
+}
+
+
+// -- Master Slave Methods
+
+
+
+/** Block in accept. If spares is low, create more spares.
+ *  If spares is high - terminate this thread. Checks before 
+ *  and after running the connection handler.
+ */
+class AcceptorThread implements Runnable {
+private TcpConnection con = new TcpConnection();
+
+public void run() {
+Object[] threadData = getConnectionHandler().init();
+while( running ) {
+// Loop if endpoint is paused
+if( checkSpares() ) {
+return;
+}
+
+while (paused) {
+try {
+Thread.sleep(1000);
+} catch (InterruptedException e) {
+// Ignore
+}
+}
+
+Socket socket = acceptSocket();
+
+workerStart(this);
+
+// Process the request from this socket
+processSocket(socket, con, threadData);
+
+// Finish up this request
+workerDone(this);
+
+if( checkSpares() ) {
+return;
+}
+}
+
+acceptors--; // we're done
+synchronized (threadSync) {
+threadSync.notifyAll();
+}
+}
+}
+
+public void workerDone(Runnable workerThread) {
+curThreads--;
+}
+
+void workerStart( Runnable r ) {
+curThreads++;
+}
+
+void newAcceptor() {
+acceptors++;
+Thread t=new ThreadWithAttributes( this, new AcceptorThread());
+t.se

svn commit: r348662 - in /tomcat/sandbox/java/org/apache/tomcat/util/net: AprEndpoint.java LeaderFollowerWorkerThread.java MasterSlaveWorkerThread.java

2005-11-23 Thread costin
Author: costin
Date: Wed Nov 23 21:30:33 2005
New Revision: 348662

URL: http://svn.apache.org/viewcvs?rev=348662&view=rev
Log:
Various fixes to put things in sync

Modified:
tomcat/sandbox/java/org/apache/tomcat/util/net/AprEndpoint.java

tomcat/sandbox/java/org/apache/tomcat/util/net/LeaderFollowerWorkerThread.java
tomcat/sandbox/java/org/apache/tomcat/util/net/MasterSlaveWorkerThread.java

Modified: tomcat/sandbox/java/org/apache/tomcat/util/net/AprEndpoint.java
URL: 
http://svn.apache.org/viewcvs/tomcat/sandbox/java/org/apache/tomcat/util/net/AprEndpoint.java?rev=348662&r1=348661&r2=348662&view=diff
==
--- tomcat/sandbox/java/org/apache/tomcat/util/net/AprEndpoint.java (original)
+++ tomcat/sandbox/java/org/apache/tomcat/util/net/AprEndpoint.java Wed Nov 23 
21:30:33 2005
@@ -180,7 +180,7 @@
  * SSL context.
  */
 protected long sslContext = 0;
-
+
 
 // - Properties
 
@@ -213,8 +213,13 @@
  * Size of the sendfile (= concurrent files which can be served).
  */
 protected int sendfileSize = 256;
-public void setSendfileSize(int sendfileSize) { this.sendfileSize = 
sendfileSize; }
-public int getSendfileSize() { return sendfileSize; }
+public void setSendfileSize(int sendfileSize) { 
+this.sendfileSize = sendfileSize;
+if( sendfile != null ) sendfile.setSendfileSize(sendfileSize);
+}
+public int getSendfileSize() { 
+return sendfileSize; 
+}
 
 
 /**
@@ -276,7 +281,9 @@
  */
 protected int soTimeout = -1;
 public int getSoTimeout() { return soTimeout; }
-public void setSoTimeout(int soTimeout) { this.soTimeout = soTimeout; }
+public void setSoTimeout(int soTimeout) { 
+this.soTimeout = soTimeout;
+}
 
 
 /**
@@ -293,7 +300,9 @@
  */
 protected int pollTime = 5000;
 public int getPollTime() { return pollTime; }
-public void setPollTime(int pollTime) { this.pollTime = pollTime; }
+public void setPollTime(int pollTime) { 
+this.pollTime = pollTime;
+}
 
 
 /**
@@ -332,8 +341,7 @@
 /**
  * Number of sendfile sockets.
  */
-protected int sendfileCount = 0;
-public int getSendfileCount() { return sendfileCount; }
+public int getSendfileCount() { return sendfile.getSendfileCount(); }
 
 
 /**
@@ -647,7 +655,8 @@
 
 // Start sendfile thread
 if (useSendfile) {
-sendfile = new Sendfile();
+sendfile = new Sendfile(this, serverSockPool);
+sendfile.setSendfileSize(getSendfileSize());
 sendfile.init();
 sendfileThread = new Thread(sendfile, getName() + "-Sendfile");
 sendfileThread.setPriority(getThreadPriority());
@@ -1226,9 +1235,7 @@
 }
 
 // Tell threadStop() we have shut ourselves down successfully
-synchronized (this) {
-threadSync.notifyAll();
-}
+threadSyncNotify();
 
 }
 
@@ -1246,6 +1253,12 @@
 
 }
 
+// TODO: theradEnd event, etc
+public void threadSyncNotify() {
+synchronized (this) {
+threadSync.notifyAll();
+}
+}
 
 // --- SendfileData Inner Class
 
@@ -1276,7 +1289,7 @@
 /**
  * Sendfile class.
  */
-public class Sendfile implements Runnable {
+public static class Sendfile implements Runnable {
 
 protected long sendfilePollset = 0;
 protected long pool = 0;
@@ -1285,6 +1298,23 @@
 
 protected ArrayList addS;
 
+protected int sendfileCount = 0;
+public int getSendfileCount() { return sendfileCount; }
+
+AprEndpoint ep;
+protected long serverSockPool = 0;
+
+
+protected int sendfileSize = 256;
+public void setSendfileSize(int sendfileSize) { this.sendfileSize = 
sendfileSize; }
+public int getSendfileSize() { return sendfileSize; }
+
+public Sendfile( AprEndpoint ep, long serverSockPool ) {
+this.ep = ep;
+this.serverSockPool = serverSockPool;
+}
+
+
 /**
  * Create the sendfile poller. With some versions of APR, the maximum 
poller size will
  * be 62 (reocmpiling APR is necessary to remove this limitation).
@@ -1292,13 +1322,13 @@
 protected void init() {
 pool = Pool.create(serverSockPool);
 try {
-sendfilePollset = Poll.create(sendfileSize, pool, 0, soTimeout 
* 1000);
+sendfilePollset = Poll.create(sendfileSize, pool, 0, 
ep.getSoTimeout() * 1000);
 } catch (Error e) {
 if (Status.APR_STATUS_IS_EINVAL(e.getError())) {
 try {
 // Use WIN32 maximum po

svn commit: r348663 - in /tomcat/sandbox/java/org/apache/tomcat/util/buf: B2CConverter.java ByteChunk.java C2BConverter.java MessageBytes.java TimeStamp.java UDecoder.java UTF8Decoder.java

2005-11-23 Thread costin
Author: costin
Date: Wed Nov 23 21:31:25 2005
New Revision: 348663

URL: http://svn.apache.org/viewcvs?rev=348663&view=rev
Log:
Various fixes and deprecations

Modified:
tomcat/sandbox/java/org/apache/tomcat/util/buf/B2CConverter.java
tomcat/sandbox/java/org/apache/tomcat/util/buf/ByteChunk.java
tomcat/sandbox/java/org/apache/tomcat/util/buf/C2BConverter.java
tomcat/sandbox/java/org/apache/tomcat/util/buf/MessageBytes.java
tomcat/sandbox/java/org/apache/tomcat/util/buf/TimeStamp.java
tomcat/sandbox/java/org/apache/tomcat/util/buf/UDecoder.java
tomcat/sandbox/java/org/apache/tomcat/util/buf/UTF8Decoder.java

Modified: tomcat/sandbox/java/org/apache/tomcat/util/buf/B2CConverter.java
URL: 
http://svn.apache.org/viewcvs/tomcat/sandbox/java/org/apache/tomcat/util/buf/B2CConverter.java?rev=348663&r1=348662&r2=348663&view=diff
==
--- tomcat/sandbox/java/org/apache/tomcat/util/buf/B2CConverter.java (original)
+++ tomcat/sandbox/java/org/apache/tomcat/util/buf/B2CConverter.java Wed Nov 23 
21:31:25 2005
@@ -32,6 +32,8 @@
  *  Not used in the current code, the performance gain is not very big
  *  in the current case ( since String is created anyway ), but it will
  *  be used in a later version or after the remaining optimizations.
+ *  
+ *  @deprecated use CharsetDecoder using the ByteBuffer
  */
 public class B2CConverter {
 

Modified: tomcat/sandbox/java/org/apache/tomcat/util/buf/ByteChunk.java
URL: 
http://svn.apache.org/viewcvs/tomcat/sandbox/java/org/apache/tomcat/util/buf/ByteChunk.java?rev=348663&r1=348662&r2=348663&view=diff
==
--- tomcat/sandbox/java/org/apache/tomcat/util/buf/ByteChunk.java (original)
+++ tomcat/sandbox/java/org/apache/tomcat/util/buf/ByteChunk.java Wed Nov 23 
21:31:25 2005
@@ -688,6 +688,12 @@
if( bb.get(i) != first ) continue;
// found first char, now look for a match
 int myPos=i+1;
+
+// not enough chars to have a match
+if( i + srcLen >= end ) {
+break;
+}
+
for( int srcPos=srcOff + 1; srcPos< srcEnd; ) {
 if( bb.get(myPos++) != src.charAt( srcPos++ ))
break;
@@ -815,6 +821,7 @@
  * 
  * @param value to convert to byte array
  * @return the byte array value
+ * @deprecated WRONG, if ascii is all you need - rename the method !
  */
 public static final byte[] convertToBytes(String value) {
 byte[] result = new byte[value.length()];

Modified: tomcat/sandbox/java/org/apache/tomcat/util/buf/C2BConverter.java
URL: 
http://svn.apache.org/viewcvs/tomcat/sandbox/java/org/apache/tomcat/util/buf/C2BConverter.java?rev=348663&r1=348662&r2=348663&view=diff
==
--- tomcat/sandbox/java/org/apache/tomcat/util/buf/C2BConverter.java (original)
+++ tomcat/sandbox/java/org/apache/tomcat/util/buf/C2BConverter.java Wed Nov 23 
21:31:25 2005
@@ -27,6 +27,7 @@
  *  to recycle all the objects that are used. It is compatible with JDK1.1 and 
up,
  *  ( nio is better, but it's not available even in 1.2 or 1.3 )
  * 
+ * @deprecated Use CharsetEncoder on the ByteBuffer
  */
 public final class C2BConverter {
 
@@ -48,19 +49,23 @@
 }
 
 /** Create a converter
+ * Not used.
  */
 public C2BConverter(String encoding) throws IOException {
this( new ByteChunk(1024), encoding );
 }
 
+// Not used
 public ByteChunk getByteChunk() {
return bb;
 }
 
+// not used
 public String getEncoding() {
 return enc;
 }
 
+// internal use only
 public void setByteChunk(ByteChunk bb) {
this.bb=bb;
ios.setByteChunk( bb );
@@ -97,7 +102,7 @@
 public final void convert(MessageBytes mb ) throws IOException {
 int type=mb.getType();
 if( type==MessageBytes.T_BYTES )
-return;
+return; // why ?
 ByteChunk orig=bb;
 setByteChunk( mb.getByteChunk());
 bb.recycle();

Modified: tomcat/sandbox/java/org/apache/tomcat/util/buf/MessageBytes.java
URL: 
http://svn.apache.org/viewcvs/tomcat/sandbox/java/org/apache/tomcat/util/buf/MessageBytes.java?rev=348663&r1=348662&r2=348663&view=diff
==
--- tomcat/sandbox/java/org/apache/tomcat/util/buf/MessageBytes.java (original)
+++ tomcat/sandbox/java/org/apache/tomcat/util/buf/MessageBytes.java Wed Nov 23 
21:31:25 2005
@@ -27,7 +27,16 @@
  * delayed and cached. Everything is recyclable.
  *
  * The object can represent a byte[], a char[], or a (sub) String. All
- * operations can be made in case sensitive mode or not.
+ * operations can be made in case sensitive mode or not. The byte[] 
+ * representation is the primary one - Strin

svn commit: r348665 - /tomcat/sandbox/java/org/apache/coyote/standalone/MainInetd.java

2005-11-23 Thread costin
Author: costin
Date: Wed Nov 23 21:34:19 2005
New Revision: 348665

URL: http://svn.apache.org/viewcvs?rev=348665&view=rev
Log:
Another experiment - this class uses NIO to get the socket from Xinetd ( I'll 
also try
with launchd ). This allows starting tomcat on-demand, from xinetd/lauchd. 
Work in progress, I also want to shutdown when idle for too long. 

This is also targeted to embeded/desktop use.

Added:
tomcat/sandbox/java/org/apache/coyote/standalone/MainInetd.java

Added: tomcat/sandbox/java/org/apache/coyote/standalone/MainInetd.java
URL: 
http://svn.apache.org/viewcvs/tomcat/sandbox/java/org/apache/coyote/standalone/MainInetd.java?rev=348665&view=auto
==
--- tomcat/sandbox/java/org/apache/coyote/standalone/MainInetd.java (added)
+++ tomcat/sandbox/java/org/apache/coyote/standalone/MainInetd.java Wed Nov 23 
21:34:19 2005
@@ -0,0 +1,69 @@
+package org.apache.coyote.standalone;
+
+import java.io.IOException;
+import java.nio.channels.Channel;
+import java.nio.channels.ServerSocketChannel;
+import java.nio.channels.spi.SelectorProvider;
+import java.util.Timer;
+import java.util.TimerTask;
+
+
+/** 
+ * Used to run tomcat or coyote on demand or on port 80 ( no JNI code needed, 
+ * just (x)inetd, launchd or other simple C wrappers ). This is intended for 
+ * simple configurations, with a single endpoint. 
+ *  
+ * The target for this mode are people running tomcat on their desktop 
+ * machines, either as personal web server or as interface to some 
applications,
+ * or as developers. It avoids the need to have tomcat taking memory all the 
+ * time - it starts on demand, when you need it, and stops itself when it's
+ * idle too long.  
+ * 
+ */
+public class MainInetd extends Main {
+Timer timer=new Timer(true); // daemon thread
+
+public MainInetd() {
+}
+
+
+/**
+ */
+public void run() {
+init();
+SelectorProvider sp=SelectorProvider.provider();
+
+// check every 5 minutes
+timer.scheduleAtFixedRate( new IdleCheck(), 30, 30);
+try {
+Channel ch=sp.inheritedChannel();
+if(ch!=null ) {
+System.err.println("Inherited: " + ch.getClass().getName());
+ServerSocketChannel ssc=(ServerSocketChannel)ch;
+proto.getEndpoint().setServerSocket( ssc.socket() );
+}
+} catch (IOException e) {
+e.printStackTrace();
+}
+
+
+
+start();
+}
+
+class IdleCheck extends TimerTask {
+
+public void run() {
+
+}
+
+}
+
+// --- Main -
+public static void main( String args[]) {
+MainInetd sa=new MainInetd();
+sa.run();
+}
+
+
+}
\ No newline at end of file



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r348666 - /tomcat/sandbox/java/org/apache/coyote/standalone/Main.java

2005-11-23 Thread costin
Author: costin
Date: Wed Nov 23 21:35:15 2005
New Revision: 348666

URL: http://svn.apache.org/viewcvs?rev=348666&view=rev
Log:
Few fixes to match the new changes

Modified:
tomcat/sandbox/java/org/apache/coyote/standalone/Main.java

Modified: tomcat/sandbox/java/org/apache/coyote/standalone/Main.java
URL: 
http://svn.apache.org/viewcvs/tomcat/sandbox/java/org/apache/coyote/standalone/Main.java?rev=348666&r1=348665&r2=348666&view=diff
==
--- tomcat/sandbox/java/org/apache/coyote/standalone/Main.java (original)
+++ tomcat/sandbox/java/org/apache/coyote/standalone/Main.java Wed Nov 23 
21:35:15 2005
@@ -29,6 +29,13 @@
 return proto;
 }
 
+/**
+ */
+public void run() {
+init();
+start();
+}
+
 public void init() {
 proto = new Http11BaseProtocol();
 
@@ -46,25 +53,20 @@
 return mainAdapter;
 }
 
-/**
- */
-public void run() {
-init();
-start();
-}
-
 public void start() {
-if( proto.getPort() == 0 )
+if( proto.getPort() == 0 && 
+proto.getEndpoint().getServerSocket() == null) {
 proto.setPort(8800);
+}
 
 try {
 proto.init();
 
-proto.getThreadPool().setDaemon(false);
+proto.getEndpoint().setDaemon(false);
 
 proto.start();
 
-} catch (Exception e) {
+} catch (Throwable e) {
 e.printStackTrace();
 }
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r348667 - in /tomcat/sandbox/java/org/apache/coyote/http11: Http11BaseProtocol.java Http11Processor.java Http11Protocol.java

2005-11-23 Thread costin
Author: costin
Date: Wed Nov 23 21:36:28 2005
New Revision: 348667

URL: http://svn.apache.org/viewcvs?rev=348667&view=rev
Log:
Updates to match the changes in endpoint ( and deprecation /removal of 
ThreadPool )


Modified:
tomcat/sandbox/java/org/apache/coyote/http11/Http11BaseProtocol.java
tomcat/sandbox/java/org/apache/coyote/http11/Http11Processor.java
tomcat/sandbox/java/org/apache/coyote/http11/Http11Protocol.java

Modified: tomcat/sandbox/java/org/apache/coyote/http11/Http11BaseProtocol.java
URL: 
http://svn.apache.org/viewcvs/tomcat/sandbox/java/org/apache/coyote/http11/Http11BaseProtocol.java?rev=348667&r1=348666&r2=348667&view=diff
==
--- tomcat/sandbox/java/org/apache/coyote/http11/Http11BaseProtocol.java 
(original)
+++ tomcat/sandbox/java/org/apache/coyote/http11/Http11BaseProtocol.java Wed 
Nov 23 21:36:28 2005
@@ -31,7 +31,6 @@
 import org.apache.coyote.Adapter;
 import org.apache.coyote.ProtocolHandler;
 import org.apache.coyote.RequestGroupInfo;
-import org.apache.coyote.RequestInfo;
 import org.apache.tomcat.util.net.PoolTcpEndpoint;
 import org.apache.tomcat.util.net.SSLImplementation;
 import org.apache.tomcat.util.net.SSLSupport;
@@ -39,8 +38,6 @@
 import org.apache.tomcat.util.net.TcpConnection;
 import org.apache.tomcat.util.net.TcpConnectionHandler;
 import org.apache.tomcat.util.res.StringManager;
-import org.apache.tomcat.util.threads.ThreadPool;
-import org.apache.tomcat.util.threads.ThreadWithAttributes;
 
 
 /**
@@ -188,8 +185,9 @@
 }
 
 //  Properties
-protected ThreadPool tp=ThreadPool.createThreadPool(true);
-protected PoolTcpEndpoint ep=new PoolTcpEndpoint(tp);
+// 
+protected PoolTcpEndpoint ep= PoolTcpEndpoint.getEndpoint("acc");
+
 protected boolean secure;
 
 protected ServerSocketFactory socketFactory;
@@ -267,13 +265,9 @@
public String getStrategy() {
 return ep.getStrategy();
}
-
-/** Access to the thread pool.
- *
- * @return tp the internal thread pool used by the protocol
- */
-   public ThreadPool getThreadPool() {
-return tp;
+   
+   public PoolTcpEndpoint getEndpoint() {
+   return ep;
}
 
 //  Tcp setup 
@@ -577,15 +571,6 @@
 return server;
 }
 
-
-private static ServerSocketFactory string2SocketFactory( String val)
-throws ClassNotFoundException, IllegalAccessException,
-InstantiationException
-{
-Class chC=Class.forName( val );
-return (ServerSocketFactory)chC.newInstance();
-}
-
 public int getTimeout() {
 return timeout;
 }
@@ -607,12 +592,12 @@
 public static final int THREAD_DATA_PROCESSOR=1;
 public static final int THREAD_DATA_OBJECT_NAME=2;
 
-static class Http11ConnectionHandler implements TcpConnectionHandler {
+public static class Http11ConnectionHandler implements 
TcpConnectionHandler {
 Http11BaseProtocol proto;
 static int count=0;
-RequestGroupInfo global=new RequestGroupInfo();
+public RequestGroupInfo global=new RequestGroupInfo();
 
-Http11ConnectionHandler( Http11BaseProtocol proto ) {
+public Http11ConnectionHandler( Http11BaseProtocol proto ) {
 this.proto=proto;
 }
 
@@ -628,7 +613,6 @@
 Http11Processor  processor =
 new Http11Processor(proto.maxHttpHeaderSize);
 processor.setAdapter( proto.adapter );
-processor.setThreadPool( proto.tp );
 processor.setEndpoint( proto.ep );
 processor.setMaxKeepAliveRequests( proto.maxKeepAliveRequests );
 processor.setTimeout( proto.timeout );
@@ -733,24 +717,9 @@
  */
 private void checkSocketFactory() throws Exception {
 if (secure) {
-try {
-// The SSL setup code has been moved into
-// SSLImplementation since SocketFactory doesn't
-// provide a wide enough interface
-sslImplementation =
-SSLImplementation.getInstance(sslImplementationName);
-socketFactory = sslImplementation.getServerSocketFactory();
-ep.setServerSocketFactory(socketFactory);
-} catch (ClassNotFoundException e){
-throw e;
-}
-} else if (socketFactoryName != null) {
-try {
-socketFactory = string2SocketFactory(socketFactoryName);
-ep.setServerSocketFactory(socketFactory);
-} catch(Exception sfex) {
-throw sfex;
-}
+ep.setSSLSupport( secure, sslImplementationName );
+} else {
+ep.setSSLSupport( secure, socketFactoryName );
 }
 }
 

Modified: tomcat/sandbox/java/org/apache/coyote/http11/Http11Processor.java
URL: 
http://svn.apache.org/v

svn commit: r348668 - in /tomcat/sandbox/java/org/apache/coyote/http11: ./ apr/

2005-11-23 Thread costin
Author: costin
Date: Wed Nov 23 21:39:36 2005
New Revision: 348668

URL: http://svn.apache.org/viewcvs?rev=348668&view=rev
Log:
Move the apr stuff to a separate package, to avoid confusion. I plan to try few 
changes
( i.e. replace direct C-style calls with a higher-level APR, implementing 
subset of nio/java.net ), 
but I also want to test the original connectors - this way I can have both

Added:
tomcat/sandbox/java/org/apache/coyote/http11/apr/
tomcat/sandbox/java/org/apache/coyote/http11/apr/Http11AprBaseProtocol.java
tomcat/sandbox/java/org/apache/coyote/http11/apr/Http11AprProcessor.java
  - copied, changed from r345767, 
tomcat/sandbox/java/org/apache/coyote/http11/Http11AprProcessor.java
tomcat/sandbox/java/org/apache/coyote/http11/apr/Http11AprProtocol.java
  - copied, changed from r345721, 
tomcat/sandbox/java/org/apache/coyote/http11/Http11AprProtocol.java
tomcat/sandbox/java/org/apache/coyote/http11/apr/InternalAprInputBuffer.java
  - copied, changed from r345767, 
tomcat/sandbox/java/org/apache/coyote/http11/InternalAprInputBuffer.java

tomcat/sandbox/java/org/apache/coyote/http11/apr/InternalAprOutputBuffer.java
  - copied, changed from r345722, 
tomcat/sandbox/java/org/apache/coyote/http11/InternalAprOutputBuffer.java
Removed:
tomcat/sandbox/java/org/apache/coyote/http11/Http11AprProcessor.java
tomcat/sandbox/java/org/apache/coyote/http11/Http11AprProtocol.java
tomcat/sandbox/java/org/apache/coyote/http11/InternalAprInputBuffer.java
tomcat/sandbox/java/org/apache/coyote/http11/InternalAprOutputBuffer.java

Added: 
tomcat/sandbox/java/org/apache/coyote/http11/apr/Http11AprBaseProtocol.java
URL: 
http://svn.apache.org/viewcvs/tomcat/sandbox/java/org/apache/coyote/http11/apr/Http11AprBaseProtocol.java?rev=348668&view=auto
==
--- tomcat/sandbox/java/org/apache/coyote/http11/apr/Http11AprBaseProtocol.java 
(added)
+++ tomcat/sandbox/java/org/apache/coyote/http11/apr/Http11AprBaseProtocol.java 
Wed Nov 23 21:39:36 2005
@@ -0,0 +1,402 @@
+/*
+ *  Copyright 1999-2004 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.coyote.http11.apr;
+
+import java.net.InetAddress;
+import java.net.URLEncoder;
+
+import org.apache.coyote.ActionCode;
+import org.apache.coyote.ActionHook;
+import org.apache.coyote.ProtocolHandler;
+import org.apache.coyote.RequestGroupInfo;
+import org.apache.coyote.http11.Constants;
+import org.apache.coyote.http11.Http11BaseProtocol;
+import org.apache.tomcat.util.net.AprEndpoint;
+import org.apache.tomcat.util.net.AprEndpoint.Handler;
+
+
+/**
+ * Abstract the protocol implementation, including threading, etc.
+ * Processor is single threaded and specific to stream-based protocols,
+ * will not fit Jk protocols like JNI.
+ *
+ * @author Remy Maucherat
+ * @author Costin Manolache
+ */
+public class Http11AprBaseProtocol extends Http11BaseProtocol implements 
ProtocolHandler
+{
+public Http11AprBaseProtocol() {
+ep=new AprEndpoint();
+cHandler = new AprHttp11ConnectionHandler( this );
+setSoLinger(Constants.DEFAULT_CONNECTION_LINGER);
+setSoTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT);
+// this line is different from super.
+//setServerSoTimeout(Constants.DEFAULT_SERVER_SOCKET_TIMEOUT);
+setTcpNoDelay(Constants.DEFAULT_TCP_NO_DELAY);
+}
+
+
+/** Start the protocol
+ */
+public void init() throws Exception {
+ep.setName(getName());
+ep.setHandler((AprEndpoint.Handler)cHandler);
+
+try {
+ep.init();
+} catch (Exception ex) {
+log.error(sm.getString("http11protocol.endpoint.initerror"), ex);
+throw ex;
+}
+if(log.isInfoEnabled())
+log.info(sm.getString("http11protocol.init", getName()));
+
+}
+
+public void start() throws Exception {
+try {
+ep.start();
+} catch (Exception ex) {
+log.error(sm.getString("http11protocol.endpoint.starterror"), ex);
+throw ex;
+}
+if(log.isInfoEnabled())
+log.info(sm.getString("http11protocol.start", getName()));
+}
+
+public void destroy() throws Exception {
+if(log.isInfoEnabled())
+log.info(sm.getString("http11protocol.stop", getName()));
+ep.destroy();
+ 

svn commit: r348669 - /tomcat/sandbox/Tomcat5.5.launch

2005-11-23 Thread costin
Author: costin
Date: Wed Nov 23 21:41:45 2005
New Revision: 348669

URL: http://svn.apache.org/viewcvs?rev=348669&view=rev
Log:
Eclipse launcher, for use to debug inside eclipse.


Added:
tomcat/sandbox/Tomcat5.5.launch

Added: tomcat/sandbox/Tomcat5.5.launch
URL: 
http://svn.apache.org/viewcvs/tomcat/sandbox/Tomcat5.5.launch?rev=348669&view=auto
==
--- tomcat/sandbox/Tomcat5.5.launch (added)
+++ tomcat/sandbox/Tomcat5.5.launch Wed Nov 23 21:41:45 2005
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r348670 - /tomcat/sandbox/.classpath

2005-11-23 Thread costin
Author: costin
Date: Wed Nov 23 21:42:50 2005
New Revision: 348670

URL: http://svn.apache.org/viewcvs?rev=348670&view=rev
Log:
Add modeler

Modified:
tomcat/sandbox/.classpath

Modified: tomcat/sandbox/.classpath
URL: 
http://svn.apache.org/viewcvs/tomcat/sandbox/.classpath?rev=348670&r1=348669&r2=348670&view=diff
==
--- tomcat/sandbox/.classpath (original)
+++ tomcat/sandbox/.classpath Wed Nov 23 21:42:50 2005
@@ -7,5 +7,6 @@



+   

 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r348672 - in /tomcat/sandbox: .classpath build.xml java/org/apache/tomcat/util/net/AcceptorEndpoint.java

2005-11-23 Thread costin
Author: costin
Date: Wed Nov 23 22:21:32 2005
New Revision: 348672

URL: http://svn.apache.org/viewcvs?rev=348672&view=rev
Log:
Few fixes and adjustments

Modified:
tomcat/sandbox/.classpath
tomcat/sandbox/build.xml
tomcat/sandbox/java/org/apache/tomcat/util/net/AcceptorEndpoint.java

Modified: tomcat/sandbox/.classpath
URL: 
http://svn.apache.org/viewcvs/tomcat/sandbox/.classpath?rev=348672&r1=348671&r2=348672&view=diff
==
--- tomcat/sandbox/.classpath (original)
+++ tomcat/sandbox/.classpath Wed Nov 23 22:21:32 2005
@@ -8,5 +8,5 @@



-   
+   
 

Modified: tomcat/sandbox/build.xml
URL: 
http://svn.apache.org/viewcvs/tomcat/sandbox/build.xml?rev=348672&r1=348671&r2=348672&view=diff
==
--- tomcat/sandbox/build.xml (original)
+++ tomcat/sandbox/build.xml Wed Nov 23 22:21:32 2005
@@ -11,6 +11,8 @@
   
 
 
+  
+  
   
   
   
@@ -113,7 +115,7 @@
 
   
 
-
   
   
@@ -126,6 +128,7 @@
   
   
   
+  
 
 
   
@@ -139,7 +142,7 @@
 
   
 
-
   
   
@@ -147,22 +150,24 @@
   
   
 
-
+
   
 
   
 
   
 
-
   
+  
   
   
   
@@ -179,7 +184,7 @@
 
   
 
-
   
   
@@ -195,7 +200,7 @@
   
 
 
-
+
 
   
   
@@ -208,9 +213,23 @@
 
   
   
+
+
+
+
+
+
   
   
 
+
+
+
+
+
+
+
+
   
   
 
@@ -284,27 +303,51 @@
   This is only the http connector, for testing/experimental purposes.
   -->
 
-  
+  
+  
+
+  
 
 
+  
+
+
+
+
+
+
+
+
+
+
+
+
+  
+
   
+
+
+
+
+
+
+
 
+
+
+
+
+
+
+
+
+
+
+
+
   
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
+
 
 
   

Modified: tomcat/sandbox/java/org/apache/tomcat/util/net/AcceptorEndpoint.java
URL: 
http://svn.apache.org/viewcvs/tomcat/sandbox/java/org/apache/tomcat/util/net/AcceptorEndpoint.java?rev=348672&r1=348671&r2=348672&view=diff
==
--- tomcat/sandbox/java/org/apache/tomcat/util/net/AcceptorEndpoint.java 
(original)
+++ tomcat/sandbox/java/org/apache/tomcat/util/net/AcceptorEndpoint.java Wed 
Nov 23 22:21:32 2005
@@ -121,6 +121,10 @@
 }
 }
 
+public void run() {
+// nothing 
+}
+
 public void workerDone(Runnable workerThread) {
 curThreads--;
 }
@@ -132,7 +136,9 @@
 void newAcceptor() {
 acceptors++;
 Thread t=new ThreadWithAttributes( this, new AcceptorThread());
-t.setPriority(threadPriority);
+if( threadPriority > 0 ) {
+t.setPriority(threadPriority);
+}
 t.setDaemon(daemon);
 threadStart( t );
 t.start();



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



svn commit: r348673 - in /tomcat/sandbox/bin: ./ jam_http11.sh jam_tomcat.sh tomcatInetd.sh

2005-11-23 Thread costin
Author: costin
Date: Wed Nov 23 22:22:58 2005
New Revision: 348673

URL: http://svn.apache.org/viewcvs?rev=348673&view=rev
Log:
Few script files for simple tests. Using jamvm - just for fun :-) ( it actually 
works pretty well )


Added:
tomcat/sandbox/bin/
tomcat/sandbox/bin/jam_http11.sh   (with props)
tomcat/sandbox/bin/jam_tomcat.sh   (with props)
tomcat/sandbox/bin/tomcatInetd.sh   (with props)

Added: tomcat/sandbox/bin/jam_http11.sh
URL: 
http://svn.apache.org/viewcvs/tomcat/sandbox/bin/jam_http11.sh?rev=348673&view=auto
==
--- tomcat/sandbox/bin/jam_http11.sh (added)
+++ tomcat/sandbox/bin/jam_http11.sh Wed Nov 23 22:22:58 2005
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+# run from sandbox dir
+
+BASE=`pwd`/..
+jamvm -cp 
$BASE/sandbox/runtime/tomcat-http11.jar:$BASE/repository/rhino1_6R2/js.jar 
org.apache.coyote.adapters.JsAdapter
+

Propchange: tomcat/sandbox/bin/jam_http11.sh
--
svn:executable = *

Added: tomcat/sandbox/bin/jam_tomcat.sh
URL: 
http://svn.apache.org/viewcvs/tomcat/sandbox/bin/jam_tomcat.sh?rev=348673&view=auto
==
--- tomcat/sandbox/bin/jam_tomcat.sh (added)
+++ tomcat/sandbox/bin/jam_tomcat.sh Wed Nov 23 22:22:58 2005
@@ -0,0 +1,3 @@
+
+BASE=..
+jamvm -Xms32M -cp 
$BASE/runtime/tomcat-all-runtime.jar:$BASE/repository/mx4j-3.0.1/lib/mx4j.jar 
org.apache.catalina.startup.Bootstrap start

Propchange: tomcat/sandbox/bin/jam_tomcat.sh
--
svn:executable = *

Added: tomcat/sandbox/bin/tomcatInetd.sh
URL: 
http://svn.apache.org/viewcvs/tomcat/sandbox/bin/tomcatInetd.sh?rev=348673&view=auto
==
--- tomcat/sandbox/bin/tomcatInetd.sh (added)
+++ tomcat/sandbox/bin/tomcatInetd.sh Wed Nov 23 22:22:58 2005
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+. $HOME/.bashrc
+
+$BASE=`pwd`/../..
+export CLASSPATH=$BASE/sandbox/classes:$BASE/connectors/bin
+cd $BASE/sandbox
+exec sudo -u costin java org.apache.coyote.standalone.MainInetd >/tmp/tc.log 
2>&1 

Propchange: tomcat/sandbox/bin/tomcatInetd.sh
--
svn:executable = *



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]