2 Replies Latest reply on Feb 6, 2004 9:36 AM by Mike Osganian

    JBoss 4.0 and MySQL Configuration

    Mike Osganian Newbie

      I'm having a problem configuring MySQL with JBoss 4.0. The same configuration that works for JBoss 3.2.3 doesn't work. I get the following exceptions when deploying the mysql-ds.xml file in the default/deploy directory:


      <local-tx-datasource>
      <jndi-name>DefaultDS</jndi-name>
      <connection-url>jdbc:mysql://localhost:3306/X</connection-url>
      <driver-class>org.gjt.mm.mysql.Driver</driver-class>
      <user-name>root</user-name>

      </local-tx-datasource>


      Exception:

      2004-02-05 15:40:02,893 ERROR [org.jboss.mq.pm.jdbc2.PersistenceManager] Starting failed: org.jboss.mq.SpyJMSException: Could not resolve uncommited transactions. Message recovery may not be accurate; - nested throwable: (org.jboss.util.NestedSQLException: Could not create connection; - nested throwable: (java.sql.SQLException: Can not issue empty query); - nested throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Can not issue empty query)))
      2004-02-05 15:40:02,893 WARN [org.jboss.system.ServiceController] Problem starting service jboss.mq:service=PersistenceManager
      org.jboss.mq.SpyJMSException: Could not resolve uncommited transactions. Message recovery may not be accurate; - nested throwable: (org.jboss.util.NestedSQLException: Could not create connection; - nested throwable: (java.sql.SQLException: Can not issue empty query); - nested throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Can not issue empty query)))
      at org.jboss.mq.pm.jdbc2.PersistenceManager.resolveAllUncommitedTXs(PersistenceManager.java:287)
      at org.jboss.mq.pm.jdbc2.PersistenceManager.startService(PersistenceManager.java:1255)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:233)
      at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:72)
      ...

      Caused by: org.jboss.util.NestedSQLException: Could not create connection; - nested throwable: (java.sql.SQLException: Can not issue empty query); - nested throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Can not issue empty query))

      Caused by: org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Can not issue empty query)

      Caused by: java.sql.SQLException: Can not issue empty query

      Now, 3.2.3 had a mysql-jdbc2-service.xml file deployed in the default/deploy/jms directory but I don't see a corresponding one for the 4.0 installation.

      Anybody have any ideas or has successfully configured 4.0 with mySQL?

      Thanks for any help,
      Mike

        • 1. Re: JBoss 4.0 and MySQL Configuration
          Mike Osganian Newbie

          Ok, I've gotten a little farther. I'm trying to get the JBoss JDO example to work with JBoss 4.0 against MySQL. I got the example to work against the Hypersonic database. Below is the error I'm getting now:

          2004-02-06 09:49:10,076 ERROR [org.jboss.web.localhost.Engine] StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
          org.apache.jasper.JasperException: Failed to execute statement: SELECT COMMENT.OID FROM COMMENT COMMENT ORDER BY COMMENT.PUBLISHDATE ASC
          at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
          at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
          at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

          ...

          2004-02-06 09:49:10,106 ERROR [org.jboss.web.localhost.Engine] ----- Root Cause -----
          javax.jdo.JDOFatalDataStoreException: Failed to execute statement: SELECT COMMENT.OID FROM COMMENT COMMENT ORDER BY COMMENT.PUBLISHDATE ASC
          at org.jboss.persistence.jbossdo.command.JDOAbstractCommand.executeQuery(JDOAbstractCommand.java:178)
          at org.jboss.persistence.jbossdo.JBossQuery.execute(JBossQuery.java:134)
          at org.apache.jsp.index_jsp._jspService(index_jsp.java:191)
          at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)

          Any ideas out there???

          The query cut and pasted in mysql works fine.

          Thanks,
          Mike

          • 2. Re: JBoss 4.0 and MySQL Configuration
            Mike Osganian Newbie

            From looking at the JBoss source code (for 4.0 DR2), the actual SQLException that is raised in the JDOAbstractCommand class is lost and with it the actual cause. Does anybody have any idea on what is going on here?

            Thanks,
            Mike