Re: Tomcat 6 And SSL Configuration

2009-11-02 Thread Peter Crowther
2009/11/2 Nilesh Patil nileshpatil2...@gmail.com

  The apache tomcat service on local computer started and then stopped .
  Some services stopped automaticaly if they are not in use by other
 services or programs


There should be more details of what went wrong in one of Tomcat's log files
(it doesn't use the Windows event log). If you can find and post the
exception and stack trace that's causing it to shut down, we might be able
to help - otherwise we're guessing!

- Peter


Re: Tomcat 6 And SSL Configuration

2009-11-02 Thread Nilesh Patil
Hi Peter

First of All Thnaks  for replay.
 Now the Tomcat service  is started but I am not able to access the Urk
through HTTPs..
 The log file contains are given below

 Nov 2, 2009 2:21:38 PM org.apache.coyote.http11.Http11Protocol pause
INFO: Pausing Coyote HTTP/1.1 on http-
Nov 2, 2009 2:21:38 PM org.apache.coyote.http11.Http11Protocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8443
Nov 2, 2009 2:21:38 PM org.apache.catalina.connector.Connector pause
SEVERE: Protocol handler pause failed
java.lang.NullPointerException
at org.apache.jk.server.JkMain.pause(JkMain.java:679)
at org.apache.jk.server.JkCoyoteHandler.pause(JkCoyoteHandler.java:153)
at org.apache.catalina.connector.Connector.pause(Connector.java:1073)
at
org.apache.catalina.core.StandardService.stop(StandardService.java:563)
at org.apache.catalina.core.StandardServer.stop(StandardServer.java:744)
at org.apache.catalina.startup.Catalina.stop(Catalina.java:628)
at org.apache.catalina.startup.Catalina.start(Catalina.java:603)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Nov 2, 2009 2:21:39 PM org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina
Nov 2, 2009 2:21:39 PM org.apache.coyote.http11.Http11Protocol destroy
INFO: Stopping Coyote HTTP/1.1 on http-
Nov 2, 2009 2:21:39 PM org.apache.catalina.connector.MapperListener destroy
WARNING: Error unregistering MBeanServerDelegate
java.lang.NullPointerException
at
org.apache.catalina.connector.MapperListener.destroy(MapperListener.java:162)
at org.apache.catalina.connector.Connector.stop(Connector.java:1179)
at
org.apache.catalina.core.StandardService.stop(StandardService.java:593)
at org.apache.catalina.core.StandardServer.stop(StandardServer.java:744)
at org.apache.catalina.startup.Catalina.stop(Catalina.java:628)
at org.apache.catalina.startup.Catalina.start(Catalina.java:603)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Nov 2, 2009 2:21:39 PM org.apache.coyote.http11.Http11Protocol destroy
INFO: Stopping Coyote HTTP/1.1 on http-8443
Nov 2, 2009 2:21:39 PM org.apache.catalina.connector.Connector stop
SEVERE: Coyote connector has not been started
Nov 2, 2009 2:21:42 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal
performance in production environments was not found on the
java.library.path: C:\Program Files\Apache Software Foundation\Tomcat
6.0\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\JavaFX\javafx-sdk1.2\bin;C:\JavaFX\javafx-sdk1.2\emulator\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program
Files\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program
Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL
Server\100\DTS\Binn\;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program
Files\svn-win32-1.5.6\bin;C:\jdk1.6.0_14\bin;c:\apache-ant-1.7.1\bin;D:\New
Folder\jboss-profiler-1.0.CR4\jvmpi\windows\jbossInspector.dll;C:\Program
Files\QuickTime\QTSystem\
Nov 2, 2009 2:21:42 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-
Nov 2, 2009 2:21:42 PM org.apache.coyote.http11.Http11Protocol init
SEVERE: Error initializing endpoint
java.io.FileNotFoundException: C:\.keystore (The system cannot find the file
specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.init(Unknown Source)
at
org.apache.tomcat.util.net.jsse.JSSESocketFactory.getStore(JSSESocketFactory.java:319)
at
org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeystore(JSSESocketFactory.java:259)
at
org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeyManagers(JSSESocketFactory.java:413)
at
org.apache.tomcat.util.net.jsse.JSSESocketFactory.init(JSSESocketFactory.java:381)
at
org.apache.tomcat.util.net.jsse.JSSESocketFactory.createSocket(JSSESocketFactory.java:125)
at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:496)
at org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:176)
at
org.apache.catalina.connector.Connector.initialize(Connector.java:1058)
at
org.apache.catalina.core.StandardService.initialize(StandardService.java:677)
at

Re: Will tomcat allow me to configur access to a single folder?

2009-11-02 Thread André Warnier

Josh Gooding wrote:

Unlike Apache HTTPD, can Tomcat be configured to allow access to a single
directory? 

Huh ?

Which Apache http documentation have you been reading ?
Not this one :
http://httpd.apache.org/docs/2.2/howto/auth.html



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: starting tomcat from ant not working

2009-11-02 Thread André Warnier

Dean Hiller wrote:

I have tried from ant and programmed up a main class to start tomcat via
catalina.bat start and tried catalina.bat start from ant as well.
Lastly, I finally tried directly running the exact command that catalina.bat
start tries to run and then ended up with classnotfound which makes no sense
since I thought the bootstrap class is supposed to put that
together.(any ideas?)


Have you tried startup.bat ?

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: ConnectionPool question

2009-11-02 Thread Elli Albek
Here is some idea for you:

First, you have two static methods to get and return the connection inside a
listener class. Those methods do not have anything to do with the listener
(which is an instance), and also and also do not need synchronization.
Synchronizing on getConnection can be a big bottleneck, especially if you
are doing a validation query onBorrow. Having said that, it sounds like this
is the least of your problems now.

I think you can have a solution without changing your code.

Try something like this:

getConnection() static method should get the connection, and add it to a
list that you keep in threadlocal.

recycleConnection() should close the connection and remove the connection
object from thread local.

Add a servlet filter that closes all connections in thread local. The filter
calls next filter, and in a finally block get the connections from thread
local, close all of them, and clear the list in thread local.


This will allow you to keep your legacy code. As far as I remember DBCP has
an option to close the result sets and statements when you close the
connection. If not this will partly work.


This is as close as you can get to having the connections reclaimed
immediately without rewriting your application.


Something like:

public static /* NOT synchronized */ Connection getConnection(){

Connection c = ...// get the connection from JNDI/DBCP

ListConnection connections = // get or create from thread local

if(connections.contains(c) == false)

// make sure c.equals() works as object reference equality, eg ==

// You may have to read DBCP code for this or add a break point and trace
through the code until you get to equals()

connections.add(c);

if(myLogger.isDebug())

myLogger.debug(“Request consumed “+ list.size() + “ connection(s)”);

return c;

}


public void doFilter(ServletRequest req, ServletResponse res, FilterChain
chain) throws IOException, ServletException {

try{

// handle request

chain.doFilter(req, res);

}finally{

ListConnection connections = ...// get from thread local

if (connections != null){

for(Connection c: connections){

try{

c.close();

}catch(Throwable t){

myLogger.error(“Error on connection close”, t);

}

}

connections.clear();

}

}

}


public static synchronized void recycleConnection(Connection c) {

ListConnection connections = ...// get from thread local

connections.remove(c);

try {

c.close();

} catch (Throwable t) {

// DO NOT eat the exception, especially when there are known issues in the
connection management code

myLogger.warn(“Error closing connection”, t);

}

}


I also think that I have seen somewhere a configuration that does the above
for you, but if not its not a lot of code to do yourself. Map the filter to
all the URL mappings that can possibly can open connection, which in the
worse case is /*.


Notice that with the code sample you wrote, a typical application will
consume many connections for one request (possible one per statement), and
worse than that, will not be able to perform transactional writes (since
each write is on a separate connection).


Version 2: Advanced

Keep the actual connection in thread local. You will have one connection per
HTTP request. getConnection() should be something like


public static /* NOT synchronized */ Connection getConnection(){

Connection c = ...// get the connection from thread local

if (c != null)

return c;

Connection c = ...// get the connection from JNDI/DBCP

// put connection in thread local

return c;

}


recycleConnection(){

// empty, connection will be recycled by filter.

}

public void doFilter(ServletRequest req, ServletResponse res, FilterChain
chain) throws IOException, ServletException {

try{

// handle request

chain.doFilter(req, res);

}finally{

ListConnection connections = ...// get from thread local

if (connections != null){

for(Connection c: connections){

try{

c.close();

}catch(Throwable t){

myLogger.error(“Error on connection
close”, t);

}

}

connections.clear();

}

}

}

public void doFilter(ServletRequest req, ServletResponse res, FilterChain
chain) throws IOException, ServletException {

try{

// handle request

chain.doFilter(req, res);

}finally{

Connection c = ...// get and REMOVE from thread local

if (c != null){

try{

c.close();

}catch(Throwable t){

myLogger.error(“Error on connection close”, t);

}

}

}

}


The filter is the same, but not using lists. Version 2 will give you one
connection per servlet request, which normally I would not do for a well
written DAO code, but in your case you are not really dealing with such
code. You can get large performance boost by having one 

Re: ConnectionPool question

2009-11-02 Thread Elli Albek
Oops, I had a copy paste error. Version 2 has the filter method twice.
Ignore the first, use the second. Notice this code was written in an email
client, not an IDE :)

E


Re: starting tomcat from ant not working

2009-11-02 Thread Elli Albek
Hi,
This is how we start tomcat from ant. ${server} is your tomcat installation
directory. Then we have a condition on a URL, so we know tomcat actually
starts and handling HTTP requests.

java jar=${server}/bin/bootstrap.jar fork=true spawn=true
dir=${server}/bin
jvmarg value=-Dcatalina.home=${server} /
arg line=start /
 /java

Notice the startup folder and catalina home argument. This is to avoid
conflicts with other tomcat installations that may be on the system.

E

On Sun, Nov 1, 2009 at 9:16 PM, Dean Hiller d...@alvazan.com wrote:

 I have tried from ant and programmed up a main class to start tomcat via
 catalina.bat start and tried catalina.bat start from ant as well.
 Lastly, I finally tried directly running the exact command that
 catalina.bat
 start tries to run and then ended up with classnotfound which makes no
 sense
 since I thought the bootstrap class is supposed to put that
 together.(any ideas?)




Re: ConnectionPool question

2009-11-02 Thread Konstantin Kolinko
2009/10/31 Josh Gooding josh.good...@gmail.com:
(...)
  and I am getting a tomcat startup exception:

 WARNING: Unexpected exception resolving reference
 java.lang.IllegalArgumentException
    at java.util.concurrent.ArrayBlockingQueue.init(Unknown Source)
    at
 org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:367)

Line 367 in ConnectorPool.java is

busy = new 
ArrayBlockingQueuePooledConnection(properties.getMaxActive(),false);

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: [OT] Hammers and nails (was Re: A question about log-rotation on catalina.out)

2009-11-02 Thread Elli Albek
How did this make it into the tomcat users list? :)

CPAN: Driven by users. Java (JCP) Driven by vendors.


Re: Tomcat 6 And SSL Configuration

2009-11-02 Thread Nilesh Patil
I got the solutions ... the path of keystore file was wrong..
and I done changes in Connector.

On Mon, Nov 2, 2009 at 2:26 PM, Nilesh Patil nileshpatil2...@gmail.comwrote:

 Hi Peter

 First of All Thnaks  for replay.
  Now the Tomcat service  is started but I am not able to access the Urk
 through HTTPs..
  The log file contains are given below

  Nov 2, 2009 2:21:38 PM org.apache.coyote.http11.Http11Protocol pause
 INFO: Pausing Coyote HTTP/1.1 on http-
 Nov 2, 2009 2:21:38 PM org.apache.coyote.http11.Http11Protocol pause
 INFO: Pausing Coyote HTTP/1.1 on http-8443
 Nov 2, 2009 2:21:38 PM org.apache.catalina.connector.Connector pause
 SEVERE: Protocol handler pause failed
 java.lang.NullPointerException
 at org.apache.jk.server.JkMain.pause(JkMain.java:679)
 at org.apache.jk.server.JkCoyoteHandler.pause(JkCoyoteHandler.java:153)
 at org.apache.catalina.connector.Connector.pause(Connector.java:1073)
 at
 org.apache.catalina.core.StandardService.stop(StandardService.java:563)
 at
 org.apache.catalina.core.StandardServer.stop(StandardServer.java:744)
 at org.apache.catalina.startup.Catalina.stop(Catalina.java:628)
 at org.apache.catalina.startup.Catalina.start(Catalina.java:603)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
 Nov 2, 2009 2:21:39 PM org.apache.catalina.core.StandardService stop
 INFO: Stopping service Catalina
 Nov 2, 2009 2:21:39 PM org.apache.coyote.http11.Http11Protocol destroy
 INFO: Stopping Coyote HTTP/1.1 on http-
 Nov 2, 2009 2:21:39 PM org.apache.catalina.connector.MapperListener destroy
 WARNING: Error unregistering MBeanServerDelegate
 java.lang.NullPointerException
 at
 org.apache.catalina.connector.MapperListener.destroy(MapperListener.java:162)
 at org.apache.catalina.connector.Connector.stop(Connector.java:1179)
 at
 org.apache.catalina.core.StandardService.stop(StandardService.java:593)
 at
 org.apache.catalina.core.StandardServer.stop(StandardServer.java:744)
 at org.apache.catalina.startup.Catalina.stop(Catalina.java:628)
 at org.apache.catalina.startup.Catalina.start(Catalina.java:603)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
 Nov 2, 2009 2:21:39 PM org.apache.coyote.http11.Http11Protocol destroy
 INFO: Stopping Coyote HTTP/1.1 on http-8443
 Nov 2, 2009 2:21:39 PM org.apache.catalina.connector.Connector stop
 SEVERE: Coyote connector has not been started
 Nov 2, 2009 2:21:42 PM org.apache.catalina.core.AprLifecycleListener init
 INFO: The APR based Apache Tomcat Native library which allows optimal
 performance in production environments was not found on the
 java.library.path: C:\Program Files\Apache Software Foundation\Tomcat
 6.0\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\JavaFX\javafx-sdk1.2\bin;C:\JavaFX\javafx-sdk1.2\emulator\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program
 Files\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program
 Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL
 Server\100\DTS\Binn\;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program
 Files\svn-win32-1.5.6\bin;C:\jdk1.6.0_14\bin;c:\apache-ant-1.7.1\bin;D:\New
 Folder\jboss-profiler-1.0.CR4\jvmpi\windows\jbossInspector.dll;C:\Program
 Files\QuickTime\QTSystem\
 Nov 2, 2009 2:21:42 PM org.apache.coyote.http11.Http11Protocol init
 INFO: Initializing Coyote HTTP/1.1 on http-
 Nov 2, 2009 2:21:42 PM org.apache.coyote.http11.Http11Protocol init
 SEVERE: Error initializing endpoint
 java.io.FileNotFoundException: C:\.keystore (The system cannot find the
 file specified)
 at java.io.FileInputStream.open(Native Method)
 at java.io.FileInputStream.init(Unknown Source)
 at
 org.apache.tomcat.util.net.jsse.JSSESocketFactory.getStore(JSSESocketFactory.java:319)
 at
 org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeystore(JSSESocketFactory.java:259)
 at
 org.apache.tomcat.util.net.jsse.JSSESocketFactory.getKeyManagers(JSSESocketFactory.java:413)
 at
 org.apache.tomcat.util.net.jsse.JSSESocketFactory.init(JSSESocketFactory.java:381)
 at
 org.apache.tomcat.util.net.jsse.JSSESocketFactory.createSocket(JSSESocketFactory.java:125)
 at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:496)
 at
 

Want to customise the tomcat's session logic

2009-11-02 Thread S Arvind
Hi Tomcat developers,

   Bascially my requirement is ability to control the session
sharing in browser. Till now we maintained each application as differnet
context but pointing to same doc-base. So different web application will be
running on a same code to control the session sharing between different
application . But now we want to run in same context as one application but
control the session sharing. So i planned to customise session creation n
management of the tomcat to our requirements to add some value to
*path*attribute in session. Is this possible?

Is there anyother way to solve this session sharing??

Thanks in advance.

Arvind S


Re: [OT] Hammers and nails (was Re: A question about log-rotation on catalina.out)

2009-11-02 Thread André Warnier

Elli Albek wrote:

How did this make it into the tomcat users list? :)

CPAN: Driven by users. Java (JCP) Driven by vendors.

Tomcat logging: driven by Java Hammer (tm) manufacturers.



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Occasional NoClassDefFoundError, but disappears after couple of restarts

