7 Replies Latest reply on Sep 5, 2001 10:03 PM by David Jencks

    RemoveException

    Juergen Heidak Newbie

      JBoss (2.4 Beta) throws RemoteExceptions if we run more than one client and the size of the connection pool for jdbc connections (configured in jboss.jcml) is greater than one.
      This exception is thrown when the remove method on an EntityBean is called. It simply states that the object with a specific primary key could not be removed.
      Many clients with a pool of size one works fine, one client with more than one connection in the pool too.
      The same scenario works fine under JBoss 2.2.2

        • 1. Re: RemoveException
          David Jencks Master

          This is not enough information to do anything but guess. What db, jcml, bmp/cmp, code, etc etc? Can you make a small self contained example that shows the problem using hypersonic?

          • 2. Re: RemoveException
            Juergen Heidak Newbie

            We are using Oracle.
            The code causing the exception is nothing special, a session bean provides access to two kinds of entity beans including creation and removal. The entity beans themselves are nothing more than stupid data containers.

            The important point in jboss.jcml is the MaxSize attribute of the following mbean configuration. If set to one, two (or more) clients are able to operate on the session bean without an error. If MaxSize is greater than one only one client works without an error, two clients (or more) causes the mentioned RemoveException. The exception itself is thrown when the remove method on a entity bean is called from the session bean.



            DefaultDS
            org.opentools.minerva.jdbc.xa.wrapper.XADataSourceImpl

            jdbc:oracle:thin:@linux1:1521:test
            1200000
            jh
            10
            jh
            false
            false
            false
            true
            120000
            1800000
            false
            false
            1.0
            0


            All other settings in jboss.jcml and standardjboss.xml are left to their defaults.

            The stacktrace, maybe helpful
            The entity (Contact99...) exists in the corresponding table and can be deleted using a normal sql delete statement.

            [Default] javax.ejb.RemoveException: Could not remove Contact998293733718-1493614310
            [Default] at org.jboss.ejb.plugins.jaws.jdbc.JDBCRemoveEntityCommand.execute(JDBCRemoveEntityCommand.java:56)
            [Default]
            [Default] at org.jboss.ejb.plugins.jaws.JAWSPersistenceManager.removeEntity(JAWSPersistenceManager.java:180)
            [Default]
            [Default] at org.jboss.ejb.plugins.CMPPersistenceManager.removeEntity(CMPPersistenceManager.java:465)
            [Default]
            [Default] at org.jboss.ejb.EntityContainer.remove(EntityContainer.java:357)
            [Default]
            [Default] at java.lang.reflect.Method.invoke(Native Method)
            [Default]
            [Default] at org.jboss.ejb.EntityContainer$ContainerInterceptor.invoke(EntityContainer.java:818)
            [Default]
            [Default] at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:318)
            [Default]
            [Default] at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:256)
            [Default]
            [Default] at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:133)
            [Default]
            [Default] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:247)
            [Default]
            [Default] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:99)
            [Default]
            [Default] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:127)
            [Default]
            [Default] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:195)
            [Default]
            [Default] at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:349)
            [Default]
            [Default] at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerInvoker.java:483)
            [Default]
            [Default] at org.jboss.ejb.plugins.jrmp.interfaces.GenericProxy.invokeContainer(GenericProxy.java:335)
            [Default]
            [Default] at org.jboss.ejb.plugins.jrmp.interfaces.EntityProxy.invoke(EntityProxy.java:133)
            [Default]
            [Default] at $Proxy12.remove(Unknown Source)
            [Default]
            [Default] at de.cursor.twovsthreetier.server.cmp.PersistentCustomerBean.deleteContacts(PersistentCustomerBean.java:379)
            [Default]
            [Default] at java.lang.reflect.Method.invoke(Native Method)
            [Default]
            [Default] at org.jboss.ejb.EntityContainer$ContainerInterceptor.invoke(EntityContainer.java:848)
            [Default]
            [Default] at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:318)
            [Default]
            [Default] at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:256)
            [Default]
            [Default] at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:133)
            [Default]
            [Default] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:247)
            [Default]
            [Default] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:99)
            [Default]
            [Default] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:127)
            [Default]
            [Default] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:195)
            [Default]
            [Default] at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:349)
            [Default]
            [Default] at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerInvoker.java:483)
            [Default]
            [Default] at org.jboss.ejb.plugins.jrmp.interfaces.GenericProxy.invokeContainer(GenericProxy.java:335)
            [Default]
            [Default] at org.jboss.ejb.plugins.jrmp.interfaces.EntityProxy.invoke(EntityProxy.java:133)
            [Default]
            [Default] at $Proxy11.deleteContacts(Unknown Source)
            [Default]
            [Default] at de.cursor.twovsthreetier.server.cmp.TierTestSessionEJBBean.deleteCustomer(TierTestSessionEJBBean.java:108)
            [Default]
            [Default] at java.lang.reflect.Method.invoke(Native Method)
            [Default]
            [Default] at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:543)
            [Default]
            [Default] at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:87)
            [Default]
            [Default] at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:133)
            [Default]
            [Default] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:247)
            [Default]
            [Default] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:99)
            [Default]
            [Default] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:127)
            [Default]
            [Default] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:195)
            [Default]
            [Default] at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:286)
            [Default]
            [Default] at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerInvoker.java:393)
            [Default]
            [Default] at java.lang.reflect.Method.invoke(Native Method)
            [Default]
            [Default] at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
            [Default]
            [Default] at sun.rmi.transport.Transport$1.run(Unknown Source)
            [Default]
            [Default] at java.security.AccessController.doPrivileged(Native Method)
            [Default]
            [Default] at sun.rmi.transport.Transport.serviceCall(Unknown Source)
            [Default]
            [Default] at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
            [Default]
            [Default] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
            [Default]
            [Default] at java.lang.Thread.run(Unknown Source)
            [Default]

            • 3. Re: RemoveException
              Juergen Heidak Newbie

              Using the JDBCDataSourceLoader instead of XADataSourceLoader fixed the problem.

              • 4. Re: RemoveException
                David Jencks Master

                Changing to JDBCDataSourceLoader may seem to fix the problem... however you have removed all your code from transaction control and all your connections have autocommit = true. JDBCDataSourceLoader should only be used if you need unmanaged (as far as transactions) connections for e.g. a servlet.

                What are the transaction attributes of your beans?

                • 5. Re: RemoveException
                  Juergen Heidak Newbie

                  You're right, exactly ( :-(( ) one method got the wrong transaction attribute "NotSupported", changing it to "Required" fixed the RemoveExceptions when using the XADataSourceLoader.

                  Thanks

                  • 6. Re: RemoveException
                    Ramin Akhbari Newbie

                    David,

                    This is an unrelated question to this thread, but the answer very relevant to something I need to know.

                    You mentioned that for non-txn-managed connections to be used from Servlets/JSPs, one should change the tag in jboss.jcml to JDBCDataSourceLoader, instead of XADataSourceLoader.

                    Is there any other parts of this element that has to be changed, such as the "service=" or the setting of the <property name="DataSourceClass", which currently points to org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl?

                    In other words, if I just make that one change, can everything else remain the same so I'll be able to get connections from that pool in Servlets/JSPs?

                    Thanks in advance,

                    Ramin Akhbari

                    • 7. Re: RemoveException
                      David Jencks Master

                      Hi, don't set DataSourceClass, it determines the driver from the url. The easy way to check what you need to set is to put the mbean config into jboss.jcml, then look on the jmx http port 8082 interface to see what properties are exposed to make sure you didn't miss any.

                      Note that I wouldn't recommend using db connections from a servlet, but if you want to...