0 Replies Latest reply on Apr 25, 2006 6:19 AM by aidan_b5

    EJB 3.0 PFD6 problems

    aidan_b5

      Hi, I've just upgraded Jboss 4.03SP1 from EJB PFD 5 to 6....jboss starts ok except when it reaches one of my entity beans I get the following exception:

      09:49:14,109 WARN [ServiceController] Problem starting service persistence.units:ear=SMSPortal.ear,unitName=objentity
      org.hibernate.MappingException: Could not determine type for: com.sms.object.entity.PersistentProperty, for columns: [org.hibernate.mapping.Column(elt)]
       at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:266)
       at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:253)
       at org.hibernate.mapping.Collection.validate(Collection.java:262)
       at org.hibernate.cfg.Configuration.validate(Configuration.java:992)
       at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1173)
       at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:505)
       at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:632)
       at org.hibernate.ejb.Ejb3Configuration.createContainerEntityManagerFactory(Ejb3Configuration.java:308)
       at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:115)
       at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:264)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)


      The class apparently causing the problem:

      @Entity
      @Table (name="persistentproperty")
      public class PersistentProperty {
      
       @Id @GeneratedValue(strategy= GenerationType.AUTO)
       public int getId() {
       return id;
       }
      
       public void setId(int id) {
       this.id = id;
       }
      
       @ManyToOne (cascade = {CascadeType.ALL}, fetch = FetchType.EAGER)
       public PersistentKey getPersistentKey() {
       return persistentkey;
       }
      
       public void setPersistentKey(PersistentKey persistentKey) {
       this.persistentkey = persistentKey;
       }
      
       public String getValue() {
       return value;
       }
      
       public void setValue(String value) {
       this.value = value;
       }
      
       @ManyToOne (cascade = {CascadeType.ALL}, fetch = FetchType.EAGER)
       public PersistentObject getPersistentObject(){
       return persistentobject;
       }
      
       public void setPersistentObject(PersistentObject persistentobject) {
       this.persistentobject = persistentobject;
       }
      
       public Date getStartdate() {
       return startdate;
       }
      
       public void setStartdate(Date startdate) {
       this.startdate = startdate;
       }
      
       public Date getEnddate() {
       return enddate;
       }
      
       public void setEnddate(Date enddate) {
       this.enddate = enddate;
       }
      
       @Transient
       public String getStringstartdate()
       {
       try {
       return DateUtils.getStringFromDate(startdate);
       } catch (Exception e) {
       e.printStackTrace();
       }
       return "";
       }
      
       @Transient
       public String getStringenddate()
       {
       try {
       return DateUtils.getStringFromDate(enddate);
       } catch (Exception e) {
       e.printStackTrace();
       }
       return "";
       }
      
       @Transient
       public void setStringstartdate(String startdate) {
       try {
       this.startdate = DateUtils.getDateFromString(startdate);
       } catch (Exception e) {
       e.printStackTrace();
       }
       }
      
       @Transient
       public void setStringenddate(String enddate) {
       if(!enddate.equals("")) try {
       this.enddate = DateUtils.getDateFromString(enddate);
       } catch (Exception e) {
       e.printStackTrace();
       }
       else this.enddate = Calendar.getInstance().getTime();
       }
      
      
       private PersistentObject persistentobject;
       private int id;
       private PersistentKey persistentkey;
       private String value;
       private Date startdate;
       private Date enddate;
      
       public int getPrevious() {
       return previous;
       }
      
       public void setPrevious(int previous) {
       this.previous = previous;
       }
      
       public int getNext() {
       return next;
       }
      
       public void setNext(int next) {
       this.next = next;
       }
      
       private int previous;
       private int next;
      
      }


      Comparing the sizes of the Hibernate jars reveals a lot has been added....does anyone know what has changed as this code worked perfectly fine in version 5.

      Is there some new annotation that I've missed?

      Help Appreciated Thanks!