JNDI Issues: Jboss 4.2.2 Spring 2.5 and hibernate ejb

Posted by jon077 on Stack Overflow See other posts from Stack Overflow or by jon077
Published on 2010-04-21T02:08:33Z Indexed on 2010/04/21 2:13 UTC
Read the original article Hit count: 257

Filed under:
|
|

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.

© Stack Overflow or respective owner

Related posts about jboss

Related posts about java