Results 1 to 3 of 3
  1. #1
    Heather is offline Senior Member
    Join Date
    Jun 2007
    Posts
    164
    Rep Power
    8

    Default org.hibernate.ejb.Version <clinit> INFO: Hibernate EntityManager 3.2.0.CR1

    I have this problem with hibernate and annotations
    Java Code:
    --------------------------------------- ERROR ----------------------------------------------
    11/06/2007 20:31:10 org.hibernate.ejb.Version <clinit>
    INFO: Hibernate EntityManager 3.2.0.CR1
    11/06/2007 20:31:10 org.hibernate.cfg.annotations.Version <clinit>
    INFO: Hibernate Annotations 3.2.0.CR1
    11/06/2007 20:31:10 org.hibernate.cfg.Environment <clinit>
    INFO: Hibernate 3.2 cr2
    11/06/2007 20:31:10 org.hibernate.cfg.Environment <clinit>
    INFO: hibernate.properties not found
    11/06/2007 20:31:10 org.hibernate.cfg.Environment buildBytecodeProvider
    INFO: Bytecode provider name : cglib
    11/06/2007 20:31:10 org.hibernate.cfg.Environment <clinit>
    INFO: using JDK 1.4 java.sql.Timestamp handling
    11/06/2007 20:31:10 org.hibernate.ejb.Ejb3Configuration$4 accept
    GRAVE: META-INF/persistence.xmlO-:-Ofalse
    11/06/2007 20:31:10 org.hibernate.cfg.AnnotationBinder bindClass
    INFO: Binding entity from annotated class: domain.Stock
    11/06/2007 20:31:10 org.hibernate.cfg.annotations.EntityBinder bindTable
    INFO: Bind entity domain.Stock on table stockdb
    Exception in thread "main" javax.persistence.PersistenceException: org.hibernate.AnnotationException: No identifier specified for entity: domain.Stock
        at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:217)
        at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:114)
        at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:37)
        at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:27)
        at appl.Main.main(Main.java:16)
    Caused by: org.hibernate.AnnotationException: No identifier specified for entity: domain.Stock
        at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:619)
        at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:353)
        at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:265)
        at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1034)
        at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1015)
        at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:154)
        at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:751)
        at org.hibernate.ejb.Ejb3Configuration.createFactory(Ejb3Configuration.java:151)
        at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:205)
        ... 4 more
    Last edited by Heather; 06-30-2007 at 03:50 PM.

  2. #2
    bbq
    bbq is offline Senior Member
    Join Date
    Jun 2007
    Posts
    132
    Rep Power
    0

    Default

    The exception is clear, you didn't declare an ID of Stock class, it doesn't have the primary key.

  3. #3
    Jack is offline Senior Member
    Join Date
    Jun 2007
    Posts
    130
    Rep Power
    0

    Default

    is your application in this path: WEB-INF/classes/META-INF ?
    please check this

Similar Threads

  1. Hibernate, help me
    By Nick15 in forum JDBC
    Replies: 2
    Last Post: 06-05-2008, 04:39 PM
  2. help with inheritance in hibernate
    By valery in forum JDBC
    Replies: 1
    Last Post: 08-06-2007, 09:44 PM
  3. Hibernate subclasses
    By Ed in forum JDBC
    Replies: 2
    Last Post: 07-02-2007, 05:42 PM
  4. Hibernate
    By Alan in forum JDBC
    Replies: 2
    Last Post: 05-11-2007, 02:19 AM
  5. Hibernate
    By Shuru in forum JDBC
    Replies: 2
    Last Post: 05-09-2007, 06:39 PM

Posting Permissions

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