Tomcat + Ubuntu Juju = HA/clustered and integrated Tomcat in Seconds

2013-10-31 Thread Maarten Ectors
Hi Tomcat Expert,

You probably know Ubuntu from the Ubuntu desktop or phone. You might know
that we are the number 1 operating system in the cloud and the number 1
OpenStack distribution.

What you might not know is that one of our latest open source
products, Jujuhttp://juju.ubuntu.comcan instantly deploy, integrate
and scale any server software on any cloud
or server. An expert makes a
charmhttps://juju.ubuntu.com/docs/charms.html one
time and anybody in the world can instantly deploy it via juju deploy
charmname or via our GUI http://jujucharms.com

We are trying to give anybody in the world an instant
high-available/clustered tomcat stack based on a blueprint design. If you
want to understand what we mean with instant just go to
comingsoon.jujucharms.com and drag and drop the tomcatHAstack.yaml file on
the canvas.

You will see how tomcat, apache, haproxy, memcached, terracotta, mysql,
postgres and mongo all get installed in multiple instances and mostly all
get instantly integrated. This is exactly our problem, we are almost where
we want to be with creating instant Tomcat clusters and having tomcat come
pre-integrated with lots of third-party software. However we must admit
that we are not a Java fortress. We are not an expert on how to make the
tomcat clustering work on any cloud. We build three versions of tomcat but
non is really the top quality that we would have hoped for:
tomcat 
charmhttp://comingsoon.jujucharms.com/sidebar/search/~robert-ayres/precise/tomcat-3/?text=tomcat
tomcat7 
charmhttp://comingsoon.jujucharms.com/sidebar/search/oneiric/tomcat7-0/?text=tomcat
tomcat6 
charmhttp://comingsoon.jujucharms.com/sidebar/search/precise/tomcat6-1/?text=tomcat

We now got a request from a non-profit group, that is creating open source
software to help poor countries better manage their health records, to use
our tomcat charm to install their software in high-availability clusters.
We could really use some help from the tomcat community and ideally have
the tomcat community take over the ownership of the tomcat charm hence
anybody can instantly have blueprint solutions that come pre-integrated and
scale on the click of a button. Can you please help us? We can give you
remote training on how to charm and you can find more info on creating
charms here https://juju.ubuntu.com/docs/authors-charm-writing.html.

Many thanks,
Maarten


tomcatHAstack.yaml
Description: application/yaml

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

Tomcat getting stopped when idle

2013-10-31 Thread Vidyadhar
Hi,

We are facing some weird issue in our Tomcat environment. After starting
the Tomcat process on one of our Solaris server, process is automatically
getting shutdown after 2-3 minutes if no activity is done through
Application deployed in Tomcat.

I have observed similar issue in one of following mailing thread where as
user has asked to install a Listener and print a stacktrace when the stop
event
happens. I need to know how to install such Listener.

http://www.mail-archive.com/users@tomcat.apache.org/msg84717.html

Server version: Apache Tomcat/6.0.16
Server built:   Jan 28 2008 11:35:29
Server number:  6.0.16.0
OS Name:SunOS
OS Version: 5.10
Architecture:   sparc
JVM Version:1.6.0_51-b11
JVM Vendor: Sun Microsystems Inc.


Error in the catalina.out

Oct 30, 2013 5:04:56 AM org.apache.coyote.http11.Http11Protocol pause
INFO: Pausing Coyote HTTP/1.1 on http-9920
Oct 30, 2013 5:04:56 AM org.apache.catalina.connector.Connector pause
SEVERE: Protocol handler pause failed
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:382)
at
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:241)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:228)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:365)
at java.net.Socket.connect(Socket.java:527)
at java.net.Socket.connect(Socket.java:476)
at java.net.Socket.init(Socket.java:373)
at java.net.Socket.init(Socket.java:216)
at
org.apache.jk.common.ChannelSocket.unLockSocket(ChannelSocket.java:486)
at org.apache.jk.common.ChannelSocket.pause(ChannelSocket.java:283)
at org.apache.jk.server.JkMain.pause(JkMain.java:681)
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$CatalinaShutdownHook.run(Catalina.java:671)
Oct 30, 2013 5:04:57 AM org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina
Oct 30, 2013 5:04:58 AM org.apache.coyote.http11.Http11Protocol destroy
INFO: Stopping Coyote HTTP/1.1 on http-9920



