1 Reply Latest reply on Oct 25, 2007 11:07 PM by wayne baylor

    ArrayList Mapping

    Poyan Gerami Novice

      Hi,
      I have an Object Rollingstock, inside Rollingstock I have a collection off Vehicles.
      Hear is the mapping:

      @JoinTable( name="vehicles",
      joinColumns= @JoinColumn( name= "fk_rollingstock"),
      inverseJoinColumns= @JoinColumn( name="id_vehicle") )
      public Collection<Vehicle> getVehicles() { return vehicles; }
      public void setVehicles(ArrayList<Vehicle> vehicles) { this.vehicles = vehicles;}
      

      when i try to persist an Roolingstock i get this error:
      19:41:54,218 ERROR [property.BasicPropertyAccessor] expected type: java.util.ArrayList, actual value: org.hibernate.collection.Pe
      rsistentBag
      19:41:54,234 ERROR [er.jms.inflow.JmsServerSession] Unexpected error delivering message delegator->JBossMessage[376834]:PERSISTEN
      T, deliveryId=1
      javax.ejb.EJBTransactionRolledbackException: org.hibernate.PropertyAccessException: IllegalArgumentException occurred while calli
      ng setter of se.sj.ipl.rollingstock.domain.Rollingstock.vehicles
       at org.jboss.ejb3.tx.Ejb3TxPolicy.handleInCallerTx(Ejb3TxPolicy.java:87)
       at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:130)
       at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.remoting.ReplicantsManagerInterceptor.invoke(ReplicantsManagerInterceptor.java:51)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
       at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:106)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:278)
       at org.jboss.ejb3.remoting.IsLocalInterceptor.invokeLocal(IsLocalInterceptor.java:79)
       at org.jboss.ejb3.remoting.ClusteredIsLocalInterceptor.invoke(ClusteredIsLocalInterceptor.java:53)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.stateless.StatelessClusteredProxy.invoke(StatelessClusteredProxy.java:105)
       at $Proxy158.persistRollingStock(Unknown Source)
      
      



      Any Ideas ?