2 Replies Latest reply on Dec 14, 2001 9:07 AM by Frank Xia

    EJB transaction exception

    Frank Xia Newbie

      I am running JBOSS 2.4.4-beta with MySQL 3.23.46 (binary distribution) on Linux. In the entity bean's ejbLoad() method (BMP), it gave me a TransactionException while it runs fine in Windows 2000 with same versions of MySQL and JBOSS. The problem seems caused by a file IO within the ejbLoad() (I know the file IO is not allowed in EJB container) but the same application runs perfect on Windows 2000.

      Any insight and advice will be highly appreciated

      Frank

      TRANSACTION ROLLBACK EXCEPTION:
      javax.transaction.TransactionRolledbackException: null
      Embedded Exception
      null; nested exception is:
      javax.ejb.EJBException: null
      Embedded Exception
      null
      at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:166)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:347)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:100)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:127)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:170)
      at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:428)
      at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invoke(BaseLocalContainerInvoker.java:297)
      at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker$EntityProxy.invoke(BaseLocalContainerInvoker.java:399)
      at $Proxy5.getLayer(Unknown Source)
      at com.esri.mo.server.bean.ImageServiceBean.addLayers(ImageServiceBean.java:110)
      at com.esri.mo.server.bean.ImageServiceBean.getServiceInfo(ImageServiceBean.java:336)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:42)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:28)
      at java.lang.reflect.Method.invoke(Method.java:327)
      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:542)
      at org.jboss.ejb.plugins.TxInterceptorBMT.invoke(TxInterceptorBMT.java:299)
      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:81)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:127)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:170)
      at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:286)
      at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerInvoker.java:410)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:42)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:28)
      at java.lang.reflect.Method.invoke(Method.java:327)
      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:264)
      at sun.rmi.transport.Transport$1.run(Transport.java:151)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Transport.java:147)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:463)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:704)
      at java.lang.Thread.run(Thread.java:539)
      Caused by: javax.ejb.EJBException: null
      Embedded Exception
      null
      at org.jboss.ejb.plugins.BMPPersistenceManager.loadEntity(BMPPersistenceManager.java:350)
      at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:287)
      at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:197)
      at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:125)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:138)
      ... 32 more

        • 1. Re: EJB transaction exception
          Michel de Groot Newbie

          Are you sure this is not a problem of proper access to MySQL? MySql is notoriously picky about the user name/host combination (I'm sure from a security point of view this is a good thing, but it can drive you nuts).

          If you want to be sure, write a small Java program which opens a jdbc connection on mysql and print the stack trace of the exception that must be caught.

          The relevant code:
          mySqlUrl = "jdbc:mysql://localhost/daisy";
          mySqlProperties = new Properties();
          mySqlProperties.setProperty("user", "daisy");
          mySqlProperties.setProperty("password", "daisy");
          // force load of mySql driver
          Class.forName("org.gjt.mm.mysql.Driver");
          // make connection
          Connection conn = DriverManager.getConnection(mySqlUrl,mySqlProperties);

          Experiment a bit with the mysql datasource in jboss.jcml. I'm not sure what JBoss appends to the user name.

          Happy bug hunting!

          • 2. Re: EJB transaction exception
            Frank Xia Newbie

            It turned out that the exception was caused by a missing class. However, the trasaction exception really doesn't make sense and offers no help for debugging. Hope in the future, JBOSS would give us more meaningful error message.

            Frank