Stateless actions for web application

2010-05-01 Thread Padam J Singh

Hello,

I have a web application that is installed on two servers, each hosting 
a tomcat server with the following version details:


Server version: Apache Tomcat/5.5.20
Server built:   Sep 12 2006 10:09:20
Server number:  5.5.20.0
OS Name:Linux
OS Version: 2.6.18-92.el5
Architecture:   i386
JVM Version:1.5.0_07-b03
JVM Vendor: Sun Microsystems Inc.

The session replication is enabled between the two servers. The two 
application servers are front-ended by two apache http servers with 
mod_jk that do load balancing requests to the two tomcat instances and 
also do sticky sessions so requests go to the same server every time.


Now in the application, there are two kind of actions (stateful and 
stateless). There are certain actions which constitute 99% of total 
requests which have no session relevance or logic required. The issue is 
that I do not want to enable session replication for these actions. In 
fact I do not want ANY session management at all for these actions. How 
is it possible to exclude these requests for session creation and 
replication?


Thanks,
Paddy.


Re: How to force session replication per request in a Tomcat 6 cluster

2010-05-01 Thread Martin Grotzke
Hi,

I created the memcached-session-manager as an alternative session
replication solution:
code.google.com/p/memcached-session-manager/

It keeps sessions in local memory and stores session additionally in
memcached nodes (for backup, asynchronously if desired).
Sessions are replicated when session data has changed, so that no
setAttribute is required.

There are also different serialization stategies available, additionally
to default java serialization there's a javolution/xml based one, and I
also just added serialization based on kryo [1] (very fast according to
protobuf-thrift-compare benchmark). Both (javolution, kryo based) don't
need objects in the session attributes object graph to implement
Serializable - which is sometimes useful, e.g. if "legacy" projects
shall get session failover.

Cheers,
Martin

[1] code.google.com/p/kryo/


On Wed, 2010-04-28 at 22:34 +1000, Kevin Jansz wrote:
> In a Tomcat 6 cluster can you force session replication on every
> request? In Tomcat 5.0.x you had the ability to set
> useDirtyFlag="false" on the manager
> (org.apache.catalina.cluster.session.SimpleTcpReplicationManager) -
> meaning a mutable object in the session would always be
> "re-replicated".
> 
> Looking at the source I can see the old "SimpleTcpReplicationManager"
> manager implementation in the new "org.apache.catalina.ha.session"
> package - and it still has the useDirtyFlag but the javadoc comments
> in this state it's "Tomcat Session Replication for Tomcat 4.0" ... I
> don't know if this is ok to use - I'm guessing not as it's not
> mentioned in the main cluster configuration documentation.
> 
> aside: a similar question was posed on stackoverflow (with more detail
> and formatting) with no response:
> http://stackoverflow.com/questions/2680958 - I'd be happy with
> comments in either forum, and I'll share the advice.
> 
> Regards,
> Kevin
> 
> --
> Kevin Jansz
> kevin.ja...@exari.com
> Level 7, 10-16 Queen Street, Melbourne 3000 Australia
> Tel +61 3 9621 2773 | Fax +61 3 9621 2776
> Exari Systems
> Boston | London | Melbourne | Munich
> www.exari.com
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 

-- 
Martin Grotzke
http://www.javakaffee.de/blog/


signature.asc
Description: This is a digitally signed message part


Windows' UAC prevents from automatically starting Tomcat 6 Service Manager at logon

2010-05-01 Thread Guillaume Rossolini
Hi,

I have successfull installed and been running Tomcat on my dev machine
(Windows 7) and on a test server (Windows 2008 R2), but with a small problem
akin to the one described in bug #49161:
https://issues.apache.org/bugzilla/show_bug.cgi?id=49161

This bug also applies to Windows 7 and Windows Server 2008 (I would guess
any Windows machine with UAC turned on), as well as to the
"bin/tomcat6w" executable (while "bin/tomcat6" has no problem starting, even
without administrator privileges).

After initial setup, when I log on to my machine, I see an error telling me
that the Tomcat6 service could not be found. It is an access control
problem: the Commons Daemon Service Manager doesn't have access to the
service. This can be solved by going to tomcat6w.exe's Properties to tell
Windows to execute it with Administrator privileges, but then I get a
warning that the file is not signed, and therefore I am prompted to confirm
that I do want to execute it. This prevents me from automatically starting
the Service Manager at logon.

Since the service itself doesn't seem to bother Windows all that much (I
have seen no UAC prompt after initial setup), have I missed anything? Of
course, I would rather not have to disable UAC.

