Before I start shouting "CRIITICAL BUG" is there anything I should check in
relation
to configuration of jboss that may cause the problem:
The following code snippet inside the stateless session bean SimpleSessionBean:
System.out.println("Looking up referance");
Object ref = jndiContext.lookup("CategoryBean");
System.out.println("Got reference");
CategoryHome home = (CategoryHome)
PortableRemoteObject.narrow (ref, CategoryHome.class);
Category cat = home.create("xxx");
System.out.println(cat.getCategoryID());
cat.remove();
home.create("xxx");
produces the following error in jBoss (latest CVS)
[Default] JBoss PRE-2.1 Started
[SimpleSessionBean] Got context
[SimpleSessionBean] Looking up referance
[SimpleSessionBean] Got reference
[CategoryBean] CategoryBean: in setEntityContext()
[CategoryBean] CategoryBean: in ejbCreate()
[CategoryBean] CategoryBean: in ejbPostCreate()
[SimpleSessionBean] xxx
[CategoryBean] CategoryBean: in ejbRemove()
[CategoryBean] CategoryBean: in setEntityContext()
[CategoryBean] CategoryBean: in ejbCreate()
[CategoryBean] TRANSACTION ROLLBACK EXCEPTION:null; nested exception is:
javax.ejb.EJBException
[CategoryBean] java.lang.IllegalStateException: INSERTING AN ALREADY
EXISTING BEAN, ID = xxx
[CategoryBean] at
org.jboss.ejb.plugins.AbstractInstanceCache.insert(AbstractInstanceCache.java:205)
[CategoryBean] at
org.jboss.ejb.plugins.BMPPersistenceManager.createEntity(BMPPersistenceManager.java:165)
[CategoryBean] at
org.jboss.ejb.EntityContainer.createHome(EntityContainer.java:441)
[CategoryBean] at java.lang.reflect.Method.invoke(Native Method)
[CategoryBean] at
org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:639)
[CategoryBean] at
org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:160)
[CategoryBean] at
org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:87)
[CategoryBean] at
org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:135)
[CategoryBean] at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:263)
[CategoryBean] at
org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:86)
[CategoryBean] at
org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:125)
[CategoryBean] at
org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:106)
[CategoryBean] at
org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:316)
[CategoryBean] at
org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invokeHome(JRMPContainerInvoker.java:404)
[CategoryBean] at
org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.invoke(HomeProxy.java:198)
[CategoryBean] at $Proxy4.create(Unknown Source)
[CategoryBean] at site.SimpleSessionBean.doit(SimpleSessionBean.java:59)
with the following deployment descriptor:
<ejb-jar>
<enterprise-beans>
<entity>
<description>Models a Category</description>
<ejb-name>CategoryBean</ejb-name>
<home>site.CategoryHome</home>
<remote>site.Category</remote>
<ejb-class>site.CategoryBean</ejb-class>
<persistence-type>Bean</persistence-type>
<prim-key-class>java.lang.String</prim-key-class>
<transaction-type>Container</transaction-type>
<reentrant>true</reentrant>
</entity>
<session>
<description>A Simple Session Bean</description>
<ejb-name>SimpleSessionBean</ejb-name>
<home>site.SimpleSessionHome</home>
<remote>site.SimpleSession</remote>
<ejb-class>site.SimpleSessionBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
<container-transaction>
<method>
<ejb-name>SimpleSessionBean</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</enterprise-beans>
</ejb-jar>
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
List Help?: [EMAIL PROTECTED]