EntityManagerFactory not bound error!
sunsy Nov 29, 2005 10:55 PMWe use the jboss-seam in our new project, but now some really troubled problems prevent us. The most terrible problem is that:the EntityManagerFactory not bound, such problem makes us can not interact with database at all.
In our project, one statefull session bean is used to operation the actions to database. The EntityManager is defined like this:
@PersistenceContext(type = PersistenceContextType.EXTENDED)
EntityManager redemDatabase;
And, in this statefull session bean there is a method named save() providing for other java beans' invoking, like this:
public void save() {
redemDabase.merge(object);
}
But if we do some operations then leave the system unused for a short while, when we come back to do another operation the problems occur, and the exceptions list following:
javax.ejb.EJBTransactionRolledbackE
xception: null; CausedByException is:
Could not activate; failed to restore state; CausedByException is:
javax.naming.NameNotFoundException: EntityManagerFactory not bound
at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.ja
va:73)
at org.apache.myfaces.application.ActionListenerImpl.processAction(Actio
nListenerImpl.java:63)
... 34 more
Caused by: javax.ejb.EJBTransactionRolledbackException: null; CausedByException
is:
Could not activate; failed to restore state; CausedByException is:
javax.naming.NameNotFoundException: EntityManagerFactory not bound
at org.jboss.ejb3.tx.Ejb3TxPolicy.handleInCallerTx(Ejb3TxPolicy.java:65)
at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:117)
at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java
:138)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
java:98)
at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInt
erceptor.java:61)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
java:98)
at org.jboss.aspects.security.AuthenticationInterceptor.invoke(Authentic
ationInterceptor.java:63)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
java:98)
at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterce
ptor.java:32)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
java:98)
at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(Asynchrono
usInterceptor.java:91)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
java:98)
at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContain
er.java:150)
at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.
java:83)
at $Proxy107.loadAllProject(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.sun.el.parser.AstValue.invoke(AstValue.java:130)
at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:274)
at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.ja
va:68)
at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.ja
va:69)
... 35 more
It is the most serious problem, i hope someone can help us!
Thank you!