Might this be because of the slightly off description of the exe? The box
"Properties > General > Details > Copyright" seems wrong, the year doesn't
display correctly. I can send screenshots if anyone asks.

Oh yes, my Commons Daemon Service Manager is version 1.0.2.0.

Thanks for your help,
Regards,

Guillaume Rossolini

--
I N S T A N T  |  L U X E - web : www.instantluxe.com


Re: changing tomcat-users.xml makes tomcat unresponsive

2010-05-01 Thread Pid
On 01/05/2010 18:19, paul geer wrote:
> Hello all,
> 
> I had an installation of ubuntu 8.04 that I recently upgraded to 9.10.  I
> barely used it before the upgrade so the system was very close to a fresh
> install of 8.04 before the upgrade.
> 
> I installed tomcat6 with apt-get.  After setting everything up, I checked
> that I could access the "It works" default page from both inside my home
> network and would accept outside connections.  Clicking the link for the
> manager console prompted me for a username and password, but since I had not
> yet made changes to tomcat-users.xml, it failed as expected.
> 
> I edited the file (/etc/tomcat6/tomcat-users.xml), uncommented the
> "existing" users and added a manager role and a manager user with that
> role.  Upon restarting the server, any attempt to connect to the server
> locally or externally causes the browser to "spin" as if loading a page but
> with no results.  I will sit and spin for hours if I let it (I have) without
> timing out.
> 
> I have tried various permutations of users in the file, such as uncommenting
> the original ones and not adding a manager role or user, adding the role to
> one of the default users, etc, but the only way to get the index page to
> actually load again is to comment out all users.
> 
> Web searches of this issue have only turned up instances of people not
> realizing the users were commented out and editing the file anyway.
> 
> Also, /var/logs/tomcat6 does not contain any logs. I've used updatedb and
> locate to verify that there aren't other tomcat-users files elsewhere.  I've
> also been unable to locate an alternate log directory.
> 
> Thanks for any help the community can offer.  Enjoy your weekend,

If you revert to the original installation, does the /examples app work?

Does using the examples app generate log files in the expected location?


p




signature.asc
Description: OpenPGP digital signature


RE: please hwlp with hibernate strategy

2010-05-01 Thread Jason Pyeron


--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-   -
- Jason Pyeron  PD Inc. http://www.pdinc.us -
- Principal Consultant  10 West 24th Street #100-
- +1 (443) 269-1555 x333Baltimore, Maryland 21218   -
-   -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
This message is copyright PD Inc, subject to license 20080407P00.

 

> -Original Message-
> From: Yucca Nel [mailto:yucca...@live.co.za] 
> Sent: Saturday, May 01, 2010 13:38
> To: Tomcat Users List
> Subject: please hwlp with hibernate strategy
> 
> I am planning on using hibernate (1st time) in tomcat webapp. 
> It would appear that it is common to use hibernate util class 
> to load the session factory but I have yet to see this done 
> using Servlet ContextListener. I have also only seen very bad 

We load a helper class, which is the sessions factory with the webapp.

>From web.xml:

us.pdinc.client.mil.navy.servlet.support.RequestScopeH
ibernateSession


public class RequestScopeHibernateSession implements ServletRequestListener 
{
public static final String PREFIX;
public final String KEY;
/** This method will fetch a hibernate session from request scope,
stored under KEY **/
public static Session getSession(ServletRequest request);
/** This method will close the session and execute the needed rollback
if there is a dirty transaction **/
public void requestDestroyed(ServletRequestEvent arg0);
/** This method will register this object into the request scope, under
KEY. **/
public void requestInitialized(ServletRequestEvent arg0);
}

> example where someone used hibernate directly in their model 
> instead of using it as part of a DAO  façade. The following 

While what you saw may indeed be very bad, DAO is not always an answer either.

> example is half finished from netbeans 
> too:http://netbeans.org/kb/docs/web/hibernate-webapp.html Can 
> someon point met to full MVC example with hibernate. I am 

Its not full, but it might get the point across.
http://stackoverflow.com/questions/786840/annotation-support-in-struts-2/791164#
791164

> only interested in seeing the bsckend examples really and 
> would any of you recommend using hibernate directly in a 
> model business class?
> 


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



please hwlp with hibernate strategy

2010-05-01 Thread Yucca Nel
I am planning on using hibernate (1st time) in tomcat webapp. It would appear 
that it is common to use hibernate util class to load the session factory but I 
have yet to see this done using Servlet ContextListener. I have also only seen 
very bad example where someone used hibernate directly in their model instead 
of using it as part of a DAO  façade. The following example is half finished 
from netbeans too:http://netbeans.org/kb/docs/web/hibernate-webapp.html Can 
someon point met to full MVC example with hibernate. I am only interested in 
seeing the bsckend examples really and would any of you recommend using 
hibernate directly in a model business class?

