JBoss Community

Re: Datasource configuration from Tomcat

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

I tried with this name, but I got the same error.

 

I made a full search on my code, here is the results:

 

String jndiName = getProperties().getProperty("jndi.datasource.name", "java:comp/env/jdbc/EPCISDB");

jndi.datasource.name=java:comp/env/jdbc/EPCISDB

<hibernate-configuration>
  <session-factory>
    <property name="hibernate.connection.datasource">java:comp/env/jdbc/EPCISDB</property>

<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean" scope="singleton">
    <property name="jndiName" value="jdbc/EPCISDB" />
    <property name="resourceRef" value="true" />
  </bean>

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

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

Reply to this message by going to Community

Start a new discussion in JBoss AS 7 Development at Community