7 Replies Latest reply on May 18, 2005 2:53 PM by x y

    jboss and MySql

    Jong Lee Newbie

      Instead of default HS DB, I want to use MySql for DB. What's the step to replace it?

        • 2. Re: jboss and MySql
          Jong Lee Newbie

          I did what the document said. But jboss does not find MySql DB. Can you recommend some places I should check?

          • 3. Re: jboss and MySql
            Jong Lee Newbie

            The following is the error message when I start server.

            15:08:44,678 ERROR [DatabasePersistencePolicy] Starting failed jboss.ejb:service
            =EJBTimerService,persistencePolicy=database
            java.lang.IllegalStateException: Cannot find datasource meta data: jboss.jdbc:da
            tasource=MySqlDS,service=metadata
            at org.jboss.ejb.txtimer.GeneralPurposeDatabasePersistencePlugin.init(Ge
            neralPurposeDatabasePersistencePlugin.java:81)
            at org.jboss.ejb.txtimer.DatabasePersistencePolicy.startService(Database
            PersistencePolicy.java:93)
            at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanS
            upport.java:272)
            at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:1
            73)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
            java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
            sorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
            er.java:144)
            at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
            at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
            at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
            java:249)
            at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)

            • 4. Re: jboss and MySql
              Yann Lenne Newbie

              I had the same error and I finally realized I was using a wrong mysql-ds.xml (from a previous version).

              Check that your file has the correct format as defined in jboss/docs/examples/jca/mysql-ds.xml (I was missing the metadata tag) :


              <local-tx-datasource>
              <jndi-name>MySqlDS</jndi-name>
              <connection-url>jdbc:mysql://mysql-hostname:3306/jbossdb</connection-url>
              <driver-class>com.mysql.jdbc.Driver</driver-class>
              <user-name>x</user-name>
              y
              <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
              <!-- sql to call when connection is created
              <new-connection-sql>some arbitrary sql</new-connection-sql>
              -->
              <!-- sql to call on an existing pooled connection when it is obtained from pool
              <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
              -->

              <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->

              <type-mapping>mySQL</type-mapping>

              </local-tx-datasource>


              • 5. Re: jboss and MySql
                ju xiaomi Newbie

                I hava encounted this problem before, its "get started" document do nothing with this issue.
                Actually, you must place the mysql-ds.xml to correct directory. I placed it in /usr/local/jboss/server/all/deploy/jca and then it works!

                • 6. Re: jboss and MySql
                  Simon Ward Newbie

                  Slight problem with that theory mate...there is no Jboss jca directory in the deploy directory of JBoss 4.0.0 or 4.0.1

                  • 7. Re: jboss and MySql
                    x y Newbie

                    So...was there a solution found to configuring MySql for JBoss 4.0 (I'm on XP) ?

                    I've seen it here and other internet posts where in order to configure mysql for jboss 4.0, config items are to be placed in non-existant folders...???