-- 
Regards,


com.amazonaws.services.dynamodb.sessionmanager.DynamoDBSessionManager

2013-10-31 Thread spring
Hi,

when I use the
com.amazonaws.services.dynamodb.sessionmanager.DynamoDBSessionManager I get
classloader issues when a session gets deserialized and my session contains
classes which are not available to the shared loader.

My question:

Is this a bug in
com.amazonaws.services.dynamodb.sessionmanager.DynamoDBSessionManager? 
I do not want to put these classes into the shared loader because they
belong only to a special webapp.

Thank you.

P.S.

Code can be found here:

https://github.com/aws/aws-dynamodb-session-tomcat/tree/master/src/main/java
/com/amazonaws/services/dynamodb/sessionmanager


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



Re: com.amazonaws.services.dynamodb.sessionmanager.DynamoDBSessionManager

2013-10-31 Thread Daniel Mikusa
On Oct 31, 2013, at 8:19 AM, spr...@gmx.eu wrote:

 Hi,
 
 when I use the
 com.amazonaws.services.dynamodb.sessionmanager.DynamoDBSessionManager I get
 class loader issues

Can you be more specific here?  What stack trace do you see?

 when a session gets deserialized and my session contains
 classes which are not available to the shared loader.
 
 My question:
 
 Is this a bug in
 com.amazonaws.services.dynamodb.sessionmanager.DynamoDBSessionManager? 

Couple things hereā€¦

1.) Seeing as it's their code, have you asked Amazon?  Not sure if this is you, 
but seems like a similar issue.

  https://github.com/aws/aws-dynamodb-session-tomcat/issues/1

2.) Have you tried one of Tomcat's included persistent session managers?  Do 
you see the same behavior?  My guess is that you won't, but it never hurts to 
try and it would certainly point the finger at Amazon's code.

  http://tomcat.apache.org/tomcat-7.0-doc/config/manager.html

Dan

 I do not want to put these classes into the shared loader because they
 belong only to a special webapp.
 
 Thank you.
 
 P.S.
 
 Code can be found here:
 
 https://github.com/aws/aws-dynamodb-session-tomcat/tree/master/src/main/java
 /com/amazonaws/services/dynamodb/sessionmanager
 
 
 -
 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: com.amazonaws.services.dynamodb.sessionmanager.DynamoDBSessionManager

2013-10-31 Thread Konstantin Kolinko
2013/10/31  spr...@gmx.eu:
 Hi,

 when I use the
 com.amazonaws.services.dynamodb.sessionmanager.DynamoDBSessionManager I get
 classloader issues when a session gets deserialized and my session contains
 classes which are not available to the shared loader.

 My question:

 Is this a bug in
 com.amazonaws.services.dynamodb.sessionmanager.DynamoDBSessionManager?
 I do not want to put these classes into the shared loader because they
 belong only to a special webapp.

 Thank you.

 P.S.

 Code can be found here:

 https://github.com/aws/aws-dynamodb-session-tomcat/tree/master/src/main/java
 /com/amazonaws/services/dynamodb/sessionmanager


Their code (DynamoDBSessionStore.load(...)) uses ObjectInputStream

Tomcat code (e.g. o.a.catalina.session.FileStore.load(..)) uses
CustomObjectInputStream which knows how to deal with class loaders.

It is their bug (or feature).

Best regards,
Konstantin Kolinko

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



Re: Multi-URL Access 1 Webapp

2013-10-31 Thread Chris Arnold
Starting over since i can not seem to get this to work with tomcat or apache. 
So what i have now that IS somewhat working is:

#This rewrites https://share.anydomain.tld to our mail server
RewriteEngine On
RewriteCond %{HTTP_HOST} ^share\.
RewriteCond %{HTTPS} on
RewriteRule ^/(.*) https://192.168.123.3:8443/share/$1 [P]

This DOES get me over to the tomcat side but gives a 404. Notice the status 
line:
HTTP Status 404 - /share/share/page/
Tomcat seems to be adding an extra /share. User need to access the web app with 
https://share.anydomain.tld which will land on apache and apache will get it to 
tomcat. The web app is accessible from http://ip:8080/share or 
https://ip:8443/share. How do i stop tomcat from adding the extra share?

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



