1 Reply Latest reply on Sep 13, 2001 6:33 AM by ben

    BMP and java.rmi.ServerException

    ben

      Hi,

      I'm using JBoss 2.2.2, Interbase 6.0 and BMP. The first time, I run my client-program after my bean was deployed everything works fine. When I try to run the client the second time, I get the following exception whereas the client execute the line BeanHome.create(...):

      java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
      java.rmi.ServerException: Exception occurred; nested exception is:
      javax.ejb.EJBException
      java.rmi.ServerException: Exception occurred; nested exception is:
      javax.ejb.EJBException
      javax.ejb.EJBException
      at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
      at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
      at sun.rmi.server.UnicastRef.invoke(Unknown Source)
      at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker_Stub.invokeHome(Unknown Source)
      at org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.invoke(HomeProxy.java
      :248)
      at $Proxy0.create(Unknown Source)
      at Client.init(Client.java:143)
      at Client.main(Client.java:323)

      The ejbCreate puts all values into the database, closes the PreparedStatement and the connection. Can you help me? Thanks.

      Ben

        • 1. Re: BMP and java.rmi.ServerException
          ben

          Hi,

          i changed the transaction attribute to "RequiresNew" Now i got the following exception:

          [ProductBean] TRANSACTION ROLLBACK EXCEPTION:null; nested exception is: javax.ejb.EJBException
          [ProductBean] java.lang.IllegalStateException: INSERTING AN ALREADY EXISTING BEAN, ID = 323-456-7890-60
          [ProductBean] at org.jboss.ejb.plugins.AbstractInstanceCache.insert(AbstractInstanceCache.java:207)
          [ProductBean] at org.jboss.ejb.plugins.CMPPersistenceManager.createEntity(CMPPersistenceManager.java:219)
          [ProductBean] at org.jboss.ejb.EntityContainer.createHome EntityContainer.java:441)
          [ProductBean] at java.lang.reflect.Method.invoke(Native Method)
          [ProductBean] at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:639)
          [ProductBean] at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:160)
          [ProductBean] at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:87)
          [ProductBean] at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:135)
          [ProductBean] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:263)
          [ProductBean] at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:86)
          [ProductBean] at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:164)
          [ProductBean] at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:106)
          [ProductBean] at org.jboss.ejb.EntityContainer.invokeHome (EntityContainer.java:316)
          [ProductBean] at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invokeHome(JRMPContainerInvoker.java:369)
          [ProductBean] at java.lang.reflect.Method.invoke(Native Method)
          [ProductBean] at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
          [ProductBean] at sun.rmi.transport.Transport$1.run(Unknown Source)
          [ProductBean] at java.security.AccessController.doPrivileged(Native Method)
          [ProductBean] at sun.rmi.transport.Transport.serviceCall(Unknown Source)
          [ProductBean] at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
          [ProductBean] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
          [ProductBean] at java.lang.Thread.run(Unknown Source)

          I get the connection to the database in every method I want to execute a SQL-Statement. The first time i run the Client the test works, but when i run the client again, the listed execption occures.

          Please help me, to find the fault.

          Thanks

          Ben