JBoss Community

Datasource configuration from Tomcat

created by Julien Pardons in JBoss AS 7 Development - View the full discussion

Hello,

 

I'm importing .war package in JBoss 7 and I have some problem with the JNDI Name.

 

In Tomcat, I have this configuration:

 

<Resource
    name="jdbc/EPCISDB"
    type="javax.sql.DataSource"
    auth="Container"
    username="epcis"
    password="******"
    driverClassName="com.mysql.jdbc.Driver"
    defaultAutoCommit="false"
    url="jdbc:mysql://localhost:3306/epcis?autoReconnect=true">
  </Resource>

 

I tried a lot of solution, but I still get an error on the deployment:

{"Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"Services with missing/unavailable dependencies" => ["jboss.naming.context.java.module.\"epcis-repository-0.5.1-SNAPSHOT\".\"epcis-repository-0.5.1-SNAPSHOT\".env.jdbc.EPCISDB missing [ jboss.naming.context.java.jboss.resources.jdbc.EPCISDB ]"]}}}

 

<datasource jndi-name="java:jboss/datasources/env/jdbc/EPCISDB" pool-name="comp/env/jdbc/EPCISDB" enabled="true" jta="true" use-java-context="true" use-ccm="true">
    <connection-url>
        jdbc:mysql://localhost:3306/epcis?autoReconnect=true
    </connection-url>
    <driver>
        mysql
    </driver>
    <security>
        <user-name>
            epcis
        </user-name>
        <password>
            ******
        </password>
    </security>
</datasource>

 

I have tries this name:

java:jboss/datasources/env/jdbc/EPCISDB

java:jboss/datasources/comp/env/jdbc/EPCISDB

java:jboss/datasources/jdbc/EPCISDB

 

I the config file, I found many different name too:

 

# the name of the JNDI datasource holding the connection to the database
jndi.datasource.name=java:comp/env/jdbc/EPCISDB

 

<property name="jndiName" value="jdbc/EPCISDB" />

 

<resource-ref>
    <res-ref-name>jdbc/EPCISDB</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
  </resource-ref>

 

Somebody got a solution for me ?


Thanks !

 

Julien

Reply to this message by going to Community

Start a new discussion in JBoss AS 7 Development at Community