Re: Tomcat managed connections (DBCP) with driver in web application.

2012-10-09 Thread Jeremy Heiler
On Tue, Oct 9, 2012 at 5:46 PM, Christopher Schultz
 wrote:
> Are you sure you're not just getting the "global" driver and it
> happens to work properly?

There is no "global" driver because I took the jar out of
$CATALINA_HOME/lib before running the test and restarted the server.

>
> - -chris

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



Re: Tomcat managed connections (DBCP) with driver in web application.

2012-10-09 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Jeremy,

On 10/9/12 5:19 PM, Jeremy Heiler wrote:
> On Tue, Oct 9, 2012 at 4:56 PM, Andrew Todd
>  wrote:
>> 
>> On Tue, Oct 9, 2012 at 10:37 AM, Jeremy Heiler
>>  wrote:
>>> Every resource I've read thus far has said that the driver jar
>>> must be in $CATALINA_HOME/lib or DBCP wont work.
>> 
>> Can you provide a link for that? I've been just fine bundling
>> the Oracle 11 library inside my .war file.
> 
> http://tomcat.apache.org/tomcat-7.0-doc/jndi-resources-howto.html#JDBC_Data_Sources
>
>  "Use of the JDBC Data Sources JNDI Resource Factory requires that
> you make an appropriate JDBC driver available to both Tomcat
> internal classes and to your web application. This is most easily
> accomplished by installing the driver's JAR file(s) into the
> $CATALINA_HOME/lib directory, which makes the driver available both
> to the resource factory and to your application."
> 
> My expectation is that the jars in the WAR file are not available
> to the Tomcat internal classes.
> 
>> For that matter, I actually pull in the DBCP artifact from
>> Maven, because I'm developing on Grails and their embedded Tomcat
>> instance for development doesn't (or didn't, at least) contain
>> DBCP.
> 
> In that case, I would expect my test case to work. However, since I
> am still using Tomcat's DBCP machinery, I would expect my test case
> to fail.

Are you sure you're not just getting the "global" driver and it
happens to work properly?

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

iEYEARECAAYFAlB0mx4ACgkQ9CaO5/Lv0PAXigCghaBSe7FK+AR7okmwG0UWymSH
pxAAoI0C5kKt1WpnA2FrahSd5k/V4cVc
=iK4S
-END PGP SIGNATURE-

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



Re: Tomcat managed connections (DBCP) with driver in web application.

2012-10-09 Thread Andrew Todd
On Tue, Oct 9, 2012 at 5:19 PM, Jeremy Heiler  wrote:
> "Use of the JDBC Data Sources JNDI Resource Factory requires that you

Ah, OK. I'm not using JNDI. I'm instantiating the DBCP as a Spring
bean inside the app.

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



Re: Tomcat managed connections (DBCP) with driver in web application.

2012-10-09 Thread Jeremy Heiler
On Tue, Oct 9, 2012 at 4:56 PM, Andrew Todd  wrote:
>
> On Tue, Oct 9, 2012 at 10:37 AM, Jeremy Heiler 
> wrote:
> > Every resource I've read thus far has said that the driver jar must be
> > in $CATALINA_HOME/lib or DBCP wont work.
>
> Can you provide a link for that? I've been just fine bundling the
> Oracle 11 library inside my .war file.

http://tomcat.apache.org/tomcat-7.0-doc/jndi-resources-howto.html#JDBC_Data_Sources

"Use of the JDBC Data Sources JNDI Resource Factory requires that you
make an appropriate JDBC driver available to both Tomcat internal
classes and to your web application. This is most easily accomplished
by installing the driver's JAR file(s) into the $CATALINA_HOME/lib
directory, which makes the driver available both to the resource
factory and to your application."

My expectation is that the jars in the WAR file are not available to
the Tomcat internal classes.

> For that matter, I actually pull in the DBCP artifact from Maven,
> because I'm developing on Grails and their embedded Tomcat instance
> for development doesn't (or didn't, at least) contain DBCP.

