Announcement Announcement Module
No announcement yet.
No identifier specified for entity Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • No identifier specified for entity

    I got an error saying
    org.hibernate.AnnotationException: No identifier specified for entity: MyEntity.
    when I deploy my roo generated war file to Tomcat 6.0.

    My project is using Spring 3.0 + Hibernate 3.4.

    but in MyEntity_Roo_Entity the code is as below:
        @GeneratedValue(strategy = GenerationType.AUTO)
        @Column(name = "id")
        private Long;
        @Column(name = "version")
        private Integer MyEntity.version;
        public Long MyEntity.getId() {
        public void MyEntity.setId(Long id) {
   = id;
    What is wrong with my code? The primary key has been defined in Why does it show that error?

  • #2
    There does not appear to be anything wrong in you what you have listed. You mentioned you are using Hibernate 3.4 and I have seen this problem before when mixed versions of Hibernate jars are used. Roo has used Hibernate 3.6.x for a while now so make sure that all the Hibernate jars in your classpath have exactly the same version number.


    • #3
      Thanks Alan I am also aware of that. But when I search the dependency in Eclipse the latest version of these two dependencies available is 3.4.0.GA.

      But I did notice that there are multiple but different versions of jar files in the lib folder of my Tomcat server.