I'm having the same problem, only I am using the java:comp/env notation in the spring app context config file. I'm convinced it's a spring problem because I can use the same JNDI datasource in a hibernate/JPA app without any problems. I am on the verge of dropping spring entirely because of stuff like this.
I have the following config in my app context:
Code:
<bean id="myDS" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:comp/env/jdbc/MyDS"/>
</bean>
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="datasource" ref="myDS"/>
<property name="hibernateProperties">
<value>
hibernate.dialect=org.hibernate.dialect.Oracle9Dialect
hibernate.hbm2ddl.auto=update
</value>
</property>
</bean>