Spring Roo
  1. Spring Roo
  2. ROO-2864

DBRef annotation error when referring to RooMongoEntity from a RooEntity

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.2.0.M1
    • Fix Version/s: None
    • Component/s: PERSISTENCE
    • Labels:
      None
    • Environment:
      SpringSource tc Server 2.1

      Description

      In my 1.2M1 Roo project I have created a RooEntity and a RooMongoEntity. I want to refer to the mongo entity using @DBRef. However, when starting

      @RooJavaBean
      @RooToString
      @RooEntity
      public class MyClass {

      @DBRef
      List<MyContent> content;
      }

      @RooJavaBean
      @RooToString
      @RooMongoEntity
      public class MyContent {

      }

      However, at runtime I get a "org.hibernate.AnnotationException: No identifier specified for entity" error

      2011-11-01 11:13:54,210 [main] ERROR org.springframework.web.context.ContextLoader - Context initialization failed
      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in file [/Users/mark/apps/springsource/tc-server-developer-2.1.1.RELEASE/cbs2/wtpwebapps/mongo2/WEB-INF/classes/META-INF/spring/applicationContext.xml]: Cannot resolve reference to bean 'entityManagerFactory' while setting bean property 'entityManagerFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in file [/Users/mark/apps/springsource/tc-server-developer-2.1.1.RELEASE/cbs2/wtpwebapps/mongo2/WEB-INF/classes/META-INF/spring/applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.AnnotationException: No identifier specified for entity: com.mongo.domain.MyContent
      at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
      at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1325)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
      at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282)
      at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:204)
      at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:568)
      at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637)
      at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:563)
      at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498)
      at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1282)
      at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
      at org.apache.catalina.core.StandardHost.start(StandardHost.java:807)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
      at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
      at org.apache.catalina.core.StandardService.start(StandardService.java:519)
      at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
      at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
      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:597)
      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
      Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in file [/Users/mark/apps/springsource/tc-server-developer-2.1.1.RELEASE/cbs2/wtpwebapps/mongo2/WEB-INF/classes/META-INF/spring/applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.AnnotationException: No identifier specified for entity: com.mongo.domain.MyContent
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
      at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
      ... 39 more
      Caused by: org.hibernate.AnnotationException: No identifier specified for entity: com.mongo.domain.MyContent
      at org.hibernate.cfg.InheritanceState.determineDefaultAccessType(InheritanceState.java:268)
      at org.hibernate.cfg.InheritanceState.getElementsToProcess(InheritanceState.java:223)
      at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:686)
      at org.hibernate.cfg.Configuration$MetadataSourceQueue.processAnnotatedClassesQueue(Configuration.java:4035)
      at org.hibernate.cfg.Configuration$MetadataSourceQueue.processMetadata(Configuration.java:3989)
      at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1398)
      at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1375)
      at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1519)
      at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:193)
      at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:1100)
      at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:689)
      at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:73)
      at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:225)
      at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:310)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
      ... 46 more
      N

        Issue Links

          Activity

          Hide
          Stefan Schmidt added a comment -

          I have not tried this yet but I would guess you'll need to setup cross store support offered by Spring Data MongoDB: http://static.springsource.org/spring-data/data-document/docs/current/reference/html/#mongo.cross.store

          Let us know if this does the trick...

          Show
          Stefan Schmidt added a comment - I have not tried this yet but I would guess you'll need to setup cross store support offered by Spring Data MongoDB: http://static.springsource.org/spring-data/data-document/docs/current/reference/html/#mongo.cross.store Let us know if this does the trick...
          Hide
          Ben Alex added a comment -

          This is not a bug, it is an improvement. Editing accordingly.

          Show
          Ben Alex added a comment - This is not a bug, it is an improvement. Editing accordingly.
          Hide
          Mark Dopheide added a comment -

          Thanks for the quick response. It would be great to see this support added as an enhancement

          But even after following Stephan's advice by adding this to applicationContext-mongo.xml
          <bean class="org.springframework.data.mongodb.core.MongoExceptionTranslator" />

          <!-- Mongo cross-store aspect config -->
          <bean id="mongoChangeSetPersister"
          class="org.springframework.data.persistence.document.mongodb.MongoChangeSetPersister">
          <property name="mongoTemplate" ref="mongoTemplate" />
          <property name="entityManagerFactory" ref="entityManagerFactory" />
          </bean>

          <bean
          class="org.springframework.data.persistence.document.mongodb.MongoDocumentBacking"
          factory-method="aspectOf">
          <property name="changeSetPersister" ref="mongoChangeSetPersister" />
          </bean>

          and adding these to the pom:
          <dependency>
          <groupId>org.springframework.data</groupId>
          <artifactId>spring-data-mongodb-cross-store</artifactId>
          <version>1.0.0.M4</version>
          </dependency>
          ...
          <aspectLibrary>
          <groupId>org.springframework.data</groupId>
          <artifactId>spring-data-mongodb-cross-store</artifactId>
          </aspectLibrary>

          I still see this error when starting tc server 2.1

          2011-11-01 23:11:51,764 [main] ERROR org.springframework.web.context.ContextLoader - Context initialization failed
          org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongoChangeSetPersister' defined in file [/Users/mark/apps/springsource/tc-server-developer-2.1.1.RELEASE/cbs2/wtpwebapps/mongo/WEB-INF/classes/META-INF/spring/applicationContext-mongo.xml]: Cannot resolve reference to bean 'entityManagerFactory' while setting bean property 'entityManagerFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in file [/Users/mark/apps/springsource/tc-server-developer-2.1.1.RELEASE/cbs2/wtpwebapps/mongo/WEB-INF/classes/META-INF/spring/applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.AnnotationException: No identifier specified for entity: com.test.domain.MyMongo
          at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
          at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1325)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
          at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
          at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
          at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
          at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
          at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
          at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
          at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
          at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282)
          at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:204)
          at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
          at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
          at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
          at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
          at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
          at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:568)
          at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637)
          at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:563)
          at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498)
          at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1282)
          at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
          at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
          at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
          at org.apache.catalina.core.StandardHost.start(StandardHost.java:807)
          at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
          at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
          at org.apache.catalina.core.StandardService.start(StandardService.java:519)
          at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
          at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
          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:597)
          at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
          at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
          Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in file [/Users/mark/apps/springsource/tc-server-developer-2.1.1.RELEASE/cbs2/wtpwebapps/mongo/WEB-INF/classes/META-INF/spring/applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.AnnotationException: No identifier specified for entity: com.test.domain.MyMongo
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
          at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
          at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
          at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
          at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
          at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
          ... 39 more
          Caused by: org.hibernate.AnnotationException: No identifier specified for entity: com.test.domain.MyMongo
          at org.hibernate.cfg.InheritanceState.determineDefaultAccessType(InheritanceState.java:268)
          at org.hibernate.cfg.InheritanceState.getElementsToProcess(InheritanceState.java:223)
          at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:686)
          at org.hibernate.cfg.Configuration$MetadataSourceQueue.processAnnotatedClassesQueue(Configuration.java:4035)
          at org.hibernate.cfg.Configuration$MetadataSourceQueue.processMetadata(Configuration.java:3989)
          at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1398)
          at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1375)
          at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1519)
          at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:193)
          at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:1100)
          at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:689)
          at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:73)
          at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:225)
          at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:310)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
          ... 46 more

          p.s.

          My clasees this time were:
          @RooJavaBean
          @RooToString
          @RooEntity
          public class MyEntity {
          }

          @RooJavaBean
          @RooToString
          @RooMongoEntity
          public class MyMongo

          { private Date created = Calendar.getInstance().getTime(); }
          Show
          Mark Dopheide added a comment - Thanks for the quick response. It would be great to see this support added as an enhancement But even after following Stephan's advice by adding this to applicationContext-mongo.xml <bean class="org.springframework.data.mongodb.core.MongoExceptionTranslator" /> <!-- Mongo cross-store aspect config --> <bean id="mongoChangeSetPersister" class="org.springframework.data.persistence.document.mongodb.MongoChangeSetPersister"> <property name="mongoTemplate" ref="mongoTemplate" /> <property name="entityManagerFactory" ref="entityManagerFactory" /> </bean> <bean class="org.springframework.data.persistence.document.mongodb.MongoDocumentBacking" factory-method="aspectOf"> <property name="changeSetPersister" ref="mongoChangeSetPersister" /> </bean> and adding these to the pom: <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-mongodb-cross-store</artifactId> <version>1.0.0.M4</version> </dependency> ... <aspectLibrary> <groupId>org.springframework.data</groupId> <artifactId>spring-data-mongodb-cross-store</artifactId> </aspectLibrary> I still see this error when starting tc server 2.1 2011-11-01 23:11:51,764 [main] ERROR org.springframework.web.context.ContextLoader - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongoChangeSetPersister' defined in file [/Users/mark/apps/springsource/tc-server-developer-2.1.1.RELEASE/cbs2/wtpwebapps/mongo/WEB-INF/classes/META-INF/spring/applicationContext-mongo.xml] : Cannot resolve reference to bean 'entityManagerFactory' while setting bean property 'entityManagerFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in file [/Users/mark/apps/springsource/tc-server-developer-2.1.1.RELEASE/cbs2/wtpwebapps/mongo/WEB-INF/classes/META-INF/spring/applicationContext.xml] : Invocation of init method failed; nested exception is org.hibernate.AnnotationException: No identifier specified for entity: com.test.domain.MyMongo at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1325) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:204) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:568) at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637) at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:563) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1282) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) at org.apache.catalina.core.StandardHost.start(StandardHost.java:807) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445) at org.apache.catalina.core.StandardService.start(StandardService.java:519) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:581) 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:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in file [/Users/mark/apps/springsource/tc-server-developer-2.1.1.RELEASE/cbs2/wtpwebapps/mongo/WEB-INF/classes/META-INF/spring/applicationContext.xml] : Invocation of init method failed; nested exception is org.hibernate.AnnotationException: No identifier specified for entity: com.test.domain.MyMongo at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322) ... 39 more Caused by: org.hibernate.AnnotationException: No identifier specified for entity: com.test.domain.MyMongo at org.hibernate.cfg.InheritanceState.determineDefaultAccessType(InheritanceState.java:268) at org.hibernate.cfg.InheritanceState.getElementsToProcess(InheritanceState.java:223) at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:686) at org.hibernate.cfg.Configuration$MetadataSourceQueue.processAnnotatedClassesQueue(Configuration.java:4035) at org.hibernate.cfg.Configuration$MetadataSourceQueue.processMetadata(Configuration.java:3989) at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1398) at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1375) at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1519) at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:193) at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:1100) at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:689) at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:73) at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:225) at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:310) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417) ... 46 more p.s. My clasees this time were: @RooJavaBean @RooToString @RooEntity public class MyEntity { } — @RooJavaBean @RooToString @RooMongoEntity public class MyMongo { private Date created = Calendar.getInstance().getTime(); }

            People

            • Assignee:
              Unassigned
              Reporter:
              Mark Dopheide
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: