[jboss-user] [EJB 3.0] - Problem with simple example of @ManyToMany

tsirel84 do-not-reply at jboss.com
Fri Jan 25 08:45:34 EST 2008


I have two entities Course and Student (example from book Mastering EJB3) related as bidirectional many to many. Application fails during deployment. 

Environment:
-----------------------
JBoss Bootstrap Environment

  JBOSS_HOME: C:\jboss-4.2.1.GA

  JAVA: C:\Program Files\Java\jdk1.5.0_09\bin\java

  JAVA_OPTS:  -Dprogram.name=run.bat -server -Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000

  CLASSPATH: C:\Program Files\Java\jdk1.5.0_09\lib\tools.jar;C:\jboss-4.2.1.GA\bin\run.jar
--------------------------------

Here is the log:
16:05:01,600 WARN  [ServiceController] Problem starting service persistence.units:ear=javaEEApplication.ear,jar=EJB.jar,unitName=first
javax.persistence.PersistenceException: org.hibernate.MappingException: Could not determine type for: java.util.Collection, for columns: [org.hibernate.mapping.Column(students)]
	at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:720)
	at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:127)
	at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:246)
	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.ejb3.ServiceDelegateWrapper.startService(ServiceDelegateWrapper.java:103)
	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:155)
	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
	at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
	at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
	at $Proxy0.start(Unknown Source)