In that case, I would expect my test case to work. However, since I am
still using Tomcat's DBCP machinery, I would expect my test case to
fail.

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



Re: Apache, Tomcat and Comet

2012-10-09 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Mikel,

On 10/9/12 4:15 PM, Mikel Gonzalez Gainza wrote:
> Is it smart changing from mod_jk to mod_proxy when all other web
> applications run just fine? Is it possible to use both at the same
> time?

Yes, you can use mod_jk and mod_proxy_ajp (or mod_proxy_http)
side-by-side. Just make sure that you map your URLs properly and
you'll be fine.

> I dont think this one is possible since, even though you can
> configure which URLs get redirected with mod_proxy, you'd need
> different connectors in tomcat! Is that even possible?

You can set up as many connectors in Tomcat as you want: it's just
more port numbers. You can even have them all share the same
 so you have a single thread pool for everything, regardless
of protocol.

> Ideal thing would be to add mod_proxy (without removing mod_jk) so
> my Comet application runs without problem, adding another connector
> for it and, depending on which web application is accessed, use one
> connector or the other. Is that possible? Sorry if these are silly
> questions but I'm not too familiar with this kind of
> configuration.

That should be no problem: just add another  on another
port and configure mod_proxy to connect to that port.

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

iEYEARECAAYFAlB0kDIACgkQ9CaO5/Lv0PAjugCffxpTNUUDqhyNaVFf9qa11IUH
VXQAnjVDFvxtBopctoL17udi9iY9EL4A
=rGqm
-END PGP SIGNATURE-

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



Re: Tomcat managed connections (DBCP) with driver in web application.

2012-10-09 Thread Andrew Todd
On Tue, Oct 9, 2012 at 10:37 AM, Jeremy Heiler  wrote:
> Every resource I've read thus far has said that the driver jar must be
> in $CATALINA_HOME/lib or DBCP wont work.

Can you provide a link for that? I've been just fine bundling the
Oracle 11 library inside my .war file.

For that matter, I actually pull in the DBCP artifact from Maven,
because I'm developing on Grails and their embedded Tomcat instance
for development doesn't (or didn't, at least) contain DBCP.

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



Re: how to programmatically expire inactive sessions?

2012-10-09 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Kirill,

On 10/9/12 2:36 PM, Kirill Kireyev wrote:
> I never modified/extended the Tomcat code, so I doubt it.

This has nothing to do with Tomcat's code: HttpSessionBindingListener
and HttpSessionListener are servlet-API interfaces that you might
implement in your own product. If they are written badly, then might
interfere with Tomcat's session-expiration thread.

I use Tomcat 5.5, 6.0, and 7.0 and none of them have any problem with
expiring sessions after the configured expiration interval.

> Could it be that I'm allocating too much heap memory (-Xmx2M),
> so that Tomcat doesn't feel the urgency to clean up?

This has nothing to do with Tomcat's desire to clean anything up: the
session-cleanup thread runs at the same interval regardless of the
heap size.

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

iEYEARECAAYFAlB0il0ACgkQ9CaO5/Lv0PAH9QCfdMlqsZ9FmL+cyGGDkYSsbUs9
TYsAnjh+fMcmNBZshzICboVHP6x6z4EI
=aKfk
-END PGP SIGNATURE-

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



Re: how to programmatically expire inactive sessions?

2012-10-09 Thread Kirill Kireyev

  
  
I never modified/extended the Tomcat
  code, so I doubt it. Could it be that I'm allocating too much heap
  memory (-Xmx2M), so that Tomcat doesn't feel the urgency to
  clean up?
  
Is is possible that you have a broken HttpSessionBindingListener or
HttpSessionListener that is preventing Tomcat from actually performing
the expirations?
  
  
  
  On 10/9/12 12:27 PM, Christopher Schultz wrote:


  -BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Kirill,

