I have a strange problem, that is causing me some grief. If the following jar is in my classpath:
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>org.hibernate.ejb</artifactId>
<version>3.3.2.GA</version>
</dependency>
My JNDI lookup for my datasource returns null. Here is the basic code I am using to do the lookup:
InitialDirContext ctx = new InitialDirContext(env);
DataSource dataSource = (DataSource)ctx.lookup("java:dataContent");
Otherwise, the DataSource returns fine from the context. Unfortunately, I need the jar in order to avoid ClassCastExceptions within Jboss 4.2.2.
Any help is appreciated.
<datasources>
<local-tx-datasource>
<jndi-name>dataContent</jndi-name>
<connection-url>jdbc:oracle:thin:@server.net:1521:XXX</connection-url>
<min-pool-size>1</min-pool-size>
<max-pool-size>5</max-pool-size>
<user-name>dbuser</user-name>
<valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
<password>dbpasswd</password>
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
</local-tx-datasource>
</datasources>