Re: Bug with tomcat JDBC connection pool?

2012-03-05 Thread Mark Thomas
On 04/03/2012 23:37, Adib wrote:
 Hi,
 
 I think I have run into a bug with tomcat, but wanted to check with
 the user list to make sure it is a bug before  I file it.
Good job you checked. It isn't a bug, it is user error.

 Background:
 
 I am using the tomact jdbc pool over the dbcp pool and I am embedding
 tomcat as part of an application that clients install on their data
 centers.
 
 1) delete the lib\tomcat-dbcp.jar from the tomcat\lib
Unnecessary.

 2) Configure a jdbc connection pool in server.xml in the GlobalNamingResource
Looks OK.

 3) Add a resource ref to the web.xml
And here is where you go wrong.

You need to read [1].

You can use a resource-ref if all of the following are true:
a) Tomcat is able to identify a suitable factory
b) No further configuration is required.

a) is true but not what you want. Tomcat will use the default.
b) is not true. More information is required (URL, user, pwd,  etc)

Since a resource-ref is not suitable, you must define a resource-link to
a global resource or the entire resource in the context.xml.

The resource ref in web.xml is more a marker that a resource is
required. It isn't usually sufficient to define the resource.

 4) do an a lookup for the data source
Looks OK.

 5)  Tomcat throws an exception  java.lang.ClassNotFoundException:
 org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory full stack trace
 below.
As expected, given the error you have made.

 It is not clear why it would be looking for dbcp DataSource when i
 have my data source defined   using
 factory=org.apache.tomcat.jdbc.pool.DataSourceFactory
Because you haven't configured you DataSource correctly.

 Interestingly if the resource is defined in context.xml in META-INF
 for the war there are no exceptions it just works.
As expected.

 Any thoughts on whether this is a bug or not?
As above. No bug, this is user error.

Mark

[1] http://tomcat.apache.org/tomcat-7.0-doc/jndi-resources-howto.html

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



Re: Maven and dependencies for $CATALINA/lib

2012-03-05 Thread Olivier Lamy
2012/3/4 James Apfel james.ap...@gmail.com:
 Hi,

 I'm working on a project that requires me to replace Tomcat's
 SessionManager. I've created a src/main/webapp/META-INF/context.xml
 (it defines the custom Manager) and I've edited my Maven pom file to
 include the requires JARs in the tomcat6-maven-plugin's dependencies
 section (see below) but I'm not sure if that actually refers to
 $CATALINA/lib or if these dependencies are for something else. It's
 failing with a ClassNotFoundException (it can't find the Manager class
 as defined in context.xml).
Arghh :-)
The dependencies for the tomcat start (the plugin create a class
loader with needed embeded tomcat jars) are limited to groupId
org.apache.tomcat
Can you load an issue ? https://issues.apache.org/jira/browse/MTOMCAT
That's an easy fix.


 Thanks,
  James



 plugin
  groupIdorg.apache.tomcat.maven/groupId
  artifactIdtomcat6-maven-plugin/artifactId
  version2.0-SNAPSHOT/version
  dependencies
    dependency
      groupIdspy/groupId
      artifactIdspymemcached/artifactId
      version2.8.0/version
      scoperuntime/scope
    /dependency
    dependency
      groupIdde.javakaffee.msm/groupId
      artifactIdmemcached-session-manager-tc6/artifactId
      version1.6.1/version
      scoperuntime/scope
    /dependency
    dependency
      groupIdde.javakaffee.msm/groupId
      artifactIdmsm-kryo-serializer/artifactId
      version1.6.0/version
      scoperuntime/scope
    /dependency
  /dependencies
 /plugin

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




-- 
Olivier Lamy
Talend: http://coders.talend.com
http://twitter.com/olamy | http://linkedin.com/in/olamy

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



Re: [Tomcat Maven plugin] Not pulling in Test dependencies when useTestClasspath is true

2012-03-05 Thread Olivier Lamy
2012/3/4 Nathan Schile nathan.sch...@gmail.com:
 I have the plugin configured to pull in test classes and dependencies
 [1], however it doesn't seem to be pulling in my test dependencies.  I
 am recieving a NoClassDefFoundError on the class from a test
 dependency, if I switch the dependency to a scope of compile, it works
 file.  Any ideas?

Looks to be an issues with artifacts scoped test.
Can you record an entry here: https://issues.apache.org/jira/browse/MTOMCAT


 [1] 
 http://tomcat.apache.org/maven-plugin-2.0-SNAPSHOT/tomcat7-maven-plugin/run-mojo.html#useTestClasspath

      plugin
               groupIdorg.apache.tomcat.maven/groupId
               artifactIdtomcat7-maven-plugin/artifactId
               version2.0-SNAPSHOT/version
               configuration
                   useTestClasspathtrue/useTestClasspath

 warSourceDirectory${basedir}/src/test/webapp/warSourceDirectory
                   ignorePackagingtrue/ignorePackaging
               /configuration
               executions
                   execution
                       idtomcat-run/id
                       goals
                           goalrun/goal
                       /goals
                       phasepre-integration-test/phase
                       configuration
                           path//path
                           forktrue/fork
                           useTestClasspathtrue/useTestClasspath

 warSourceDirectory${basedir}/src/test/webapp/warSourceDirectory
                           ignorePackagingtrue/ignorePackaging
                           port${reserved.tomcat.port}/port
                       /configuration
                   /execution
                   execution
                       idtomcat-shutdown/id
                       goals
                           goalshutdown/goal
                       /goals
                       phasepost-integration-test/phase
                   /execution
               /executions
           /plugin

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




-- 
Olivier Lamy
Talend: http://coders.talend.com
http://twitter.com/olamy | http://linkedin.com/in/olamy

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



Tomcat7 OutOFMemoryError

2012-03-05 Thread Philippe ROUXEL
When I set JAVA_OPTS= -Xmx1024m -Xss75m
 
I got: 
GRAVE: A child container failed during start
java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: unable to c
reate new native thread
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
at java.util.concurrent.FutureTask.get(FutureTask.java:83)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.ja
va:1128)
 
I using windowsXP and tomcat7.0.26. 
 
Regards,
Philippe

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



Re: Tomcat silently dies

2012-03-05 Thread Carl Kabbe
David, 

Thanks, I will try that.

Carl


