1 Reply Latest reply on Jun 24, 2003 3:50 AM by Dmitry Mozheyko

    one to many cmp problem

    johnwoo Newbie

      Hi all, I am trying a one to many testing program. My client code is like :

      forumejb.Thread myBean = getThreadHome().create("thread id 1", "poster 1", "subject 1");
      Vector msgV = new Vector();
      msgV.add(getMsgHome().create("testing 0", "thread id 1"));
      msgV.add(getMsgHome().create("testing 1", "thread id 1"));
      myBean.setMessages(msgV);

      I omit the code of the cmp and ejb-jar.xml. Please ask me for details if needed.

      Using this client, I successfully inserted the record into the db but finally it throw the following exception.

      23:41:59,109 ERROR [LogInterceptor] EJBException, causedBy:
      java.lang.ClassCastException: $Proxy71
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.setInstanceValue(JDBCCMRFieldBridge.java:662)
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.setValue(JDBCCMRFieldBridge.java:541)
      at org.jboss.ejb.plugins.cmp.bridge.EntityBridgeInvocationHandler.invoke(EntityBridgeInvocationHandler.java:126)
      at org.jboss.proxy.compiler.Runtime.invoke(Runtime.java:59)
      at forumejb.ThreadCMP$Proxy.setMessages()
      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:324)
      at org.jboss.ejb.EntityContainer$ContainerInterceptor.invoke(EntityContainer.java:1044)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor.invoke(JDBCRelationInterceptor.java:95)
      at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:301)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
      at org.jboss.ejb.plugins.EntityReentranceInterceptor.invoke(EntityReentranceInterceptor.java:82)
      at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:174)
      at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:89)
      at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInterceptor.java:53)
      ....

      Can anyone help me on this ?

      Thanks.

      Perseus