On 10/9/12 12:22 PM, Kirill Kireyev wrote:

  
I think I figured it out. It seems /manager/text/expire only lists
the expiration info, instead of expiring sessions. Also, wget
wasn't authenticating me properly. Instead I used curl against the
html interface: curl --anyauth -u xxx:yyy --data "idle=20" -d
path=/zzz http://localhost:8080/manager/html/expire

Though I'm still not sure why my sessions aren't expiring
automatically...

  
  
Is is possible that you have a broken HttpSessionBindingListener or
HttpSessionListener that is preventing Tomcat from actually performing
the expirations?

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

iEYEARECAAYFAlB0bKEACgkQ9CaO5/Lv0PBSbwCgrat4Bz5jDdnh5FoAIRRu+AhE
258An2f0l4NOJ3vd8ch1e+/26zQP1MF3
=1MMn
-END PGP SIGNATURE-

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





-- 
  Kirill Kireyev, PhD
  Founder/CTO instaGrok.com
  kir...@instagrok.com
  Twitter: @instaGrok
  FB: facebook.com/instagrok
  
  



Re: how to programmatically expire inactive sessions?

2012-10-09 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Kirill,

On 10/9/12 12:22 PM, Kirill Kireyev wrote:
> I think I figured it out. It seems /manager/text/expire only lists
> the expiration info, instead of expiring sessions. Also, wget
> wasn't authenticating me properly. Instead I used curl against the
> html interface: curl --anyauth -u xxx:yyy --data "idle=20" -d
> path=/zzz http://localhost:8080/manager/html/expire
> 
> Though I'm still not sure why my sessions aren't expiring
> automatically...

Is is possible that you have a broken HttpSessionBindingListener or
HttpSessionListener that is preventing Tomcat from actually performing
the expirations?

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

iEYEARECAAYFAlB0bKEACgkQ9CaO5/Lv0PBSbwCgrat4Bz5jDdnh5FoAIRRu+AhE
258An2f0l4NOJ3vd8ch1e+/26zQP1MF3
=1MMn
-END PGP SIGNATURE-

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



Re: How to check whether a SSL certificate has been correctly installed

2012-10-09 Thread Tom Anthony
Great information Christopher, thank you for your help.



--
View this message in context: 
http://tomcat.10.n6.nabble.com/How-to-check-whether-a-SSL-certificate-has-been-correctly-installed-tp4987669p4987692.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: How to check whether a SSL certificate has been correctly installed

2012-10-09 Thread Tom Anthony
Thank you so much, I wanted to double check.




--
View this message in context: 
http://tomcat.10.n6.nabble.com/How-to-check-whether-a-SSL-certificate-has-been-correctly-installed-tp4987669p4987690.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: how to programmatically expire inactive sessions?

2012-10-09 Thread Kirill Kireyev

  
  