changing tomcat-users.xml makes tomcat unresponsive

2010-05-01 Thread paul geer
Hello all,

I had an installation of ubuntu 8.04 that I recently upgraded to 9.10.  I
barely used it before the upgrade so the system was very close to a fresh
install of 8.04 before the upgrade.

I installed tomcat6 with apt-get.  After setting everything up, I checked
that I could access the "It works" default page from both inside my home
network and would accept outside connections.  Clicking the link for the
manager console prompted me for a username and password, but since I had not
yet made changes to tomcat-users.xml, it failed as expected.

I edited the file (/etc/tomcat6/tomcat-users.xml), uncommented the
"existing" users and added a manager role and a manager user with that
role.  Upon restarting the server, any attempt to connect to the server
locally or externally causes the browser to "spin" as if loading a page but
with no results.  I will sit and spin for hours if I let it (I have) without
timing out.

I have tried various permutations of users in the file, such as uncommenting
the original ones and not adding a manager role or user, adding the role to
one of the default users, etc, but the only way to get the index page to
actually load again is to comment out all users.

Web searches of this issue have only turned up instances of people not
realizing the users were commented out and editing the file anyway.

Also, /var/logs/tomcat6 does not contain any logs. I've used updatedb and
locate to verify that there aren't other tomcat-users files elsewhere.  I've
also been unable to locate an alternate log directory.

Thanks for any help the community can offer.  Enjoy your weekend,

paul


Tomcat Connector to Apache 2.2

2010-05-01 Thread Jie Sheng Chua
Hi,

I operating Ubuntu 10.04 with Tomcat 6.0.24 on OpenJDK 6b18-1.8.
I trying to configure tomcat connector to allow (for now) all request to be
pass from Apache 2.2 to Tomcat 6.
I downloaded 
mod_jk-1.2.28-httpd-2.2.X.so
.
With the help of the quick start
guide,
i manage to configure my workers.properties, httpd.conf and tomcat
server.xml as follows.

After the below configuration, the connector didn't work. There are no error
display on the logs too.
Example context from tomcat is the tomcat supplied examples.

Does anyone know how to make this work out?

Thanks and Best Regards
Jie Sheng

*workers.properties*
*
*
*
# Define 1 real worker using ajp13
worker.list=tomcat1

# Set properties for worker1 (ajp13)
worker.tomcat1.type=ajp13
worker.tomcat1.host=localhost
worker.tomcat1.port=8009
*

*httpd.conf*

# Load mod_jk module
# Update this path to match your modules location
LoadModulejk_module  /usr/lib/apache2/modules/mod_jk.so

# Declare the module for  (remove this line on Apache
2.x)
# AddModule mod_jk.c

# Where to find workers.properties
# Update this path to match your conf directory location (put
workers.properties next to httpd.conf)
JkWorkersFile /etc/apache2/workers.properties

# Where to put jk shared memory
# Update this path to match your local state directory or logs directory
JkShmFile /var/log/apache2/mod_jk.shm

# Where to put jk logs
# Update this path to match your logs directory location (put mod_jk.log
next to access_log)
JkLogFile /var/log/apache2/mod_jk.log

# Set the jk log level [debug/error/info]
JkLogLevelinfo

# Select the timestamp log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "

# Send everything for context /examples to worker named worker1 (ajp13)
JkMount  /examples/* tomcat1

*tomcat server.xml*
*
*
*


  
  
  
  
  
  

  

  

  




  
  
  

  


*

-- 
Jie Sheng, Chua
(+65) 97520245
chuajiesh...@gmail.com

The contents of this email are confidential to the intended recipient and
may not be disclosed. Although it is believed that this email and any
attachments are virus free, it is the responsibility of the recipient to
confirm this.


Re: Tomcat 6 Java Version Requirements

2010-05-01 Thread André Warnier

Mark Thomas wrote:

On 29/04/2010 17:51, Caldarale, Charles R wrote:

From: Christopher Schultz [mailto:ch...@christopherschultz.net]
Subject: FAQ: Tomcat 6 Java Version Requirements

I was just looking on the TC site to see what minimum Java version is
required for TC 6.

It's in the RUNNING.txt file in the download:

"Apache Tomcat 6.0 requires the Java 2 Standard Edition Runtime Environment (JRE) 
version 5.0 or later."

But I agree, having it up front on the web site would be helpful.


Done. Changes will appear on the next sync.


Is there. Nice. Thanks.

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