Results 1 to 5 of 5

Thread: RC2: org.hibernate.AnnotationException: No identifier specified for entity

  1. #1
    Join Date
    Oct 2009
    Location
    Munich, Germany
    Posts
    103

    Default RC2: org.hibernate.AnnotationException: No identifier specified for entity

    I use the new RC2 and if i run a demo app with only one persistent class i get the following exception:

    Code:
    Caused by: org.hibernate.AnnotationException: No identifier specified for entity: com.hra.pizza.domain.Product
    	at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:671)
    	at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:534)
    	at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:286)
    	at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1121)
    	at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1225)
    	at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:159)
    	at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:854)
    	at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:425)
    	at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:131)
    	at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:225)
    	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:288)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1454)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1392)
    	... 37 more
    I used the pom generated by roo, no special entries.

    Any ideas?

    Cheers Fireball

  2. #2
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

    Can you please include Product*.* file contents as an attachment? That way we can take a look. Alternately or additionally, can you also please provide the Roo commands you used to create the application so that we can attempt to reproduce.
    Ben Alex
    Project Founder, Spring UAA, Spring Roo and Spring Security

  3. #3
    Join Date
    Oct 2009
    Location
    Munich, Germany
    Posts
    103

    Default

    Sorry, but i can't reproduce the error. Perhaps a subspace anomaly :-)

  4. #4
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

    Great to hear you got it working. Please don't hesitate to post other threads if we can be of further assistance.
    Ben Alex
    Project Founder, Spring UAA, Spring Roo and Spring Security

  5. #5
    Join Date
    Oct 2007
    Posts
    16

    Default "no identifier specified for entity"

    I have not been able to run my Spring/ROO/JPA application due to the error ""no identifier specified for entity" under some conditions

    1. The entity was created by ROO. It has the standard "Long id" identifier in the Roo_Entity.aj file

    2. If I manually move the id field definition to the .java file (not moving the getters and setters), the problem goes away.

    3. The problem has occurred under Eclipse but not when I run the same test from the maven command line.

    4. The problem is somewhat unstable (a "heisenbug" ). I have long suspected that the incremental compilation feature in Eclipse with AJDT eventually gets corrupted after repeated incremental compilations. As a troubleshooting step, I turned off incremental compilation, did a clean, followed by a build. In one case the problem went away, but this does not seem to be a general solution. Other times I have done a clean and a build without the problem going away.

    -Robert Blumen

    -Robert Blumen

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •