Tomcat JNDI Datasource access

I want to use the tomcat configured Datsource (in contect.xml) instead of using the driver/username/password bean setting in camunda-cfg.xml file. How can I do this? This what I have now.

<bean id="processEngineConfiguration"
		class="org.camunda.bpm.engine.spring.SpringProcessEngineConfiguration">
		<property name="history" value="full" />
		<property name="dataSource" ref="dataSource" />........

</bean>
<bean id="dataSource"
		class="org.springframework.jdbc.datasource.SimpleDriverDataSource">
		<property name="driverClass" value="org.h2.Driver" />
		<property name="url"
			value="jdbc:h2:tcp://localhost/~/test;DB_CLOSE_DELAY=1000" />
		<property name="username" value="sa" />
		<property name="password" value="sa" />
	</bean>

I have tried the following :

<jee:jndi-lookup 
	 expected-type="javax.sql.DataSource" 
	 jndi-name="java:comp/env/jdbc/mydb" id="dataSource" 
	 resource-ref="true" />

but it fails to get the jndi connection…

Thanks,
AD

Please post the datasource configuration in context.xml and the error message you get. Check out How to format code blocks? for how to format code blocks in this forum.

Cheers,
Thorben

Thorben

Thank you for the response. I moved all the configuration to spring applicationcontext.xml file from camunda-cfg as and used the spring configuration instead. It works now. somewhere I had read that camunda-cfg was reduntant aand going to be replaced.

Thanks
Adat