RE: Multi-URL Access 1 Webapp

2013-10-31 Thread Matt Barry
mod_rewrite is what's adding the extra /share/

RewriteRule ^/(.*) https://192.168.123.3:8443/share/$1 [P]

should be something like either:

RewriteRule ^/(.*) https://192.168.123.3:8443/$1 [P]

or:

RewriteRule ^/share/(.*) https://192.168.123.3:8443/share/$1 [P]

..depending on whether you want to proxy all URL's to Tomcat, or just the 
/share ones..

Matt

From: Chris Arnold [carn...@electrichendrix.com]
Sent: Thursday, October 31, 2013 2:16 PM
To: Tomcat Users List
Subject: Re: Multi-URL Access 1 Webapp

Starting over since i can not seem to get this to work with tomcat or apache. 
So what i have now that IS somewhat working is:

#This rewrites https://share.anydomain.tld to our mail server
RewriteEngine On
RewriteCond %{HTTP_HOST} ^share\.
RewriteCond %{HTTPS} on
RewriteRule ^/(.*) https://192.168.123.3:8443/share/$1 [P]

This DOES get me over to the tomcat side but gives a 404. Notice the status 
line:
HTTP Status 404 - /share/share/page/
Tomcat seems to be adding an extra /share. User need to access the web app with 
https://share.anydomain.tld which will land on apache and apache will get it to 
tomcat. The web app is accessible from http://ip:8080/share or 
https://ip:8443/share. How do i stop tomcat from adding the extra share?

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org
The contents of this message and any attachments to it are confidential and may 
be legally privileged.
If you have received this message in error you should delete it from your 
system immediately and advise the sender.
dunnhumby may monitor and record all emails. The views expressed in this email 
are those of the sender and not those of dunnhumby.


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



RE: com.amazonaws.services.dynamodb.sessionmanager.DynamoDBSessionManager

2013-10-31 Thread spring
 1.) Seeing as it's their code, have you asked Amazon?  Not 
 sure if this is you, but seems like a similar issue.
 
   https://github.com/aws/aws-dynamodb-session-tomcat/issues/1

Oh yes, same issue.

 2.) Have you tried one of Tomcat's included persistent 
 session managers?  Do you see the same behavior?  My guess is 
 that you won't, but it never hurts to try and it would 
 certainly point the finger at Amazon's code.
 
   http://tomcat.apache.org/tomcat-7.0-doc/config/manager.html


Yes, they use the correct classloader, then it works.


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



RE: com.amazonaws.services.dynamodb.sessionmanager.DynamoDBSessionManager

2013-10-31 Thread spring

 Their code (DynamoDBSessionStore.load(...)) uses ObjectInputStream
 
 Tomcat code (e.g. o.a.catalina.session.FileStore.load(..)) uses
 CustomObjectInputStream which knows how to deal with class loaders.

Yes. 

 It is their bug (or feature).

:)

Thank you!


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



Re: Tomcat getting stopped when idle

2013-10-31 Thread Konstantin Kolinko
2013/10/31 Vidyadhar techienote@gmail.com:
 Hi,

 We are facing some weird issue in our Tomcat environment. After starting
 the Tomcat process on one of our Solaris server, process is automatically
 getting shutdown after 2-3 minutes if no activity is done through
 Application deployed in Tomcat.

 I have observed similar issue in one of following mailing thread where as
 user has asked to install a Listener and print a stacktrace when the stop
 event
 happens. I need to know how to install such Listener.


http://tomcat.apache.org/tomcat-6.0-doc/config/listeners.html

There are several listeners that have been already configured there. You can
use their source code as an example.

 http://www.mail-archive.com/users@tomcat.apache.org/msg84717.html

 Server version: Apache Tomcat/6.0.16
 Server built:   Jan 28 2008 11:35:29
 Server number:  6.0.16.0
 OS Name:SunOS
 OS Version: 5.10
 Architecture:   sparc
 JVM Version:1.6.0_51-b11
 JVM Vendor: Sun Microsystems Inc.