2009-11-02 Thread A. Rothman
To anyone who may stumble upon this thread looking for solutions - this 
bug has been investigated and fixed by Konstantin Kolinko 
(https://issues.apache.org/bugzilla/show_bug.cgi?id=48097). The fix 
should be available in Tomcat 6.0.21 and later. 
mailto:knst.koli...@gmail.com


A. Rothman wrote:

I've opened https://issues.apache.org/bugzilla/show_bug.cgi?id=48097 
with a sample jsp that recreates the error.


Mark Thomas wrote:


A. Rothman wrote:
 
A couple months ago I had a slightly different setting but with the 
same

strange result - NoClassDefFoundErrors which occurred on a particular
jsp page in my app, but only if it was the first jsp accessed following
a restart (and remained in the error state until the next restart). If
it was not the first jsp accessed, then everything came up fine (with
nothing in the configuration or app changing in between). I also 
figured

it's some classloader bug in Tomcat, not entirely a race condition
(since it did happen consistently), but something that manifests itself
depending on the order of class loading.



If you can provide a cut-down copy of that JSP that reproduces the
problem on a clean Tomcat install, I'd be happy to take a look. Just
create a new bugzilla entry and provide the JSP as an attachment.

Mark



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


  




Re: Bizarre NoClassDefFoundError

2009-11-02 Thread A. Rothman
To anyone who may stumble upon this thread looking for solutions - this 
bug has been recreated in 6.0.20 with a consistent recipe, and 
investigated and fixed by Konstantin Kolinko 
(https://issues.apache.org/bugzilla/show_bug.cgi?id=48097). The fix 
should be available in Tomcat 6.0.21 and later.



It also uncovered another blank-page bug, which is yet to be solved 
(anyone who can help, pls read the bug report for details)... but that's 
another story.



Thanks to everyone for the help, especially to Konstantin for his 
fruitful efforts :-)



Amichai


A. Rothman wrote:


Thanks Bill - I think we've got progress!


I missed the policy file, thinking about file permissions... when I 
add grant { permission java.security.AllPermission; } to the policy 
file, the error goes away!



So - what's going on? It makes sense that the compiler and app runtime 
would have different classloaders, one which can see the bean class 
and one which can't. But what's the explanation for different behavior 
depending on the order in which the jsps load? Note that the other 
jsps that work ok also reference the same bean class...



Here's another clue I found: In the offending jsp, there is a creation 
of a URI instance before the useBean tag. It looks like if I rearrange 
a couple of lines in the jsp, moving the URI creation after the 
useBean tag, the problem is solved as well (regardless of the policy 
file). Unfortunately, when trying to then insert these lines in a 
working jsp to try to break it, it did not break. I'm lost for an 
explanation.



I tried searching for some reference stating that a useBean tag must 
be the first on the jsp page (before any other variables/classes are 
instantiated), but couldn't find one - is this true? (best practices 
aside...)



Changing the line order is a good workaround which solves the problem 
(without having to change permissions), but I'd still like to 
understand what's going on - both to learn, and since there still may 
be a bug somewhere to be fixed...



Finally, I added the FINEST log level and ran it in the error 
scenario, and these are the lines that look relevant:



...

Jun 25, 2009 1:09:46 PM org.apache.catalina.loader.WebappClassLoader 
loadClass

FINE:   Loading class from parent
Jun 25, 2009 1:09:46 PM org.apache.catalina.loader.WebappClassLoader 
loadClass

FINE: loadClass(web.SessionBean, false)
Jun 25, 2009 1:09:46 PM org.apache.catalina.loader.WebappClassLoader 
loadClass

FINE:   Searching local repositories
Jun 25, 2009 1:09:46 PM org.apache.catalina.loader.WebappClassLoader 
findClass

FINE: findClass(web.SessionBean)
Jun 25, 2009 1:09:46 PM org.apache.catalina.loader.WebappClassLoader 
loadClass
FINE:   Delegating to parent classloader at end: 
org.apache.catalina.loader.standardclassloa...@6aa6aeed


...

Jun 25, 2009 1:09:46 PM org.apache.catalina.loader.WebappClassLoader 
loadClass

FINE: loadClass(web.SessionBean, false)
Jun 25, 2009 1:09:46 PM org.apache.catalina.loader.WebappClassLoader 
loadClass

FINE:   Searching local repositories
Jun 25, 2009 1:09:46 PM org.apache.catalina.loader.WebappClassLoader 
findClass

FINE: findClass(web.SessionBean)
Jun 25, 2009 1:09:46 PM org.apache.catalina.loader.WebappClassLoader 
loadClass

FINE: loadClass(java.lang.Object, false)
Jun 25, 2009 1:09:46 PM org.apache.catalina.loader.WebappClassLoader 
findClass

FINE:   Returning class class web.SessionBean
Jun 25, 2009 1:09:46 PM org.apache.catalina.loader.WebappClassLoader 
findClass

FINE:   Loaded by WebappClassLoader
 delegate: false
 repositories:
-- Parent Classloader:
org.apache.catalina.loader.standardclassloa...@6aa6aeed

Jun 25, 2009 1:09:46 PM org.apache.catalina.loader.WebappClassLoader 
loadClass

FINE:   Loading class from local repository

...

Jun 25, 2009 1:40:48 PM org.apache.catalina.loader.WebappClassLoader 
modified

FINE: modified()
Jun 25, 2009 1:40:48 PM org.apache.catalina.loader.WebappClassLoader 
modified

FINE: Failed tracking modifications of '/WEB-INF/lib'
Jun 25, 2009 1:40:48 PM org.apache.catalina.loader.WebappClassLoader 
modified

FINE: modified()
Jun 25, 2009 1:40:48 PM org.apache.catalina.loader.WebappClassLoader 
modified

FINE: Failed tracking modifications of '/WEB-INF/lib'
Jun 25, 2009 1:40:58 PM org.apache.catalina.loader.WebappClassLoader 
modified

FINE: modified()
Jun 25, 2009 1:40:58 PM org.apache.catalina.loader.WebappClassLoader 
modified

FINE: Failed tracking modifications of '/WEB-INF/lib'
Jun 25, 2009 1:40:58 PM org.apache.catalina.loader.WebappClassLoader 
modified

FINE: modified()

...


Thanks again,


Amichai


Bill Barker wrote:

A. Rothman amich...@amichais.net wrote in message 
news:965599.49.1245887723160.javamail.sys...@endor...
 

Yes, I've compared both the generated java files and corresponding
compiled class files from when it works and when it doesn't work - they
are identical. I think the problem is not with the bean sources, jsps,
configuration, 

How to make tomcat persistant ?

2009-11-02 Thread daulat khan
Hi,
I am developing servlet to run in tomcat 6.0.20. I need to store a
java class object in \
session. The class is not serialized. I got error message:

SEVERE: IOException while loading persisted sessions:
java.io.WriteAbortedException: \
writing aborted; java.io.NotSerializableException: (class name)

I know that tomcat use session manager to persist sessions and reload
them when \
server starts up. But I can not find where to configure it. How can I
turn it off so \
that I don't get the error message? Can anyone give some suggestion?
Thank you very \
much.


regards,
Daulatkhan

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: starting tomcat from ant not working

2009-11-02 Thread Konstantin Kolinko
2009/11/2 Dean Hiller d...@alvazan.com:
     [java] java.lang.ClassNotFoundException:
 org.apache.catalina.startup.Catalina

Probably your conf/catalina.properties file is broken. Maybe you
copied it from an earlier TC 5.5 installation.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: How to make tomcat persistant ?

2009-11-02 Thread Markus Schönhaber
daulat khan:

 I know that tomcat use session manager to persist sessions and reload
 them when \
 server starts up. But I can not find where to configure it. How can I
 turn it off so \
 that I don't get the error message?

Take a look at conf/context.xml.

-- 
Regards
  mks

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Understanding context.xml

2009-11-02 Thread Carsten Pohl
Hi!

I created a mainly empty dynamic web project in eclipse.

It has

- no servlets
- no jsp files

The web.xml is 

?xml version=1.0 encoding=UTF-8?
web-app xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; 
xmlns=http://java.sun.com/xml/ns/javaee; 
xmlns:web=http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd; 
xsi:schemaLocation=http://java.sun.com/xml/ns/javaee 
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd; id=WebApp_ID version=2.5
  display-nametestprojekt/display-name
  welcome-file-list
welcome-fileindex.html/welcome-file
welcome-fileindex.htm/welcome-file
welcome-fileindex.jsp/welcome-file
welcome-filedefault.html/welcome-file
welcome-filedefault.htm/welcome-file
welcome-filedefault.jsp/welcome-file
  /welcome-file-list
/web-app

and I added a context.xml to its META-INF folder

?xml version=1.0 encoding=UTF-8?
Context
Parameter name=companyName value=My Company, Incorporated  
override=false/
/Context

I exported this project as a WAR file. With the following structure:

