-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Apache + mod_jk + Tomcat Cluster + Hibernate Problem
PostPosted: Sat Feb 25, 2006 2:37 pm 
Beginner
Beginner

Joined: Wed May 18, 2005 9:48 am
Posts: 31
Hi all,

I have two tomcats with same web applicattion running on two machines. They have Persistent sessions by Postgresql Database.

When I initialize two tomcats and i load page all goes okey. Apache redirects request to tomcat1 or tomcat2. Problems come in this case:


- Initialize two tomcats with its owns hibernate Sessions.

- Web Access to Apache. It redirects requests to, for example, tomcat1.

- Session is inserted into database tomcat_sessions table with hibernate session object thanks to session in view implementation.

- Stopped Tomcat1 before session expires (forced by me).

- In same web session try to do something, for viewing that tomcat2 take control of that session and continues request from that session but... ERROR!!!

Code:
25-feb-2006 19:19:23 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:12009
25-feb-2006 19:19:23 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/129  config=null
25-feb-2006 19:19:24 org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
25-feb-2006 19:19:24 org.apache.catalina.startup.Catalina start
INFO: Server startup in 11647 ms
25-feb-2006 19:21:14 org.apache.catalina.cluster.tcp.SimpleTcpCluster memberDisappeared
INFO: Received member disappeared:org.apache.catalina.cluster.mcast.McastMember[tcp://28.100.0.100:4001,catalina,28.100.0.100,4001, alive=343198]
[ WARN] {25/02/06 19:21:24} (hibernate.impl.SessionFactoryObjectFactory.getInstance()) - Not found: 9ce480e409a270a80109a270aca30000
[ WARN] {25/02/06 19:21:25} (hibernate.impl.SessionFactoryObjectFactory.getInstance()) - Not found: 9ce480e409a270a80109a270aca30000


I think this is because when you stop tomcat1 and tomcat2 tries to get SessionFactory, its session factory hasn't this id. I was thinking about binding SessionFactory to JNDI in order to have same names to each one tomcat but... Context is read-only in tomcat.

Any ideas?

Best regards


Top
 Profile  
 
 Post subject: names
PostPosted: Wed Mar 01, 2006 2:12 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
Yes, session factories in both Tomcat's should have the same name, the message you see is just a warning telling that there is no serialized instance of the session factory found. Makes sense...
SessionFactoryImpl::

private Object readResolve() throws ObjectStreamException {
log.trace("Resolving serialized SessionFactory");
// look for the instance by uuid
Object result = SessionFactoryObjectFactory.getInstance(uuid);
if (result==null) {
// in case we were deserialized in a different JVM, look for an instance with the same name
// (alternatively we could do an actual JNDI lookup here....)
result = SessionFactoryObjectFactory.getNamedInstance(name);
if (result==null) {
throw new InvalidObjectException("Could not find a SessionFactory named: " + name);
}
else {
log.debug("resolved SessionFactory by name");
}
}
else {
log.debug("resolved SessionFactory by uid");
}
return result;
}

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.