2 Replies Latest reply: May 4, 2012 3:41 PM by Acelino Freitas RSS

Jboss 7 EntityManagerFactory issue

Acelino Freitas Newbie

Hi,

 

we are about migrating our jboss seam application from jboss 4 to jboss 7, and we face a problem on jboss startup with the injection of the entitymanager on jboss seam startup components. This problem happens only when the application is deployed automatically on jboss startup; if we redeploy the ear file without restarting the jboss, the injection of the entitymanager works without any problems and the application works flawlessly (and much faster than jboss 4 ).

 

The stacktrace is the following and indicates that the entitymangerfactory is looked up before it is bound to the JNDI; as I said before if we redeploy the ear the problem does not appear:

 

 

Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener: org.jboss.seam.InstantiationException: Could not instantiate Seam component: xxxSeamApplicationComponent
    at org.jboss.seam.Component.newInstance(Component.java:2170) [seam.jar:]
    at org.jboss.seam.contexts.Contexts.startup(Contexts.java:304) [seam.jar:]
    at org.jboss.seam.contexts.Contexts.startup(Contexts.java:278) [seam.jar:]
    at org.jboss.seam.contexts.ServletLifecycle.endInitialization(ServletLifecycle.java:143) [seam.jar:]
    at org.jboss.seam.init.Initialization.init(Initialization.java:744) [seam.jar:]
    at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:36) [seam.jar:]
    at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3368) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3821) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
    at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:70) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_24]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_24]
    at java.lang.Thread.run(Thread.java:662) [:1.6.0_24]
Caused by: java.lang.IllegalStateException
    at org.jboss.msc.value.InjectedValue.getValue(InjectedValue.java:47)
    at org.jboss.as.naming.service.BinderService.getValue(BinderService.java:116)
    at org.jboss.as.naming.service.BinderService.getValue(BinderService.java:43)
    at org.jboss.msc.service.ServiceControllerImpl.getValue(ServiceControllerImpl.java:1216)
    at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:111)
    at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:73)
    at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:173)
    at org.jboss.as.naming.InitialContext.lookup(InitialContext.java:57)
    at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:209)
    at javax.naming.InitialContext.lookup(InitialContext.java:392) [:1.6.0_24]
    at org.jboss.seam.persistence.ManagedPersistenceContext.getEntityManagerFactoryFromJndiOrValueBinding(ManagedPersistenceContext.java:257) [seam.jar:]
    at org.jboss.seam.persistence.ManagedPersistenceContext.initEntityManager(ManagedPersistenceContext.java:79) [seam.jar:]
    at org.jboss.seam.persistence.ManagedPersistenceContext.getEntityManager(ManagedPersistenceContext.java:108) [seam.jar:]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_24]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_24]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_24]
    at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_24]
    at org.jboss.seam.util.Reflections.invoke(Reflections.java:22) [seam.jar:]
    at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144) [seam.jar:]
    at org.jboss.seam.Component.callComponentMethod(Component.java:2275) [seam.jar:]
    at org.jboss.seam.Component.unwrap(Component.java:2301) [seam.jar:]
    at org.jboss.seam.Component.getInstance(Component.java:2044) [seam.jar:]
    at org.jboss.seam.Component.getInstance(Component.java:1986) [seam.jar:]
    at org.jboss.seam.Component.getInstance(Component.java:1980) [seam.jar:]
    at org.jboss.seam.Component.getInstanceInAllNamespaces(Component.java:2375) [seam.jar:]
    at org.jboss.seam.Component.getValueToInject(Component.java:2327) [seam.jar:]
    at org.jboss.seam.Component.injectAttributes(Component.java:1739) [seam.jar:]
    at org.jboss.seam.Component.inject(Component.java:1557) [seam.jar:]
    at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:61) [seam.jar:]
    at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) [seam.jar:]
    at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44) [seam.jar:]
    at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) [seam.jar:]
    at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107) [seam.jar:]
    at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185) [seam.jar:]
    at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103) [seam.jar:]

 

Has anybody ran into a similar issue? Any feedback dearly appreciated.

 

Kind regards,

Acelino