On Mar 4, 2012, at 7:45 PM, David Kerber wrote:

 On 3/4/2012 7:31 PM, Carl Kabbe wrote:
 Recap:
 
 OS   Slackware 13.x 64bit
 
 Tomcat   6.0.24
 
 Two different servers… one with 16 GB and one with 8GB
 
 Heap 2GB, PermGen 300MB
 
 Tried different versions of the (Oracle) JVM … tried 1.6.0_24 and 1.6.0_31
 
 The current solution:
 
 Has been stable using JVM version 1.6.0_7 for the last week (we were going 
 down once or twice a day.)
 
 Discussion:
 
 Two years ago, I faced this same issue and Chuck suggested I revert to 
 1.6.0_7.  He said there was a change in 1.6.0_10 that may have caused the 
 problem… I do not know what that was but he appeared to be correct.  I 
 reverted to 1.6.0_7 and the system was stable for two years until I tried 
 more recent JVM's.
 
 At this point, I am looking for suggestions as it clearly has something to 
 do with the JVM (I don't want to stay on 1.6.0_7 forever) but I have no idea 
 how to duplicate or troubleshoot the problem.
 
 Thanks,
 
 Carl
 
 
 Update to a later Tomcat?  Maybe there's some interaction between it and the 
 JVM...
 
 just a swag...
 
 
 -
 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: Tomcat7 OutOFMemoryError

2012-03-05 Thread Rainer Frey
On 05.03.2012, at 11:30, Philippe ROUXEL wrote:

 When I set JAVA_OPTS= -Xmx1024m -Xss75m

That means: each thread get a stack of 75MB. One of the following applies:
* the operating system has a limit on thread stack size
* the per process memory limit is reached before all initial tomcat threads are 
started
* the system runs out of total memory before all initial tomcat threads are 
started

75MB thread stack size seems quite insane, the default is around 1-2MB. Perhaps 
you meant to set -Xms (which sets the initial Java heap size)?

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



Re: Closing tomcat jdbc connection pool

2012-03-05 Thread amit shah
Probably a solution (or workaround) would be to have a initial decorator
which doesn't delegate the unwrap() method to the tomcat data source and
instead just returns the  org.apache.tomcat.jdbc.pool.DataSource instance.

The downside is that this needs to be the very first decorator applied.

On Fri, Mar 2, 2012 at 11:53 AM, amit shah amits...@gmail.com wrote:

 Hello,
   I am using the tomcat7 jdbc pool independently by deploying the
 jdbc pool and juli jars with my web application. I would like to get
 suggestions on how to close the connection pool when the application server
 is stopped.
   The below code doesn't work as expected

 public void shutdown(DataSource dataSource) {
 org.apache.tomcat.jdbc.pool.DataSource tomcatDataSource =
 null;
 try {
tomcatDataSource =
 dataSource.unwrap(org.apache.tomcat.jdbc.pool.DataSource.class);
 } catch (SQLException e) {
throw new RuntimeException(e);
 }
 tomcatDataSource.close();
 }


 The reason being the unwrap implementation
 in org.apache.tomcat.jdbc.pool.DataSource returns null. Hence a NPE.
 Casting the dataSource instance to
 directly org.apache.tomcat.jdbc.pool.DataSource isn't an option because
 during creation we decorate the data source for various reasons like
 logging, changing the isolation level etc.

 Any ideas on how could the close method be called?

 Thank you.



AW: Too many connections in keepalive state in jk threadpool

2012-03-05 Thread Beier Michael
Hallo Herr Jung,

-Ursprüngliche Nachricht-
Von: Rainer Jung [mailto:rainer.j...@kippdata.de] 

Hallo Herr Beier,

On 02.03.2012 11:19, Beier Michael wrote:
 Hi all,

 we're running tomcat 7.0.23 on sun jdk 1.6.0_29, connected 
via ajp to httpd 2.2.21 using mod_jk 1.2.32.

 I observed the behavior, that tomcat keeps threads in its 
ajp pool in keepalive state, regardless of which timeouts 
(connectionTimeout and keepAliveTimeout) are configured in tomcat.
 I tested three connector configurations and with all I see 
connections in tomcat server status where the Time value 
amounts up to several million milliseconds, which is more than 
configured in connectionTimeout/keepAliveTimeout.
 This results in having 60-80 percent of the thread pool 
being in state keepAlive.

 1)
  Connector port=8309 protocol=AJP/1.3
 maxThreads=200 redirectPort=8343 
tomcatAuthentication=false
 keepAliveTimeout=30 
connectionTimeout=30 /
 2)
  Connector port=8309 protocol=AJP/1.3
 maxThreads=200 redirectPort=8343 
tomcatAuthentication=false
 keepAliveTimeout=30 /
 3)
  Connector port=8309 protocol=AJP/1.3
 maxThreads=200 redirectPort=8343 
tomcatAuthentication=false /

 In mod_jk the connection_pool_timeout is set to the same 
value as connectionTimeout (only in seconds, not milliseconds).
 I verified that the values are set correctly querying the 
parameters via JMX.

 How can I avoid having so many threads in keepalive state - 
I don't have any idea at the moment and can't see that there 
is an error in my configuration.

Educated guess: you have an interval based cping/cpong 
connection check 
configured for mod_jk.

You're right, that's the way cping/cpong was configured.

Any cping will wake up the thread waiting for data on the 
connection and 
will reset the timeouts. But a cping will be ommediately answered by a 
cpong and not update the last request time. So that would 
explain, why 
your connections never timeout though the Manager shows constantly 
increasing times for the last request seen.

OK, that's an important information on the value of Time in tomcat
server status. Maybe it should be added to jk worker docs and/or
tomcat manager-howto.

Usually that feature would be activated for mo_jk using the 
JkWatchdogInterval in combination with ping_mode I or A. 
In case you 
are unsure about the effects of the various jk configuration options, 
you might post them here (remove sensitive data before posting).

I'd say the current behaviour is a bit problematic, but I don't see an 
easy improvement. So if your focus is on keeping the number of idle 
connections low you would need to switch off interval cpings. Cping 
before rquests and after opening connections are fine (improves 
stability and reduces the likeliness of race conditions).

I disabled interval cping by setting ping_mode = C,P instead of A.
At the moment everything looks good and tomcat behaves as expected.

Thank's for your help!