A recent commercial JRE, but 5,5 years old Tomcat? You may need to read this:
http://tomcat.apache.org/security-6.html



 Error in the catalina.out

 Oct 30, 2013 5:04:56 AM org.apache.coyote.http11.Http11Protocol pause
 INFO: Pausing Coyote HTTP/1.1 on http-9920
 Oct 30, 2013 5:04:56 AM org.apache.catalina.connector.Connector pause
 SEVERE: Protocol handler pause failed
 java.net.ConnectException: Connection refused
 at java.net.PlainSocketImpl.socketConnect(Native Method)
 at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:382)
 at
 java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:241)
 at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:228)
 at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:365)
 at java.net.Socket.connect(Socket.java:527)
 at java.net.Socket.connect(Socket.java:476)
 at java.net.Socket.init(Socket.java:373)
 at java.net.Socket.init(Socket.java:216)
 at
 org.apache.jk.common.ChannelSocket.unLockSocket(ChannelSocket.java:486)
 at org.apache.jk.common.ChannelSocket.pause(ChannelSocket.java:283)
 at org.apache.jk.server.JkMain.pause(JkMain.java:681)
 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$CatalinaShutdownHook.run(Catalina.java:671)

Here you already have the stacktrace.

It starts with CatalinaShutdownHook. It means that JVM was shut down
by some external force (e.g. a HUP signal). Thus the shutdown hook was
triggered.

Best regards,
Konstantin Kolinko

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



Re: Multi-URL Access 1 Webapp

2013-10-31 Thread Chris Arnold
mod_rewrite is what's adding the extra /share/

RewriteRule ^/(.*) https://192.168.123.3:8443/share/$1 [P]

should be something like either:

RewriteRule ^/(.*) https://192.168.123.3:8443/$1 [P]

This takes me to the tomcat home page, /

or:

RewriteRule ^/share/(.*) https://192.168.123.3:8443/share/$1 [P]

This one gives me a 403 access denied

..depending on whether you want to proxy all URL's to Tomcat, or just the 
/share ones..

Looks like i am back to the apache list

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



Configuring Embedded Tomcat for SSL

2013-10-31 Thread Matthew Westwood-Hill
Tomcat version: 7.0.47

OS: Windows 7 (x64)

JDK: 1.7



I am attempting to start an embedded instance of Tomcat, which is
configured for SSL only, on port 443.  The code I am using is as follows:



   *public* *static* *void* *main*(String[] args)
*throws*UnknownHostException, LifecycleException, ServletException {

  Tomcat tomcat = *new* Tomcat();



  tomcat.setBaseDir(D:\\Temp);

  tomcat.addWebapp(/sslapp, D:\\);



  Connector connector = *new* Connector();

  connector.setPort(443);

  connector.setScheme(https);

  connector.setSecure(*true*);



  connector.setAttribute(address, 127.0.0.1);

  connector.setAttribute(SSLEnabled, *true*);



  connector.setAttribute(bindOnInit, *true*);



  connector.setAttribute(keystoreFile,
...\\EngineInstance.keystore);

  connector.setAttribute(keystorePass, password);

  connector.setAttribute(clientAuth, false);

  connector.setAttribute(sslProtocol, TLS);

  connector.setAttribute(keyAlias, test);

  connector.setAttribute(keyPass, password);



  tomcat.setConnector(connector);

  tomcat.init();

 tomcat.start();

  tomcat.getServer().await();



   }



When I run the above, I receive the following output:



Nov 01, 2013 10:08:07 AM org.apache.catalina.core.StandardService
startInternal

INFO: Starting service Tomcat

Nov 01, 2013 10:08:07 AM org.apache.catalina.core.StandardEngine
startInternal

INFO: Starting Servlet Engine: Apache Tomcat/7.0.47

Nov 01, 2013 10:08:07 AM org.apache.catalina.startup.ContextConfig
getDefaultWebXmlFragment

INFO: No global web.xml found



It does not look like the connector I created is actually being started.
 When I try browsing to the above port using Chrome/IE all it does not
connect.



I thought I was following the correct process base don information I
located on Google, however, it would appear I am still doing something
incorrect.



I have confirmed the existence of the private key in the keystore (using
Keystore Explorer), so all that is fine.

Please, any help would be greatly appreciated.



Cheers,

Matthew



*Matthew Westwood-Hill **

*