Hi,
I'd like to use tomcat JNDI as the datasource for my application and
don't seem to be able to find the right configuration. Have tried
everything I could think of:
sqlMapConfig contains the following section:
...
<transactionManager type="JDBC">
<dataSource type="JNDI">
<property name="DBJndiContext" value="jdbc/EIS" />
</dataSource>
</transactionManager>
...
context.xml:
<?xml version="1.0" encoding="UTF-8"?>
<Context docBase="eis" debug="5" path="" reloadable="true">
<Resource name="jdbc/EIS" auth="Container"
type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="1000"
username="webuser" password="somepwd"
driverClassName="net.sourceforge.jtds.jdbc.Driver"
url="jdbc:jtds:sqlserver://localhost:1433/EIS" />
</Context>
Where am I wrong?
Here's the end of the stack trace:
Caused by: java.lang.RuntimeException: Error parsing XPath
'/sqlMapConfig/transactionManager/dataSource/end()'. Cause:
com.ibatis.sqlmap.client.SqlMapException: There was an error configuring
JndiDataSourceDaoTransactionPool. Cause:
javax.naming.NameNotFoundException: Name jdbc is not bound in this
Context
at
com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:11
3)
at
com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:95)
at
com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:92)
at
com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:92)
at
com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:62)
at
com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:50)
... 41 more
Caused by: com.ibatis.sqlmap.client.SqlMapException: There was an error
configuring JndiDataSourceDaoTransactionPool. Cause:
javax.naming.NameNotFoundException: Name jdbc is not bound in this
Context
at
com.ibatis.sqlmap.engine.datasource.JndiDataSourceFactory.initialize(Jnd
iDataSourceFactory.java:60)
at
com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser$9.process(SqlMap
ConfigParser.java:318)
at
com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:11
1)
... 46 more
Caused by: javax.naming.NameNotFoundException: Name jdbc is not bound in
this Context
at org.apache.naming.NamingContext.lookup(NamingContext.java:769)
at org.apache.naming.NamingContext.lookup(NamingContext.java:139)
at org.apache.naming.NamingContext.lookup(NamingContext.java:780)
at org.apache.naming.NamingContext.lookup(NamingContext.java:139)
at org.apache.naming.NamingContext.lookup(NamingContext.java:780)
at org.apache.naming.NamingContext.lookup(NamingContext.java:152)
at
org.apache.naming.SelectorContext.lookup(SelectorContext.java:136)
at javax.naming.InitialContext.lookup(Unknown Source)
at
com.ibatis.sqlmap.engine.datasource.JndiDataSourceFactory.initialize(Jnd
iDataSourceFactory.java:48)
... 48 more
Thanks,
Chris