Best regards,
Michael Beier

Team SIS OIOAW (Web Basis)
 
EnBW Systeme Infrastruktur Support GmbH
Durlacher Allee 93
76131 Karlsruhe

Tel.: +49 (7 21) 63 - 14545 
Fax: +49 (7 21) 63 - 15099
mailto:m.be...@enbw.com

EnBW Systeme Infrastruktur Support GmbH
Sitz der Gesellschaft: Karlsruhe
Handelsregister: Amtsgericht Mannheim ­ HRB 108550
Vorsitzender des Aufsichtsrats: Dr. Bernhard Beck
Geschäftsführer: Jochen Adenau, Hans-Günther Meier

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



RE : Tomcat7 OutOFMemoryError

2012-03-05 Thread Philippe ROUXEL
75MB of stack is needed by hibenate to save the data aka a graph.
 
Philippe



De: Rainer Frey [mailto:rainer.f...@inxmail.de]
Date: lun. 05/03/2012 13:19
À: Tomcat Users List
Objet : Re: Tomcat7 OutOFMemoryError



On 05.03.2012, at 11:30, Philippe ROUXEL wrote:

 When I set JAVA_OPTS= -Xmx1024m -Xss75m

That means: each thread get a stack of 75MB. One of the following applies:
* the operating system has a limit on thread stack size
* the per process memory limit is reached before all initial tomcat threads are 
started
* the system runs out of total memory before all initial tomcat threads are 
started

75MB thread stack size seems quite insane, the default is around 1-2MB. Perhaps 
you meant to set -Xms (which sets the initial Java heap size)?

Rainer
-
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: Maven and dependencies for $CATALINA/lib

2012-03-05 Thread Olivier Lamy
2012/3/5 Olivier Lamy ol...@apache.org:
 2012/3/4 James Apfel james.ap...@gmail.com:
 Hi,

 I'm working on a project that requires me to replace Tomcat's
 SessionManager. I've created a src/main/webapp/META-INF/context.xml
 (it defines the custom Manager) and I've edited my Maven pom file to
 include the requires JARs in the tomcat6-maven-plugin's dependencies
 section (see below) but I'm not sure if that actually refers to
 $CATALINA/lib or if these dependencies are for something else. It's
 failing with a ClassNotFoundException (it can't find the Manager class
 as defined in context.xml).
 Arghh :-)
 The dependencies for the tomcat start (the plugin create a class
 loader with needed embeded tomcat jars) are limited to groupId
 org.apache.tomcat
 Can you load an issue ? https://issues.apache.org/jira/browse/MTOMCAT

Thanks for the issue entry.
That should be fixed now. Can you try with last 2.0-SNAPSHOT.

 That's an easy fix.


 Thanks,
  James



 plugin
  groupIdorg.apache.tomcat.maven/groupId
  artifactIdtomcat6-maven-plugin/artifactId
  version2.0-SNAPSHOT/version
  dependencies
    dependency
      groupIdspy/groupId
      artifactIdspymemcached/artifactId
      version2.8.0/version
      scoperuntime/scope
    /dependency
    dependency
      groupIdde.javakaffee.msm/groupId
      artifactIdmemcached-session-manager-tc6/artifactId
      version1.6.1/version
      scoperuntime/scope
    /dependency
    dependency
      groupIdde.javakaffee.msm/groupId
      artifactIdmsm-kryo-serializer/artifactId
      version1.6.0/version
      scoperuntime/scope
    /dependency
  /dependencies
 /plugin

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




 --
 Olivier Lamy
 Talend: http://coders.talend.com
 http://twitter.com/olamy | http://linkedin.com/in/olamy



-- 
Olivier Lamy
Talend: http://coders.talend.com
http://twitter.com/olamy | http://linkedin.com/in/olamy

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



Re: [Tomcat 7] org.apache.jasper.xmlparser.EncodingMap question

2012-03-05 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Eu-gene,

On 3/2/12 1:34 AM, Eu-gene Chung wrote:
 I'm doing porting Jasper of Tomcat 7 to our product.
 
 I was adding 'UTF-32' mappings to the 
 org.apache.jasper.xmlparser.EncodingMap#fIANA2JavaMap
 
 when I found that there were some unmatched mappings compared to 
 http://docs.oracle.com/javase/6/docs/technotes/guides/intl/encoding.doc.html.

 
 
 Referring to that Java SE 6 document,
 
 fIANA2JavaMap.put(UTF-16BE,   UnicodeBig); 
 fIANA2JavaMap.put(UTF-16LE,   UnicodeLittle);
 
 should be
 
 fIANA2JavaMap.put(UTF-16BE,   UnicodeBigUnmarked); 
 fIANA2JavaMap.put(UTF-16LE,   UnicodeLittleUnmarked);

The only difference is whether there is a BOM in the document, which
has IMO little to do with the encoding itself.

That code is only used in XMLEncodingDetector which returns
UTF-16BE/LE regardless of whether the BOM is present. One could argue
that UnicodeLittle really maps to x-UTF-16LE-BOM and that UnicodeBig
doesn't map to anything.