u...@system:$ tree
.
|-- META-INF
|   |-- MANIFEST.MF
|   `-- context.xml
`-- WEB-INF
|-- classes
|-- lib
`-- web.xml

4 directories, 3 files

When I deploy the project to a local tomcat (Apache Tomcat/6.0.20) Everything 
works as expected. Meaning, the context.xml is copied to 
/conf/Catalina/localhost and renamed to testprojekt.xml.

When I edit the testprojekt.xml to:

?xml version=1.0 encoding=UTF-8?
Context
  Parameter name=companyName value=My BLAH Company, Incorporated  
override=false/
/Context

I see the following output in the catalina.out:

02.11.2009 13:21:35 org.apache.catalina.startup.HostConfig checkResources
INFO: Undeploying context [/testprojekt]
02.11.2009 13:21:35 org.apache.catalina.core.StandardContext resourcesStart
SCHWERWIEGEND: Error starting static Resources
java.lang.IllegalArgumentException: Document base 
/opt/tomcat6/webapps/testprojekt does not exist or is not a readable directory
at 
org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:142)
at 
org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4048)
at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:4217)
at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526)
at 
org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:630)
at 
org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:556)
at 
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:491)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1274)
at 
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:296)
at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at 
org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
at 
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
at 
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
at 
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
at java.lang.Thread.run(Thread.java:619)
02.11.2009 13:21:35 org.apache.catalina.core.StandardContext start
SCHWERWIEGEND: Error in resourceStart()
02.11.2009 13:21:35 org.apache.catalina.core.StandardContext start
SCHWERWIEGEND: Error getConfigured
02.11.2009 13:21:35 org.apache.catalina.core.StandardContext start
SCHWERWIEGEND: Context [/testprojekt] startup failed due to previous errors
02.11.2009 13:21:35 org.apache.catalina.core.StandardContext stop
INFO: Container 
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/testprojekt] 
has not been started

Why is that? Is that the expected result? What is the right way to change 
parameters in a context.xml?

Thank you in advance.
Regards,
Carsten Pohl

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Understanding context.xml

2009-11-02 Thread Markus Schönhaber
Carsten Pohl:

 When I deploy the project to a local tomcat (Apache Tomcat/6.0.20) Everything 
 works as expected. Meaning, the context.xml is copied to 
 /conf/Catalina/localhost and renamed to testprojekt.xml.
 
 When I edit the testprojekt.xml to:
 
 ?xml version=1.0 encoding=UTF-8?
 Context
   Parameter name=companyName value=My BLAH Company, Incorporated  
 override=false/
 /Context
 
 I see the following output in the catalina.out:
 
 02.11.2009 13:21:35 org.apache.catalina.startup.HostConfig checkResources
 INFO: Undeploying context [/testprojekt]
 02.11.2009 13:21:35 org.apache.catalina.core.StandardContext resourcesStart
 SCHWERWIEGEND: Error starting static Resources
 java.lang.IllegalArgumentException: Document base 
 /opt/tomcat6/webapps/testprojekt does not exist or is not a readable directory
[...]
 INFO: Container 
 org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/testprojekt] 
 has not been started
 
 Why is that? Is that the expected result? What is the right way to change 
 parameters in a context.xml?

You might be affected by this bug:
https://issues.apache.org/bugzilla/show_bug.cgi?id=47343

-- 
Regards
  mks

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Want to customise the tomcat's session logic

2009-11-02 Thread Pid

On 02/11/2009 10:06, S Arvind wrote:

Hi Tomcat developers,

Bascially my requirement is ability to control the session
sharing in browser. Till now we maintained each application as differnet
context but pointing to same doc-base. So different web application will be
running on a same code to control the session sharing between different
application . But now we want to run in same context as one application but
control the session sharing. So i planned to customise session creation n
management of the tomcat to our requirements to add some value to
*path*attribute in session. Is this possible?



I'm not sure your question is very clear, perhaps if you are able to 
make your question clearer someone will be able to help.


p



Is there anyother way to solve this session sharing??

Thanks in advance.

Arvind S




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: How to make tomcat persistant ?

2009-11-02 Thread daulat khan
Thanks a lot mark.

It is fixed...

--Daulatkhan

2009/11/2 Markus Schönhaber tomcat-us...@list-post.mks-mail.de:
 daulat khan:

 I know that tomcat use session manager to persist sessions and reload
 them when \
 server starts up. But I can not find where to configure it. How can I
 turn it off so \
 that I don't get the error message?

 Take a look at conf/context.xml.

 --
 Regards
  mks

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



How do I setup Tomcat ro refresh a directory faster than the default 5 seconds?

2009-11-02 Thread ed2003


 I tried adding variations of the following to server.xml but it still
 takes 5
 seconds for a newly modified file to appear.  Anybody know what I am doing
 wrong? (If the file is new, it appears within a second or so.  But if it
 exists and is rewritten, it takes 5 sec)


 Context path=/usr/share/tomcat5.5-webapps/ROOT/status
 cacheTTL=1 
WatchedResourcestatus/picture.png/WatchedResource
  /Context


-- 
View this message in context: 
http://old.nabble.com/How-do-I-setup-Tomcat-ro-refresh-a-directory-faster-than-the-default-5-seconds--tp26156902p26156902.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Understanding context.xml

2009-11-02 Thread Carsten Pohl
Oh, Thanks a lot, I would have never guessed that it is a bug in tomcat. But I 
would like to ask a follow up question.

If I change the testprojekt.xml in conf/Catalina/localhost/testprojekt.xml my 
webapplication will be redeployed (assuming the bug is fixed), and it would get 
the new values. If I change the conf/context.xml all my webapps will be 
RELOADED, but new values and changes to values in conf/context.xml will not be 
given to the webapp.

I am using the tomcat connection pooling to connect to a postgres DB, I would 
like to put the configuration (hostname, username, etc) somewhere, so that i 
can change it, when I change the databasehost. Where is the right place to put 
such a configuration?

If i put the configuration in conf/context.xml the changes to the values wont 
be given to running applications.

If i put it in the conf/Catalina/ the application will be redeployed, which 
causes downtimes.

What is the right place to PUT and later change the connection infos to the 
database?

Thank you again for your help.
Regards,
Carsten Pohl


- Original Message -
From: Markus Schönhaber tomcat-us...@list-post.mks-mail.de
To: users@tomcat.apache.org
Sent: Monday, 2 November, 2009 13:53:15 GMT +01:00 Amsterdam / Berlin / Bern / 
Rome / Stockholm / Vienna
Subject: Re: Understanding context.xml

Carsten Pohl:

 When I deploy the project to a local tomcat (Apache Tomcat/6.0.20) Everything 
 works as expected. Meaning, the context.xml is copied to 
 /conf/Catalina/localhost and renamed to testprojekt.xml.
 
 When I edit the testprojekt.xml to:
 
 ?xml version=1.0 encoding=UTF-8?
 Context
   Parameter name=companyName value=My BLAH Company, Incorporated  
 override=false/
 /Context
 
 I see the following output in the catalina.out:
 
 02.11.2009 13:21:35 org.apache.catalina.startup.HostConfig checkResources
 INFO: Undeploying context [/testprojekt]
 02.11.2009 13:21:35 org.apache.catalina.core.StandardContext resourcesStart
 SCHWERWIEGEND: Error starting static Resources
 java.lang.IllegalArgumentException: Document base 
 /opt/tomcat6/webapps/testprojekt does not exist or is not a readable directory
[...]
 INFO: Container 
 org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/testprojekt] 
 has not been started
 
 Why is that? Is that the expected result? What is the right way to change 
 parameters in a context.xml?

You might be affected by this bug:
https://issues.apache.org/bugzilla/show_bug.cgi?id=47343

-- 
Regards
  mks

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: loading a CharsetProvider via WebappClassLoader

2009-11-02 Thread Ronald Klop

Kris,

Thanks a lot for these pointers. It makes a lot very clear and we will do the 
dirty workaround now and vote for the bugs at the Sun website.

Ronald.


Op donderdag, 29 oktober 2009 16:48 schreef Kris Schneider 
kschnei...@gmail.com:


 
I guess this bug will be of interest since it mentions both jutf7 and

webapps ;-)

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4619777

On Thu, Oct 29, 2009 at 11:42 AM, Kris Schneider kschnei...@gmail.com wrote:
 While the Javadoc for CharsetProvider claims that providers are looked
 up via the current thread's context class loader, the code for Charset
 seems to clearly be using ClassLoader.getSystemClassLoader()...

 On Thu, Oct 29, 2009 at 10:51 AM, Ronald Klop
 ronald-mailingl...@base.nl wrote:
 Hi,

 I have this jar (jutf7.jar) which should register itself with the
 CharsetProvider of Java. If I put it in the WEB-INF/lib directory it is
 ignored by Java. I understand that this is because of order in which the
 WebappClassLoader asks all other classloaders for a class.
 How can this be solved? Withouting having to deploy a jar file outside of
 the webapp. Or is this not possible?

 Thanks in advance for any tips.

 Ronald.

 --
 Kris Schneider




--
Kris Schneider

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org








valve.invoke() called twice in request

2009-11-02 Thread Johan Thorselius
Why is my valve.invoke() called twice ?

I have developed my own valve like in the code below. I see that the
invoke() method is called twice in the same request - does anyone know why ?

Note that my trace in listValves() shows that it is only one instance of my
valve AuthValve and one of
'org.apache.catalina.core.StandardEngineValve/1.0' which registered with the
pipeline (there are two valves in the list).

Tomcat 6.0.20 is used.

Johan

-- snip ---

public class AuthValve extends ValveBase {

public AuthValve() {
}

@Override
public void event(Request arg0, Response arg1, CometEvent arg2) throws
IOException, ServletException {
}

@Override
public String getInfo() {
   return This is the AuthValve;
}

@Override
public Valve getNext() {
   return super.getNext();
}

@Override
public void invoke(Request request, Response response) throws
IOException, ServletException {

System.out.println(valve.invoke() thread:  +
Thread.currentThread().getName());
listValves();

String username = request.getHeader(h_name);
String rolename = request.getHeader(h_role);
System.out.println(valve.invoke() name: + username +  role: +
rolename + );

/*
 * Store info for LoginModule...
 */
NameStore.setName(username);
RoleStore.setRole(rolename);

getNext().invoke(request,response);
}


private void listValves() {

  Container container=this.getContainer();
  if( container == null || ! (container instanceof ContainerBase) )
 return;
  ContainerBase containerBase=(ContainerBase)container;
  Pipeline pipe=containerBase.getPipeline();
  Valve valves[]=pipe.getValves();

  System.out.println( This valve info: + this.getInfo() +  :  +
this.toString());
  for (int i = 0; i  valves.length; i++) {
Valve v = valves[i];
System.out.println( Valve  + String.valueOf(i) +  info: +
v.getInfo() +  :  + v.toString());
  }
}

}

-- end snip ---


Re: ConnectionPool question

2009-11-02 Thread Josh Gooding
It seems as though you cannot set the maxActive to -1 as you can in the
javax.sql.ConnectionPool for unlimited.

On Mon, Nov 2, 2009 at 4:36 AM, Konstantin Kolinko
knst.koli...@gmail.comwrote:

 2009/10/31 Josh Gooding josh.good...@gmail.com:
 (...)
   and I am getting a tomcat startup exception:
 
  WARNING: Unexpected exception resolving reference
  java.lang.IllegalArgumentException
 at java.util.concurrent.ArrayBlockingQueue.init(Unknown Source)
 at
  org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:367)

 Line 367 in ConnectorPool.java is

busy = new
 ArrayBlockingQueuePooledConnection(properties.getMaxActive(),false);

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




RE: valve.invoke() called twice in request

2009-11-02 Thread Caldarale, Charles R
 From: Johan Thorselius [mailto:johan.thorsel...@gmail.com]
 Subject: valve.invoke() called twice in request
 
 Why is my valve.invoke() called twice ?

Are you sure it's called twice in the same request?  Or is the browser making 
multiple requests for separate resources on the same page?

You could log the stack trace when invoked, and included additional information 
such as the result of the toString() method for both the Request and Response 
object.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Debian Linux and JAVA - _OPTS and _HOME

2009-11-02 Thread Massan

Hi,

What file I should modify to get these JAVA commands to work. I have tried
catalina.sh and almost all files in bin folder. Should it be like:

export JAVA_OPTS ...

And yes OS is Debian Linux.

Thanks buddys !
-- 
View this message in context: 
http://old.nabble.com/Debian-Linux-and-JAVA_OPTS-and-_HOME-tp26157106p26157106.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Debian Linux and JAVA - _OPTS and _HOME

2009-11-02 Thread Carsten Pohl
Have you tried

JRE_HOME=/usr/lib/jvm/java-6-sun/jre/ ./catalina.sh run

or in your case

JAVA-OPTS=-Dsth ./catalina.sh run
..


Regards,
Carsten

- Original Message -
From: Massan grant.mas...@gmail.com
To: users@tomcat.apache.org
Sent: Monday, 2 November, 2009 15:27:31 GMT +01:00 Amsterdam / Berlin / Bern / 
Rome / Stockholm / Vienna
Subject: Debian Linux and JAVA -  _OPTS and _HOME


Hi,

What file I should modify to get these JAVA commands to work. I have tried
catalina.sh and almost all files in bin folder. Should it be like:

export JAVA_OPTS ...

And yes OS is Debian Linux.

Thanks buddys !
-- 
View this message in context: 
http://old.nabble.com/Debian-Linux-and-JAVA_OPTS-and-_HOME-tp26157106p26157106.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Understanding context.xml

2009-11-02 Thread Markus Schönhaber
Carsten Pohl:

 If I change the testprojekt.xml in
 conf/Catalina/localhost/testprojekt.xml my webapplication will be
 redeployed (assuming the bug is fixed), and it would get the new
 values. If I change the conf/context.xml all my webapps will be
 RELOADED, but new values and changes to values in conf/context.xml
 will not be given to the webapp.

Hm, indeed.
If the changes in conf/context.xml aren't propagated to the webapps, I
don't see the point in reloading the apps on changes in that file.
But I don't know if this is a (known) bug or if it works as designed and
I'm simply misunderstanding how it's supposed to work.

 I am using the tomcat connection pooling to connect to a postgres DB,
 I would like to put the configuration (hostname, username, etc)
 somewhere, so that i can change it, when I change the databasehost.
 Where is the right place to put such a configuration?
 
 If i put the configuration in conf/context.xml the changes to the
 values wont be given to running applications.
 
 If i put it in the conf/Catalina/ the application will be
 redeployed, which causes downtimes.
 
 What is the right place to PUT and later change the connection infos
 to the database?

Well what is right for you depends on your needs.
I configure Resource elements in the webapp's context.xml - but YMMV.

Anyway: I don't know of a built-in method that would enable a webapp to
see changes in a Resource configuration without a reload of the app.
But maybe someone else can provide better/additional information.

-- 
Regards
  mks

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: valve.invoke() called twice in request

2009-11-02 Thread Johan Thorselius
 Are you sure it's called twice in the same
 request?  Or is the browser making multiple
 requests for separate resources on the
 same page?

Yes, sorry - they are multiple requests. A stack trace showed two reqeusts.
I was confused.

It's part of a bigger issue where 'I cannot get rid of the authentication
login user/pwd box' when using an authentication proxy in front of the
Tomcat.  I found that the call to the authentication login user/pwd box is
done approx. between my valve and the StandardEngineValve, or maybe rather
in the StandardEngineValve itself. After the authent. login user/pwd,
obviously my valve is called once again. My bigger issue I described in
another posting last friday.

Thanks

Johan


2009/11/2 Caldarale, Charles R chuck.caldar...@unisys.com

  From: Johan Thorselius [mailto:johan.thorsel...@gmail.com]
  Subject: valve.invoke() called twice in request
 
  Why is my valve.invoke() called twice ?

 Are you sure it's called twice in the same request?  Or is the browser
 making multiple requests for separate resources on the same page?

 You could log the stack trace when invoked, and included additional
 information such as the result of the toString() method for both the Request
 and Response object.

  - Chuck


 THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
 MATERIAL and is thus for use only by the intended recipient. If you received
 this in error, please contact the sender and delete the e-mail and its
 attachments from all computers.


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




Re: Debian Linux and JAVA - _OPTS and _HOME

2009-11-02 Thread André Warnier

Massan wrote:

Hi,

What file I should modify to get these JAVA commands to work. I have tried
catalina.sh and almost all files in bin folder. Should it be like:

export JAVA_OPTS ...

And yes OS is Debian Linux.


To answer your question directly, and in general :
You should create the file bin/setenv.sh if it is not there, then insert 
your environment values there.

This file is read by catalina.sh if it exists.

About Debian in particular, have a look also at /etc/init.d/tomcatxxx 
(where xxx is your tomcat version, which you did not say), and check how 
it does things (what it calls to start tomcat, in what order).




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat Manager sees distribution directories as applications

2009-11-02 Thread Jonathan Mast
You're right, I totally forgot to put appBase attributes in my Host
declarations.  However, httpd only lets *.jsp and *.do requests pass on to
Tomcat so I don't have to worry about the security issue.

I'm gonna put appBase attributes into my config and see if that fixes it.

thanks

On Fri, Oct 30, 2009 at 7:59 PM, Christopher Schultz 
ch...@christopherschultz.net wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Hassan,

 On 10/30/2009 5:07 PM, Hassan Schroeder wrote:
  On Fri, Oct 30, 2009 at 2:03 PM, Jonathan Mast
  jhmast.develo...@gmail.com wrote:
  When I log into the Tomcat Web Application Manager, in addition to the
  actual webapps defined in server.xml, it also lists the /bin, /conf,
 /logs,
  /temp, /lib and /work directories of the Tomcat installation as if they
 are
  webapps.
 
  I doubt this is correct, so how do I fix it?
 
  Sounds like your server.xml is wildly wrong. :-)

 +1

 I suspect you have something like this:

 Host appBase= ...

 If you thought I don't need a webapps directory because all my webapps
 are defined in their own XML files and you decided to just remove the
 appBase string, then you likely ended up setting your appBase to
 CATALINA_BASE and exposing all your configuration to the world.  If
 you're using JNDI DataSources, you might want to change your database
 passwords right about now. ;)

 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.10 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

 iEYEARECAAYFAkrri9sACgkQ9CaO5/Lv0PCWAACfQmyQyUGXH1JmWdC5KjjvPrhT
 psoAnAtiufYZvyqE8Fd4D9gZYm4Qa3UB
 =XY3t
 -END PGP SIGNATURE-

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




Tomcat service stops frequently after MS09-061 patch

2009-11-02 Thread chetan khadye
Hi,

We are facing an issue with the microsoft patch. We applied the patch
MS09-061 on our production and development environment which is
running on Windows server 2003. After the patch applied the tomcat
server stops responding the http requests after every 15 20 minutes.
The restarting of tomcat server seems resolving the issue.

We have removed the patch from our development environment to check if
the tomcat responds normally, and its working fine now.

Since the patch is critical it's mandatory to apply it. Kindly advice
what can be causing the issue of tomcat not responding the http
requests.

Please let me know if any more details are required.

Regards,
Chetan K.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: MISC; After one Tomcat Cluster node shutdown Session Replication working but a Hashmap object is getting empty

2009-11-02 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Imad,

On 11/1/2009 1:41 AM, Imad Hachem wrote:
 After setting a Tomcat Cluster of 2 nodes on separate machine, Session
 replication is working very fine except one library objects
 (QueryCrypt.jar included in this Web Project) having a Hashmap where we
 store Users SESSION ID.
 
 After one node shutdown, this Hashmap object is getting empty, note that
 all other session variables have been replicated successfully and
 SESSIONID.jvmRoute still the same which is correct and expected
 behavior.

If that node does /not/ shut down, can you observe that the HashMap is
correctly replicated to the other node? I suspect not.

My guess is that your HashMap has data other than just the SESSIONID,
and that data is not serializable.

Can you run this code against your HashMap in the session?

Map map = (Map)session.getAttribute(whatever);

for(Iterator i=map.entrySet().iterator(); i.hasNext(); )
{
  Map.Entry entry = (Map.Entry)i;

  Object key = entry.getKey();
  Object value = entry.getValue();

  System.out.print(key);
  System.out.print( ();
  System.out.print((null == key ? null : key.getClass().getName()));
  System.out.print() - );

  System.out.print(value);
  System.out.print( ();
  System.out.print((null == value
? null
: value.getClass().getName()));
  System.out.println());
}

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkru+DcACgkQ9CaO5/Lv0PAfgACbB7Vu9eKS/9rrfhYxqoBcKnv+
ARQAoKFbk70KLHU/dh+0CypVk839V2ku
=Vz81
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat service stops frequently after MS09-061 patch

2009-11-02 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chetan,

On 11/2/2009 10:14 AM, chetan khadye wrote:
 We are facing an issue with the microsoft patch. We applied the patch
 MS09-061 on our production and development environment which is
 running on Windows server 2003.

This patch is for the .NET framework and should not have broken
anything Tomcat related. Tomcat does not use .NET and neither, I'm
pretty sure, does any Java Virtual Machine on Microsoft Windows.

 We have removed the patch from our development environment to check if
 the tomcat responds normally, and its working fine now.

That certainly is strange.

Can you re-apply the patch in development and produce some log files? Is
the Tomcat process gracefully stopping (it will write log statements
about attempting to shut itself down) or does the process just die? Are
there errors in any log file that you can see?

 Since the patch is critical it's mandatory to apply it. Kindly advice
 what can be causing the issue of tomcat not responding the http
 requests.
 
 Please let me know if any more details are required.

Many more details are requied.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkru+jQACgkQ9CaO5/Lv0PDIhgCeOKCZuk2qw8J+l8SPfz+eHo3a
kQ0AnRmZlkQOuGyhHAbeyyre5lql3FCE
=6fzs
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat service stops frequently after MS09-061 patch

2009-11-02 Thread Peter Crowther
2009/11/2 chetan khadye chetan.kha...@gmail.com

 We are facing an issue with the microsoft patch. We applied the patch
 MS09-061 on our production and development environment which is
 running on Windows server 2003. After the patch applied the tomcat
 server stops responding the http requests after every 15 20 minutes.
 The restarting of tomcat server seems resolving the issue.

 We have removed the patch from our development environment to check if
 the tomcat responds normally, and its working fine now.

 Since the patch is critical it's mandatory to apply it. Kindly advice
 what can be causing the issue of tomcat not responding the http
 requests.

 Please let me know if any more details are required.


Java version?
Tomcat version?
Is it standalone or behind Apache httpd? If behind httpd, httpd version and
connector details?
Any exceptions in the Tomcat log files?
If you take a thread dump once the server has stalled, where are the threads
stalled?

This information *might* be enough to start debugging the issue.

- Peter


Re: Tomcat service stops frequently after MS09-061 patch

2009-11-02 Thread Pid

On 02/11/2009 15:14, chetan khadye wrote:

Hi,

We are facing an issue with the microsoft patch. We applied the patch
MS09-061 on our production and development environment which is
running on Windows server 2003. After the patch applied the tomcat
server stops responding the http requests after every 15 20 minutes.
The restarting of tomcat server seems resolving the issue.

We have removed the patch from our development environment to check if
the tomcat responds normally, and its working fine now.

Since the patch is critical it's mandatory to apply it. Kindly advice
what can be causing the issue of tomcat not responding the http
requests.


The unknown patch, whatever it does, is evidently causing the problem.
Microsoft will have more details about what it does.


Please let me know if any more details are required.


Unless I employ my patent-pending Internet Telepathy I think a *lot* 
more details are required.


e.g. Tomcat version, JVM version, what the patch is for... etc


p



Regards,
Chetan K.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat service stops frequently after MS09-061 patch

2009-11-02 Thread Pid

On 02/11/2009 15:30, Pid wrote:

On 02/11/2009 15:14, chetan khadye wrote:

Hi,

We are facing an issue with the microsoft patch. We applied the patch
MS??-??? on our production and development environment which is
running on Windows server . After the patch applied the tomcat
server stops responding the http requests after every ?? ?? minutes.
The restarting of tomcat server seems resolving the issue.

We have removed the patch from our development environment to check if
the tomcat responds normally, and its working fine now.

Since the patch is critical it's mandatory to apply it. Kindly advice
what can be causing the issue of tomcat not responding the http
requests.


The unknown patch


snip apologies, I appear to have some encoding issues... /snip


Please let me know if any more details are required.


Unless I employ my patent-pending Internet Telepathy I think a *lot*
more details are required.

e.g. Tomcat version, JVM version, what the patch is for... etc


p



Regards,
Chetan K.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org






-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat Manager sees distribution directories as applications

2009-11-02 Thread Jonathan Mast
OK I just added the appBase attr to a Host in my server.xml.  It did get rid
of the Tomcat install. folders showing up as webapps, but it isnt' doing
exactly what I thought it would do.  Now everything in my appBase shows up
in my Manager instance as belonging to that Host, when what I want there is
only those directories in my appBase that are referenced by Contexts in my
particular Host.

At least the old (appBase-less) method retained the logical mapping defined
in the Host section.

My reading of the Tomcat config docs seemed to indicate that each Host
should have it's own Manager Context defined as opposed to having a single
Manager instance that can span multiple Hosts.  Is this correct?



On Mon, Nov 2, 2009 at 10:05 AM, Jonathan Mast
jhmast.develo...@gmail.comwrote:

 You're right, I totally forgot to put appBase attributes in my Host
 declarations.  However, httpd only lets *.jsp and *.do requests pass on to
 Tomcat so I don't have to worry about the security issue.

 I'm gonna put appBase attributes into my config and see if that fixes it.

 thanks


 On Fri, Oct 30, 2009 at 7:59 PM, Christopher Schultz 
 ch...@christopherschultz.net wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Hassan,

 On 10/30/2009 5:07 PM, Hassan Schroeder wrote:
  On Fri, Oct 30, 2009 at 2:03 PM, Jonathan Mast
  jhmast.develo...@gmail.com wrote:
  When I log into the Tomcat Web Application Manager, in addition to the
  actual webapps defined in server.xml, it also lists the /bin, /conf,
 /logs,
  /temp, /lib and /work directories of the Tomcat installation as if they
 are
  webapps.
 
  I doubt this is correct, so how do I fix it?
 
  Sounds like your server.xml is wildly wrong. :-)

 +1

 I suspect you have something like this:

 Host appBase= ...

 If you thought I don't need a webapps directory because all my webapps
 are defined in their own XML files and you decided to just remove the
 appBase string, then you likely ended up setting your appBase to
 CATALINA_BASE and exposing all your configuration to the world.  If
 you're using JNDI DataSources, you might want to change your database
 passwords right about now. ;)

 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.10 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

 iEYEARECAAYFAkrri9sACgkQ9CaO5/Lv0PCWAACfQmyQyUGXH1JmWdC5KjjvPrhT
 psoAnAtiufYZvyqE8Fd4D9gZYm4Qa3UB
 =XY3t
 -END PGP SIGNATURE-

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org





Re: Will tomcat allow me to configur access to a single folder?

2009-11-02 Thread Josh Gooding
What I was saying is that in httpd, you can configure httpd to do what I
want, but I was unsure if you could in tomcat.  Since I'm not using httpd, I
just wanted to see if I can configure access to a specific folder in
Tomcat.  I am setting up a backup site for a group of people on my domain.
That's all.



On Mon, Nov 2, 2009 at 4:03 AM, André Warnier a...@ice-sa.com wrote:

 Josh Gooding wrote:

 Unlike Apache HTTPD, can Tomcat be configured to allow access to a single
 directory?

 Huh ?

 Which Apache http documentation have you been reading ?
 Not this one :
 http://httpd.apache.org/docs/2.2/howto/auth.html




 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




Re: Will tomcat allow me to configur access to a single folder?

2009-11-02 Thread André Warnier

Josh Gooding wrote:

What I was saying is that in httpd, you can configure httpd to do what I
want, but I was unsure if you could in tomcat.  Since I'm not using httpd, I
just wanted to see if I can configure access to a specific folder in
Tomcat.  I am setting up a backup site for a group of people on my domain.
That's all.


Josh Gooding wrote:


Unlike Apache HTTPD, can Tomcat be configured to allow access to a single
directory?


So, you really meant :
Q: Can Tomcat, like httpd, be configured to allow access to a single 
directory ?

A: yes.
:-)

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat Manager sees distribution directories as applications

2009-11-02 Thread Hassan Schroeder
On Mon, Nov 2, 2009 at 8:35 AM, Jonathan Mast
jhmast.develo...@gmail.com wrote:

 My reading of the Tomcat config docs seemed to indicate that each Host
 should have it's own Manager Context defined as opposed to having a single
 Manager instance that can span multiple Hosts.  Is this correct?

Yes, and its own appBase.

-- 
Hassan Schroeder  hassan.schroe...@gmail.com
twitter: @hassan

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat Manager sees distribution directories as applications

2009-11-02 Thread Jonathan Mast
So you are saying each Host *must* have it's own distinct appBase.  That
sucks, doing that will make my deployment process a nightmare.  Any way
around the problem I described above?

On Mon, Nov 2, 2009 at 11:02 AM, Hassan Schroeder 
hassan.schroe...@gmail.com wrote:

 On Mon, Nov 2, 2009 at 8:35 AM, Jonathan Mast
 jhmast.develo...@gmail.com wrote:

  My reading of the Tomcat config docs seemed to indicate that each Host
  should have it's own Manager Context defined as opposed to having a
 single
  Manager instance that can span multiple Hosts.  Is this correct?

 Yes, and its own appBase.

 --
 Hassan Schroeder  hassan.schroe...@gmail.com
 twitter: @hassan

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




RE: Tomcat Manager sees distribution directories as applications

2009-11-02 Thread Caldarale, Charles R
 From: Jonathan Mast [mailto:jhmast.develo...@gmail.com]
 Subject: Re: Tomcat Manager sees distribution directories as
 applications
 
 So you are saying each Host *must* have it's own distinct appBase.
 That sucks, doing that will make my deployment process a nightmare.
 Any way around the problem I described above?

Perhaps you can tell us exactly what you're trying to achieve...

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Compression and SSL

2009-11-02 Thread Jeffrey Janner
OK, another newbie-ish question here.

 

I am using Tomcat 5.5.x with APR/native libraries on Windows 2003 x32 or
Windows 2008 x64 to serve applications from the US to Asia-based
clients.

We encrypt everything using SSL, from Login page onward, with
transport-guarantee of CONFIDENTIAL. 

All URLs are configured as relative, i.e., /images/picture.png,
/APP1?param1=value, etc.

We use Tomcat as the web server with no intervening proxies,
load-balancers, accelerators, etc.

Response time is noticeably slow (based on complaint level) and I am
looking for ways to improve it.

Will setting the HTTPS connector compression=on actually compress the
data for HTTPS?

Does it compress before or after applying the encryption?

 

And,  in case it's relevant, here is the relevant excerpt from the
web.xml file we use:

 

  security-constraint

web-resource-collection

  web-resource-nameEverything/web-resource-name

  url-pattern*.jsp/url-pattern

  url-pattern*.html/url-pattern

  url-pattern*.js/url-pattern

  url-pattern/APP1/url-pattern

  url-pattern/APP2/url-pattern

/web-resource-collection

user-data-constraint

  transport-guaranteeCONFIDENTIAL/transport-guarantee

/user-data-constraint

  /security-constraint

 

Any assistance would be much appreciated.

 

Jeff


***  NOTICE  *
This message is intended for the use of the individual or entity to which 
it is addressed and may contain information that is privileged, 
confidential, and exempt from disclosure under applicable law.  If the 
reader of this message is not the intended recipient or the employee or 
agent responsible for delivering this message to the intended recipient, 
you are hereby notified that any dissemination, distribution, or copying 
of this communication is strictly prohibited.  If you have received this 
communication in error, please notify us immediately by reply or by 
telephone (call us collect at 512-343-9100) and immediately delete this 
message and all its attachments.


Tomcat 5.5.20 Installation Issues for IIS Redirect

2009-11-02 Thread Corrin, Simon P
Hello,

I am new at this, but am having some trouble getting Tomcat 5.5.20
installed the way I would like to.  I am trying to install the Windows
EXE for version 5.5.20 which seems to work fine.  The next part is where
I am having issues.  I am trying to set it up to run Single Sign On
through IIS and need to modify the worker.properties file for example.
Yet, the file is not in the config folder and doesn't exist in the
installation.  When I go to the SRC file it is in there, but does not
get installed for some reason.  I did see the documentation on setting
up the IIS Redirect but I don't have the files they are looking for as a
part of my installation.  Can anyone help me out to get this version
installed correctly so I can use IIS Redirect to set up SSO?

Thanks in advance for your help on this.

Thanks!

Simon.


how to change the url,username and password connection pooling

2009-11-02 Thread Carsten Pohl
Hi,

I wrote a webapp, that is using tomcats connection pooling. I was wondering how 
I can change URL / username or password of the connection pool, without 
redeploying the webapp.

I tried the following:

1. putting the configuration in the 
$CATALINA_BASE/conf/[enginename]/[hostname]/[webappname].xml and then changing 
the ressource entries. This works (in 6.0.18) but a redeploy happens. Which 
means, that the application is unavailable for some time.

2. Using JMX to connect to the tomcat. Under catalina - datasource - 
webappname - localhost- javax.sql.datasource - jdbc/postgres - attributes 
 i see the URL, but when i change that, nothing happens.

What possiblities are left? Or is there simply no way to change that, while the 
application runs?

Thank you in advance,
Regards,
Carsten Pohl

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat Manager sees distribution directories as applications

2009-11-02 Thread Hassan Schroeder
On Mon, Nov 2, 2009 at 9:22 AM, Jonathan Mast
jhmast.develo...@gmail.com wrote:
 So you are saying each Host *must* have it's own distinct appBase.

Not must, but that's the easy/simple/standard way to do it, and of
course you're free to complicate your life in any number of ways by
fighting it.  :-)

 That
 sucks, doing that will make my deployment process a nightmare.  Any way
 around the problem I described above?

Uh, nightmare? If it were me I'd fix that deployment process. YMMV.

-- 
Hassan Schroeder  hassan.schroe...@gmail.com
twitter: @hassan

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: MISC; After one Tomcat Cluster node shutdown Session Replication working but a Hashmap object is getting empty

2009-11-02 Thread Imad Hachem
Dear chris,

Thanks for your reply.

You are right about the case of Tomcat Node non shutdown, HashMap is not
replicated correctly to the other node.

Note that I am saving a secretKey (javax.crypto.SecretKey) as a VALUE
for the sessionid KEY stored in the HashMap.

How can I make sure that this secretKey or all HaspMap data are
serializable?

Note I am using the below code to store in the HashMap:

static HashMap userSessionMapArray = new HashMap();
SecretKey   b =
KeyGenerator.getInstance(DESede).generateKey();
QueryCryptUser  qcu = new QueryCryptUser(sessionID, b);
userSessionMapArray.put(sessionID, qcu);


Note that I have tried to create the QueryCryptUser Class to
implements java.io.Serializable but still facing the same problem and
HashMap not replicated to the 2nd Node.




Imad Hachem | Asst.Product Development Manager
e-Banking Department
Path Solutions
Tel: +961 1 697444 ext. 222
Fax: +961 1 696744
www.path-solutions.com



Disclaimer
[The information contained in this e-mail message and any attached files
are confidential information and intended solely for the use of the
individual or entity to whom they are addressed. This transmission may
contain information that is privileged, confidential or exempt from
disclosure under applicable law. If you have received this e-mail in
error, please notify the sender immediately and delete all copies. If
you are not the intended recipient, any disclosure, copying,
distribution, or use of the information contained herein is STRICTLY
PROHIBITED. Path Solutions accepts no responsibility for any errors,
omissions, computer viruses and other defects.]
 
 
 

-Original Message-
From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
Sent: Monday, November 02, 2009 5:18 PM
To: Tomcat Users List
Subject: Re: MISC; After one Tomcat Cluster node shutdown Session
Replication working but a Hashmap object is getting empty

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Imad,

On 11/1/2009 1:41 AM, Imad Hachem wrote:
 After setting a Tomcat Cluster of 2 nodes on separate machine, Session
 replication is working very fine except one library objects
 (QueryCrypt.jar included in this Web Project) having a Hashmap where
we
 store Users SESSION ID.
 
 After one node shutdown, this Hashmap object is getting empty, note
that
 all other session variables have been replicated successfully and
 SESSIONID.jvmRoute still the same which is correct and expected
 behavior.

If that node does /not/ shut down, can you observe that the HashMap is
correctly replicated to the other node? I suspect not.

My guess is that your HashMap has data other than just the SESSIONID,
and that data is not serializable.

Can you run this code against your HashMap in the session?

Map map = (Map)session.getAttribute(whatever);

for(Iterator i=map.entrySet().iterator(); i.hasNext(); )
{
  Map.Entry entry = (Map.Entry)i;

  Object key = entry.getKey();
  Object value = entry.getValue();

  System.out.print(key);
  System.out.print( ();
  System.out.print((null == key ? null : key.getClass().getName()));
  System.out.print() - );

  System.out.print(value);
  System.out.print( ();
  System.out.print((null == value
? null
: value.getClass().getName()));
  System.out.println());
}

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkru+DcACgkQ9CaO5/Lv0PAfgACbB7Vu9eKS/9rrfhYxqoBcKnv+
ARQAoKFbk70KLHU/dh+0CypVk839V2ku
=Vz81
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Tomcat 6.0.20 on 64bit Window2003 - Service CAN'T start

2009-11-02 Thread tiffany.d...@inovis.com

The log says below. Note errors on lines 4 and 5.

1/  [2009-10-30 14:23:26] [info] Procrun (2.0.4.0) started
2/  [2009-10-30 14:23:26] [info] Running Service...
3/  [2009-10-30 14:23:26] [info] Starting service...
4/  [2009-10-30 14:23:26] [994  prunsrv.c] [error] Failed creating java 
5/  [2009-10-30 14:23:26] [1269 prunsrv.c] [error] ServiceStart returned 1
6/  [2009-10-30 14:23:26] [info] Run service finished.
7/  [2009-10-30 14:23:26] [info] Procrun finished.

Tiffany K. Dinh
Software QA Engineer
18300 Von Karman, suite 800
Irvine, CA 92612
+1 949.838.1070 direct
tiffany.d...@inovis.com
www.inovis.com

 
-Original Message-
From: Martin Gainty [mailto:mgai...@hotmail.com] 
Sent: Friday, October 30, 2009 4:36 PM
To: Tomcat Users List
Subject: RE: Tomcat 6.0.20 on 64bit Window2003 - Service CAN'T start


sc query tomcat

what do the logs say?

Martin 
__ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.




 From: tiffany.d...@inovis.com
 To: users@tomcat.apache.org
 Date: Fri, 30 Oct 2009 16:25:28 -0700
 Subject: Tomcat 6.0.20 on 64bit Window2003 - Service CAN'T start
 
 I installed Tomcat 6.0.20 on my 64bit Window2003. I installed the service. 
 But the Service did not start. Jakarta_service_mmdd.log file logs the 
 below:
 
 
 
 [994  prunsrv.c] [error] Failed creating java and
 
 [1269 prunsrv.c] [error] ServiceStart returned 1
 
 
 
 Please help me to run the service successfully.
 
 
 
 Thanks,
 
 Tiffany Dinh
 
 
 
  
_
Windows 7: Simplify your PC. Learn more.
http://www.microsoft.com/Windows/windows-7/default.aspx?ocid=PID24727::T:WLMTAGL:ON:WL:en-US:WWL_WIN_evergreen1:102009

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Compression and SSL

2009-11-02 Thread Pid

On 02/11/2009 16:48, Jeffrey Janner wrote:

OK, another newbie-ish question here.



I am using Tomcat 5.5.x with APR/native libraries on Windows 2003 x32 or
Windows 2008 x64 to serve applications from the US to Asia-based
clients.

We encrypt everything using SSL, from Login page onward, with
transport-guarantee  of CONFIDENTIAL.

All URLs are configured as relative, i.e., /images/picture.png,
/APP1?param1=value, etc.

We use Tomcat as the web server with no intervening proxies,
load-balancers, accelerators, etc.

Response time is noticeably slow (based on complaint level) and I am
looking for ways to improve it.


Bigger server?


Will setting the HTTPS connector compression=on actually compress the
data for HTTPS?


What makes you think that compressing things is going to improve 
matters?  Doing the compression is an overhead itself.


What's slow about your app and how do you know it?



Does it compress before or after applying the encryption?

And,  in case it's relevant, here is the relevant excerpt from the
web.xml file we use:



   security-constraint

 web-resource-collection

   web-resource-nameEverything/web-resource-name

   url-pattern*.jsp/url-pattern

   url-pattern*.html/url-pattern

   url-pattern*.js/url-pattern


Brevity:

  url-pattern/*/url-pattern


   url-pattern/APP1/url-pattern
   url-pattern/APP2/url-pattern


If those actually represent real webapps, with their own 
WEB-INF/web.xml, the lines above don't do anything.


p



 /web-resource-collection

 user-data-constraint

   transport-guaranteeCONFIDENTIAL/transport-guarantee

 /user-data-constraint

   /security-constraint



Any assistance would be much appreciated.



Jeff


***  NOTICE  *
This message is intended for the use of the individual or entity to which
it is addressed and may contain information that is privileged,
confidential, and exempt from disclosure under applicable law.  If the
reader of this message is not the intended recipient or the employee or
agent responsible for delivering this message to the intended recipient,
you are hereby notified that any dissemination, distribution, or copying
of this communication is strictly prohibited.  If you have received this
communication in error, please notify us immediately by reply or by
telephone (call us collect at 512-343-9100) and immediately delete this
message and all its attachments.




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: MISC; After one Tomcat Cluster node shutdown Session Replication working but a Hashmap object is getting empty

2009-11-02 Thread Pid

On 02/11/2009 17:33, Imad Hachem wrote:

Dear chris,

Thanks for your reply.

You are right about the case of Tomcat Node non shutdown, HashMap is not
replicated correctly to the other node.

Note that I am saving a secretKey (javax.crypto.SecretKey) as a VALUE
for the sessionid KEY stored in the HashMap.

How can I make sure that this secretKey or all HaspMap data are
serializable?

Note I am using the below code to store in the HashMap:

static HashMap userSessionMapArray = new HashMap();
SecretKey   b =
KeyGenerator.getInstance(DESede).generateKey();
QueryCryptUser  qcu = new QueryCryptUser(sessionID, b);
userSessionMapArray.put(sessionID, qcu);


Why is the HashMap static?
I don't think the code above will cause anything to replicate.


Note that I have tried to create the QueryCryptUser Class to
implements java.io.Serializable but still facing the same problem and
HashMap not replicated to the 2nd Node.


Are you storing the QueryCryptUser, or the HashMap in an HTTPSession 
somewhere else?


What is it that you are actually trying to achieve?


p



Imad Hachem | Asst.Product Development Manager
e-Banking Department
Path Solutions
Tel: +961 1 697444 ext. 222
Fax: +961 1 696744
www.path-solutions.com



Disclaimer
[The information contained in this e-mail message and any attached files
are confidential information and intended solely for the use of the
individual or entity to whom they are addressed. This transmission may
contain information that is privileged, confidential or exempt from
disclosure under applicable law. If you have received this e-mail in
error, please notify the sender immediately and delete all copies. If
you are not the intended recipient, any disclosure, copying,
distribution, or use of the information contained herein is STRICTLY
PROHIBITED. Path Solutions accepts no responsibility for any errors,
omissions, computer viruses and other defects.]




-Original Message-
From: Christopher Schultz [mailto:ch...@christopherschultz.net]
Sent: Monday, November 02, 2009 5:18 PM
To: Tomcat Users List
Subject: Re: MISC; After one Tomcat Cluster node shutdown Session
Replication working but a Hashmap object is getting empty

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Imad,

On 11/1/2009 1:41 AM, Imad Hachem wrote:

After setting a Tomcat Cluster of 2 nodes on separate machine, Session
replication is working very fine except one library objects
(QueryCrypt.jar included in this Web Project) having a Hashmap where

we

store Users SESSION ID.

After one node shutdown, this Hashmap object is getting empty, note

that

all other session variables have been replicated successfully and
SESSIONID.jvmRoute still the same which is correct and expected
behavior.


If that node does /not/ shut down, can you observe that the HashMap is
correctly replicated to the other node? I suspect not.

My guess is that your HashMap has data other than just the SESSIONID,
and that data is not serializable.

Can you run this code against your HashMap in the session?

Map map = (Map)session.getAttribute(whatever);

for(Iterator i=map.entrySet().iterator(); i.hasNext(); )
{
   Map.Entry entry = (Map.Entry)i;

   Object key = entry.getKey();
   Object value = entry.getValue();

   System.out.print(key);
   System.out.print( ();
   System.out.print((null == key ? null : key.getClass().getName()));
   System.out.print() -  );

   System.out.print(value);
   System.out.print( ();
   System.out.print((null == value
 ? null
 : value.getClass().getName()));
   System.out.println());
}

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkru+DcACgkQ9CaO5/Lv0PAfgACbB7Vu9eKS/9rrfhYxqoBcKnv+
ARQAoKFbk70KLHU/dh+0CypVk839V2ku
=Vz81
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat hangs when reloading context if user is logged in

2009-11-02 Thread James Murphy

Chris,

Thanks for the response. I went ahead and got the info you requested.

Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

James,

On 10/30/2009 9:05 AM, James Murphy wrote:
  

Some background info:
OS: Windows Server 2003
Tomcat Version: 5.5
JDK Version: 1.6.0

I've run into a very annoying problem while trying to enable
automatic context reload on our development server. It works well
when there is not a user logged on to the system (I guess that means
while there is session info on the server), but if someone is logged
in, then Tomcat fails to reload the context.



I can confirm that Tomcat 5.5.26 both reloads and stops properly when
multiple sessions are active. Persist-to-disk works as expected, and
sessions are retained across the restart/reload.

I suspect there is a problem with your specific webapp and/or setup.
  

My thoughts too, I'm just not sure where to look.
  

Another issue that may be related to this is that Tomcat will not
shutdown cleanly when someone is logged in (Tomcat hangs at INFO:
Stopping service Catalina). Rather, we must close the console window
forcefully, then start the server back up to an error (IOException
while loading persisted sessions: java.io.EOFException)



That's interesting: your session (de)serialization is failing because
the file is incomplete. I suspect this is because the sessions are not
correctly written to the file before application stop. Perhaps session
serialization is the actual problem.

Can you attempt to shut down Tomcat and then check:
1. A few thread dumps
(http://wiki.apache.org/tomcat/HowTo#How_do_I_obtain_a_thread_dump_of_my_running_webapp_.3F)
  

I put them at the bottom of the message.

2. The CPU usage of your webapp and/or threads
  
The CPU usage jumped to about 05% right before it hung, and then fell to 
00% and stayed there. Memory usage held steady at 37K.

I'm wondering if serialization is either running-away (infinite loop,
etc.) or stalling (waiting for access to a locked object) and it's never
completing.

  
Looks to me like it's waiting for a locked object, like you said, rather 
than hitting an infinite loop.

I used jstack to get a stack trace on the Tomcat process when it hung
on context reload. I won't post the details unless someone thinks
they might be helpful (Don't want to fill the email with too much
stuff).



I think they might be. Go ahead and post the thread dump.
  

See the bottom of the message.
  

However, I know I read somewhere that Tomcat will hang on shutdown
if there is a non-daemon thread still running.



While this is true, it shouldn't block a webapp from reloading (it will
leave the old webapp in memory, so the old webapp won't really go away
completely, but the new webapp should load in its place and handle
requests).

  

jstack reports three non-daemon threads: main, VM Thread, and VM
Periodic Task Thread. I don't think that's causing the problem, but
figured I'd better let you know anyway.



Nope, those are normal.
  


Here are a couple of thread dumps of tomcat, the first taken about 5 
seconds after the hang, and the second a couple of minutes later, while 
still hung.
Note that in the main methods, there is one stack frame with some XX's 
in it. I put those there to cover the name of a method which could 
identify our company. Nothing personal, I'm just not allowed to let that 
information leak out.
After seeing that stack frame, however, I looked into the method which 
it referenced. It appears to be sending a HTTP POST message to a servlet 
which we have running, which is supposed to log the user out when it 
recieves said message. Could the problem be that the servlet is shut 
down before the message reaches it?


--
--
--

2009-11-02 13:10:11
Full thread dump Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, 
sharing):


http-80-6 daemon prio=6 tid=0x0322a400 nid=0xb10 in Object.wait() 
[0x03d5f000..0x03d5fb18]

  java.lang.Thread.State: WAITING (on object monitor)
   at java.lang.Object.wait(Native Method)
   - waiting on 0x181530c0 (a 
org.apache.tomcat.util.net.JIoEndpoint$Worker)

   at java.lang.Object.wait(Object.java:485)
   at 
org.apache.tomcat.util.net.JIoEndpoint$Worker.await(JIoEndpoint.java:423)

   - locked 0x181530c0 (a org.apache.tomcat.util.net.JIoEndpoint$Worker)
   at 
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:449)

   at java.lang.Thread.run(Thread.java:619)

http-80-5 daemon prio=6 tid=0x02f89400 nid=0xe2c in Object.wait() 
[0x03cbf000..0x03cbfc18]

  java.lang.Thread.State: WAITING (on object monitor)
   at java.lang.Object.wait(Native Method)
   - waiting on 0x18153148 (a 
org.apache.tomcat.util.net.JIoEndpoint$Worker)

   at 

[OT] App Server Safari

2009-11-02 Thread Pid

Tomcat spotted in the wild.

http://www.theregister.co.uk/2009/11/02/virgin_america_start_up_thinks_big/page2.html


p

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Compression and SSL

2009-11-02 Thread André Warnier

Jeffrey Janner wrote:

OK, another newbie-ish question here.


Then a dummy-ish answer may be sufficient :



Will setting the HTTPS connector compression=on actually compress the
data for HTTPS?


It will compress all data it would compress it it wasn't HTTPS.



Does it compress before or after applying the encryption?


Before.
HTTPS is at a lower level, at the connection level.
I'm not even sure that Tomcat is really involved.  As far as responses 
are concerned, Tomcat probably just hands them over to the socket (in 
clear, normal), and it is the socket which does the SSL encryption.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat hangs when reloading context if user is logged in

2009-11-02 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

James,

On 11/2/2009 1:32 PM, James Murphy wrote:
 Here are a couple of thread dumps of tomcat, the first taken about 5
 seconds after the hang, and the second a couple of minutes later, while
 still hung.

Okay.

 Note that in the main methods, there is one stack frame with some XX's
 in it. I put those there to cover the name of a method which could
 identify our company. Nothing personal, I'm just not allowed to let that
 information leak out.

No problem: this is always good practice. Thanks for mentioning it,
though :)

 After seeing that stack frame, however, I looked into the method which
 it referenced. It appears to be sending a HTTP POST message to a servlet
 which we have running, which is supposed to log the user out when it
 recieves said message. Could the problem be that the servlet is shut
 down before the message reaches it?


Most of these all look the same. That is, they are just waiting for
requests to come in:

 http-80-6 daemon prio=6 tid=0x0322a400 nid=0xb10 in Object.wait()
 [0x03d5f000..0x03d5fb18]
   java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on 0x181530c0 (a

[snip]

 main prio=6 tid=0x00297000 nid=0xb18 runnable [0x0088f000..0x0088fe58]
   java.lang.Thread.State: RUNNABLE
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:258)
at java.io.BufferedInputStream.read(BufferedInputStream.java:317)
- locked 0x1698bc98 (a java.io.BufferedInputStream)
at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:632)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:577)
at
 sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1004)
 
- locked 0x16981bd0 (a sun.net.www.protocol.http.HttpURLConnection)
at com.oreilly.servlet.HttpMessage.sendPostMessage(HttpMessage.java:141)
at
 com.XXX.bean.SessionListener.valueUnbound(SessionListener.java:44)
 
at
 org.apache.catalina.session.StandardSession.removeAttributeInternal(StandardSession.java:1654)
 
at
 org.apache.catalina.session.StandardSession.writeObject(StandardSession.java:1507)
 
at
 org.apache.catalina.session.StandardSession.writeObjectData(StandardSession.java:959)
 
at
 org.apache.catalina.session.StandardManager.doUnload(StandardManager.java:517)

It looks like the StandardManager is trying to persist your sessions,
which is proper behavior (unless you have disabled it). You have a
listener that, as you mentioned, is making an outgoing HTTP connection.

Is it connecting to another webapp, or to the same webapp? If you're
trying to connect to the same webapp, then it's possible that Tomcat has
paused all your Connectors, and they aren't accepting any connections.
In that case, you'll wait for a long time (and possibly repeatedly
attempt connections) before your POST fails.

If the above describes your situation, may I recommend that, instead of
making an HTTP POST back to your own webapp, you instead make a regular
Java method call to process this logout stuff? It shouldn't be that
tough to refactor your code to allow your logout logic to be called
either from an HTTP request or from an explicit method call.

Your second thread dump shows the main thread stuck in the same place:

 main prio=6 tid=0x00297000 nid=0xb18 runnable [0x0088f000..0x0088fe58]
   java.lang.Thread.State: RUNNABLE
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:258)
at java.io.BufferedInputStream.read(BufferedInputStream.java:317)
- locked 0x1698bc98 (a java.io.BufferedInputStream)
at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:632)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:577)
at
 sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1004)
 
- locked 0x16981bd0 (a sun.net.www.protocol.http.HttpURLConnection)
at com.oreilly.servlet.HttpMessage.sendPostMessage(HttpMessage.java:141)
at
 com.XXX.bean.SessionListener.valueUnbound(SessionListener.java:44)

Yup: still waiting.

Try calling your logout logic without using an HTTP POST and I think
you'll find that things start working more reasonably for you.

Good luck,
- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkrvLKAACgkQ9CaO5/Lv0PCuZwCgrpXZFpDQKvWcHXqy3eqw/Ra2
sAIAnjnhp5a8eeK/vf3sBsTtCeJg3hCZ
=dILD
-END PGP SIGNATURE-


Re: Tomcat 6.0.20 on 64bit Window2003 - Service CAN'T start

2009-11-02 Thread André Warnier

tiffany.d...@inovis.com wrote:

The log says below. Note errors on lines 4 and 5.

1/  [2009-10-30 14:23:26] [info] Procrun (2.0.4.0) started
2/  [2009-10-30 14:23:26] [info] Running Service...
3/  [2009-10-30 14:23:26] [info] Starting service...
4/  [2009-10-30 14:23:26] [994  prunsrv.c] [error] Failed creating java 


2 guesses :
- either it does not have the right path to the java JVM
- or you are trying to run a 32-bit JVM n a 64-bit machine or vice-versa


5/  [2009-10-30 14:23:26] [1269 prunsrv.c] [error] ServiceStart returned 1
6/  [2009-10-30 14:23:26] [info] Run service finished.
7/  [2009-10-30 14:23:26] [info] Procrun finished.

Tiffany K. Dinh
Software QA Engineer
18300 Von Karman, suite 800
Irvine, CA 92612


Funny. I used to work for a small computer company which had its first 
address there.  Alpha Microsystems.



+1 949.838.1070 direct
tiffany.d...@inovis.com
www.inovis.com


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Compression and SSL

2009-11-02 Thread George Sexton
 -Original Message-
 From: Pid [mailto:p...@pidster.com]
 Sent: Monday, November 02, 2009 11:12 AM
 To: Tomcat Users List
 Subject: Re: Compression and SSL
 
 On 02/11/2009 16:48, Jeffrey Janner wrote:
  OK, another newbie-ish question here.
 
 
 
  I am using Tomcat 5.5.x with APR/native libraries on Windows 2003 x32
 or
  Windows 2008 x64 to serve applications from the US to Asia-based
  clients.
 
  We encrypt everything using SSL, from Login page onward, with
  transport-guarantee  of CONFIDENTIAL.
 
  All URLs are configured as relative, i.e., /images/picture.png,
  /APP1?param1=value, etc.
 
  We use Tomcat as the web server with no intervening proxies,
  load-balancers, accelerators, etc.
 
  Response time is noticeably slow (based on complaint level) and I am
  looking for ways to improve it.
 
 Bigger server?
 
  Will setting the HTTPS connector compression=on actually compress
 the
  data for HTTPS?
 
 What makes you think that compressing things is going to improve
 matters?  Doing the compression is an overhead itself.
 

In general, Compressing HTML can help a great deal for any case besides a
local network.

A typical HTML page will compress by a factor of 6 or so. Compressing a 42 K
page can result in a 7K page. This reduces the typical packet count from 28
or so to around 5. 

Even with the overhead of compressing the HTML on the server, and
decompressing it, this can yield a great performance improvement for any
user. If there are fewer packets, there are fewer lost packets.
Additionally, you're reducing the overhead of sending the packets through
the OS.

If you're serving a great deal of data, through a pipe of a fixed size, this
effectively makes your pipe 6 times bigger (assuming it's mostly HTML you
move). So, your pipe isn't as full, and you're not paying for as much
bandwidth.


So, compression of HTML is a really valid technique that will be helpful for
any case beyond the local network. The one caveat is the compressability of
the data. For example, you're not going to get much improvement attempting
to compress JPG images.


George Sexton
MH Software, Inc.
http://www.mhsoftware.com/
Voice: 303 438 9585


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Compression and SSL

2009-11-02 Thread Peter Crowther
2009/11/2 George Sexton geor...@mhsoftware.com

 In general, Compressing HTML can help a great deal for any case besides a
 local network.


... or a CPU-limited server.

To the OP: What's the bottleneck in your environment?  CPU?  Disk I/O?
Network bandwidth?  Measure the problem, *then* look for solutions to the
problem that actually exists.  If you've measured and you have CPU to spare
but are bandwidth-limited, then compression will help a great deal!

- Peter


Re: Tomcat Manager sees distribution directories as applications

2009-11-02 Thread Jonathan Mast
By nightmare I meant complexity.  Currently all my webapps are located in a
single directory, its flat, it only contains webapps (IE. folders with a
WEB-INF directory).  I have approximately a dozen Hosts defined across 3
domain names (and every intention of adding more).  Some Hosts have single
Contexts, but others have dozens of Contexts defined.  If each Host must
have it's own unique appBase for the Manager to work correctly, then that
entails a 3 level structure for my webserver's document root:
/
--/webapps
-/host_MY_HOST
---/MY_CONTEXT

Which means reworking the build scripts for each and every webapp.  If this
is the only way to have the manager work correctly, then I guess I'll have
to do.  I just don't understand why the server.xml cannot be interpreted as
a logical structure.

If I can define a /blahblah Context on a docBase of foobar-webapp (a
logical or arbitrary mapping) why can't Contexts be understood as belonging
to certain arbitrary Hosts, regardless of their filepath?


On Mon, Nov 2, 2009 at 12:11 PM, Hassan Schroeder 
hassan.schroe...@gmail.com wrote:

 On Mon, Nov 2, 2009 at 9:22 AM, Jonathan Mast
 jhmast.develo...@gmail.com wrote:
  So you are saying each Host *must* have it's own distinct appBase.

 Not must, but that's the easy/simple/standard way to do it, and of
 course you're free to complicate your life in any number of ways by
 fighting it.  :-)

  That
  sucks, doing that will make my deployment process a nightmare.  Any way
  around the problem I described above?

 Uh, nightmare? If it were me I'd fix that deployment process. YMMV.

 --
 Hassan Schroeder  hassan.schroe...@gmail.com
 twitter: @hassan

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




RE: Compression and SSL

2009-11-02 Thread George Sexton

 -Original Message-
 From: peter.crowth...@googlemail.com
 [mailto:peter.crowth...@googlemail.com] On Behalf Of Peter Crowther
 Sent: Monday, November 02, 2009 12:35 PM
 To: Tomcat Users List
 Subject: Re: Compression and SSL
 
 2009/11/2 George Sexton geor...@mhsoftware.com
 
  In general, Compressing HTML can help a great deal for any case
 besides a
  local network.
 

You didn't read the original post very closely.

 to serve applications from the US to Asia-based clients.

It's bandwidth and latency.


 
 ... or a CPU-limited server.
 
 To the OP: What's the bottleneck in your environment?  CPU?  Disk I/O?
 Network bandwidth?  Measure the problem, *then* look for solutions to
 the
 problem that actually exists.  If you've measured and you have CPU to
 spare
 but are bandwidth-limited, then compression will help a great deal!
 
 - Peter


George Sexton
MH Software, Inc.
http://www.mhsoftware.com/
Voice: 303 438 9585



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat Manager sees distribution directories as applications

2009-11-02 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Jonathan,

On 11/2/2009 2:37 PM, Jonathan Mast wrote:
 By nightmare I meant complexity.  Currently all my webapps are located in a
 single directory, its flat, it only contains webapps (IE. folders with a
 WEB-INF directory).  I have approximately a dozen Hosts defined across 3
 domain names (and every intention of adding more).  Some Hosts have single
 Contexts, but others have dozens of Contexts defined.

This shouldn't be a problem.

 If each Host must
 have it's own unique appBase for the Manager to work correctly

This is not altogether true. If you want to deploy all of your webapps
individually and explicitly using files in
conf/Catalina/[host]/[context].xml, then you can set all the Host
appBase's to the same empty directory if you want. It shouldn't be a
problem as long as you don't put anything in there.

But yes, if you want to be entirely safe, it wouldn't be a bad idea to
create an empty appBase directory for each host. This shouldn't
represent too much of a problem to create empty directories, right?

At any rate, it might be a good idea to request an enhancement in Tomcat
to allow an appBase-less Host for just this situation.

 then that
 entails a 3 level structure for my webserver's document root:
 /
 --/webapps
 -/host_MY_HOST
 ---/MY_CONTEXT

While this is not strictly necessary, it is recommended technique. It
will save you from having to put lots of
conf/Catalina/[host]/[context].xml files all over the place, too, since
you can simply auto-deploy them.

 Which means reworking the build scripts for each and every webapp.

Changing the target directory for a build script should be trivial. Is
it not in your deployment process?

 If this is the only way to have the manager work correctly, then I
 guess I'll have to do.

None of this really has anything to do with the Manager app itself,
really. You can choose to deploy or not deploy the Manager into each Host.

 I just don't understand why the server.xml cannot be interpreted as
 a logical structure.

I'm not sure I understand your statement, here.

 If I can define a /blahblah Context on a docBase of foobar-webapp (a
 logical or arbitrary mapping) why can't Contexts be understood as belonging
 to certain arbitrary Hosts, regardless of their filepath?

They can, if you use the conf/Catalina/[host]/[context].xml-style
deployment.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkrvOoEACgkQ9CaO5/Lv0PA0hACeOCAtVq6kNV1YatXHtw54qa7r
XEwAn0gMamfFFN3BcgCpHGGA2JLwqGxb
=12aZ
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Compression and SSL

2009-11-02 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Jeffrey,

On 11/2/2009 11:48 AM, Jeffrey Janner wrote:
 We encrypt everything using SSL, from Login page onward, with
 transport-guarantee of CONFIDENTIAL. 

[snip]

 Response time is noticeably slow (based on complaint level) and I am
 looking for ways to improve it.

The real question is: how much slower is it than non-secure HTTP? If the
answer is a lot slower, then you should focus your efforts on
improving the SSL performance. Here are some suggestions in that vein
(from most significant to least, IMO):

1. [Per Pid] Get a bigger machine. More CPU cycles are always helpful
2. Get an SSL accelerator board/appliance. That's what they're there for
3. Switch architectures to something that is better. This is getting to
be hard to do since it looks like x86 and x86-64 are pretty much going
to be the way of the future. My experience in the past was that a single
Sun server could handle a significantly higher load more quickly than
(roughly) equivalent CPU x86 horsepower.
4. Choose a simpler SSL cipher. Some ciphers take much more CPU than
others. Similar to #3, this is less likely to be useful, as simpler
ciphers suck, which is why they are faster :)

If compressing HTTP-only traffic yields a significant improvement, then
go ahead and compress your HTML.

 Will setting the HTTPS connector compression=on actually compress the
 data for HTTPS?

Any reason to suspect it wouldn't?

 Does it compress before or after applying the encryption?

HTTPS is defined to be HTTP-over-SSL which means that the encryption is
preformed on the whole connection. So, your HTML gets compressed, then
encrypted.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkrvPK4ACgkQ9CaO5/Lv0PA5HgCdEwrU7Ie8YrJDQLROxH5YPdHN
ALUAoLKVSGnrCfS0TgBhjFr5PJdUQ00I
=MG89
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat Manager sees distribution directories as applications

2009-11-02 Thread André Warnier

Jonathan Mast wrote:

/
--/webapps
-/host_MY_HOST
---/MY_CONTEXT


Is it not more like
server
-- Host1
--webapps
-- manager
-- your app 1
-- your app 2
-- others
-- Host2
--webapps
-- manager
-- your app3 (maybe the same as app 1 above)
-- others
?

Maybe you did not exactly grasp what Chuck was asking you, which was 
what are you trying to achieve ? (.. with the Tomcat Manager application)

As far as I know, the Manager allows you to :
- list the applications that exist
- start and stop these applications
- undeploy and application
- deploy an application
(all of that within a Host, and using a nice interactive web page).
Not necessarily for me, but in the grand Tomcat scheme of things, these 
look like relatively simple things, that could be done with something else.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: MISC; After one Tomcat Cluster node shutdown Session Replication working but a Hashmap object is getting empty

2009-11-02 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Imad,

On 11/2/2009 12:33 PM, Imad Hachem wrote:
 You are right about the case of Tomcat Node non shutdown, HashMap is not
 replicated correctly to the other node.

Okay, good (sort of). If it was only failing on one-node shutdown, it
would be much messier to track this down. Instead, this one attribute
(or perhaps more) are simply failing to replicate properly.

 Note that I am saving a secretKey (javax.crypto.SecretKey) as a VALUE
 for the sessionid KEY stored in the HashMap.

Do you have distributable/ set in your web.xml? If not, you should
enable this. Doing so should cause an IllegalArgumentException to be
thrown if you try to put something into the session that isn't Serializable.

Note that the above statement only apples to values explicitly stored in
the session. This, for instance, will cause an error:

HttpSession session = request.getSession(true);
session.put(someKey, new NonSerializableClass());

...while this will not:

HttpSession session = request.getSession(true);
HashMap map = new HashMap();
map.put(someOtherKey, new NonSerializableClass());
session.put(someKey, map);

so, you have to be careful that the full object trees you put into your
session are serializable in their entirety. You could write a filter
that checks all this if you wanted to.

 How can I make sure that this secretKey or all HaspMap data are
 serializable?

Well, javax.crypto.SecretKey is not itself required to be serializable,
but one of its implementations, SecretKeySpec, /is/ marked as
Serializable. Any idea what kind of object you actually have?

 Note I am using the below code to store in the HashMap:
 
   static HashMap userSessionMapArray = new HashMap();
   SecretKey   b =
 KeyGenerator.getInstance(DESede).generateKey();
   QueryCryptUser  qcu = new QueryCryptUser(sessionID, b);
   userSessionMapArray.put(sessionID, qcu);
 
 
 Note that I have tried to create the QueryCryptUser Class to
 implements java.io.Serializable but still facing the same problem and
 HashMap not replicated to the 2nd Node.

Well, would you be comfortable putting the key text itself into the
session? The key text itself should just be a byte[] which you could
convert to char[] in a number of ways if you'd like to make it (human)
readable.

I agree with Pid's question: why is the array static? ...and what it is
static to?

Clearly, your QueryCryptUser object needs to be Serializable, so you
should really focus on that, I think. You can encapsulate the logic to
serialize your SecretKey object within your QueryCryptUser class.

Can you post some or all of the QueryCryptUser class code?

Are you getting any errors in your log files when these objects are
serialized? It might help alot to see what the JVM is refusing to serialize.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkrvP/kACgkQ9CaO5/Lv0PDKEwCgr2zMyPXLl0teiHA4KhJwTh7g
pVgAmgLKL5nT+ksy7xyeekvIT/ujJmNR
=zM1q
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: ConnectionPool question

2009-11-02 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Elli,

On 11/2/2009 4:08 AM, Elli Albek wrote:
 I think you can have a solution without changing your code.
 
 Try something like this:
 
 getConnection() static method should get the connection, and add it to a
 list that you keep in threadlocal.
 
 recycleConnection() should close the connection and remove the connection
 object from thread local.
 
 Add a servlet filter that closes all connections in thread local. The filter
 calls next filter, and in a finally block get the connections from thread
 local, close all of them, and clear the list in thread local.

This is a horrible, nasty hack and it's entirely brilliant!

I would change Elli's implementation just slightly, and actually write
your own DataSource implementation that piggybacks on another one.
Basically, you just wrap the DataSource that Tomcat provides either by:

a. Using JNDI to look-up the Tomcat-created JNDI DataSource and just
   writing the plumbing code to pass everything through
b. Actually subclass the DataSource class(es) provided by Tomcat and
   use /those/ in your Resource configuration.

I would also not make any of this static... there's just no reason to do
so, especially if your DataSource object is in the JNDI context.

Although the /real/ solution is to fix the code, I really like this
solution for a couple of reasons:

1. It requires no wrapping of Connection, Statement, etc. objects
   (which is entirely miserable if you've ever had to do it)
2. It requires no changes to your code whatsoever (if you use my
   DataSource-wrapping suggestion above)
3. You won't end up closing your connection, statement, result set, etc.
   too early because your code has completed execution (unless you
   are using JDBC resources across requests, which is another story)

What this won't help, unfortunately is:

* Closing your ResultSet and Statement objects (though this can be
  solved by wrapping the Connection, Statement, etc. objects handed-
  out by your DataSource. Yes, it's miserable.)

 This will allow you to keep your legacy code. As far as I remember DBCP has
 an option to close the result sets and statements when you close the
 connection. If not this will partly work.

I don't believe commons-dbcp has this capability at all. I'm willing to
read any documentation to the contrary, though.

 Version 2: Advanced
 
 Keep the actual connection in thread local. You will have one connection per
 HTTP request. getConnection() should be something like
 
 public static /* NOT synchronized */ Connection getConnection(){
 
 Connection c = ...// get the connection from thread local
 
 if (c != null)
 
 return c;
 
 Connection c = ...// get the connection from JNDI/DBCP
 
 // put connection in thread local
 
 return c;
 
 }

I like this technique, too. You just have to decide if it's acceptable
for your webapp to re-use connections. I can't imagine why that would be
a problem, but it's worth considering before you blindly do it. This
optimization can save you from deadlock (though you're killing-off
connections after 15 seconds anyway) and should significantly improve
the performance of your webapp because you won't be bleeding so many
connections: you're limited to bleeding one connection per request
instead of potentially dozens.

 recycleConnection(){
 
 // empty, connection will be recycled by filter.
 
 }

I would actually allow recycleConnection to close the connection, and
have the filter call recycleConnection. That way, as you improve your
webapp's code, the connections will be closed as soon as possible
instead of waiting until the request is (mostly) finished.

Again, Elli, a great suggestion!

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkrvQ8AACgkQ9CaO5/Lv0PDOSACeJfqgaXmrySSKItQHji2K6UzK
hmsAoKIAhRAgwzI/QN8SPdVGkBbewA2a
=Mqjn
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Tomcat Memory and Garbage Collection questions...

2009-11-02 Thread Johnson, Trevin (Contractor)
Hello
OS Version: Windows 2000
Tomcat version:5.5.17
Initial Memory Pool: 768
Maximum Memory Pool:1024
Java Version: Java\jdk1.5.0_14

When we restart the tomcat service our tomcat memory is about 120Mb. It keeps 
going up over the next few days util it reaches 700Mb and we have to reboot the 
server. We do not see any errors just yet but the server gets close to maxing 
out
I have questions around garbage collection for tomcat

Questions:
1.We do not see the memory going down for the tomcat service. Shouldn't the 
memory go down as well as up over this timespan
2.Should the memory get to maximum 768Mb and then go back down or get recycled?
3.Is this a bug or what is normal behavior for the tomcat memory?

4.. How do we implement garbage collection for our windows server(-Xincgc)?

I am very new to Tomcat and trying to manage/decrease the memory footprint used 
by Tomcat?
Your help is most appreciated...

Thanks
trevin.john...@occ.treas.gov



RE: Tomcat Memory and Garbage Collection questions...

2009-11-02 Thread Caldarale, Charles R
 From: Johnson, Trevin (Contractor)
 [mailto:trevin.john...@occ.treas.gov]
 Subject: Tomcat Memory and Garbage Collection questions...
 
 When we restart the tomcat service our tomcat memory is about 120Mb. It
 keeps going up over the next few days util it reaches 700Mb and we have
 to reboot the server.

Why do you reboot?  Is the server unresponsive?

 1.We do not see the memory going down for the tomcat service. Shouldn't
 the memory go down as well as up over this timespan

What are you using to show the memory usage?

 2.Should the memory get to maximum 768Mb and then go back down or get
 recycled?

Depends on what you're looking at.  If it's Task Manager, it won't go down.  If 
you're using JConsole to look at the heap, it should go up and down.

 3.Is this a bug or what is normal behavior for the tomcat memory?

Depends; see above.

 4.. How do we implement garbage collection for our windows server(-
 Xincgc)?

Garbage collection is always present.  Incremental GC can be useful to minimize 
pause times, but it is more overhead and has some restrictions on just what it 
can collect.  Unless you really think you need that option, I wouldn't set it 
right now.

I'd strongly recommend using JConsole to look at heap usage, then use a 
profiler if you find that the heap usage does not stabilize.  You can also turn 
on -verbose:gc, and use jhat and jmap to do basic heap analysis.

Some useful resources:
http://java.sun.com/j2se/1.5.0/docs/guide/vm/gc-ergonomics.html
http://java.sun.com/javase/technologies/hotspot/gc/index.jsp

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat Memory and Garbage Collection questions...

2009-11-02 Thread Martin Choma
Hi,

in fact, garbage collection is not tomcat stuff. It is JVM responsibility.

So try to focus on jvm memory problem, not tomcat memory problem.
Maybe some memory leak?

Martin

2009/11/2 Johnson, Trevin (Contractor) trevin.john...@occ.treas.gov:
 Hello
 OS Version: Windows 2000
 Tomcat version:5.5.17
 Initial Memory Pool: 768
 Maximum Memory Pool:1024
 Java Version: Java\jdk1.5.0_14

 When we restart the tomcat service our tomcat memory is about 120Mb. It keeps 
 going up over the next few days util it reaches 700Mb and we have to reboot 
 the server. We do not see any errors just yet but the server gets close to 
 maxing out
 I have questions around garbage collection for tomcat

 Questions:
 1.We do not see the memory going down for the tomcat service. Shouldn't the 
 memory go down as well as up over this timespan
 2.Should the memory get to maximum 768Mb and then go back down or get 
 recycled?
 3.Is this a bug or what is normal behavior for the tomcat memory?

 4.. How do we implement garbage collection for our windows server(-Xincgc)?

 I am very new to Tomcat and trying to manage/decrease the memory footprint 
 used by Tomcat?
 Your help is most appreciated...

 Thanks
 trevin.john...@occ.treas.gov



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Tomcat Memory and Garbage Collection questions...

2009-11-02 Thread Joseph Morgan
I hope Mr. Caldarale answered your question, because you may otherwise
be looking at the 800lb Gorilla in the room.

Memory problems within Tomcat could be a number of very hard to see
things, but some quick candidates are:

* Programmers caching too much data from the DB (or file system) into
context attributes
* Programmers using context attributes to store session data
* Programmers pushing too much data into session attributes
* Session timeout is set too high and sessions aren't timing out

-Original Message-
From: Johnson, Trevin (Contractor) [mailto:trevin.john...@occ.treas.gov]

Sent: Monday, November 02, 2009 2:53 PM
To: 'users@tomcat.apache.org'
Subject: Tomcat Memory and Garbage Collection questions...

Hello
OS Version: Windows 2000
Tomcat version:5.5.17
Initial Memory Pool: 768
Maximum Memory Pool:1024
Java Version: Java\jdk1.5.0_14

When we restart the tomcat service our tomcat memory is about 120Mb. It
keeps going up over the next few days util it reaches 700Mb and we have
to reboot the server. We do not see any errors just yet but the server
gets close to maxing out
I have questions around garbage collection for tomcat

Questions:
1.We do not see the memory going down for the tomcat service. Shouldn't
the memory go down as well as up over this timespan
2.Should the memory get to maximum 768Mb and then go back down or get
recycled?
3.Is this a bug or what is normal behavior for the tomcat memory?

4.. How do we implement garbage collection for our windows
server(-Xincgc)?

I am very new to Tomcat and trying to manage/decrease the memory
footprint used by Tomcat?
Your help is most appreciated...

Thanks
trevin.john...@occ.treas.gov


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Will tomcat allow me to configur access to a single folder?

2009-11-02 Thread Josh Gooding
Basically this is a dump for back up files, that's all.  I have a website at
the .com level, would I have to put in another entry in the server.xml for
this and then populate the (dump) directory with the WEB-INF / META-INF
resources?  I think I can configure the login with a file instead of having
to have a JDBC connection to a database.

On Mon, Nov 2, 2009 at 10:51 AM, André Warnier a...@ice-sa.com wrote:

 Josh Gooding wrote:

 What I was saying is that in httpd, you can configure httpd to do what I
 want, but I was unsure if you could in tomcat.  Since I'm not using httpd,
 I
 just wanted to see if I can configure access to a specific folder in
 Tomcat.  I am setting up a backup site for a group of people on my domain.
 That's all.

  Josh Gooding wrote:

  Unlike Apache HTTPD, can Tomcat be configured to allow access to a
 single
 directory?

  So, you really meant :
 Q: Can Tomcat, like httpd, be configured to allow access to a single
 directory ?
 A: yes.
 :-)


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




RE: Tomcat 6.0.20 on 64bit Window2003 - 64bit Service CAN'T start

2009-11-02 Thread tiffany.d...@inovis.com
I installed Tomcat 6.0.20 on 64bit Window2003. I installed 64 bit tomcat 
service (64 bit tomcat6.exe and 64bit tomcat6w.exe). I set variable name of 
JRE_HOME to the path of my 64bit JRE 6.0. However the 64 bit Service can't 
start and logs below.


[2009-11-02 10:31:40] [info] Procrun (2.0.3.0) started
[2009-11-02 10:31:40] [info] Running Service...
[2009-11-02 10:31:40] [info] Starting service...
[2009-11-02 10:31:40] [986  prunsrv.c] [error] Failed creating java
[2009-11-02 10:31:40] [1260 prunsrv.c] [error] ServiceStart returned 1
[2009-11-02 10:31:40] [info] Run service finished.
[2009-11-02 10:31:40] [info] Procrun finished.


Tiffany


Re: Tomcat 6.0.20 on 64bit Window2003 - 64bit Service CAN'T start

2009-11-02 Thread Josh Gooding
Did you copy over the 64 bit tomcat files to the tomcat directory?  Not the
64 bit java files.

On Mon, Nov 2, 2009 at 5:05 PM, tiffany.d...@inovis.com 
tiffany.d...@inovis.com wrote:

 I installed Tomcat 6.0.20 on 64bit Window2003. I installed 64 bit tomcat
 service (64 bit tomcat6.exe and 64bit tomcat6w.exe). I set variable name of
 JRE_HOME to the path of my 64bit JRE 6.0. However the 64 bit Service can't
 start and logs below.


 [2009-11-02 10:31:40] [info] Procrun (2.0.3.0) started
 [2009-11-02 10:31:40] [info] Running Service...
 [2009-11-02 10:31:40] [info] Starting service...
 [2009-11-02 10:31:40] [986  prunsrv.c] [error] Failed creating java
 [2009-11-02 10:31:40] [1260 prunsrv.c] [error] ServiceStart returned 1
 [2009-11-02 10:31:40] [info] Run service finished.
 [2009-11-02 10:31:40] [info] Procrun finished.


 Tiffany



Re: Tomcat 6.0.20 on 64bit Window2003 - 64bit Service CAN'T start

2009-11-02 Thread Josh Gooding
EDIT:  Don't install tomcat as a service.  I've always had trouble running
the 64 bit service.

On Mon, Nov 2, 2009 at 5:19 PM, Josh Gooding josh.good...@gmail.com wrote:

 Did you copy over the 64 bit tomcat files to the tomcat directory?  Not the
 64 bit java files.


 On Mon, Nov 2, 2009 at 5:05 PM, tiffany.d...@inovis.com 
 tiffany.d...@inovis.com wrote:

 I installed Tomcat 6.0.20 on 64bit Window2003. I installed 64 bit tomcat
 service (64 bit tomcat6.exe and 64bit tomcat6w.exe). I set variable name of
 JRE_HOME to the path of my 64bit JRE 6.0. However the 64 bit Service can't
 start and logs below.


 [2009-11-02 10:31:40] [info] Procrun (2.0.3.0) started
 [2009-11-02 10:31:40] [info] Running Service...
 [2009-11-02 10:31:40] [info] Starting service...
 [2009-11-02 10:31:40] [986  prunsrv.c] [error] Failed creating java
 [2009-11-02 10:31:40] [1260 prunsrv.c] [error] ServiceStart returned 1
 [2009-11-02 10:31:40] [info] Run service finished.
 [2009-11-02 10:31:40] [info] Procrun finished.


 Tiffany





RE: Tomcat 6.0.20 on 64bit Window2003 - 64bit Service CAN'T start

2009-11-02 Thread tiffany.d...@inovis.com
Yes, I did.


-Original Message-
From: Josh Gooding [mailto:josh.good...@gmail.com] 
Sent: Monday, November 02, 2009 2:20 PM
To: Tomcat Users List
Subject: Re: Tomcat 6.0.20 on 64bit Window2003 - 64bit Service CAN'T start

Did you copy over the 64 bit tomcat files to the tomcat directory?  Not the
64 bit java files.

On Mon, Nov 2, 2009 at 5:05 PM, tiffany.d...@inovis.com 
tiffany.d...@inovis.com wrote:

 I installed Tomcat 6.0.20 on 64bit Window2003. I installed 64 bit tomcat
 service (64 bit tomcat6.exe and 64bit tomcat6w.exe). I set variable name of
 JRE_HOME to the path of my 64bit JRE 6.0. However the 64 bit Service can't
 start and logs below.


 [2009-11-02 10:31:40] [info] Procrun (2.0.3.0) started
 [2009-11-02 10:31:40] [info] Running Service...
 [2009-11-02 10:31:40] [info] Starting service...
 [2009-11-02 10:31:40] [986  prunsrv.c] [error] Failed creating java
 [2009-11-02 10:31:40] [1260 prunsrv.c] [error] ServiceStart returned 1
 [2009-11-02 10:31:40] [info] Run service finished.
 [2009-11-02 10:31:40] [info] Procrun finished.


 Tiffany


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat Manager sees distribution directories as applications

2009-11-02 Thread Jonathan Mast
Thanks Chris, I'm now just pointing the appBase to an empty directory and
everything looks great.  A lot easier than reorganizing my server setup.
Although I do agree with everyone that that approach (each Host has it's own
dir) is more *correct* the complexity of it just too much for my
organization at this moment.


On Mon, Nov 2, 2009 at 3:16 PM, André Warnier a...@ice-sa.com wrote:

 Jonathan Mast wrote:

 /
 --/webapps
 -/host_MY_HOST
 ---/MY_CONTEXT

  Is it not more like
 server
-- Host1
--webapps
-- manager
-- your app 1
-- your app 2
-- others
-- Host2
--webapps
-- manager
-- your app3 (maybe the same as app 1 above)
-- others
 ?

 Maybe you did not exactly grasp what Chuck was asking you, which was what
 are you trying to achieve ? (.. with the Tomcat Manager application)
 As far as I know, the Manager allows you to :
 - list the applications that exist
 - start and stop these applications
 - undeploy and application
 - deploy an application
 (all of that within a Host, and using a nice interactive web page).
 Not necessarily for me, but in the grand Tomcat scheme of things, these
 look like relatively simple things, that could be done with something else.


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




Re: Tomcat 6.0.20 on 64bit Window2003 - 64bit Service CAN'T start

2009-11-02 Thread André Warnier

tiffany.d...@inovis.com wrote:

I installed Tomcat 6.0.20 on 64bit Window2003. I installed 64 bit tomcat 
service (64 bit tomcat6.exe and 64bit tomcat6w.exe).


 I set variable name of JRE_HOME to the path of my 64bit JRE 6.0.

Where did you set that variable ?

When running Tomcat as a service under Windows, using the tomcat6.exe 
wrapper, the environment parameters, path to JVM etc.. have to be set 
using the tomcat6w.exe program.  This is a GUI (graphical) program, 
which you start on the console just by double-clicking on it.


A bit of explanation, which is available somewhere else in the docs but 
I don't remember where :

Tomcat is a Java program.
It is run by a JVM.
The JVM is thus the real program which runs under Windows.
But the JVM, by itself, does not react very well like a Windows Service 
is expected to.
So someone invented a wrapper program, which gets installed and acts 
as the Windows Service; and this program runs the JVM.

That wrapper program is tomcat6.exe.
This wrapper program looks for some of its parameters, in the Windows 
Registry.
The tomcat6w.exe program is a GUI programs that helps setting these 
Registry parameters in the right place.


So start tomcat6w.exe, and navigate through the tabs, to see where it 
thinks it should find the JVM.  Your problem is probably there.





-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Tomcat 6.0.20 on 64bit Window2003 - 64bit Service CAN'T start

2009-11-02 Thread tiffany.d...@inovis.com
Excellent! It works. Thanks Andre!



-Original Message-
From: André Warnier [mailto:a...@ice-sa.com] 
Sent: Monday, November 02, 2009 2:38 PM
To: Tomcat Users List
Subject: Re: Tomcat 6.0.20 on 64bit Window2003 - 64bit Service CAN'T start

tiffany.d...@inovis.com wrote:
 I installed Tomcat 6.0.20 on 64bit Window2003. I installed 64 bit tomcat 
 service (64 bit tomcat6.exe and 64bit tomcat6w.exe).

  I set variable name of JRE_HOME to the path of my 64bit JRE 6.0.

Where did you set that variable ?

When running Tomcat as a service under Windows, using the tomcat6.exe 
wrapper, the environment parameters, path to JVM etc.. have to be set 
using the tomcat6w.exe program.  This is a GUI (graphical) program, 
which you start on the console just by double-clicking on it.

A bit of explanation, which is available somewhere else in the docs but 
I don't remember where :
Tomcat is a Java program.
It is run by a JVM.
The JVM is thus the real program which runs under Windows.
But the JVM, by itself, does not react very well like a Windows Service 
is expected to.
So someone invented a wrapper program, which gets installed and acts 
as the Windows Service; and this program runs the JVM.
That wrapper program is tomcat6.exe.
This wrapper program looks for some of its parameters, in the Windows 
Registry.
The tomcat6w.exe program is a GUI programs that helps setting these 
Registry parameters in the right place.

So start tomcat6w.exe, and navigate through the tabs, to see where it 
thinks it should find the JVM.  Your problem is probably there.




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Compression and SSL

2009-11-02 Thread Jeffrey Janner
Pid -
Windows 64-bit Dual Quad-Core w/32G RAM.  Do I really need bigger?
App's not really slow-- works great here.  But with a 300ms latency
(one-way) to The Orient, you can see why I might want to send as few
bits as possible.
Jeff

-Original Message-
From: Pid [mailto:p...@pidster.com] 
Sent: Monday, November 02, 2009 12:12 PM
To: Tomcat Users List
Subject: Re: Compression and SSL

On 02/11/2009 16:48, Jeffrey Janner wrote:
 OK, another newbie-ish question here.



 I am using Tomcat 5.5.x with APR/native libraries on Windows 2003 x32
or
 Windows 2008 x64 to serve applications from the US to Asia-based
 clients.

 We encrypt everything using SSL, from Login page onward, with
 transport-guarantee  of CONFIDENTIAL.

 All URLs are configured as relative, i.e., /images/picture.png,
 /APP1?param1=value, etc.

 We use Tomcat as the web server with no intervening proxies,
 load-balancers, accelerators, etc.

 Response time is noticeably slow (based on complaint level) and I am
 looking for ways to improve it.

Bigger server?

 Will setting the HTTPS connector compression=on actually compress
the
 data for HTTPS?

What makes you think that compressing things is going to improve 
matters?  Doing the compression is an overhead itself.

What's slow about your app and how do you know it?


 Does it compress before or after applying the encryption?

 And,  in case it's relevant, here is the relevant excerpt from the
 web.xml file we use:



security-constraint

  web-resource-collection

web-resource-nameEverything/web-resource-name

url-pattern*.jsp/url-pattern

url-pattern*.html/url-pattern

url-pattern*.js/url-pattern

Brevity:

   url-pattern/*/url-pattern

url-pattern/APP1/url-pattern
url-pattern/APP2/url-pattern

If those actually represent real webapps, with their own 
WEB-INF/web.xml, the lines above don't do anything.

p


  /web-resource-collection

  user-data-constraint

transport-guaranteeCONFIDENTIAL/transport-guarantee

  /user-data-constraint

/security-constraint



 Any assistance would be much appreciated.



 Jeff


 ***  NOTICE
*
 This message is intended for the use of the individual or entity to
which
 it is addressed and may contain information that is privileged,
 confidential, and exempt from disclosure under applicable law.  If the
 reader of this message is not the intended recipient or the employee
or
 agent responsible for delivering this message to the intended
recipient,
 you are hereby notified that any dissemination, distribution, or
copying
 of this communication is strictly prohibited.  If you have received
this
 communication in error, please notify us immediately by reply or by
 telephone (call us collect at 512-343-9100) and immediately delete
this
 message and all its attachments.



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



***  NOTICE  *
This message is intended for the use of the individual or entity to which 
it is addressed and may contain information that is privileged, 
confidential, and exempt from disclosure under applicable law.  If the 
reader of this message is not the intended recipient or the employee or 
agent responsible for delivering this message to the intended recipient, 
you are hereby notified that any dissemination, distribution, or copying 
of this communication is strictly prohibited.  If you have received this 
communication in error, please notify us immediately by reply or by 
telephone (call us collect at 512-343-9100) and immediately delete this 
message and all its attachments.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Compression and SSL

2009-11-02 Thread Jeffrey Janner
André -
Thanks for the nice answer.
Precisely what I was looking for to make a decision.
I'll try turning it on for one customer tonight and see if we really improve 
things.
Jeff

-Original Message-
From: André Warnier [mailto:a...@ice-sa.com] 
Sent: Monday, November 02, 2009 12:59 PM
To: Tomcat Users List
Subject: Re: Compression and SSL

Jeffrey Janner wrote:
 OK, another newbie-ish question here.
 
Then a dummy-ish answer may be sufficient :

 
 Will setting the HTTPS connector compression=on actually compress the
 data for HTTPS?

It will compress all data it would compress it it wasn't HTTPS.

 
 Does it compress before or after applying the encryption?
 
Before.
HTTPS is at a lower level, at the connection level.
I'm not even sure that Tomcat is really involved.  As far as responses 
are concerned, Tomcat probably just hands them over to the socket (in 
clear, normal), and it is the socket which does the SSL encryption.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



***  NOTICE  *
This message is intended for the use of the individual or entity to which 
it is addressed and may contain information that is privileged, 
confidential, and exempt from disclosure under applicable law.  If the 
reader of this message is not the intended recipient or the employee or 
agent responsible for delivering this message to the intended recipient, 
you are hereby notified that any dissemination, distribution, or copying 
of this communication is strictly prohibited.  If you have received this 
communication in error, please notify us immediately by reply or by 
telephone (call us collect at 512-343-9100) and immediately delete this 
message and all its attachments.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Tomcat and PermGen

2009-11-02 Thread Gerwood Stewart
This is not quite a question about out of memory errors. It's a question about 
the behaviour of contexts when deployed and un-deployed and what should happen 
to the non-heap (or in fact any) memory when we undeploy a context.

From my understanding (and it's not a good one) I would expect to see a drop 
in PermGen memory area when we undeploy a context. Currently I'm seeing a very 
small increase and then a much larger (9-15mb) increase when we redeploy which 
is suggesting that significant parts of the context are being retained through 
some gc connection. 

Any suggestions for tracking this down?

Thanks
Gerwood
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat and PermGen

2009-11-02 Thread Mark Thomas
Gerwood Stewart wrote:
 This is not quite a question about out of memory errors. It's a question 
 about the behaviour of contexts when deployed and un-deployed and what should 
 happen to the non-heap (or in fact any) memory when we undeploy a context.
 
 From my understanding (and it's not a good one) I would expect to see a drop 
 in PermGen memory area when we undeploy a context. Currently I'm seeing a 
 very small increase and then a much larger (9-15mb) increase when we redeploy 
 which is suggesting that significant parts of the context are being retained 
 through some gc connection. 
 
 Any suggestions for tracking this down?

Your understanding is correct.

For some hints:

http://markmail.org/thread/ylau4txi2onthgsh

Mark


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Compression and SSL

2009-11-02 Thread Jeffrey Janner
Peter -
It's primarily the network bandwidth.
The best-case latency to Asia from the US is about 150ms (assuming
speed-of-light, no hardware delays).
What we see on bi-directional traceroutes is an across-the-ocean delay
of 200ms to 300ms on a good day.
That translates to adding roughly 1 second to response time.
Depending on the page, we probably run from 8k to 1-2 Mb of text.  And
that doesn't include uploads/downloads of user's files.
Jeff

-Original Message-
From: peter.crowth...@googlemail.com
[mailto:peter.crowth...@googlemail.com] On Behalf Of Peter Crowther
Sent: Monday, November 02, 2009 1:35 PM
To: Tomcat Users List
Subject: Re: Compression and SSL

2009/11/2 George Sexton geor...@mhsoftware.com

 In general, Compressing HTML can help a great deal for any case
besides a
 local network.


... or a CPU-limited server.

To the OP: What's the bottleneck in your environment?  CPU?  Disk I/O?
Network bandwidth?  Measure the problem, *then* look for solutions to
the
problem that actually exists.  If you've measured and you have CPU to
spare
but are bandwidth-limited, then compression will help a great deal!

- Peter

***  NOTICE  *
This message is intended for the use of the individual or entity to which 
it is addressed and may contain information that is privileged, 
confidential, and exempt from disclosure under applicable law.  If the 
reader of this message is not the intended recipient or the employee or 
agent responsible for delivering this message to the intended recipient, 
you are hereby notified that any dissemination, distribution, or copying 
of this communication is strictly prohibited.  If you have received this 
communication in error, please notify us immediately by reply or by 
telephone (call us collect at 512-343-9100) and immediately delete this 
message and all its attachments.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Compression and SSL

2009-11-02 Thread Jeffrey Janner
From: Christopher Schultz [mailto:ch...@christopherschultz.net] 


 Will setting the HTTPS connector compression=on actually compress the
 data for HTTPS?

Any reason to suspect it wouldn't?

Some result from a Google search I did trying to find a solution to this issue 
led me to infer that it didn't.  I figured it was wrong but thought I'd ask the 
gurus.

 Does it compress before or after applying the encryption?

HTTPS is defined to be HTTP-over-SSL which means that the encryption is
preformed on the whole connection. So, your HTML gets compressed, then
encrypted.

That's what I figured it should do.

***  NOTICE  *
This message is intended for the use of the individual or entity to which 
it is addressed and may contain information that is privileged, 
confidential, and exempt from disclosure under applicable law.  If the 
reader of this message is not the intended recipient or the employee or 
agent responsible for delivering this message to the intended recipient, 
you are hereby notified that any dissemination, distribution, or copying 
of this communication is strictly prohibited.  If you have received this 
communication in error, please notify us immediately by reply or by 
telephone (call us collect at 512-343-9100) and immediately delete this 
message and all its attachments.


RE: Compression and SSL

2009-11-02 Thread Jeffrey Janner
Thanks for all the suggestions so far guys.
Are there any other tips I could provide to the developers that they can
do to improve throughput?
Should they hard-code the http:// for all the static elements to avoid
passing them over SSL, or do my security constraints take care of that?
(I doub it.)
The original URL gets redirected to https immediately, so I'm thinking
everything from there on out is SSL.  Correct?
Can I get more granular?  I'd be happy for a pointer to a good reference
on the subject.
Jeff

-Original Message-
From: George Sexton [mailto:geor...@mhsoftware.com] 
Sent: Monday, November 02, 2009 1:56 PM
To: 'Tomcat Users List'
Subject: RE: Compression and SSL


 -Original Message-
 From: peter.crowth...@googlemail.com
 [mailto:peter.crowth...@googlemail.com] On Behalf Of Peter Crowther
 Sent: Monday, November 02, 2009 12:35 PM
 To: Tomcat Users List
 Subject: Re: Compression and SSL
 
 2009/11/2 George Sexton geor...@mhsoftware.com
 
  In general, Compressing HTML can help a great deal for any case
 besides a
  local network.
 

You didn't read the original post very closely.

 to serve applications from the US to Asia-based clients.

It's bandwidth and latency.


 
 ... or a CPU-limited server.
 
 To the OP: What's the bottleneck in your environment?  CPU?  Disk I/O?
 Network bandwidth?  Measure the problem, *then* look for solutions to
 the
 problem that actually exists.  If you've measured and you have CPU to
 spare
 but are bandwidth-limited, then compression will help a great deal!
 
 - Peter


George Sexton
MH Software, Inc.
http://www.mhsoftware.com/
Voice: 303 438 9585



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



***  NOTICE  *
This message is intended for the use of the individual or entity to which 
it is addressed and may contain information that is privileged, 
confidential, and exempt from disclosure under applicable law.  If the 
reader of this message is not the intended recipient or the employee or 
agent responsible for delivering this message to the intended recipient, 
you are hereby notified that any dissemination, distribution, or copying 
of this communication is strictly prohibited.  If you have received this 
communication in error, please notify us immediately by reply or by 
telephone (call us collect at 512-343-9100) and immediately delete this 
message and all its attachments.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: MISC; After one Tomcat Cluster node shutdown Session Replication working but a Hashmap object is getting empty

2009-11-02 Thread Imad Hachem
Hi Pid,

Thanks for your reply.

I am using a URL Encrytion/Decryption Open Source Library called
QueryCrypt, and HaspMap object has been declared in this Library as
Static.

QueryCrypt Library is based on HashMap where it has been used to store
Users SESSIONIDs and Encryption KEYs.


For each user we are inserting an Entry (Key=SESSIONID,
VALUE=Encryption_key) after an encryption Call of One URL String.

After a Decryption Call, QueryCrypt fetch the HashMap table and retrieve
the Encryption_key for the related SESSIONID.

What is happening, the HasMap table is not replicated at all between
Clustered Tomcats, and after Decryption I am loosing and not able to
Retrieve my Encryption_key in order to Decrypt my URL String.


Are you suggesting to Store the HashMap and QueryCryptUser objects to
the HTTPSession in order to be retrieved later on or just to store them
on the session to force the HashMap to be replicated?




Imad Hachem | Asst.Product Development Manager
e-Banking Department
Path Solutions
Tel: +961 1 697444 ext. 222
Fax: +961 1 696744
www.path-solutions.com



Disclaimer
[The information contained in this e-mail message and any attached files
are confidential information and intended solely for the use of the
individual or entity to whom they are addressed. This transmission may
contain information that is privileged, confidential or exempt from
disclosure under applicable law. If you have received this e-mail in
error, please notify the sender immediately and delete all copies. If
you are not the intended recipient, any disclosure, copying,
distribution, or use of the information contained herein is STRICTLY
PROHIBITED. Path Solutions accepts no responsibility for any errors,
omissions, computer viruses and other defects.]
 
 
 
-Original Message-
From: Pid [mailto:p...@pidster.com] 
Sent: Monday, November 02, 2009 8:30 PM
To: users@tomcat.apache.org
Subject: Re: MISC; After one Tomcat Cluster node shutdown Session
Replication working but a Hashmap object is getting empty

On 02/11/2009 17:33, Imad Hachem wrote:
 Dear chris,

 Thanks for your reply.

 You are right about the case of Tomcat Node non shutdown, HashMap is
not
 replicated correctly to the other node.

 Note that I am saving a secretKey (javax.crypto.SecretKey) as a VALUE
 for the sessionid KEY stored in the HashMap.

 How can I make sure that this secretKey or all HaspMap data are
 serializable?

 Note I am using the below code to store in the HashMap:

   static HashMap userSessionMapArray = new HashMap();
   SecretKey   b =
 KeyGenerator.getInstance(DESede).generateKey();
   QueryCryptUser  qcu = new QueryCryptUser(sessionID, b);
   userSessionMapArray.put(sessionID, qcu);

Why is the HashMap static?
I don't think the code above will cause anything to replicate.

 Note that I have tried to create the QueryCryptUser Class to
 implements java.io.Serializable but still facing the same problem and
 HashMap not replicated to the 2nd Node.

Are you storing the QueryCryptUser, or the HashMap in an HTTPSession 
somewhere else?

What is it that you are actually trying to achieve?


p


 Imad Hachem | Asst.Product Development Manager
 e-Banking Department
 Path Solutions
 Tel: +961 1 697444 ext. 222
 Fax: +961 1 696744
 www.path-solutions.com



 Disclaimer
 [The information contained in this e-mail message and any attached
files
 are confidential information and intended solely for the use of the
 individual or entity to whom they are addressed. This transmission may
 contain information that is privileged, confidential or exempt from
 disclosure under applicable law. If you have received this e-mail in
 error, please notify the sender immediately and delete all copies. If
 you are not the intended recipient, any disclosure, copying,
 distribution, or use of the information contained herein is STRICTLY
 PROHIBITED. Path Solutions accepts no responsibility for any errors,
 omissions, computer viruses and other defects.]




 -Original Message-
 From: Christopher Schultz [mailto:ch...@christopherschultz.net]
 Sent: Monday, November 02, 2009 5:18 PM
 To: Tomcat Users List
 Subject: Re: MISC; After one Tomcat Cluster node shutdown Session
 Replication working but a Hashmap object is getting empty

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Imad,

 On 11/1/2009 1:41 AM, Imad Hachem wrote:
 After setting a Tomcat Cluster of 2 nodes on separate machine,
Session
 replication is working very fine except one library objects
 (QueryCrypt.jar included in this Web Project) having a Hashmap where
 we
 store Users SESSION ID.

 After one node shutdown, this Hashmap object is getting empty, note
 that
 all other session variables have been replicated successfully and
 SESSIONID.jvmRoute still the same which is correct and expected
 behavior.

 If that node does /not/ shut down, can you observe that the HashMap is
 correctly replicated to the other node? I suspect not.

 My guess is that your HashMap has data 

RE: MISC; After one Tomcat Cluster node shutdown Session Replication working but a Hashmap object is getting empty

2009-11-02 Thread Imad Hachem
Dear Chris,

distributable/ has been set in my Web application web.xml and I have
set as well the Context distributable=true in the context.xml of
both Tomcat Nodes but still not able to replicate my haspmap.

Please find below QueryCryptUser.java source code:


package com.guhesan.querycrypt.beans;

import java.util.HashMap;

import javax.crypto.SecretKey;


public class QueryCryptUser implements java.io.Serializable
{
private String sessionID = ;
private HashMap md5Keys = new HashMap();
private SecretKey secretKey = null; 
/**
 * @return Returns the md5Keys.
 */
public HashMap getMd5Keys()
{
return md5Keys;
}
/**
 * @param md5Keys The md5Keys to set.
 */
public void setMd5Keys(HashMap md5Keys)
{
this.md5Keys = md5Keys;
}
/**
 * @return Returns the sessionID.
 */
public String getSessionID()
{
return sessionID;
}
/**
 * @param sessionID The sessionID to set.
 */
public void setSessionID(String sessionID)
{
this.sessionID = sessionID;
}

public void addToMD5Map(String md5, byte[] encryptedStr)
{
this.md5Keys.put(md5, encryptedStr);
}

public byte[] getByKey(String md5key)
{
return (byte[]) this.md5Keys.get(md5key);
}
/**
 * @return Returns the secretKey.
 */
public SecretKey getSecretKey()
{
return secretKey;
}
/**
 * @param secretKey The secretKey to set.
 */
public void setSecretKey(SecretKey secretKey)
{
this.secretKey = secretKey;
}

public QueryCryptUser(String sessionid, SecretKey key)
{
super();
// TODO Auto-generated constructor stub
secretKey = key;
sessionID = sessionid;
}


}


Imad Hachem | Asst.Product Development Manager
e-Banking Department
Path Solutions
Tel: +961 1 697444 ext. 222
Fax: +961 1 696744
www.path-solutions.com



Disclaimer
[The information contained in this e-mail message and any attached files
are confidential information and intended solely for the use of the
individual or entity to whom they are addressed. This transmission may
contain information that is privileged, confidential or exempt from
disclosure under applicable law. If you have received this e-mail in
error, please notify the sender immediately and delete all copies. If
you are not the intended recipient, any disclosure, copying,
distribution, or use of the information contained herein is STRICTLY
PROHIBITED. Path Solutions accepts no responsibility for any errors,
omissions, computer viruses and other defects.]
 
 
 

-Original Message-
From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
Sent: Monday, November 02, 2009 10:24 PM
To: Tomcat Users List
Subject: Re: MISC; After one Tomcat Cluster node shutdown Session
Replication working but a Hashmap object is getting empty

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Imad,

On 11/2/2009 12:33 PM, Imad Hachem wrote:
 You are right about the case of Tomcat Node non shutdown, HashMap is
not
 replicated correctly to the other node.

Okay, good (sort of). If it was only failing on one-node shutdown, it
would be much messier to track this down. Instead, this one attribute
(or perhaps more) are simply failing to replicate properly.

 Note that I am saving a secretKey (javax.crypto.SecretKey) as a VALUE
 for the sessionid KEY stored in the HashMap.

Do you have distributable/ set in your web.xml? If not, you should
enable this. Doing so should cause an IllegalArgumentException to be
thrown if you try to put something into the session that isn't
Serializable.

Note that the above statement only apples to values explicitly stored in
the session. This, for instance, will cause an error:

HttpSession session = request.getSession(true);
session.put(someKey, new NonSerializableClass());

...while this will not:

HttpSession session = request.getSession(true);
HashMap map = new HashMap();
map.put(someOtherKey, new NonSerializableClass());
session.put(someKey, map);

so, you have to be careful that the full object trees you put into your
session are serializable in their entirety. You could write a filter
that checks all this if you wanted to.

 How can I make sure that this secretKey or all HaspMap data are
 serializable?

Well, javax.crypto.SecretKey is not itself required to be serializable,
but one of its implementations, SecretKeySpec, /is/ marked as
Serializable. Any idea what kind of object you actually have?

 Note I am using the below code to store in the HashMap:
 
   static HashMap userSessionMapArray = new HashMap();
   SecretKey   

RE: Tomcat and PermGen

2009-11-02 Thread Gerwood Stewart
Mark

Thanks for the reply.

I've gone through a few things and shifted all our direct use of log4j to 
commons-logging (this may not be a good thing, but consistency was the point) 
and then put commons-logging and log4j into tomcats common/lib directory... 
(recommendation from a colleague)

Re-running this with a profiler has shown that things appear to be cleaning up 
better and the heap space has a much more significant garbage collection 
afterwards. Problem is that permgen space still appears to ONLY build up...

Do you know of any ways to track down what might be 'stuck' here or a starting 
point I could use?

If you have any info on the logging issue it would be helpful but from my 
Google searches everyone seems to have a differing (if only slightly) view on 
this.

Thanks
Gerwood



From: Mark Thomas [ma...@apache.org]
Sent: Tuesday, 3 November 2009 11:04 AM
To: Tomcat Users List
Subject: Re: Tomcat and PermGen

Gerwood Stewart wrote:
 This is not quite a question about out of memory errors. It's a question 
 about the behaviour of contexts when deployed and un-deployed and what should 
 happen to the non-heap (or in fact any) memory when we undeploy a context.

 From my understanding (and it's not a good one) I would expect to see a drop 
 in PermGen memory area when we undeploy a context. Currently I'm seeing a 
 very small increase and then a much larger (9-15mb) increase when we redeploy 
 which is suggesting that significant parts of the context are being retained 
 through some gc connection.

 Any suggestions for tracking this down?

Your understanding is correct.

For some hints:

http://markmail.org/thread/ylau4txi2onthgsh

Mark


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Tomcat and PermGen

2009-11-02 Thread Caldarale, Charles R
 From: Gerwood Stewart [mailto:gstew...@une.edu.au]
 Subject: RE: Tomcat and PermGen
 
 Do you know of any ways to track down what might be 'stuck' here or a
 starting point I could use?

Take a look at this, although the thread you read probably covered much of it:
http://opensource.atlassian.com/confluence/spring/pages/viewpage.action?pageId=2669

You're most likely going to have to slog through heap profiler output looking 
for objects (including java.lang.Class instances) that belong to the stopped 
webapp.  They'll show up more readily if you just undeploy, not redeploy.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat Memory and Garbage Collection questions...

2009-11-02 Thread Elli Albek
A question:

Do you guys use hot deployment of applications? If you do *not*, then
Joseph’s tips are the first things to look at, in short it is the
application code keeping too many references.

If you do hot deployment, then the number of possibilities goes up
significantly. Now you are also talking about references to class loaders
and memory cleanup at shutdown, which is another topic altogether.
E

On Mon, Nov 2, 2009 at 1:44 PM, Joseph Morgan joseph.mor...@ignitesales.com
 wrote:

 I hope Mr. Caldarale answered your question, because you may otherwise
 be looking at the 800lb Gorilla in the room.

 Memory problems within Tomcat could be a number of very hard to see
 things, but some quick candidates are:

 * Programmers caching too much data from the DB (or file system) into
 context attributes
 * Programmers using context attributes to store session data
 * Programmers pushing too much data into session attributes
 * Session timeout is set too high and sessions aren't timing out