7 Replies Latest reply on Apr 22, 2005 5:58 AM by oudjanef

    EJB3 Preview 5 deployment error

    oudjanef

      Hello,

      I just migrated from EJB3 preview 4 to preview 5 and I am using the JBoss IDE M1 Eclipse bundle. My deployment used to work on preview 4 but now I have the following Exception when deploying. I checked the intallation steps to make sure I didn't forget one and updated the ejb3 jars used by the eclipse plugin.

      I hope someone can help.

      many thanks,
      farid

      09:04:05,722 ERROR [Ejb3Module] Starting failed jboss.j2ee:service=EJB3,module=common.ejb3
      java.lang.ArrayIndexOutOfBoundsException: -66
      at org.hibernate.persister.entity.BasicEntityPersister.generateUpdateString(BasicEntityPersister.java:1494)
      at org.hibernate.persister.entity.BasicEntityPersister.generateUpdateString(BasicEntityPersister.java:1461)
      at org.hibernate.persister.entity.BasicEntityPersister.postConstruct(BasicEntityPersister.java:2413)
      at org.hibernate.persister.entity.SingleTableEntityPersister.(SingleTableEntityPersister.java:375)
      at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
      at org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:206)
      at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1054)
      at org.jboss.ejb3.entity.HibernateSessionFactory.createSessionFactory(HibernateSessionFactory.java:225)
      at org.jboss.ejb3.Ejb3Module.createHibernateSessionFactory(Ejb3Module.java:256)
      at org.jboss.ejb3.Ejb3Module.startService(Ejb3Module.java:263)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:272)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:222)
      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.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:891)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:416)
      at sun.reflect.GeneratedMethodAccessor9.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:144)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy16.start(Unknown Source)
      at org.jboss.ejb3.EJB3Deployer.start(EJB3Deployer.java:166)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:964)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:775)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:738)
      at sun.reflect.GeneratedMethodAccessor43.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:144)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:122)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:131)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy8.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:305)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:463)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:204)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:215)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:194)

        • 1. Re: EJB3 Preview 5 deployment error
          bill.burke

          we need more information...The Hibernate mapping functionality totally changed in Preview 5 from PReview4. Preview5 uses the Hibernate annotatio n project, so you'll have to give us specifics of your mapping and narrow it down further.

          Apologies.

          • 2. Re: EJB3 Preview 5 deployment error
            oudjanef

            Fine, I will try and deploy beans one by one and will let you know when something goes wrong.

            Regards,
            Farid

            • 3. Re: EJB3 Preview 5 deployment error
              oudjanef

              Ok, I have an embeded field in my Entity. Here it is:

              @Embeddable (access = AccessType.PROPERTY)
              public class BaseFields implements Serializable {
              private int version = 0;
              private String createdBy = "";
              private Date createdOn = null;
              private String amendedBy = "";
              private Date amendedOn = null;

              @Column(name= "amended_by", length=100)
              public String getAmendedBy() {
              return amendedBy;
              }
              public void setAmendedBy(String amendedBy) {
              this.amendedBy = amendedBy;
              }

              @Column(name= "amended_on")
              public Date getAmendedOn() {
              return amendedOn;
              }
              public void setAmendedOn(Date amendedOn) {
              this.amendedOn = amendedOn;
              }

              @Column(name= "created_by", nullable=false, length=100)
              public String getCreatedBy() {
              return createdBy;
              }
              public void setCreatedBy(String createdBy) {
              this.createdBy = createdBy;
              }

              @Column(name= "created_on", nullable=false)
              public Date getCreatedOn() {
              return createdOn;
              }
              public void setCreatedOn(Date createdOn) {
              this.createdOn = createdOn;
              }

              @Version
              @Column(name= "version", nullable=false)
              public int getVersion() {
              return version;
              }
              public void setVersion(int version) {
              this.version = version;
              }
              }

              And here is the Entity:

              @Entity
              @Table(name="language")
              public class Language implements Serializable {
              private Log log = new Log(Language.class);
              private long languageID = 0;
              private BaseFields baseFileds = null;
              private String countryCode = "";
              private String languageCode = "";
              private boolean activeFlg = false;

              public Language() {
              }

              @Id
              @Column(name="language_id")
              public long getLanguageID() {
              return languageID;
              }
              public void setLanguageID(long languageID) {
              this.languageID = languageID;
              }

              @Embedded
              public BaseFields getBaseFileds() {
              return baseFileds;
              }
              public void setBaseFileds(BaseFields baseFileds) {
              this.baseFileds = baseFileds;
              }


              @Column(name="country_code", length=50)
              public String getCountryCode() {
              return countryCode;
              }
              public void setCountryCode(String countryCode) {
              this.countryCode = countryCode;
              }

              @Column(name="language_code", length=50)
              public String getLanguageCode() {
              return languageCode;
              }
              public void setLanguageCode(String languageCode) {
              this.languageCode = languageCode;
              }

              @Column(name="active_flg")
              public boolean isActiveFlg() {
              return activeFlg;
              }
              public void setActiveFlg(boolean activeFlg) {
              this.activeFlg = activeFlg;
              }

              public boolean equals(Object otherObject) {
              if ((otherObject == null) || !(otherObject instanceof Language)) {
              return false;
              }
              Language obj = (Language) otherObject;
              return (this.getLanguageID() == obj.getLanguageID());
              }

              public int hashCode() {
              return new Long(this.getLanguageID()).hashCode();
              }

              }

              When I deploy this I have the error stated precedently. When I comment out the embedded bit in bold above, it deploys correctly without error. I tried the same with AttributeOverride for each of the properties of the embedded object to make sure it was not the same problem as per preview 4.

              Any thoughts?
              Thanks,
              Farid

              • 4. Re: EJB3 Preview 5 deployment error
                epbernard

                Try to move the version attribute out of you component and let me know

                • 5. Re: EJB3 Preview 5 deployment error
                  oudjanef

                  Thanks for this.

                  I just tried it and it worked but I suspect this is not normal behaviour or is it?

                  farid.

                  • 6. Re: EJB3 Preview 5 deployment error
                    epbernard

                    Actually the spec state in 5.1.26

                    Only Basic, Column, Serialized, and Lob mapping
                    annotations may be used to map embedded objects.

                    An @Version is not allowed

                    • 7. Re: EJB3 Preview 5 deployment error
                      oudjanef

                      Thank you gain.
                      That is a strange restriction to put on embedded Objects though.