Is this actually causing some type of observable problem? If so,
please file a bug report in bugzilla (and include a patch, since
you've already done the work). Only do this if you can demonstrate
some kind of real problem and not just something you noticed:
otherwise, fixing it might end up breaking things for a lot of people.

Thanks,
- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9U4KcACgkQ9CaO5/Lv0PD3ugCeNKoj1yIWu5Ogp14HgUlCuGTc
NQkAn39i8dlFK00pHAGUeXXMWcogWn15
=05dN
-END PGP SIGNATURE-

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



Re: make Tomcat reachable on internet

2012-03-05 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

David,

On 3/1/12 7:18 PM, David Kerber wrote:
 On 3/1/2012 5:55 PM, giovo87 wrote:
 is this the only one solution?
 
 
 changing some router's configurations or ubuntu's firewall
 configurations can i have the same result?
 Actually, you'll have to change BOTH of those to allow the port you
 want through.  And then your ISP also has to allow incoming
 connections on the desired port.  I have done this, but I had to
 sign up for a business account with my ISP, because their TOS
 didn't allow me to run a server on a home acct.

Most ISP TOSs (at least in the US) say the same thing, but they don't
really care unless you start eating-up a ton of bandwidth. It's
largely an unforced policy but it's there so they can stop you if you
start to generate a lot of traffic.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9U4TkACgkQ9CaO5/Lv0PCk0QCaA+NkOtf2pTP/z2WDo1ekg9QC
FBEAnihyG130/lTp3b8Be07oSjzL3y5x
=n1PA
-END PGP SIGNATURE-

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



Re: [Tomcat JDBC Pool] Close pooled connections via JMX

2012-03-05 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Brooke,

On 3/4/12 10:29 AM, Brooke Hedrick wrote:
 There are cases where either or both get restarted, but the issue
 is only when the @otherdb is restarted and not the primary.

So, you have a setup like this:

DBCP --- jdbc --- Primary --- Oracle -- Secondary

The secondary db is restarted and thus the Oracle link essentially
goes down. The next time you make a query across the jdbc link to
the secondary database, you get an error.

IMO you can't fix this at the Tomcat end without using a validation
query that tests the end-to-end connection. It really seems like the
wrong place to fix it, anyway. What you really need to fix is the
Oracle link, which is surely configured somewhere in Oracle.

Suppose if you could kill the whole pool, you'll get new connections,
but won't the Oracle link still be dead? Or, does a db-link co-exist
with the connection to the primary db?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9U40MACgkQ9CaO5/Lv0PDWlQCgr98eLBsOmFezC8o0OogeeKa2
T14An29FLIVaFbRFaTqfEAdeZt5LWlod
=U8gU
-END PGP SIGNATURE-

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



Re: make Tomcat reachable on internet

2012-03-05 Thread David kerber

On 3/5/2012 10:52 AM, Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

David,

On 3/1/12 7:18 PM, David Kerber wrote:

On 3/1/2012 5:55 PM, giovo87 wrote:

is this the only one solution?


changing some router's configurations or ubuntu's firewall
configurations can i have the same result?

Actually, you'll have to change BOTH of those to allow the port you
want through.  And then your ISP also has to allow incoming
connections on the desired port.  I have done this, but I had to
sign up for a business account with my ISP, because their TOS
didn't allow me to run a server on a home acct.


Most ISP TOSs (at least in the US) say the same thing, but they don't
really care unless you start eating-up a ton of bandwidth. It's
largely an unforced policy but it's there so they can stop you if you
start to generate a lot of traffic.


Yes, that's the way mine was, but the business account was only $2.00 
more than the home acct, so I decided to stay legal on it.  They also 
bumped up my outgoing bandwidth when I upgraded, though the incoming 
stayed the same.  I get better tech support response as well.


d

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



Re: [Tomcat JDBC Pool] Close pooled connections via JMX

2012-03-05 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Brooke,

On 3/4/12 4:57 PM, Brooke Hedrick wrote:
 Everyone - the feedback is great, but it still is just working
 around the elimination of a jmx call, if that is the case.
 
 Why is the jmc close() method being eliminated?

Maybe I missed something... why do you think that the close() method
is being eliminated? As of 7.0.25, it's still in there.

Note that calling close() will kill the DataSource, not reset it.
You'll still have to figure out how to create a new one in its place
and register it. It sounds like what you really want to do is request
a new recycle method available through JMX that just closes and
re-opens all connections in the pool.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9U+GsACgkQ9CaO5/Lv0PAAJwCfbsk8rZUXLOBJQ8+v1TwcpQ+M
f80An3QsKn9rtBBPlVf5FPe+6PUvPlZa
=jOzd
-END PGP SIGNATURE-

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



Re: make Tomcat reachable on internet

2012-03-05 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

David,

On 3/5/12 11:04 AM, David kerber wrote:
 Yes, that's the way mine was, but the business account was only
 $2.00 more than the home acct, so I decided to stay legal on it.
 They also bumped up my outgoing bandwidth when I upgraded, though
 the incoming stayed the same.  I get better tech support response
 as well.

Sounds like a good deal to me!

Which ISP was it? Feel free to email me off-list if you don't want to
broadcast it to the world (Verizon?).

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9U+LEACgkQ9CaO5/Lv0PD9jQCePV1bl8LJ2tiZy9bCDfKK9oIq
tLgAn3fD5oyNoammjc4qbCsXznN5Fpc7
=B4Fz
-END PGP SIGNATURE-

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



Re: RE : Tomcat7 OutOFMemoryError

2012-03-05 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Philippe,

On 3/5/12 8:14 AM, Philippe ROUXEL wrote:
 75MB of stack is needed by hibenate to save the data aka a graph.

What!? Does Hibernate have some kind of method that needs to call itself
recursively 100,000 times?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9U+QoACgkQ9CaO5/Lv0PBohQCgkNWLGYeCYUpza6SCeHWB0MfU
r/YAniIl3sAUg/59qNoh8CJmkJKDhCn/
=2gvb
-END PGP SIGNATURE-

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



Re: RE : Tomcat7 OutOFMemoryError

2012-03-05 Thread Brooke Hedrick
On Mar 5, 2012 11:34 AM, Christopher Schultz ch...@christopherschultz.net
wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Philippe,

 On 3/5/12 8:14 AM, Philippe ROUXEL wrote:
  75MB of stack is needed by hibenate to save the data aka a graph.


Philippe, are you confusing stack memory with heap memory?

 What!? Does Hibernate have some kind of method that needs to call itself
 recursively 100,000 times?

 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
 Comment: GPGTools - http://gpgtools.org
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

 iEYEARECAAYFAk9U+QoACgkQ9CaO5/Lv0PBohQCgkNWLGYeCYUpza6SCeHWB0MfU
 r/YAniIl3sAUg/59qNoh8CJmkJKDhCn/
 =2gvb
 -END PGP SIGNATURE-

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



Re: Maven and dependencies for $CATALINA/lib

2012-03-05 Thread James Apfel
Your change fixed it. Thanks!


On Mon, Mar 5, 2012 at 9:42 AM, Olivier Lamy ol...@apache.org wrote:
 2012/3/5 Olivier Lamy ol...@apache.org:
 2012/3/4 James Apfel james.ap...@gmail.com:
 Hi,

 I'm working on a project that requires me to replace Tomcat's
 SessionManager. I've created a src/main/webapp/META-INF/context.xml
 (it defines the custom Manager) and I've edited my Maven pom file to
 include the requires JARs in the tomcat6-maven-plugin's dependencies
 section (see below) but I'm not sure if that actually refers to
 $CATALINA/lib or if these dependencies are for something else. It's
 failing with a ClassNotFoundException (it can't find the Manager class
 as defined in context.xml).
 Arghh :-)
 The dependencies for the tomcat start (the plugin create a class
 loader with needed embeded tomcat jars) are limited to groupId
 org.apache.tomcat
 Can you load an issue ? https://issues.apache.org/jira/browse/MTOMCAT

 Thanks for the issue entry.
 That should be fixed now. Can you try with last 2.0-SNAPSHOT.

 That's an easy fix.


 Thanks,
  James



 plugin
  groupIdorg.apache.tomcat.maven/groupId
  artifactIdtomcat6-maven-plugin/artifactId
  version2.0-SNAPSHOT/version
  dependencies
    dependency
      groupIdspy/groupId
      artifactIdspymemcached/artifactId
      version2.8.0/version
      scoperuntime/scope
    /dependency
    dependency
      groupIdde.javakaffee.msm/groupId
      artifactIdmemcached-session-manager-tc6/artifactId
      version1.6.1/version
      scoperuntime/scope
    /dependency
    dependency
      groupIdde.javakaffee.msm/groupId
      artifactIdmsm-kryo-serializer/artifactId
      version1.6.0/version
      scoperuntime/scope
    /dependency
  /dependencies
 /plugin

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




 --
 Olivier Lamy
 Talend: http://coders.talend.com
 http://twitter.com/olamy | http://linkedin.com/in/olamy



 --
 Olivier Lamy
 Talend: http://coders.talend.com
 http://twitter.com/olamy | http://linkedin.com/in/olamy

 -
 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 JDBC Pool] Close pooled connections via JMX

