error in connecting MYSQL database (Too many connections error)

2006-08-09 Thread prakash shanmugam

hai all,

 i have one major issue in my project..

 My project is developed using jsp,servlets in Tomcat5 with MySql as
database.. i am using type1 driver

 My project is now used by end users in intranet..

 When multiple users are accessing at the same time ,its throwing *too many
connections exception* at sometimes . And at sometimes its dispaying error
as "*Operation not allowed after ResultSet is closed"*

 i dont know how to rectify this ..  Can anybody help me to overcome this..

  Here is my bean file used for establing database connections...

package com.pts.database;
import java.io.*;
import java.sql.*;
import java.net.*;

public class DBCon
{
  private static final String DriverClass = "com.mysql.jdbc.Driver";
  private static final String CONNECTION_STRING = "jdbc:mysql://";
  private static final String PORT = "3306";
  private static final String DATABASE = "opts";
  private static final String user = "dav";
  private static final String pwd="";
  private static Connection  con = null;
  private static Statement stmt = null;
  private static Statement stmt2 = null;
  private static PreparedStatement pst = null;
  private static ResultSet rs = null;
  private static int count = 0;

  public static void assignCon()
  {
 String CONNECTION_IP="100.100.100.6";
try{
   Class.forName(DriverClass).newInstance();
   }
   catch(ClassNotFoundException ce){System.out.println(ce);}
   catch(InstantiationException ie){}
   catch(IllegalAccessException ie1){}

   try{
   con = DriverManager.getConnection
(CONNECTION_STRING+CONNECTION_IP+":"+PORT+"/"+DATABASE,user,pwd);
   stmt = con.createStatement();
   stmt2 = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
   }catch(SQLException sqle){System.out.println("STMT:"+sqle);}
  }
  public static ResultSet retrieveFromDB(String sql) throws SQLException
  {
   return (stmt.executeQuery(sql));
  }
  public static ResultSet retrieveScrollDB(String sql) throws SQLException
  {
   return (stmt2.executeQuery(sql));
  }
  public static int updateDB(String sql) throws SQLException
  {
   return (stmt.executeUpdate(sql));
  }
  public static PreparedStatement prepareStmt(String sql) throws
SQLException{
 pst=con.prepareStatement(sql);
return pst;
  }
  public static ResultSet getProjectsList() throws SQLException{
 rs=((PreparedStatement)con.prepareStatement("select projID,projName from
proj_det where delFlag=0 || delFlag IS NULL")).executeQuery();
return rs;
  }
  public Connection getConn() {
return con;
  }
  public Statement getStmt()
  {
return stmt;
  }
  public  static void CloseAll() throws SQLException
  {
   stmt.close();
   stmt2.close();
   con.close();
  }
}



Hope Any of u can help me.. it would be very much helpful to me if any body
suggest me a solution to this... Because of this issue my project is in
pending..



Thanks in Advance


DO NOT REPLY [Bug 40203] - Apache, mod_jk and Tomcat looses sessions

2006-08-09 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=40203





--- Additional Comments From [EMAIL PROTECTED]  2006-08-10 01:06 ---
I think this bug is invalid.

I think you are asking for a Servlet container that uses the HTTP protocol to
communicate with the client and wish the session management mechanism to not
make use of HTTP Cookies for session tracking.

What you are asking for is not technologically feasable with any degree of
accuracy.  Since its possible to run multiple browsers per host or have multiple
hosts per IP address so cookies provide the only way to uniquely tracking each
client instance.

If you believe you have a scheme that works for you can replace/override the
inbuilt session management function with your own implementation.

Maybe you can explain how you expect session tracking to work in the provided
test 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]



URLRewriteFilter

2006-08-09 Thread Yoav Shapira

Hi,
I'm sorry I lost the original thread, or I'd respond there, but I
believe someone (Bill B?) asked about this earlier today: a
mod_rewrite-like Java filter, http://tuckey.org/urlrewrite/ .

Yoav

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



svn commit: r430148 - /tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java

2006-08-09 Thread fhanik
Author: fhanik
Date: Wed Aug  9 14:22:24 2006
New Revision: 430148

URL: http://svn.apache.org/viewvc?rev=430148&view=rev
Log:
Fixed close down, and degraded a message to debug 

Modified:
tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java

Modified: tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java?rev=430148&r1=430147&r2=430148&view=diff
==
--- tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java 
(original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java Wed 
Aug  9 14:22:24 2006
@@ -153,7 +153,6 @@
 
 protected ConcurrentLinkedQueue nioChannels = new 
ConcurrentLinkedQueue() {
 public boolean offer(NioChannel o) {
-if ( getSecure() ) return false;
 //avoid over growing our cache or add after we have stopped
 if ( running && (size() < curThreads) ) return super.offer(o);
 else return false;
@@ -961,9 +960,10 @@
 // Wait for polltime before doing anything, so that the poller 
threads
 // exit, otherwise parallel descturction of sockets which are still
 // in the poller can cause problems
+close = true;
 try {
 synchronized (this) {
-this.wait(pollTime / 1000);
+this.wait(selectorTimeout * 2);
 }
 } catch (InterruptedException e) {
 // Ignore
@@ -1350,7 +1350,7 @@
 handshake = socket.handshake(key.isReadable(), 
key.isWritable());
 }catch ( IOException x ) {
 handshake = -1;
-log.error("Error during SSL handshake",x);
+if ( log.isDebugEnabled() ) log.debug("Error 
during SSL handshake",x);
 }catch ( CancelledKeyException ckx ) {
 handshake = -1;
 }



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



svn commit: r430130 - in /tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net: NioEndpoint.java SecureNioChannel.java

2006-08-09 Thread fhanik
Author: fhanik
Date: Wed Aug  9 12:41:02 2006
New Revision: 430130

URL: http://svn.apache.org/viewvc?rev=430130&view=rev
Log:
SSL byte buffers are cached as well

Modified:
tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/SecureNioChannel.java

Modified: tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java?rev=430130&r1=430129&r2=430130&view=diff
==
--- tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java 
(original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java Wed 
Aug  9 12:41:02 2006
@@ -46,6 +46,7 @@
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.LinkedBlockingQueue;
 import java.net.Socket;
+import java.util.StringTokenizer;
 
 /**
  * NIO tailored thread pool, providing the following services:
@@ -152,6 +153,7 @@
 
 protected ConcurrentLinkedQueue nioChannels = new 
ConcurrentLinkedQueue() {
 public boolean offer(NioChannel o) {
+if ( getSecure() ) return false;
 //avoid over growing our cache or add after we have stopped
 if ( running && (size() < curThreads) ) return super.offer(o);
 else return false;
@@ -370,13 +372,33 @@
 public String getKeystoreType() { return keystoreType;}
 public void setKeystoreType(String s ) { this.keystoreType = s;}
 
-protected String sslProtocol = "TLS";
+protected String sslProtocol = "TLS"; 
+
 public String getSslProtocol() { return sslProtocol;}
 public void setSslProtocol(String s) { sslProtocol = s;}
 
+protected String sslEnabledProtocols=null; //"TLSv1,SSLv3,SSLv2Hello"
+protected String[] sslEnabledProtocolsarr =  new String[0];
+public void setSslEnabledProtocols(String s) {
+this.sslEnabledProtocols = s;
+StringTokenizer t = new StringTokenizer(s,",");
+sslEnabledProtocolsarr = new String[t.countTokens()];
+for (int i=0; i 0 ) engine.setEnabledCipherSuites(ciphersarr);
+if ( sslEnabledProtocolsarr.length > 0 ) 
engine.setEnabledProtocols(sslEnabledProtocolsarr);
+
+return engine;
+}
+
 
 /**
  * Create (or allocate) and return an available processor for use in
@@ -872,14 +904,8 @@
 try {
 // Accept the next incoming connection from the server 
socket
 SocketChannel socket = serverSock.accept();
-processSocket(socket);
 // Hand this socket off to an appropriate processor
-//if(!setSocketOptions(socket))
-//{
-//// Close socket right away
-//socket.socket().close();
-//socket.close();
-//}
+if ( running && (!paused) && socket != null ) 
processSocket(socket);
 } catch (Throwable t) {
 log.error(sm.getString("endpoint.accept.fail"), t);
 }

Modified: 
tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/SecureNioChannel.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/SecureNioChannel.java?rev=430130&r1=430129&r2=430130&view=diff
==
--- tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/SecureNioChannel.java 
(original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/SecureNioChannel.java 
Wed Aug  9 12:41:02 2006
@@ -45,17 +45,23 @@
 reset();
 }
 
+public void reset(SSLEngine engine) throws IOException {
+this.sslEngine = engine;
+reset();
+}
 public void reset() throws IOException {
 super.reset();
 netOutBuffer.position(0);
 netOutBuffer.limit(0);
 netInBuffer.position(0);
 netInBuffer.limit(0);
-
+initHandshakeComplete = false;
+closed = false;
+closing = false;
 //initiate handshake
 sslEngine.beginHandshake();
 initHandshakeStatus = sslEngine.getHandshakeStatus();
-
+
 }
 
 
//===




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



RE: filter to "emulate" mod_rewrite

2006-08-09 Thread Bill Barker
 

> -Original Message-
> From: Jean-frederic Clere [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, August 09, 2006 3:11 AM
> To: Tomcat Developers List
> Subject: filter to "emulate" mod_rewrite
> 
> Hi,
> 
> Do we have a filter to "emulate" mod_rewrite features?
> 

Remy wrote one a while back for JBoss.  We don't have anything like that in
Tomcat.

> Cheers
> 
> Jean-Frederic
> 
> -
> 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]



svn commit: r430097 - in /tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net: NioChannel.java NioEndpoint.java SecureNioChannel.java

2006-08-09 Thread fhanik
Author: fhanik
Date: Wed Aug  9 10:12:37 2006
New Revision: 430097

URL: http://svn.apache.org/viewvc?rev=430097&view=rev
Log:
Added in a cache for byte buffers

Modified:
tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioChannel.java
tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/SecureNioChannel.java

Modified: tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioChannel.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioChannel.java?rev=430097&r1=430096&r2=430097&view=diff
==
--- tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioChannel.java 
(original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioChannel.java Wed 
Aug  9 10:12:37 2006
@@ -46,6 +46,11 @@
 this.sc = channel;
 this.bufHandler = bufHandler;
 }
+
+public void reset() throws IOException {
+bufHandler.getReadBuffer().clear();
+bufHandler.getWriteBuffer().clear();
+}
 
 /**
  * returns true if the network buffer has 
@@ -119,7 +124,6 @@
 public Poller getPoller() {
 return poller;
 }
-
 /**
  * getIOChannel
  *
@@ -156,6 +160,14 @@
 
 public void setPoller(Poller poller) {
 this.poller = poller;
+}
+
+public void setIOChannel(SocketChannel IOChannel) {
+this.sc = IOChannel;
+}
+
+public String toString() {
+return super.toString()+":"+this.sc.toString();
 }
 
 }

Modified: tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java?rev=430097&r1=430096&r2=430097&view=diff
==
--- tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java 
(original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java Wed 
Aug  9 10:12:37 2006
@@ -45,6 +45,7 @@
 import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.LinkedBlockingQueue;
+import java.net.Socket;
 
 /**
  * NIO tailored thread pool, providing the following services:
@@ -149,11 +150,13 @@
 protected ServerSocketChannel serverSock = null;
 
 
-/**
- * APR memory pool for the server socket.
- */
-protected long serverSockPool = 0;
-
+protected ConcurrentLinkedQueue nioChannels = new 
ConcurrentLinkedQueue() {
+public boolean offer(NioChannel o) {
+//avoid over growing our cache or add after we have stopped
+if ( running && (size() < curThreads) ) return super.offer(o);
+else return false;
+}
+};
 
 
 
@@ -581,6 +584,7 @@
 }
 pollers = null;
 }
+nioChannels.clear();
 }
 
 
@@ -597,6 +601,7 @@
 serverSock = null;
 sslContext = null;
 initialized = false;
+nioChannels.clear();
 }
 
 
@@ -658,33 +663,36 @@
 try {
 //disable blocking, APR style, we are gonna be polling it
 socket.configureBlocking(false);
-
+Socket sock = socket.socket();
 // 1: Set socket options: timeout, linger, etc
 if (soLinger >= 0)
-socket.socket().setSoLinger(true,soLinger);
+sock.setSoLinger(true,soLinger);
 if (tcpNoDelay)
-socket.socket().setTcpNoDelay(true);
+sock.setTcpNoDelay(true);
 if (soTimeout > 0)
-socket.socket().setSoTimeout(soTimeout);
+sock.setSoTimeout(soTimeout);
 
-NioChannel channel = null;
-// 2: SSL setup
-step = 2;
-if (sslContext != null) {
-SSLEngine engine = sslContext.createSSLEngine();
-engine.setNeedClientAuth(getClientAuth());
-engine.setUseClientMode(false);
-int appbufsize = 
engine.getSession().getApplicationBufferSize();
-int bufsize = 
Math.max(Math.max(getReadBufSize(),getWriteBufSize()),appbufsize);
-NioBufferHandler bufhandler = new 
NioBufferHandler(bufsize,bufsize);
-channel = new SecureNioChannel(socket,engine,bufhandler);
-
+NioChannel channel = nioChannels.poll();
+if ( channel == null ) {
+// 2: SSL setup
+step = 2;
+
+if (sslContext != null) {
+SSLEngine engine = sslContext.createSSLEngine();
+engine.setNeedClientAuth(getClientAuth());
+engine.setUseClientMode(false);
+int appbufsize = 
engine.getSession().getApplicationBufferSize();
+int bufsize = Math.max(

svn commit: r430064 - in /tomcat/tc6.0.x/trunk/java/org/apache: coyote/http11/ tomcat/util/net/

2006-08-09 Thread fhanik
Author: fhanik
Date: Wed Aug  9 07:44:50 2006
New Revision: 430064

URL: http://svn.apache.org/viewvc?rev=430064&view=rev
Log:
Fixed deadlock issue with thread pool
Fixed error catches for a known JDK bug on windows #5076772 
Added in the ability to have more than one poller, although performance 
actually gets worse
Next steps: hand off setting socket options etc to the worker thread for faster 
acceptance of new socket

Modified:
tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java
tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java

tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/InternalNioInputBuffer.java

tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/InternalNioOutputBuffer.java
tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioChannel.java
tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java

Modified: 
tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java?rev=430064&r1=430063&r2=430064&view=diff
==
--- tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java 
(original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java 
Wed Aug  9 07:44:50 2006
@@ -95,7 +95,6 @@
 //readTimeout = -1;
 }
 inputBuffer = new InternalNioInputBuffer(request, 
headerBufferSize,readTimeout);
-inputBuffer.setPoller(endpoint.getPoller());
 request.setInputBuffer(inputBuffer);
 
 response = new Response();
@@ -752,7 +751,7 @@
 if (request.getAttribute("org.apache.tomcat.comet") == null) {
 comet = false;
 }
-SelectionKey key = 
socket.getIOChannel().keyFor(endpoint.getPoller().getSelector());
+SelectionKey key = 
socket.getIOChannel().keyFor(socket.getPoller().getSelector());
 if ( key != null ) {
 NioEndpoint.KeyAttachment attach = (NioEndpoint.KeyAttachment) 
key.attachment();
 if ( attach!=null ) {
@@ -778,10 +777,10 @@
 return SocketState.CLOSED;
 } else if (!comet) {
 recycle();
-endpoint.getPoller().add(socket);
+socket.getPoller().add(socket);
 return SocketState.OPEN;
 } else {
-endpoint.getCometPoller().add(socket);
+socket.getPoller().add(socket);
 return SocketState.LONG;
 }
 }
@@ -809,7 +808,6 @@
 this.socket = socket;
 inputBuffer.setSocket(socket);
 outputBuffer.setSocket(socket);
-outputBuffer.setSelector(endpoint.getPoller().getSelector());
 
 // Error flag
 error = false;
@@ -841,7 +839,7 @@
 // and the method should return true
 openSocket = true;
 // Add the socket to the poller
-endpoint.getPoller().add(socket);
+socket.getPoller().add(socket);
 break;
 }
 request.setStartTime(System.currentTimeMillis());
@@ -897,7 +895,7 @@
 if (request.getAttribute("org.apache.tomcat.comet") != 
null) {
 comet = true;
 }
-SelectionKey key = 
socket.getIOChannel().keyFor(endpoint.getPoller().getSelector());
+SelectionKey key = 
socket.getIOChannel().keyFor(socket.getPoller().getSelector());
 if (key != null) {
 NioEndpoint.KeyAttachment attach = 
(NioEndpoint.KeyAttachment) key.attachment();
 if (attach != null)  {
@@ -1049,7 +1047,7 @@
 
 comet = false;
 cometClose = true;
-SelectionKey key = 
socket.getIOChannel().keyFor(endpoint.getPoller().getSelector());
+SelectionKey key = 
socket.getIOChannel().keyFor(socket.getPoller().getSelector());
 if ( key != null ) {
 NioEndpoint.KeyAttachment attach = (NioEndpoint.KeyAttachment) 
key.attachment();
 if ( attach!=null && attach.getComet()) {

Modified: 
tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java?rev=430064&r1=430063&r2=430064&view=diff
==
--- tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java 
(original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java 
Wed Aug  9 07:44:50 2006
@@ -223,6 +223,21 @@
 
 //  Pool setup 
 
+public void setPollerThreadCount(int count) {
+ep.setPoller

DO NOT REPLY [Bug 40222] New: - Default Tomcat configuration alows easy session hijacking

2006-08-09 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=40222

   Summary: Default Tomcat configuration alows easy session
hijacking
   Product: Tomcat 5
   Version: 5.0.15
  Platform: All
OS/Version: All
Status: NEW
  Severity: major
  Priority: P2
 Component: Catalina
AssignedTo: tomcat-dev@jakarta.apache.org
ReportedBy: [EMAIL PROTECTED]


Tomcat should not carry over a session id generated under HTTP do HTTPS
requests. After authentication, the session ID becomes THE secret password.

In reality, many standard servlets (including e.g. Apache MyFaces servlet)
return a session ID on the first request. After switch to SSL (with
authentication), the session ID is retained, thus allowing easy session 
hijacking.

In the ideal world the session should survive the switch from HTTP to HTTPS, but
the session ID must change upon switch to HTTPS.

-- 
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: r430043 - in /tomcat/tc6.0.x/trunk/java/org/apache: coyote/http11/InternalNioInputBuffer.java tomcat/util/net/NioEndpoint.java

2006-08-09 Thread fhanik
Author: fhanik
Date: Wed Aug  9 05:26:11 2006
New Revision: 430043

URL: http://svn.apache.org/viewvc?rev=430043&view=rev
Log:
Tune the connector, next step is to add the ability to have more than one 
poller, this is achievable by simply having each poller have its own selector, 
exactly like it is done today

Modified:

tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/InternalNioInputBuffer.java
tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java

Modified: 
tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/InternalNioInputBuffer.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/InternalNioInputBuffer.java?rev=430043&r1=430042&r2=430043&view=diff
==
--- 
tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/InternalNioInputBuffer.java 
(original)
+++ 
tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/InternalNioInputBuffer.java 
Wed Aug  9 05:26:11 2006
@@ -569,7 +569,7 @@
 //to do, add in a check, we might have just timed out 
on the wait,
 //so there is no need to register us again.
 boolean addToQueue = false;
-try { addToQueue = 
((key.interestOps()&SelectionKey.OP_READ) != SelectionKey.OP_READ); } catch ( 
CancelledKeyException ckx ){ throw new IOException("Socket key cancelled.");}
+try { addToQueue = 
((att.interestOps()&SelectionKey.OP_READ) != SelectionKey.OP_READ); } catch ( 
CancelledKeyException ckx ){ throw new IOException("Socket key cancelled.");}
 if ( addToQueue ) {
 synchronized (att.getMutex()) {
 addToReadQueue(key, att);
@@ -591,7 +591,10 @@
 new Runnable() {
 public void run() {
 try {
-if (key != null) key.interestOps(SelectionKey.OP_READ);
+if (key != null) {
+key.interestOps(SelectionKey.OP_READ);
+att.interestOps(SelectionKey.OP_READ);
+}
 } catch (CancelledKeyException ckx) {
 try {
 if ( att != null ) {

Modified: tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java?rev=430043&r1=430042&r2=430043&view=diff
==
--- tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java 
(original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java Wed 
Aug  9 05:26:11 2006
@@ -40,6 +40,8 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.tomcat.util.net.SecureNioChannel.ApplicationBufferHandler;
 import org.apache.tomcat.util.res.StringManager;
+import java.util.concurrent.ConcurrentLinkedQueue;
+import java.util.concurrent.atomic.AtomicLong;
 
 /**
  * NIO tailored thread pool, providing the following services:
@@ -868,12 +870,15 @@
 public class Poller implements Runnable {
 
 protected Selector selector;
-protected LinkedList events = new LinkedList();
+protected ConcurrentLinkedQueue events = new ConcurrentLinkedQueue();
+
 protected boolean close = false;
 protected long nextExpiration = 0;//optimize expiration handling
 
 protected int keepAliveCount = 0;
 public int getKeepAliveCount() { return keepAliveCount; }
+
+protected AtomicLong wakeupCounter = new AtomicLong(0l);
 
 
 
@@ -909,10 +914,11 @@
 }
 
 public void addEvent(Runnable event) {
-synchronized (events) {
-events.add(event);
-}
-selector.wakeup();
+//synchronized (events) {
+//events.add(event);
+//}
+events.offer(event);
+if ( wakeupCounter.incrementAndGet() < 3 ) selector.wakeup();
 }
 
 /**
@@ -925,12 +931,15 @@
  */
 public void add(final NioChannel socket) {
 final SelectionKey key = socket.getIOChannel().keyFor(selector);
-KeyAttachment att = (KeyAttachment)key.attachment();
+final KeyAttachment att = (KeyAttachment)key.attachment();
 if ( att != null ) att.setWakeUp(false);
 Runnable r = new Runnable() {
 public void run() {
 try {
-if (key != null) key.interestOps(SelectionKey.OP_READ);
+if (key != null) {
+key.interestOps(SelectionKey.OP_READ);
+att.interestOps(SelectionKey.OP_READ);
+}
 }catch ( CancelledKeyException ckx ) {
   

DO NOT REPLY [Bug 40220] - Order of jar loading affects packaged resources

2006-08-09 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=40220


[EMAIL PROTECTED] changed:

   What|Removed |Added

   Priority|P4  |P2




-- 
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 40220] New: - Order of jar loading affects packaged resources

2006-08-09 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=40220

   Summary: Order of jar loading affects packaged resources
   Product: Tomcat 5
   Version: 5.0.28
  Platform: PC
OS/Version: Windows XP
Status: NEW
  Severity: major
  Priority: P4
 Component: Catalina
AssignedTo: tomcat-dev@jakarta.apache.org
ReportedBy: [EMAIL PROTECTED]


Consider two jar files:
JarA contains:
/mypackage/SomeClass.class
/mypackage/SomeClass.hbm.xml

JarB contains:
/mypackage/Another.class

When 'JarA' gets loaded before 'JarB' I have access to 'SomeClass.hbm.xml', but
when the order is changed the resource is not available. I do have access to the
classes at all time though. This behaviour only seems to occur when both jars
contain classes in the package where the resource is located.

-- 
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]



filter to "emulate" mod_rewrite

2006-08-09 Thread Jean-frederic Clere

Hi,

Do we have a filter to "emulate" mod_rewrite features?

Cheers

Jean-Frederic

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