No default persistence unit
kryptontri Feb 1, 2006 6:03 PMjboss-5.0.0alpha (cvs today)
jboss-seam-1.0beta1 (cvs yesterday)
Problem: I am morphing the booking example, everything was fine until I upgraded to the latest ejb3 and seam. The same error occurs with jboss-seam-head and with a patched jboss-4.0.3SP1 with ejb3 patches as per instruction and following
http://wiki.jboss.org/wiki/Wiki.jsp?page=FromJBossEJB3.0RC3ToRC4PFD ie i followed these instructions http://docs.jboss.org/ejb3/app-server/tutorial/installing.html
Anyway, I decided to try building jboss-head with jboss-seam-head, but I cannot deploy my ear.
Deployables:
cms.ear
TIA if anyone can help
Server Trace:
22:38:08,706 INFO [Server] JBoss (MX MicroKernel) [5.0.0alpha (build: CVSTag=HEAD date=200602011955)] Started in 1m:13s:937ms 22:39:43,111 INFO [EARDeployer] Init J2EE application: file:/C:/projects/myproject/prod/jboss-5.0.0alpha/server/i playserver/deploy/cms.ear 22:39:49,691 INFO [Ejb3AnnotationHandler] found EJB3: ejbName=LoginAction, class=com.myproject.cms.manager.Logi nAction, type=STATELESS 22:39:49,841 INFO [Ejb3AnnotationHandler] found EJB3: ejbName=LogoutAction, class=com.myproject.cms.manager.Log outAction, type=STATELESS 22:39:49,901 INFO [Ejb3AnnotationHandler] found EJB3: ejbName=RegisterAction, class=com.myproject.cms.manager.R egisterAction, type=STATEFUL 22:39:50,021 INFO [Ejb3Deployment] EJB3 deployment time took: 630 22:39:50,252 WARN [ServiceController] Ignoring request to stop nonexistent service: jboss.j2ee:service=EJB3,e ar=cms.ear,jar=cms.ejb3,name=LoginAction 22:39:50,262 WARN [ServiceController] Ignoring request to destroy nonexistent service: jboss.j2ee:service=EJB 3,ear=cms.ear,jar=cms.ejb3,name=LoginAction 22:39:50,262 WARN [ServiceController] Ignoring request to stop nonexistent service: jboss.j2ee:service=EJB3,e ar=cms.ear,jar=cms.ejb3,name=LogoutAction 22:39:50,272 WARN [ServiceController] Ignoring request to destroy nonexistent service: jboss.j2ee:service=EJB 3,ear=cms.ear,jar=cms.ejb3,name=LogoutAction 22:39:50,272 WARN [ServiceController] Ignoring request to stop nonexistent service: jboss.j2ee:service=EJB3,e ar=cms.ear,jar=cms.ejb3,name=RegisterAction 22:39:50,282 WARN [ServiceController] Ignoring request to destroy nonexistent service: jboss.j2ee:service=EJB 3,ear=cms.ear,jar=cms.ejb3,name=RegisterAction 22:39:50,312 WARN [ServiceController] Problem starting service jboss.j2ee:service=EJB3,module=cms.ejb3 java.lang.RuntimeException: Field private javax.persistence.EntityManager com.myproject.cms.manager.LoginAction. em @PersistenceUnit in error: There is no default persistence unit in this deployment. at org.jboss.ejb3.injection.PersistenceContextHandler.loadFieldDependencies(PersistenceContextHandler. java:306) at org.jboss.ejb3.injection.PersistenceContextHandler.loadDependencies(PersistenceContextHandler.java: 349) at org.jboss.ejb3.EJBContainer.processMetadata(EJBContainer.java:239) at org.jboss.ejb3.SessionContainer.processMetadata(SessionContainer.java:77) at org.jboss.ejb3.Ejb3Deployment.processEJBContainerMetadata(Ejb3Deployment.java:406) at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:457) at org.jboss.ejb3.Ejb3Module.startService(Ejb3Module.java:139) at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289) at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245) at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157) at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96) at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:262) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668) at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:974) at $Proxy0.start(Unknown Source) at org.jboss.system.ServiceController.start(ServiceController.java:417) at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157) at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96) at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:262) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668) at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:190) at $Proxy29.start(Unknown Source) at org.jboss.ejb3.EJB3Deployer.start(EJB3Deployer.java:377) 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.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157) at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96) at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:138) at org.jboss.mx.server.Invocation.invoke(Invocation.java:90) at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java: 140) at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97) at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:237) at org.jboss.ws.server.WebServiceDeployer.start(WebServiceDeployer.java:111) at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSu pport.java:181) at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:96) at org.jboss.mx.server.Invocation.invoke(Invocation.java:90) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:262) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668) at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:190) at $Proxy30.start(Unknown Source) at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1007) at org.jboss.deployment.MainDeployer.start(MainDeployer.java:997) at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:808) at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771) at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157) at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96) at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:138) at org.jboss.mx.server.Invocation.invoke(Invocation.java:90) at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java: 140) at org.jboss.mx.server.Invocation.invoke(Invocation.java:90) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:262) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668) at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:190) at $Proxy8.deploy(Unknown Source) at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:334) at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:522) at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScann er.java:207) at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner .java:218) at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner. java:197) 22:39:50,562 INFO [EJB3Deployer] Deployed: file:/C:/projects/myproject/prod/jboss-5.0.0alpha/server/myprojectserver/t mp/deploy/tmp1427cms.ear-contents/cms.ejb3 22:39:50,582 INFO [TomcatDeployer] deploy, ctxPath=/, warUrl=.../tmp/deploy/tmp1427cms.ear-contents/cms-exp.w ar/ 22:39:50,893 INFO [ServletContextListener] Welcome to Seam 1.0 beta 2 22:39:50,913 INFO [Initialization] reading properties from: /seam.properties 22:39:50,923 INFO [Initialization] reading properties from: /seam-jndi.properties 22:39:50,923 INFO [Initialization] initializing Seam 22:39:51,053 INFO [Component] Component: org.jboss.seam.core.init, scope: APPLICATION, type: JAVA_BEAN, class : org.jboss.seam.core.Init 22:39:51,754 INFO [Component] Component: org.jboss.seam.core.pages, scope: APPLICATION, type: JAVA_BEAN, clas s: org.jboss.seam.core.Pages 22:39:51,794 INFO [Component] Component: org.jboss.seam.core.manager, scope: EVENT, type: JAVA_BEAN, class: o rg.jboss.seam.core.Manager 22:39:51,864 INFO [Component] Component: switcher, scope: PAGE, type: JAVA_BEAN, class: org.jboss.seam.core.S witcher 22:39:51,894 INFO [Component] Component: conversation, scope: CONVERSATION, type: JAVA_BEAN, class: org.jboss .seam.core.Conversation 22:39:51,914 INFO [Component] Component: conversationList, scope: PAGE, type: JAVA_BEAN, class: org.jboss.sea m.core.ConversationList 22:39:51,944 INFO [Component] Component: conversationStack, scope: PAGE, type: JAVA_BEAN, class: org.jboss.se am.core.ConversationStack 22:39:51,964 INFO [Component] Component: facesContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss. seam.core.FacesContext 22:39:51,984 INFO [Component] Component: eventContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss. seam.core.EventContext 22:39:52,014 INFO [Component] Component: sessionContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jbos s.seam.core.SessionContext 22:39:52,044 INFO [Component] Component: statelessContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jb oss.seam.core.StatelessContext 22:39:52,064 INFO [Component] Component: applicationContext, scope: APPLICATION, type: JAVA_BEAN, class: org. jboss.seam.core.ApplicationContext 22:39:52,084 INFO [Component] Component: conversationContext, scope: APPLICATION, type: JAVA_BEAN, class: org .jboss.seam.core.ConversationContext 22:39:52,104 INFO [Component] Component: businessProcessContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.BusinessProcessContext 22:39:52,124 INFO [Component] Component: resourceBundle, scope: APPLICATION, type: JAVA_BEAN, class: org.jbos s.seam.core.ResourceBundle 22:39:52,175 INFO [Component] Component: org.jboss.seam.debug.introspector, scope: EVENT, type: JAVA_BEAN, cl ass: org.jboss.seam.debug.Introspector 22:39:52,335 INFO [ResourceBundle] resource bundle missing: messages 22:39:52,635 INFO [Component] Component: org.jboss.seam.debug.contexts, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.debug.Contexts 22:39:52,675 INFO [Component] Component: myprojectcmsEntityManager, scope: CONVERSATION, type: JAVA_BEAN, class : org.jboss.seam.core.ManagedPersistenceContext 22:39:52,705 INFO [Scanner] scanning: /C:/projects/myproject/prod/jboss-5.0.0alpha/server/myprojectserver/tmp/deploy/ tmp1427cms.ear-contents/cms.ejb3 22:39:52,866 INFO [Component] Component: themeManager, scope: APPLICATION, type: JAVA_BEAN, class: com.myproject6 9.cms.theme.ThemeManager 22:39:52,906 INFO [Component] Component: login, scope: STATELESS, type: STATELESS_SESSION_BEAN, class: com.ip lay69.cms.manager.LoginAction, JNDI: cms/LoginAction/local 22:39:52,976 INFO [Component] Component: user, scope: SESSION, type: ENTITY_BEAN, class: com.myproject.cms.mode l.user.User 22:39:53,056 INFO [Component] Component: logout, scope: STATELESS, type: STATELESS_SESSION_BEAN, class: com.i play69.cms.manager.LogoutAction, JNDI: cms/LogoutAction/local 22:39:53,136 INFO [Component] Component: register, scope: EVENT, type: STATEFUL_SESSION_BEAN, class: com.ipla y69.cms.manager.RegisterAction, JNDI: cms/RegisterAction/local 22:39:53,186 INFO [Initialization] done initializing Seam 22:39:53,647 INFO [FacesConfigurator] Reading standard config org/apache/myfaces/resource/standard-faces-conf ig.xml 22:39:53,857 INFO [FacesConfigurator] Reading config jar:file:/C:/projects/myproject/prod/jboss-5.0.0alpha/server /myprojectserver/tmp/deploy/tmp1427cms.ear-contents/cms-exp.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/faces-confi g.xml 22:39:53,887 INFO [FacesConfigurator] Reading config /WEB-INF/faces-config.xml 22:39:54,167 ERROR [LocaleUtils] Locale name null or empty, ignoring 22:39:54,908 INFO [StartupServletContextListener] ServletContext 'C:\projects\myproject\prod\jboss-5.0.0alpha\ser ver\myprojectserver\.\tmp\deploy\tmp1427cms.ear-contents\cms-exp.war\' initialized. 22:39:54,928 INFO [ProfileServlet] Starting initialisation 22:39:54,989 INFO [ProfileServlet] Completed initialisation 22:39:55,159 INFO [EARDeployer] Started J2EE application: file:/C:/projects/myproject/prod/jboss-5.0.0alpha/serve r/myprojectserver/deploy/cms.ear
seam.properties
org.jboss.seam.core.init.managedPersistenceContexts myprojectcmsEntityManager myprojectcmsEntityManager.persistenceUnitJndiName java:/MyProjectCMSEntityManagerFactor
seam-jndi.properties
java.naming.factory.initial org.jnp.interfaces.LocalOnlyContextFactory java.naming.factory.url.pkgs org.jboss.naming:org.jnp.interfaces
persistence.xml
... <property name="jboss.entity.manager.jndi.name" value="java:/MyProjectCMSEntityManager"/> <property name="jboss.entity.manager.factory.jndi.name" value="java:/MyProjectCMSEntityManagerFactory"/>
web.xml
... <!-- Global JNDI name pattern for JBoss EJB3 (change for other servers) --> <context-param> <param-name>org.jboss.seam.core.init.jndiPattern</param-name> <param-value>cms/#{ejbName}/local</param-value> </context-param> <context-param> <param-name> org.jboss.seam.core.init.managedPersistenceContexts </param-name> <param-value>myprojectcmsEntityManager</param-value> </context-param> <context-param> <param-name>trySeam1Entity.myprojectcmsEntityManager</param-name> <param-value> java:/MyProjectCMSEntityManagerFactory </param-value> </context-param>
any ideas people ?