2012-03-05 Thread Michael

Pid schrieb:

On 03/03/2012 12:33, Michael wrote:

Hi folks,

I've been examining the JMX operations of the new pool and did not find
a crucial one.

Sometimes our Oracle database has to be restarted, the pool still keeps
the pooled connections. The webapp requests a connection, receives a
pooled one and boom = ORA-... Connection closed.

I'd like to be able via JMX to reopen all open pooled connections
without the need to restart the webapp.


Do you have testOnBorrow=true and a validationQuery=SELECT 1 FROM
DUAL configured?

This should suffice to ensure each connection is valid before use.


Pid,

works like a charms. Thanks very much.

Michael


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



Re: RE : Tomcat7 OutOFMemoryError

2012-03-05 Thread André Warnier

Brooke Hedrick wrote:

On Mar 5, 2012 11:34 AM, Christopher Schultz ch...@christopherschultz.net
wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Philippe,

On 3/5/12 8:14 AM, Philippe ROUXEL wrote:

75MB of stack is needed by hibenate to save the data aka a graph.


Philippe, are you confusing stack memory with heap memory?


What!? Does Hibernate have some kind of method that needs to call itself
recursively 100,000 times?


I found this page which may be of interest :
http://www.odi.ch/weblog/posting.php?posting=411


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



Re: [Tomcat JDBC Pool] Close pooled connections via JMX

2012-03-05 Thread Chema

 Do you have testOnBorrow=true and a validationQuery=SELECT 1 FROM
 DUAL configured?

 This should suffice to ensure each connection is valid before use.


 Pid,

 works like a charms. Thanks very much.


From Tomcat doc for testOnBorrow setting:

The indication of whether objects will be validated before being
borrowed from the pool. If the object fails to validate, it will be
dropped from the pool, and we will attempt to borrow another
For a true value to have any effect, the validationQuery parameter
must be set to a non-null string. Default value is false In order to
have a more efficient validation, see validationInterval Default value
is false

I don't understand how it works now

By the way, what does validate a object ?

Regards

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



RE: RE : Tomcat7 OutOFMemoryError

2012-03-05 Thread Caldarale, Charles R
 From: André Warnier [mailto:a...@ice-sa.com] 
 Subject: Re: RE : Tomcat7 OutOFMemoryError

 I found this page which may be of interest :
 http://www.odi.ch/weblog/posting.php?posting=411

This one's also pretty interesting, especially the link to Cliff Click's blog:
http://mail.openjdk.java.net/pipermail/hotspot-dev/2011-June/004272.html

(CC's blog doesn't have much to do with the OP's problem, but it illustrates 
the complexity of stack handling in the JVM and why one size fits none.)

 - 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 JDBC Pool] Close pooled connections via JMX

2012-03-05 Thread Michael

Chema schrieb:

Do you have testOnBorrow=true and a validationQuery=SELECT 1 FROM
DUAL configured?

This should suffice to ensure each connection is valid before use.


Pid,

works like a charms. Thanks very much.




From Tomcat doc for testOnBorrow setting:


The indication of whether objects will be validated before being
borrowed from the pool. If the object fails to validate, it will be
dropped from the pool, and we will attempt to borrow another
For a true value to have any effect, the validationQuery parameter
must be set to a non-null string. Default value is false In order to
have a more efficient validation, see validationInterval Default value
is false

I don't understand how it works now

By the way, what does validate a object ?


It executes the validation query and checks if there is no SQLException.

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



Re: [Tomcat JDBC Pool] Close pooled connections via JMX

2012-03-05 Thread Chema
2012/3/5 Michael sg...@gmx.net:
 Chema schrieb:

 Do you have testOnBorrow=true and a validationQuery=SELECT 1 FROM
 DUAL configured?

 This should suffice to ensure each connection is valid before use.


 Pid,

 works like a charms. Thanks very much.



 It executes the validation query and checks if there is no SQLException.

Thanks ...but , if you only restart the remote db , the query SELECT
1 FROM DUAL always works , am I wrong ?

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



Re: [Tomcat JDBC Pool] Close pooled connections via JMX

2012-03-05 Thread Michael

Chema schrieb:

2012/3/5 Michael sg...@gmx.net:

Chema schrieb:


Do you have testOnBorrow=true and a validationQuery=SELECT 1 FROM
DUAL configured?

This should suffice to ensure each connection is valid before use.


Pid,

works like a charms. Thanks very much.




It executes the validation query and checks if there is no SQLException.


Thanks ...but , if you only restart the remote db , the query SELECT
1 FROM DUAL always works , am I wrong ?


