Bugs item #592855, was opened at 2002-08-08 17:23
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=592855&group_id=22866

Category: JBossCMP
Group: v3.0 Rabbit Hole
>Status: Closed
>Resolution: Invalid
Priority: 5
Submitted By: Gerald Turner (crazyfoam)
Assigned to: Dain Sundstrom (dsundstrom)
Summary: CMR set in ejbPostCreate fails option D

Initial Comment:
I have a CMP deployed on JBoss 3.0.1/JDK 1.4 that's
setting a CMR at ejbPostCreate like this:

  public void ejbPostCreate() {
    setCreatedUserLocal
      (userLocalHome.findByName
        (context.getCallerPrincipal().getName()));
  }

Which works fine with commit options A, B, and C, but D
on the other hand causes the following code from
JDBCCMRFieldBridge.addRelation to throw:

  // Check that single value relations are current not
related to anything.
  if(isSingleValued() && fieldState.getValue().size() >
0) {
    throw new IllegalStateException("This bean may only
be related to " +
      "one other bean at a time");
  }


2002-08-08 14:22:12,359 ERROR
[org.jboss.ejb.plugins.LogInterceptor]
TransactionRolledbackLocalException, causedBy:
java.lang.IllegalStateException: This bean may only be
related to one other bean at a time
        at
org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.addRelation(JDBCCMRFieldBridge.java:747)
        at
org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor.invoke(JDBCRelationInterceptor.java:120)
        at
org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:308)
        at
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
        at
org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:152)
        at
org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:107)
        at
org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInterceptor.java:69)
        at
org.jboss.ejb.plugins.AbstractInterceptor.invoke(AbstractInterceptor.java:78)
        at
com.newedgenetworks.phoenix.ejb.jboss.AuditInterceptor.invoke(AuditInterceptor.java:190)
        at
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:107)
        at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:232)
        at
org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:60)
        at
org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130)
        at
org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:203)
        at
org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:493)
        at
org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.invokeAddRelation(JDBCCMRFieldBridge.java:670)
        at
org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.createRelationLinks(JDBCCMRFieldBridge.java:581)
        at
org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.setInstanceValue(JDBCCMRFieldBridge.java:545)
        at
org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.setValue(JDBCCMRFieldBridge.java:483)
        at
org.jboss.ejb.plugins.cmp.bridge.EntityBridgeInvocationHandler.invoke(EntityBridgeInvocationHandler.java:125)
        at org.jboss.proxy.compiler.Runtime.invoke(Runtime.java:59)
        at
com.newedgenetworks.phoenix.ejb.entity.CatalogCMP$Proxy.setCreatedUserLocal(<generated>)
        at
com.newedgenetworks.phoenix.ejb.entity.CatalogBean.ejbPostCreate(CatalogBean.java:704)
        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.plugins.CMPPersistenceManager.postCreateEntity(CMPPersistenceManager.java:284)
        at
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.postCreateEntity(CachedConnectionInterceptor.java:278)
        at
org.jboss.ejb.EntityContainer.postCreateHome(EntityContainer.java:716)
        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:1170)
        at
org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor.invoke(JDBCRelationInterceptor.java:95)
        at
org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:308)
        at
org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
        at
org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:152)
        at
org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:107)
        at
org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:59)
        at
org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:73)
        at
com.newedgenetworks.phoenix.ejb.jboss.AuditInterceptor.invokeHome(AuditInterceptor.java:175)
        at
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:111)
        at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:178)
        at
org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:52)
        at
org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:105)
        at
org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:129)
        at
org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:487)
        at org.jboss.ejb.Container.invoke(Container.java:729)
        at
org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1055)
        at
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
        at
org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:370)
        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
sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
        at sun.rmi.transport.Transport$1.run(Transport.java:148)
        at java.security.AccessController.doPrivileged(Native
Method)
        at
sun.rmi.transport.Transport.serviceCall(Transport.java:144)
        at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
        at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
        at java.lang.Thread.run(Thread.java:536)


----------------------------------------------------------------------

>Comment By: Dain Sundstrom (dsundstrom)
Date: 2002-09-23 14:46

Message:
Logged In: YES 
user_id=251431

It looks like you have declared the relationship between
Catalog and User to be one-to-one.  You can see this because
setCreatedUserLocal is called on Catalog and then a message
is sent to User to say add a relationship link back to me. 
 The code you have posted is from the CMR field bridge, but
the field bridge for the user side of the relationship and
you can see that this field is single valued.

Double check you ejb-jar.xml file.  If I have diagnosed the
problem wrong, reopen the bug and post a test case.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=592855&group_id=22866


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to