6 Replies Latest reply on Oct 5, 2005 4:22 AM by Venu Narla

    unanticipated error while deploying EntityBeans in EJB3.0

    Venu Narla Newbie

      I have an entity bean that has some properties NOT mapped to any column in the table. The properties that DO have a @Column annotation defined at the resective getter method.

      However while deloying JBoss ejb3 deployer complains as

      org.hibernate.MappingException: property not found: xxxxxxxx


      it appears that jboss also complains in a similar way to any helper method in the entity bean that starts with a "getxxx" or "isxxx"...
      It appears that Jboss automatically expects any method/property to be mapped to a column in the table that starts with a "getxxx" or "isxxx"

      is this expected behavior?? or is it a bug???

      Any pointers are appreciated...






        • 1. Re: unanticipated error while deploying EntityBeans in EJB3.
          Venu Narla Newbie

          I have alternatively marked that property as transient. And JBoss ignores it and stills throws out the same error.

          hmmmmmmmmmmmmm.....

          • 2. Re: unanticipated error while deploying EntityBeans in EJB3.
            Emmanuel Bernard Master

            use @Transient.
            This is not a bug, all getters are supposed to be persistent

            • 3. Re: unanticipated error while deploying EntityBeans in EJB3.
              Venu Narla Newbie

              Thanks for your response. I already tried that. There is an improvement. but the fundamental problem continues.

              Improvement: The entity bean is not iisted in the final summary of failed beans.

              Continuing problem: JBoss throws a exception while "processing collections"..and further collection processing is aborted...i dont see other collections being processed after this exception... overall 3 collections gets processed...

              :26:49,845 WARN [ServiceController] Problem creating service jboss.j2ee:service=EJB3,module=pu_services.ejb3
              org.hibernate.MappingException: property not found: currentState
              at org.hibernate.mapping.PersistentClass.getProperty(PersistentClass.java:351)
              at org.hibernate.mapping.PersistentClass.getProperty(PersistentClass.java:356)
              at org.hibernate.cfg.annotations.TableBinder.bindFk(TableBinder.java:115)
              at org.hibernate.cfg.annotations.CollectionBinder.bindCollectionSecondPas.............
              .........
              .........


              I want to take this opportunity to give u more information. Maybe u can see something wrong i am doing....

              I have a class State and class StateContext (Embeddable) both mapped to the same Table "StateTB" (except for the transient properties in Class StateContext).
              
              @Entity
              @Table(name = "StateTB")
              public class State{
               protected int a;
              
               @Embedded
               protedted StateContext stateContext = new StateContext(this);
              
               @Column(name = "colA")
               public getA(){...}
               public setA(){...}
              
               @Embedded
               @AttributeOverrides({
               @AttributeOverride(name = "b", column = @Column(name = "colB"))
               })
               public DealerContext getStateContext() {
               return stateContext;
               }
               public void setStateCtx(StateContext stateCtx) {
               this.stateContext = stateCtx;
               }
              }
              
              @Embeddable(access = AccessType.PROPERTY)
              public class StateContext{
              
               protected int b;
              
               @Transient
               protected State currentState;
              
               public getB(){...}
               public setB(){...}
              
               @Transient
               public getCurrentState(){
               return currentState;
               }
              
               public setCurrentState(State state){
               currentState = state;
               }
              }
              
              

              Obviously I have simplified the code for clarity

              Hope this helps....I appreciate any pointers...
              Thanks so much again for taking some time out. Feel free to let me know if u need more info...



              • 4. Re: unanticipated error while deploying EntityBeans in EJB3.
                Venu Narla Newbie

                There is a minor type in the above code listing...
                corrected version is as follows

                
                @Entity
                @Table(name = "StateTB")
                public class State{
                 protected int a;
                
                 @Embedded
                 protected StateContext stateContext = new StateContext(this);
                
                 @Column(name = "colA")
                 public getA(){...}
                 public setA(){...}
                
                 @Embedded
                 @AttributeOverrides({
                 @AttributeOverride(name = "b", column = @Column(name = "colB"))
                 })
                 public StateContext getStateContext() {
                 return stateContext;
                 }
                 public void setStateCtx(StateContext stateCtx) {
                 this.stateContext = stateCtx;
                 }
                }
                
                @Embeddable(access = AccessType.PROPERTY)
                public class StateContext{
                
                 protected int b;
                
                 @Transient
                 protected State currentState;
                
                 public getB(){...}
                 public setB(){...}
                
                 @Transient
                 public getCurrentState(){
                 return currentState;
                 }
                
                 public setCurrentState(State state){
                 currentState = state;
                 }
                }
                
                

                thanks.

                • 5. Re: unanticipated error while deploying EntityBeans in EJB3.
                  Venu Narla Newbie

                  update: in my earlier reply...i incorrectly said there was an "imrovement" after using @Transient annotation.

                  Actually the StateContext bean is still being reported as failing in the final summary report of JBoss deployments AFTER throwing an exception at the "processing collection mappings" phase.

                  • 6. Re: unanticipated error while deploying EntityBeans in EJB3.
                    Venu Narla Newbie

                    FINAL UDATE:

                    The previous three replies from me are a non-issue.
                    in other words @Transient works..

                    END OF TOPIC

                    PS: Admin please consider removing this topic from the forum or the previous 3 resonses from me.