No if the connection has been reset by the instance. The query will 
result in a SQLException. You have to close the connection and open a 
new one. The query works on an open connection only. That's the point.

See the second paragraph of this [1].

Mike

[1] 
http://docs.oracle.com/javase/6/docs/api/java/sql/Connection.html#isClosed%28%29


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



Re: RE : Tomcat7 OutOFMemoryError

2012-03-05 Thread Pid
On 05/03/2012 20:39, Caldarale, Charles R wrote:
 From: André Warnier [mailto:a...@ice-sa.com] 
 Subject: Re: RE : Tomcat7 OutOFMemoryError
 
 I found this page which may be of interest :
 http://www.odi.ch/weblog/posting.php?posting=411
 
 This one's also pretty interesting, especially the link to Cliff Click's blog:
 http://mail.openjdk.java.net/pipermail/hotspot-dev/2011-June/004272.html
 
 (CC's blog doesn't have much to do with the OP's problem, but it illustrates 
 the complexity of stack handling in the JVM and why one size fits none.)

Varies by OS too.

-XX:ThreadStackSize=512

Thread Stack Size (in Kbytes). (0 means use default stack size) [Sparc:
512; Solaris x86: 320 (was 256 prior in 5.0 and earlier); Sparc 64 bit:
1024; Linux amd64: 1024 (was 0 in 5.0 and earlier); all others 0.]

From:
http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html


p


  - 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
 


-- 

[key:62590808]



signature.asc
Description: OpenPGP digital signature


Re: [Tomcat JDBC Pool] Close pooled connections via JMX

2012-03-05 Thread Chema
 No if the connection has been reset by the instance. The query will result
 in a SQLException. You have to close the connection and open a new one. The
 query works on an open connection only. That's the point.
 See the second paragraph of this [1].


