0 Replies Latest reply on Nov 9, 2005 4:08 PM by jwu

    ClassCastException when trying to access something via CMR

    jwu

      I'm a bit lost on this problem:

      There are two entity beans, Filiale (Store) and Verkaeufer (Employee)
      There is a 1:n relationship between them, unidirectional from the Verkaeufer side.

      I use these xdoclet tags in the VerkaeuferBean:


      /**
      * Getter for CMR Relationship
      *
      * @ejb.interface-method view-type="both"
      * @ejb.relation name = "Verkaeufer-Filiale"
      * role-name = "arbeiten"
      * target-ejb = "Filiale"
      * target-role-name = "arbeiten2"
      * target-multiple = "yes"
      * @jboss.relation fk-column="filiale"
      * related-pk-field="iD"
      */
      public abstract Filiale getFiliale();



      I can deploy it, and accessing the attributes works too, but when i try to call getFiliale() i get that Exception:


      TransactionRolledbackException in method: public abstract de.PGTest.cmp.Filiale de PGTest.cmp.Verkaeufer.getFiliale() throws java.rmi.RemoteException, caused by:
      classcastexception: $Proxy399 at de.PGTest.cmp.VerkaeuferCMP$Proxy.getFiliale()<>
      at sunn.reflect.NativeMethodAccessorImpl.incoke0(Native Method)
      ...
      ...


      I have absolutely no idea what causes this...according to all tutorials i have read it should work. Can anyone help me?

      Thanks in advance!