1 Reply Latest reply on Jun 26, 2003 12:38 PM by billelmehdi

    problem to connect jboss and MySql

    billelmehdi Newbie

      Hi, I'm new in JBoss and I want to connect Jboss with MySql.

      I'm using JBoss 3.0.1 with Tomcat-4.1
      Mysql is installed in other computer named "superserveur"

      Tomcat Work with no problem with jboss.

      To connect JBoss to Mysql I followed this steps:

      I download J/Connector and copied
      "mysql-connector-java-3.0.8-stable-bin.jar" in %jboss_dest%\server\default\lib

      I removed hdsldb-service.xml from the deploy folder.

      I added mysql-service.xml to deploy folder where I put this:



      ModelDB



      <config-property name="ConnectionURL" type="java.lang.String">jdbc:mysql://superserveur:3306/nova</config-property>
      <config-property name="DriverClass" type="java.lang.String">org.gjt.mm.mysql.Driver</config-property>
      <!--set these only if you want only default logins, not through JAAS -->
      <config-property name="UserName" type="java.lang.String">novastorm</config-property>
      <config-property name="Password" type="java.lang.String">root</config-property>




      I modified login-config.xml (\server\default\conf) where I put:

      <application-policy name = "MySqlDbRealm">

      <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule" flag = "required">
      <module-option name = "principal">nova</module-option>
      <module-option name = "userName">novastorm</module-option>
      <module-option name = "password">root</module-option>
      <module-option name = "managedConnectionFactoryName"> jboss.jca:service=LocalTxCM,name=ModelDB</module-option>
      </login-module>

      </application-policy>

      and finally in <resource-ref> in ejb-jar.xml of my beans I added:

      <resource-ref>
      <res-ref-name>java:/ModelDB</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth> Container</res-auth> </resource-ref>

      but I got this when I attempt to use my bean.

      .......................
      14:29:57,372 INFO [ModelDB] Bound connection factory for resource adapter 'JBoss LocalTransaction JDBC Wrapper' to JNDI name 'java:/ModelDB'
      ...............................................................

      14:34:44,465 INFO [EjbModule] Creating
      14:34:44,535 INFO [EjbModule] Deploying LinkedNode
      14:34:44,605 INFO [EjbModule] Deploying Node
      14:34:44,725 INFO [EjbModule] Created
      14:34:44,725 INFO [EjbModule] Starting
      14:34:44,725 WARN [EntityContainer] No resource manager found for java:/ModelDB
      14:34:44,936 WARN [EntityContainer] No resource manager found for java:/ModelDB
      14:34:44,966 INFO [EjbModule] Started
      14:34:44,976 INFO [MainDeployer] Deployed package: file:/E:/jboss-3.0.4/server/default/deploy/DataJar.jar

      Thank you to help me it's very important to me.
      Thanks