But the problem was when you restart the remote database , not the
local database.
In this case, SELECT 1 FROM DUAL works ( doesn't return a SQL exception ).
But , when you execute after the query SELEC * FROM TABLE@remotedb,
then fails , was this the problem, right ?

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



Re: RE : Tomcat7 OutOFMemoryError

2012-03-05 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Pid,

On 3/5/12 3:54 PM, Pid wrote:
 Varies by OS too.
 
 -XX:ThreadStackSize=512
 
 Thread Stack Size (in Kbytes). (0 means use default stack size)
 [Sparc: 512; Solaris x86: 320 (was 256 prior in 5.0 and earlier);
 Sparc 64 bit: 1024; Linux amd64: 1024 (was 0 in 5.0 and earlier);
 all others 0.]

How can the default default be 0?!

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9VObIACgkQ9CaO5/Lv0PARCwCeK4OExMI0Xm3ZLfM/ji/gbHkm
A4MAn1VgN5loW2QyiayGdDW6rb4WZBlb
=QiA5
-END PGP SIGNATURE-

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



Re: [Tomcat JDBC Pool] Close pooled connections via JMX

2012-03-05 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chema,

On 3/5/12 4:06 PM, Chema wrote:
 No if the connection has been reset by the instance. The query
 will result in a SQLException. You have to close the connection
 and open a new one. The query works on an open connection only.
 That's the point. See the second paragraph of this [1].
 
 
 But the problem was when you restart the remote database , not the 
 local database. In this case, SELECT 1 FROM DUAL works ( doesn't
 return a SQL exception ). But , when you execute after the query
 SELEC * FROM TABLE@remotedb, then fails , was this the problem,
 right ?

Correct.

Note that Michael was having a problem that was solved by using a
validationQuery.  Brooke is the one with an elaborate two-tier
database with these links that survive SELECT 1 FROM DUAL but not
SELECT 1 FROM TABLE@remotedb.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9VOmAACgkQ9CaO5/Lv0PCZCACdHN9yBw5h55WbUf5CtgG9hMId
0qcAn2Cf5mDw0dZ/NA3ap+XNNFJiyKC8
=o9Fc
-END PGP SIGNATURE-

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



RE: RE : Tomcat7 OutOFMemoryError

2012-03-05 Thread Caldarale, Charles R
 From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
 Subject: Re: RE : Tomcat7 OutOFMemoryError

  Thread Stack Size (in Kbytes). (0 means use default stack size)
  [Sparc: 512; Solaris x86: 320 (was 256 prior in 5.0 and earlier);
  Sparc 64 bit: 1024; Linux amd64: 1024 (was 0 in 5.0 and earlier);
  all others 0.]

 How can the default default be 0?!

Very, very short-lived programs...

The reference to zero means default stack size for the OS.

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



Re: RE : Tomcat7 OutOFMemoryError

2012-03-05 Thread Pid
On 05/03/2012 22:09, Christopher Schultz wrote:
 Pid,
 
 On 3/5/12 3:54 PM, Pid wrote:
 Varies by OS too.
 
 -XX:ThreadStackSize=512
 
 Thread Stack Size (in Kbytes). (0 means use default stack size)
 [Sparc: 512; Solaris x86: 320 (was 256 prior in 5.0 and earlier);
 Sparc 64 bit: 1024; Linux amd64: 1024 (was 0 in 5.0 and earlier);
 all others 0.]
 
 How can the default default be 0?!

I'm just quoting the docs!


p



-- 

[key:62590808]



signature.asc
Description: OpenPGP digital signature


Re: [Tomcat JDBC Pool] Close pooled connections via JMX

2012-03-05 Thread Pid
On 05/03/2012 22:12, Christopher Schultz wrote:
 Chema,
 
 On 3/5/12 4:06 PM, Chema wrote:
 No if the connection has been reset by the instance. The query
 will result in a SQLException. You have to close the connection
 and open a new one. The query works on an open connection only.
 That's the point. See the second paragraph of this [1].

 
 But the problem was when you restart the remote database , not the 
 local database. In this case, SELECT 1 FROM DUAL works ( doesn't
 return a SQL exception ). But , when you execute after the query
 SELEC * FROM TABLE@remotedb, then fails , was this the problem,
 right ?
 
 Correct.
 
 Note that Michael was having a problem that was solved by using a
 validationQuery.  Brooke is the one with an elaborate two-tier
 database with these links that survive SELECT 1 FROM DUAL but not
 SELECT 1 FROM TABLE@remotedb.

To be fair, between that  the discussion about 'losing the close
method' it's no wonder people got confused...


p



-- 

[key:62590808]



signature.asc
Description: OpenPGP digital signature


Re: RE : Tomcat7 OutOFMemoryError

2012-03-05 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chuck,

On 3/5/12 5:20 PM, Caldarale, Charles R wrote:
 From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
 Subject: Re: RE : Tomcat7 OutOFMemoryError
 
 Thread Stack Size (in Kbytes). (0 means use default stack
 size) [Sparc: 512; Solaris x86: 320 (was 256 prior in 5.0 and
 earlier); Sparc 64 bit: 1024; Linux amd64: 1024 (was 0 in 5.0
 and earlier); all others 0.]
 
 How can the default default be 0?!
 
 Very, very short-lived programs...
 
 The reference to zero means default stack size for the OS.

Yes, at the command-line. It looked like Pid was quoting the
documentation for what the default stack size was on a particular
platform (used presumably when you set them to '0' or didn't specify
them at all). If the default is 0, then ... ?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9VXJoACgkQ9CaO5/Lv0PCMPQCgpbnk/Iaoo7xunKiRAa7sByRW
I9gAn0lrzRcnaRqSyUHo715aUocnt6j7
=2BUQ
-END PGP SIGNATURE-

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



Re: [Tomcat JDBC Pool] Close pooled connections via JMX

2012-03-05 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Pid,

On 3/5/12 5:55 PM, Pid wrote:
 On 05/03/2012 22:12, Christopher Schultz wrote:
 Chema,
 
 On 3/5/12 4:06 PM, Chema wrote:
 No if the connection has been reset by the instance. The
 query will result in a SQLException. You have to close the
 connection and open a new one. The query works on an open
 connection only. That's the point. See the second paragraph
 of this [1].
 
 
 But the problem was when you restart the remote database , not
 the local database. In this case, SELECT 1 FROM DUAL works (
 doesn't return a SQL exception ). But , when you execute after
 the query SELEC * FROM TABLE@remotedb, then fails , was this
 the problem, right ?
 
 Correct.
 
 Note that Michael was having a problem that was solved by using
 a validationQuery.  Brooke is the one with an elaborate two-tier 
 database with these links that survive SELECT 1 FROM DUAL but
 not SELECT 1 FROM TABLE@remotedb.
 
 To be fair, between that  the discussion about 'losing the close 
 method' it's no wonder people got confused...

There's nothing like chasing your tail for a few days on a mailing list.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9VXMoACgkQ9CaO5/Lv0PBUWgCgrCozrsjfedR5NkZ6sy4pqs02
OcUAoJLuKRPTWnkssK59SgUjsMFRESts
=BcMC
-END PGP SIGNATURE-

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



Proxypass Question

2012-03-05 Thread Truckman
Greetings,

I'm not sure whether this is a tomcat6 issue or an apache issue, but I thought 
maybe I would start here if no one minds.

We have a domain name and we have apache answering the door on both https(443) 
and http(80).  What we'd like to do is proxypass port 443 to tomcat6, and have 
port 80 serve html files normally on that domain name (i.e. different content)

So, we defined such in /etc/httpd/conf.d/virtuals.conf like so:

NameVirtualHost *:443

VirtualHost *:443
ServerName www.example.com:443
SSLEngine on
SSLCipherSuite 
ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile /mnt/html/example/example.com.crt
SSLCertificateKeyFile /mnt/html/example/www.example.com.key
ProxyPass / ajp://localhost:8009/
/VirtualHost

NameVirtualHost *:80

VirtualHost *:80
ServerName www.example.com:80
#ProxyPass / ajp://localhost:8009/
DocumentRoot/mnt/html/example
/VirtualHost

With the above, nothing works and in the /var/log/error_log file we see an 
entry for file does not exist /mnt/html/example/, and we get that entry 
regardless whether we hit ports 443 or port 80 - which tells us nothing is 
proxying when set this way.

If we change the latter part of the configuration file to this:

NameVirtualHost *:80

VirtualHost *:80
ServerName www.example.com:80
ProxyPass / ajp://localhost:8009/
#DocumentRoot/mnt/html/example
/VirtualHost

Then https: does in fact proxy up to tomcat6, the application loads, and all is 
well.  However, it does the very same thing for port 80 as the proxypass 
statement is there also.

Proxypass seems to only work if both ports are proxied, and not work if either 
port is not proxied.

My question is this - is that the normal/expected behavior of proxypass, or 
should we keep digging elsewhere?

Thank you very much!




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



Issues with the tomcat connector (On W2k8 + IIS7.5)

2012-03-05 Thread Alex Samad - Yieldbroker
Hi

This is my prod setup

Client - Internet - IIS7.5/NLB (2 node cluster) with the 1.2.32 tomcat 
connector - 2 node tomcat cluster.

We had done a fair bit of testing on this setup enough to move into production. 
 But we ran into a problem ... when IIS recycle its application pool. Luckily 
we had set this to manually happen after hours

So I setup a test rig to see if I could simulate the problem.  The test rig is

Client - 1 node of IIS7.5  + 1.2.32 tomcat connector - 2 node of development 
tomcat :)

The client works by creating a connection and keeping it open and making lots 
of requests.  

We have jerry rigged a client to make multiple of these as the error occurs 
when the system is under load.

So the test scenario is 
start client
login  this creates 1 connection 
strat stress test  this creates 500 connection and does a little bit of 
polling

My initial setup is 
4 process worker threads for the application pool
Allow overlapping recycle  my understanding is this means the 4 threads are 
not all terminated at once, but one at a time as a new thread is restarted

I use isapi_redirect.properties file

extension_uri=/jakarta/isapi_redirect.dll
log_file=C:\ThisNow\Local\dev.ThisNow.com\Logs\ajpconfisapi_redirect.log
log_level=warn
log_filesize=20M
worker_file=C:\ThisNow\Shared\dev.ThisNow.com\ajpconfig\workers.properties
worker_mount_file=C:\ThisNow\Shared\dev.ThisNow.com\ajpconfig\uriworkermap.properties
rewrite_rule_file=C:\ThisNow\Shared\dev.ThisNow.com\ajpconfig\\rewrite.properties


C:\ThisNow\Shared\dev.ThisNow.com\ajpconfig\workers.properties

worker.maintain=60
worker.list=jbclb
worker.jbclb.type=lb
worker.jbclb.balance_workers=worker1, worker2
worker.jbclb.sticky_session=true
worker.jbclb.method=Request
worker.jbclb.lock=pessimistic

# Template for all worker threads
worker.template.type=ajp13
worker.template.port=8009
worker.template.ping_mode=A
worker.template.ping_timeout=3
worker.template.connection_pool_size=1000
worker.template.connection_pool_minsize=100
worker.template.socket_keepalive=true
worker.template.lock=pessimistic
worker.template.max_packet_size=65536

# worker 1
worker.worker1.host=10.172.204.30
worker.worker1.route=node1
worker.worker1.reference=worker.template

# worker 1
worker.worker2.route=node2
worker.worker2.host=10.172.204.31
worker.worker2.reference=worker.template

worker.list=jkstatus
# Define a 'jkstatus' worker using status
worker.jkstatus.type=status



C:\ThisNow\Shared\dev.ThisNow.com\ajpconfig\uriworkermap.properties
= 
/dev.ThisNow.com/ThisNowLive|/*=jbclb
/dev.ThisNow.com/wls|/*=jbclb
/dev.ThisNow.com/jkmanager|/*=jkstatus
/10.172.204.33/jkmanager|/*=jkstatus
/ThisNowodevrp01/jkmanager|/*=jkstatus




C:\ThisNow\Shared\dev.ThisNow.com\ajpconfig\rewrite.properties
=== 
# rewrite rules
# Convert single node 
~/jb./(.*)=/$1
/web-debts-1.0.0-nossl/=/web-debts-1.0.0/


I can see there are 500 connection to IIS and ~500 connection through to 
tomcat. Check with perfmon, netstat...

When I recycle the application pool. IIS starts to send 500's back to the 
server it complain about the tomcat connector returning an error errorcode 
2147942401, internal server error Incorrect Function 0c80070001

What I can see from the network side of things. Is the client is trying to 
recreate all 500 connections at once.

What I can see in my tomcat connector logs... some times there is 4 for each 
process and sometimes 2 or 3, if its crashed into this 500 error loop


Examples of what I see (2 log files)
Ajp file 1
===
[Tue Mar 06 14:46:46.572 2012] [5872:5028] [error] 
ajp_worker_factory::jk_ajp_common.c (2997): allocating ajp worker record from 
shared memory 
[Tue Mar 06 14:46:46.572 2012] [5872:5028] [error] 
wc_create_worker::jk_worker.c (151): factory for ajp13 failed for worker2 
m shared memory 
[Tue Mar 06 14:46:46.572 2012] [5872:5028] [error] validate::jk_lb_worker.c 
(1615): Failed creating worker worker2 
worker2 
[Tue Mar 06 14:46:46.587 2012] [2888:5708] [error] 
ajp_worker_factory::jk_ajp_common.c (2997): allocating ajp worker record from 
shared memory 
[Tue Mar 06 14:46:46.603 2012] [5872:5028] [error] validate::jk_lb_worker.c 
(1663): NULL parameters 
[Tue Mar 06 14:46:46.603 2012] [5872:5028] [error] 
wc_create_worker::jk_worker.c (163): validate failed for jbclb 
 worker2 
[Tue Mar 06 14:46:46.619 2012] [5872:5028] [error] 
build_worker_map::jk_worker.c (262): failed to create worker jbclb 
[Tue Mar 06 14:46:46.619 2012] [5872:5028] [error] 
uri_worker_map_ext::jk_uri_worker_map.c (506): Could not find worker with name 
'jkstatus' in uri map post processing. 
[Tue Mar 06 14:46:46.619 2012] [5872:5028] [error] 
uri_worker_map_ext::jk_uri_worker_map.c (506): Could not find worker with name 
'jbclb' in uri map post processing. 
[Tue Mar 06 14:46:46.634 2012] 

Re: RE : Tomcat7 OutOFMemoryError

2012-03-05 Thread Rainer Frey

On 05.03.2012, at 14:14, Philippe ROUXEL wrote:

 When I set JAVA_OPTS= -Xmx1024m -Xss75m
 
 That means: each thread get a stack of 75MB. One of the following applies:
 * the operating system has a limit on thread stack size
 * the per process memory limit is reached before all initial tomcat threads 
 are started
 * the system runs out of total memory before all initial tomcat threads are 
 started
 
 75MB thread stack size seems quite insane, the default is around 1-2MB. 
 Perhaps you meant to set -Xms (which sets the initial Java heap size)?
 75MB of stack is needed by hibenate to save the data aka a graph.

I haven't used hibernate personally, but I never heard anything like that. So 
please elaborate. Where did you get that information?
Also what do you mean with graph? The graph of associated objects that are 
updated by one hibernate call, or is your data actually graph data?
If so, how is that mapped? do you have any self-referential associations?
Is it really stack that you are talking about?

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



Re: Proxypass Question

2012-03-05 Thread Pid
Please start an entirely new thread, rather than replying to and editing
an existing, already rather long and confusing thread[1].


p


1. Re: [Tomcat JDBC Pool] Close pooled connections via JMX



signature.asc
Description: OpenPGP digital signature


Re: RE : Tomcat7 OutOFMemoryError

2012-03-05 Thread Pid
On 06/03/2012 07:12, Rainer Frey wrote:
 
 On 05.03.2012, at 14:14, Philippe ROUXEL wrote:
 
 When I set JAVA_OPTS= -Xmx1024m -Xss75m

 That means: each thread get a stack of 75MB. One of the following applies:
 * the operating system has a limit on thread stack size
 * the per process memory limit is reached before all initial tomcat threads 
 are started
 * the system runs out of total memory before all initial tomcat threads are 
 started

 75MB thread stack size seems quite insane, the default is around 1-2MB. 
 Perhaps you meant to set -Xms (which sets the initial Java heap size)?
 75MB of stack is needed by hibenate to save the data aka a graph.
 
 I haven't used hibernate personally, but I never heard anything like that. So 
 please elaborate. Where did you get that information?
 Also what do you mean with graph? The graph of associated objects that are 
 updated by one hibernate call, or is your data actually graph data?
 If so, how is that mapped? do you have any self-referential associations?
 Is it really stack that you are talking about?

I'm also interested in the answers to these questions.


p



-- 

[key:62590808]



signature.asc
Description: OpenPGP digital signature