Multi-Module SEAM Project Problem
kellyds.skelly.akimeka.com Oct 10, 2008 3:46 PMI'm relatively new to configuring Seam apps and I've run into a problem getting an application to deploy. The goal was to remove the entity beans into a different package so we could use it in a different application that needs the same database.
I've got a SEAM project that is broken down into the following structure:
- App-EAR
- App-EJB (Session and Message)
- App-Model (Entity Beans)
- App-WAR (Web .xhtml)
- App-Common (utility no SEAM dependency)
- App-Applet (client side applet no SEAM dependency)
Arch:
SEAM 2.0.1ga
OC4J 11g (Yes, I know...)
The problem I'm running into is that after moving the Entity Beans out of the App-EJB project (module?) and fixing all the references the application will not run. It deploys without any errors. When the application runs the first reference to a Seam component that requires a JNDI lookup it fails with:
javax.el.ELException: javax.ejb.EJBTransactionRolledbackException: org.jboss.seam.InstantiationException: Could not instantiate Seam component: accountManager; nested exception is: org.jboss.seam.InstantiationException: Could not instantiate Seam component: accountManager at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:333) at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:342) at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58) at org.jboss.el.parser.AstValue.invoke(AstValue.java:96) at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276) at org.jboss.seam.core.Expressions$2.invoke(Expressions.java:173) at org.jboss.seam.navigation.Page.preRender(Page.java:264) at org.jboss.seam.navigation.Pages.preRender(Pages.java:309) at org.jboss.seam.jsf.SeamPhaseListener.preRenderPage(SeamPhaseListener.java:549) at org.jboss.seam.jsf.SeamPhaseListener.beforeRenderResponse(SeamPhaseListener.java:460) at org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:144) at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:114) at com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:214) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:96) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266) at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65) at jmat.utils.TimingFilter.doFilter(TimingFilter.java:19) at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15) at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83) at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68) at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73) at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85) at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64) at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45) at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:177) at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267) at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380) at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507) at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60) at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58) at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:617) at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:368) at com.evermind.server.http.HttpRequestHandler.doDispatchRequest(HttpRequestHandler.java:889) at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:797) at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:607) at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:376) at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:161) at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:142) at oracle.oc4j.network.ServerSocketReadHandler$ClientRunnable.run(ServerSocketReadHandler.java:275) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675) at java.lang.Thread.run(Thread.java:595) Caused by: javax.ejb.EJBTransactionRolledbackException: org.jboss.seam.InstantiationException: Could not instantiate Seam component: accountManager; nested exception is: org.jboss.seam.InstantiationException: Could not instantiate Seam component: accountManager at com.evermind.server.ejb.EJBUtils.getLocalUserException(EJBUtils.java:84) at com.evermind.server.ejb.interceptor.system.AbstractTxInterceptor.convertAndHandleMethodException(AbstractTxInterceptor.java:93) at com.evermind.server.ejb.interceptor.system.TxRequiredInterceptor.invoke(TxRequiredInterceptor.java:52) at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:101) at com.evermind.server.ejb.interceptor.system.JAASInterceptor$1.run(JAASInterceptor.java:52) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAsPrivileged(Subject.java:517) at oracle.oc4j.security.SecurityServices.doAsPrivileged(SecurityServices.java:150) at oracle.oc4j.security.SecurityServices.doAsPrivileged(SecurityServices.java:420) at oracle.oc4j.security.JaasModeImpl$DoAsPrivilegedExecutor.execute(JaasModeImpl.java:280) at com.evermind.server.ejb.interceptor.system.JAASInterceptor.invoke(JAASInterceptor.java:57) at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:101) at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52) at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:101) at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:58) at com.evermind.server.ejb.StatefulSessionEJBObject.OC4J_invokeMethod(StatefulSessionEJBObject.java:828) at LoginManagerBean_LocalProxy_2n598p4.isUserLoggedIn(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.jboss.seam.util.Reflections.invoke(Reflections.java:21) at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31) at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:76) at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56) at org.jboss.seam.ejb.RemoveInterceptor.aroundInvoke(RemoveInterceptor.java:41) at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) at org.jboss.seam.core.SynchronizationInterceptor.aroundInvoke(SynchronizationInterceptor.java:32) at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107) at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54) at org.javassist.tmp.java.lang.Object_$$_javassist_18.isUserLoggedIn(Object_$$_javassist_18.java) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:329) ... 49 more Caused by: org.jboss.seam.InstantiationException: Could not instantiate Seam component: accountManager at org.jboss.seam.Component.newInstance(Component.java:1970) at org.jboss.seam.Component.getInstance(Component.java:1873) at org.jboss.seam.Component.getInstance(Component.java:1840) at org.jboss.seam.Component.getInstanceInAllNamespaces(Component.java:2182) at org.jboss.seam.Component.getValueToInject(Component.java:2134) at org.jboss.seam.Component.injectAttributes(Component.java:1598) at org.jboss.seam.Component.inject(Component.java:1416) at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:45) at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) at org.jboss.seam.core.ConversationInterceptor.aroundInvoke(ConversationInterceptor.java:65) at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42) at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) at org.jboss.seam.persistence.HibernateSessionProxyInterceptor.aroundInvoke(HibernateSessionProxyInterceptor.java:27) at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) at jmat.utils.TimingInterceptor.timeCall(TimingInterceptor.java:51) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.jboss.seam.util.Reflections.invoke(Reflections.java:21) at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:177) at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:72) at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31) at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) at org.jboss.seam.persistence.EntityManagerProxyInterceptor.aroundInvoke(EntityManagerProxyInterceptor.java:26) at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107) at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:50) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.evermind.server.ejb.interceptor.MethodBasedInterceptor.invoke(MethodBasedInterceptor.java:45) at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:101) at com.evermind.server.ejb.interceptor.system.SetContextActionInterceptor.invoke(SetContextActionInterceptor.java:44) at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:101) at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52) at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:101) at com.evermind.server.ejb.interceptor.system.TxRequiredInterceptor.invoke(TxRequiredInterceptor.java:50) ... 83 more Caused by: javax.naming.NameNotFoundException: java:comp/env/jmat/AccountManager/local not found at com.oracle.naming.J2EEContext.getSubContext(J2EEContext.java:198) at com.oracle.naming.J2EEContext.lookup(J2EEContext.java:145) at com.evermind.server.ApplicationContext.lookupInJavaContext(ApplicationContext.java:305) at com.evermind.server.ApplicationContext.unprivileged_lookup(ApplicationContext.java:229) at com.evermind.server.ApplicationContext.lookup(ApplicationContext.java:194) at javax.naming.InitialContext.lookup(InitialContext.java:351) at org.jboss.seam.Component.instantiateSessionBean(Component.java:1287) at org.jboss.seam.Component.instantiate(Component.java:1273) at org.jboss.seam.Component.newInstance(Component.java:1966) ... 122 more
I can see the component deploy properly...
... 536 08:21:22,405 INFO [Component] Component: accountManager, scope: CONVERSATION, type: STATEFUL_SESSION_BEAN, class: jmat.security.AccountManager, JNDI: java:comp/env/jmat/AccountManager/local ...
It appears that the error is not being thrown in one of the classes, but maybe from an EL expression in one of the pages or during the initialization of the app before it gets to any pages.
I could use some assistance on finding a starting point to unravel this problem!
Thanks!
D. Sean Kelly