我在Weblogic中创建了两个数据源,其JNDI名称如下:
- jdbc/testDatasource
- testDatasource1
我能够使用Java访问testDatasource1数据源,但是当我访问jdbc/testDatasource数据源时,出现以下错误:
javax.naming.NameNotFoundException: While trying to lookup 'jdbc.testDatasource' didn't find subcontext 'jdbc'. Resolved '' [Root exception is javax.naming.NameNotFoundException: While trying to lookup 'jdbc.testDatasource' didn't find subcontext 'jdbc'. Resolved '']; remaining name 'jdbc/testDatasource'
看起来前缀jdbc/会导致问题。