[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Problems when deploying two EARs both having hibernate archi

fschristopher do-not-reply at jboss.com
Thu May 17 05:13:22 EDT 2007


Hi,

In my project I have to deploy 2 applications on the same instance of JBoss server. Both the applications have thier own hibernate archives using two different session factories.

Applications are deployed as ear on jboss-4.0.4.GA.

Application1 has the following components: 
app1-ejb.jar
app1-hibernate.sar
app1-internal.war
app1-model.jar
app-core.jar. 

Application2 has a similar structure with its own hibernate archive.

The applications work fine when only one of them is deployed. But when we deploy the second application after the first one, pages that access the database in both applications break. I have listed the stack trace for some of the exceptions thrown.

1. Caused by: java.lang.IllegalStateException: The x.app1.module1.model.table1 Cache is not alive.
	at net.sf.ehcache.Cache.checkStatus(Cache.java:1201)
	at net.sf.ehcache.Cache.put(Cache.java:550)
	at net.sf.ehcache.Cache.put(Cache.java:523)
	at org.hibernate.cache.EhCache.put(EhCache.java:153)

2. Caused by: java.lang.ClassCastException: org.hibernate.hql.ast.HqlToken
	at org.hibernate.hql.ast.HqlLexer.makeToken(HqlLexer.java:33)
	at org.hibernate.hql.antlr.HqlBaseLexer.mIDENT(HqlBaseLexer.java:632)
	at org.hibernate.hql.antlr.HqlBaseLexer.nextToken(HqlBaseLexer.java:225)
	at antlr.TokenBuffer.fill(TokenBuffer.java:69)
	at antlr.TokenBuffer.LA(TokenBuffer.java:80)

This error happens when the page has to execute a named query. It happens the first time the page is accessed after being deployed and when we refresh the page, the page is rendered without error.

3. java.lang.LinkageError: loader constraints violated when linking com/common/model/BusinessException class
	...
	at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
I get LinkageError when one of the application is undeployed.

I also notice that when jboss is restarted after deploying both applications, both the applications work fine without any error. 
Can anyone please give me some suggestions to resolve this issue?

Regards,
Flora

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4046405#4046405

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4046405



More information about the jboss-user mailing list