3 Replies Latest reply on Feb 8, 2005 4:08 AM by Darran Lofthouse

    Error for onfigure an Mysql data source

    quinten jiang Newbie

      Hi

      I built correct user for mysql, put mysql-connector-java-3.1.6-bin.jar
      under lib. and modified mysql-ds.xml under deploy. But when I start
      jboss, it keep to generate error like:


      2005-02-06 18:23:54,520 DEBUG [org.jboss.resource.connectionmanager.IdleRemover] internalRegisterPool: about to notify thread: old next: 1107732684520, new next: 1107732684520
      2005-02-06 18:23:54,520 DEBUG [org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory] Using properties: {user=jboss, password=--hidden--}
      2005-02-06 18:23:54,520 DEBUG [org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory] Checking driver for URL: jdbc:mysql://localhost:3306/citydb
      2005-02-06 18:23:54,530 DEBUG [org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory] Driver not yet registered for url: jdbc:mysql://localhost:3306/citydb
      2005-02-06 18:23:54,550 DEBUG [org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory] Driver already registered for url: jdbc:mysql://localhost:3306/citydb
      2005-02-06 18:23:55,020 DEBUG [org.jboss.ejb.txtimer.DatabasePersistencePolicy] Executing DDL: create table TIMERS (
      TIMERID varchar(50) not null,
      TARGETID varchar(50) not null,
      INITIALDATE timestamp not null,
      INTERVAL bigint,
      INSTANCEPK other,
      INFO other,
      constraint timers_pk primary key (TIMERID)
      )
      2005-02-06 18:23:55,111 ERROR [org.jboss.ejb.txtimer.DatabasePersistencePolicy] Starting failed jboss.ejb:persistencePolicy=database,service=EJBTimerService
      java.sql.SQLException: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTERVAL bigint,
      INSTANCEPK other,
      INFO o
      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2851)
      at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1534)
      at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1625)
      at com.mysql.jdbc.Connection.execSQL(Connection.java:2291)
      at com.mysql.jdbc.Connection.execSQL(Connection.java:2226)
      at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1262)
      at org.jboss.resource.adapter.jdbc.WrappedStatement.executeUpdate(WrappedStatement.java:229)
      at org.jboss.ejb.txtimer.DatabasePersistencePolicy.createTableIfNotExists(DatabasePersistencePolicy.java:403)
      at org.jboss.ejb.txtimer.DatabasePersistencePolicy.startService(DatabasePersistencePolicy.java:102)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:172)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      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:242)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:908)
      at $Proxy0.start(Unknown Source)


      Can Anyone solve my problem?


      Quinten

        • 2. Re: Error for onfigure an Mysql data source
          quinten jiang Newbie

          Hi,

          mysql-ds.xml look like this:



          <local-tx-datasource>
          <jndi-name>DefaultDS</jndi-name>
          <connection-url>jdbc:mysql://localhost:3306/citydb</connection-url>
          <driver-class>com.mysql.jdbc.Driver</driver-class>
          <user-name>jboss</user-name>
          nrtpos

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

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

          </local-tx-datasource>




          I use mysql --user=jboss --password=nrtpos, it can connect to database.
          I also try to neglect port 3306, it got same error.

          • 3. Re: Error for onfigure an Mysql data source
            Darran Lofthouse Master

            I see quite often the first step users of JBoss take is that they immediately remove the Hypersonic datasource and try to replace it with another datasource, at this stage the users probably understand very little about JBoss and this process ends up taking quite a while.

            The easiest option really is to deploy your datasource in parallel with the Hypersonic datasource using a different JNDI name, your application can then use your datasource and you can leave the server configuration alone.

            Once you are more familiar with JBoss you can then look at migrating the other services across to your datasource.