Here is the debug log:
2008-01-25 16:05:01,069 INFO  [org.hibernate.cfg.AnnotationBinder] Binding entity from annotated class: com.gemini.test.ejb.entity.relationship.Course
2008-01-25 16:05:01,069 DEBUG [org.hibernate.cfg.Ejb3Column] Binding column DTYPE unique false
2008-01-25 16:05:01,069 DEBUG [org.hibernate.cfg.annotations.EntityBinder] Import with entity name=CourseUni
2008-01-25 16:05:01,069 INFO  [org.hibernate.cfg.annotations.EntityBinder] Bind entity com.gemini.test.ejb.entity.relationship.Course on table CourseUni
2008-01-25 16:05:01,069 DEBUG [org.hibernate.cfg.AnnotationBinder] Processing com.gemini.test.ejb.entity.relationship.Course property annotation
2008-01-25 16:05:01,069 DEBUG [org.hibernate.cfg.AnnotationBinder] Processing annotations of com.gemini.test.ejb.entity.relationship.Course.id
2008-01-25 16:05:01,069 DEBUG [org.hibernate.cfg.Ejb3Column] Binding column id unique false
2008-01-25 16:05:01,069 DEBUG [org.hibernate.cfg.AnnotationBinder] id is an id
2008-01-25 16:05:01,069 DEBUG [org.hibernate.cfg.annotations.SimpleValueBinder] building SimpleValue for id
2008-01-25 16:05:01,069 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] Building property id
2008-01-25 16:05:01,069 DEBUG [org.hibernate.cfg.AnnotationBinder] Bind @Id on id
2008-01-25 16:05:01,069 DEBUG [org.hibernate.cfg.AnnotationBinder] Processing annotations of com.gemini.test.ejb.entity.relationship.Course.students
2008-01-25 16:05:01,069 DEBUG [org.hibernate.cfg.Ejb3Column] Binding column students unique false
2008-01-25 16:05:01,069 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] binding property students with lazy=false
2008-01-25 16:05:01,069 DEBUG [org.hibernate.cfg.annotations.SimpleValueBinder] building SimpleValue for students
2008-01-25 16:05:01,069 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] Building property students
2008-01-25 16:05:01,069 DEBUG [org.hibernate.cfg.AnnotationBinder] Processing annotations of com.gemini.test.ejb.entity.relationship.Course.courseName
2008-01-25 16:05:01,069 DEBUG [org.hibernate.cfg.Ejb3Column] Binding column courseName unique false
2008-01-25 16:05:01,069 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] binding property courseName with lazy=false
2008-01-25 16:05:01,069 DEBUG [org.hibernate.cfg.annotations.SimpleValueBinder] building SimpleValue for courseName
2008-01-25 16:05:01,069 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] Building property courseName
2008-01-25 16:05:01,069 INFO  [org.hibernate.cfg.AnnotationBinder] Binding entity from annotated class: com.gemini.test.ejb.entity.relationship.Student
2008-01-25 16:05:01,069 DEBUG [org.hibernate.cfg.Ejb3Column] Binding column DTYPE unique false
2008-01-25 16:05:01,069 DEBUG [org.hibernate.cfg.annotations.EntityBinder] Import with entity name=StudentUni
2008-01-25 16:05:01,069 INFO  [org.hibernate.cfg.annotations.EntityBinder] Bind entity com.gemini.test.ejb.entity.relationship.Student on table StudentUni
2008-01-25 16:05:01,069 DEBUG [org.hibernate.cfg.AnnotationBinder] Processing com.gemini.test.ejb.entity.relationship.Student property annotation
2008-01-25 16:05:01,069 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3 at 11775bc, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader at 14de7ea{ url=null ,addedOrder=0}
2008-01-25 16:05:01,069 DEBUG [org.hibernate.cfg.AnnotationBinder] Processing annotations of com.gemini.test.ejb.entity.relationship.Student.id
2008-01-25 16:05:01,069 DEBUG [org.hibernate.cfg.Ejb3Column] Binding column id unique false
2008-01-25 16:05:01,069 DEBUG [org.hibernate.cfg.AnnotationBinder] id is an id
2008-01-25 16:05:01,069 DEBUG [org.hibernate.cfg.annotations.SimpleValueBinder] building SimpleValue for id
2008-01-25 16:05:01,069 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] Building property id
2008-01-25 16:05:01,069 DEBUG [org.hibernate.cfg.AnnotationBinder] Bind @Id on id
2008-01-25 16:05:01,069 DEBUG [org.hibernate.cfg.AnnotationBinder] Processing annotations of com.gemini.test.ejb.entity.relationship.Student.name
2008-01-25 16:05:01,069 DEBUG [org.hibernate.cfg.Ejb3Column] Binding column name unique false
2008-01-25 16:05:01,069 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] binding property name with lazy=false
2008-01-25 16:05:01,069 DEBUG [org.hibernate.cfg.annotations.SimpleValueBinder] building SimpleValue for name
2008-01-25 16:05:01,069 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] Building property name
2008-01-25 16:05:01,069 DEBUG [org.hibernate.cfg.AnnotationBinder] Processing annotations of com.gemini.test.ejb.entity.relationship.Student.courses
2008-01-25 16:05:01,069 DEBUG [org.hibernate.cfg.Ejb3Column] Binding column null unique false
2008-01-25 16:05:01,069 DEBUG [org.hibernate.cfg.Ejb3Column] Binding column element unique false
2008-01-25 16:05:01,069 DEBUG [org.hibernate.cfg.Ejb3Column] Binding column mapkey unique false
2008-01-25 16:05:01,069 DEBUG [org.hibernate.cfg.Ejb3Column] Binding column null unique false
2008-01-25 16:05:01,069 DEBUG [org.hibernate.cfg.Ejb3Column] Binding column null unique false
2008-01-25 16:05:01,069 DEBUG [org.hibernate.cfg.Ejb3Column] Binding column null unique false
2008-01-25 16:05:01,069 DEBUG [org.hibernate.cfg.annotations.CollectionBinder] Collection role: com.gemini.test.ejb.entity.relationship.Student.courses
2008-01-25 16:05:01,069 DEBUG [org.hibernate.cfg.annotations.PropertyBinder] Building property courses
2008-01-25 16:05:01,069 DEBUG [org.hibernate.cfg.AnnotationConfiguration] processing manytoone fk mappings
2008-01-25 16:05:01,225 DEBUG [org.hibernate.cfg.Configuration] processing extends queue
2008-01-25 16:05:01,225 DEBUG [org.hibernate.cfg.Configuration] processing collection mappings
2008-01-25 16:05:01,225 DEBUG [org.hibernate.cfg.CollectionSecondPass] Second pass for collection: com.gemini.test.ejb.entity.relationship.Student.courses
2008-01-25 16:05:01,225 DEBUG [org.hibernate.cfg.annotations.CollectionBinder] Binding as ManyToMany: com.gemini.test.ejb.entity.relationship.Student.courses
2008-01-25 16:05:01,240 DEBUG [org.hibernate.cfg.CollectionSecondPass] Mapped collection key: StudentUni_id, element: courses_id
2008-01-25 16:05:01,240 DEBUG [org.hibernate.cfg.CollectionSecondPass] Second pass for collection: com.gemini.test.ejb.entity.relationship.Company.employees
2008-01-25 16:05:01,240 DEBUG [org.hibernate.cfg.annotations.CollectionBinder] Binding a OneToMany: com.gemini.test.ejb.entity.relationship.Company.employees through a foreign key
2008-01-25 16:05:01,240 INFO  [org.hibernate.cfg.annotations.CollectionBinder] Mapping collection: com.gemini.test.ejb.entity.relationship.Company.employees -> EmployeeOMUni
2008-01-25 16:05:01,240 DEBUG [org.hibernate.cfg.annotations.TableBinder] Retrieving property com.gemini.test.ejb.entity.relationship.Employee.company
2008-01-25 16:05:01,240 DEBUG [org.hibernate.cfg.CollectionSecondPass] Mapped collection key: company_id, one-to-many: com.gemini.test.ejb.entity.relationship.Employee
2008-01-25 16:05:01,240 DEBUG [org.hibernate.cfg.Configuration] processing native query and ResultSetMapping mappings
2008-01-25 16:05:01,240 DEBUG [org.hibernate.cfg.Configuration] processing association property references
2008-01-25 16:05:01,240 DEBUG [org.hibernate.cfg.Configuration] processing foreign key constraints
2008-01-25 16:05:01,240 DEBUG [org.hibernate.cfg.Configuration] resolving reference to class: com.gemini.test.ejb.entity.separate.RoadVehicle
2008-01-25 16:05:01,240 DEBUG [org.hibernate.cfg.Configuration] resolving reference to class: com.gemini.test.ejb.entity.separate.Car
2008-01-25 16:05:01,240 DEBUG [org.hibernate.cfg.Configuration] resolving reference to class: com.gemini.test.ejb.entity.relationship.Company
2008-01-25 16:05:01,240 DEBUG [org.hibernate.cfg.Configuration] resolving reference to class: com.gemini.test.ejb.entity.separate.RoadVehicle
2008-01-25 16:05:01,240 DEBUG [org.hibernate.cfg.Configuration] resolving reference to class: com.gemini.test.ejb.entity.relationship.Shipment
2008-01-25 16:05:01,240 DEBUG [org.hibernate.cfg.Configuration] resolving reference to class: com.gemini.test.ejb.entity.separate.Car
2008-01-25 16:05:01,240 DEBUG [org.hibernate.cfg.Configuration] resolving reference to class: com.gemini.test.ejb.entity.relationship.Course
2008-01-25 16:05:01,240 DEBUG [org.hibernate.cfg.Configuration] resolving reference to class: com.gemini.test.ejb.entity.relationship.Student
2008-01-25 16:05:01,303 DEBUG [org.hibernate.validator.ClassValidator] ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
2008-01-25 16:05:01,334 DEBUG [org.hibernate.validator.ClassValidator] ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
2008-01-25 16:05:01,334 DEBUG [org.hibernate.validator.ClassValidator] ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
2008-01-25 16:05:01,350 DEBUG [org.hibernate.validator.ClassValidator] ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
2008-01-25 16:05:01,350 DEBUG [org.hibernate.validator.ClassValidator] ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
2008-01-25 16:05:01,365 DEBUG [org.hibernate.validator.ClassValidator] ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
2008-01-25 16:05:01,365 DEBUG [org.hibernate.validator.ClassValidator] ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
2008-01-25 16:05:01,381 DEBUG [org.hibernate.validator.ClassValidator] ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
2008-01-25 16:05:01,381 DEBUG [org.hibernate.validator.ClassValidator] ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
2008-01-25 16:05:01,381 DEBUG [org.hibernate.validator.ClassValidator] ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
2008-01-25 16:05:01,381 DEBUG [org.hibernate.validator.ClassValidator] ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
2008-01-25 16:05:01,381 DEBUG [org.hibernate.validator.ClassValidator] ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
2008-01-25 16:05:01,397 DEBUG [org.hibernate.validator.ClassValidator] ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
2008-01-25 16:05:01,397 DEBUG [org.hibernate.validator.ClassValidator] ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
2008-01-25 16:05:01,397 DEBUG [org.hibernate.validator.ClassValidator] ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
2008-01-25 16:05:01,397 DEBUG [org.hibernate.validator.ClassValidator] ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
2008-01-25 16:05:01,397 DEBUG [org.hibernate.validator.ClassValidator] ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
2008-01-25 16:05:01,397 DEBUG [org.hibernate.validator.ClassValidator] ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
2008-01-25 16:05:01,397 DEBUG [org.hibernate.validator.ClassValidator] ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
2008-01-25 16:05:01,490 DEBUG [org.hibernate.ejb.util.NamingHelper] Not Ejb3Configuration to JNDI, no JNDI name configured
2008-01-25 16:05:01,506 DEBUG [org.hibernate.cfg.Configuration] Preparing to build session factory with filters : {}
2008-01-25 16:05:01,506 DEBUG [org.hibernate.cfg.AnnotationConfiguration] Execute first pass mapping processing
2008-01-25 16:05:01,506 DEBUG [org.hibernate.cfg.AnnotationConfiguration] Process hbm files
2008-01-25 16:05:01,506 DEBUG [org.hibernate.cfg.AnnotationConfiguration] Process annotated classes
2008-01-25 16:05:01,506 DEBUG [org.hibernate.cfg.AnnotationConfiguration] processing manytoone fk mappings
2008-01-25 16:05:01,506 DEBUG [org.hibernate.cfg.Configuration] processing extends queue
2008-01-25 16:05:01,506 DEBUG [org.hibernate.cfg.Configuration] processing collection mappings
2008-01-25 16:05:01,506 DEBUG [org.hibernate.cfg.Configuration] processing native query and ResultSetMapping mappings
2008-01-25 16:05:01,506 DEBUG [org.hibernate.cfg.Configuration] processing association property references
2008-01-25 16:05:01,506 DEBUG [org.hibernate.cfg.Configuration] processing foreign key constraints
2008-01-25 16:05:01,506 DEBUG [org.hibernate.cfg.Configuration] resolving reference to class: com.gemini.test.ejb.entity.separate.RoadVehicle
2008-01-25 16:05:01,506 DEBUG [org.hibernate.cfg.Configuration] resolving reference to class: com.gemini.test.ejb.entity.separate.Car
2008-01-25 16:05:01,506 DEBUG [org.hibernate.cfg.Configuration] resolving reference to class: com.gemini.test.ejb.entity.relationship.Company
2008-01-25 16:05:01,506 DEBUG [org.hibernate.cfg.Configuration] resolving reference to class: com.gemini.test.ejb.entity.separate.RoadVehicle
2008-01-25 16:05:01,506 DEBUG [org.hibernate.cfg.Configuration] resolving reference to class: com.gemini.test.ejb.entity.relationship.Shipment
2008-01-25 16:05:01,506 DEBUG [org.hibernate.cfg.Configuration] resolving reference to class: com.gemini.test.ejb.entity.separate.Car
2008-01-25 16:05:01,506 DEBUG [org.hibernate.cfg.Configuration] resolving reference to class: com.gemini.test.ejb.entity.relationship.Course
2008-01-25 16:05:01,506 DEBUG [org.hibernate.cfg.Configuration] resolving reference to class: com.gemini.test.ejb.entity.relationship.Student
2008-01-25 16:05:01,506 DEBUG [org.hibernate.validator.ClassValidator] ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
2008-01-25 16:05:01,506 DEBUG [org.hibernate.validator.ClassValidator] ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
2008-01-25 16:05:01,506 DEBUG [org.hibernate.validator.ClassValidator] ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
2008-01-25 16:05:01,522 DEBUG [org.hibernate.validator.ClassValidator] ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
2008-01-25 16:05:01,522 DEBUG [org.hibernate.validator.ClassValidator] ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
2008-01-25 16:05:01,522 DEBUG [org.hibernate.validator.ClassValidator] ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
2008-01-25 16:05:01,522 DEBUG [org.hibernate.validator.ClassValidator] ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
2008-01-25 16:05:01,522 DEBUG [org.hibernate.validator.ClassValidator] ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
2008-01-25 16:05:01,522 DEBUG [org.hibernate.validator.ClassValidator] ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
2008-01-25 16:05:01,537 DEBUG [org.hibernate.validator.ClassValidator] ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
2008-01-25 16:05:01,537 DEBUG [org.hibernate.validator.ClassValidator] ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
2008-01-25 16:05:01,537 DEBUG [org.hibernate.validator.ClassValidator] ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
2008-01-25 16:05:01,537 DEBUG [org.hibernate.validator.ClassValidator] ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
2008-01-25 16:05:01,537 DEBUG [org.hibernate.validator.ClassValidator] ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
2008-01-25 16:05:01,553 DEBUG [org.hibernate.validator.ClassValidator] ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
2008-01-25 16:05:01,553 DEBUG [org.hibernate.validator.ClassValidator] ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
2008-01-25 16:05:01,553 DEBUG [org.hibernate.validator.ClassValidator] ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
2008-01-25 16:05:01,553 DEBUG [org.hibernate.validator.ClassValidator] ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
2008-01-25 16:05:01,553 DEBUG [org.hibernate.validator.ClassValidator] ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
2008-01-25 16:05:01,553 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3 at 11775bc, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader at f2e328{ url=null ,addedOrder=0}
2008-01-25 16:05:01,600 DEBUG [org.jboss.ejb3.ServiceDelegateWrapper] Starting failed persistence.units:ear=javaEEApplication.ear,jar=EJB.jar,unitName=first
javax.persistence.PersistenceException: org.hibernate.MappingException: Could not determine type for: java.util.Collection, for columns: [org.hibernate.mapping.Column(students)]
	at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:720)
	at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:127)
	at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:246)
	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.ejb3.ServiceDelegateWrapper.startService(ServiceDelegateWrapper.java:103)
	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:155)
	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
	at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
	at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
	at $Proxy0.start(Unknown Source)

Here is my code for both entities:
@Entity(name = "StudentUni")
public class Student implements Serializable {
    private int id;
    private String name;
    private Collection courses = new ArrayList();

    public Student(){
        id = (int) System.nanoTime();
    }

    @Id
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @ManyToMany
    public Collection getCourses() {
        return courses;
    }

    public void setCourses(Collection courses) {
        this.courses = courses;
    }
}

@Entity(name = "CourseUni")
public class Course implements Serializable {
    private int id;
    private String courseName;
    private Collection students = new ArrayList();

    public Course(){
        id = (int) System.nanoTime();
    }

    @Id
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getCourseName() {
        return courseName;
    }

    public void setCourseName(String courseName) {
        this.courseName = courseName;
    }


    @ManyToMany(mappedBy = "courses")
    public Collection getStudents() {
        return students;
    }


    public void setStudents(Collection students) {
        this.students = students;
    }
}


Please help!!

Waiting for your thoughts in the forum or
at alexander dot tsirel at gmail dot com

Alexander


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4123466#4123466

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4123466



More information about the jboss-user mailing list