I think I figured it out. It seems
  /manager/text/expire only lists the expiration info, instead of
  expiring sessions. Also, wget wasn't authenticating me properly.
  Instead I used curl against the html interface:
      curl --anyauth -u xxx:yyy --data "idle=20" -d path=/zzz
  http://localhost:8080/manager/html/expire
  
  Though I'm still not sure why my sessions aren't expiring
  automatically...
  
  -Kirill
  
  On 10/7/12 6:46 PM, Kirill Kireyev wrote:


  
  Hi, 
  
  I'm trying to force expirations of inactive sessions in Tomcat.
  (For some reason, sessions that are inactive longer than timeout
  don't expire automatically - not sure why?) 
  
  I can do it just fine, from the Tomcat Manager web app, by
  clicking the "Expire Sessions" button. 
  
  I've tried doing it programmatically by using "http://localhost:8080/manager/text/expire?path=/zzz"
  from a script running on the server:
      wget -O /dev/stdout --http-user=xxx --http-password=yyy "http://localhost:8080/manager/text/expire?path=/zzz"
  
  (I made sure that Tomcat user xxx has manager-script permissions).
  I get the following output:
  
  K - Session information for application at context path /grok
  Default maximum session inactive interval 20 minutes
  <1 minutes: 9 sessions
  1 - <2 minutes: 8 sessions
  2 - <3 minutes: 11 sessions
  3 - <4 minutes: 4 sessions
  4 - <5 minutes: 6 sessions
  5 - <6 minutes: 5 sessions
  6 - <7 minutes: 9 sessions
  7 - <8 minutes: 5 sessions
  8 - <9 minutes: 11 sessions
  9 - <10 minutes: 7 sessions
  10 - <11 minutes: 10 sessions
  11 - <12 minutes: 7 sessions
  12 - <13 minutes: 6 sessions
  13 - <14 minutes: 5 sessions
  14 - <15 minutes: 9 sessions
  15 - <16 minutes: 7 sessions
  16 - <17 minutes: 9 sessions
  17 - <18 minutes: 6 sessions
  18 - <19 minutes: 9 sessions
  >=20 minutes: 666 sessions
  
  but when I check with the Tomcat Web manager app in my web
  browser, I still see a lot of unexpired sessions (older than
  inactive interval) - which I can then manually expire, by clicking
  "Expire Sessions" button in the web app!
  
  How can i do this automatically? (And/or why don't they expire
  automatically anyway)?
  
  Thanks,
  Kirill
  
  
  
  -- 
Kirill Kireyev, PhD
Founder/CTO instaGrok.com
kir...@instagrok.com
Twitter: @instaGrok
FB: facebook.com/instagrok




-- 
  Kirill Kireyev, PhD
  Founder/CTO instaGrok.com
  kir...@instagrok.com
  Twitter: @instaGrok
  FB: facebook.com/instagrok
  
  



Tomcat managed connections (DBCP) with driver in web application.

2012-10-09 Thread Jeremy Heiler
I am using Tomcat 7 and having it manage my database connections with its
DBCP implementation. In the past I have put ojdbc14.jar in
$CATALINA_HOME/lib, which has been fine. However, some applications are
being upgraded to Oracle 11g and require the ojdbc6.jar instead. If I take
the jar out of $CATALINA_HOME/lib and put the correct one in each
individual application, everything works fine, except for the "cannot
unregister driver" error Tomcat logs.

Every resource I've read thus far has said that the driver jar must be
in $CATALINA_HOME/lib or DBCP wont work. Except that it appears to work
just fine. Perhaps I am missing something? Are there other consequences for
putting the driver in each individual webapp (when having Tomcat manage
connections) and not in $CATALINA_HOME/lib?

Thanks,
//Jeremy


[ANN] Apache Tomcat 7.0.32 released

2012-10-09 Thread Mark Thomas
The Apache Tomcat team announces the immediate availability of Apache
Tomcat 7.0.32.

Apache Tomcat is an open source software implementation of the Java
Servlet and JavaServer Pages technologies.

This release contains a small number of bug fixes and improvements
compared to version 7.0.30. The notable changes include:
- A new option to automatically remove old, unused versions (ones where
  there are no longer any active sessions) of applications deployed
  using parallel deployment.
- Faster parsing of JSPs.
- Making the members and deployer associated with a cluster visible via
  JMX.

Please refer to the change log for the complete list of changes:
http://tomcat.apache.org/tomcat-7.0-doc/changelog.html

Note: This version has 4 zip binaries: a generic one and three
  bundled with Tomcat native binaries for Windows operating systems
  running on different CPU architectures.

Note: If you use the APR/native AJP or HTTP connector you *must* upgrade
  to version 1.1.24 or later of the AJP/native library

Downloads:
http://tomcat.apache.org/download-70.cgi

Migration guides from Apache Tomcat 5.5.x and 6.0.x:
http://tomcat.apache.org/migration.html

Thank you,

-- The Apache Tomcat Team

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