我正在尝试在websphere-liberty:springBoot2码头图像上设置一个数据源。我是共享,一个war文件和一个包含jdni定义的server.xml文件
<dataSource id="oracle" jndiName="jdbc/oracle">
<jdbcDriver libraryRef="OracleLib"/>
<properties ....... />
</dataSource>war文件具有bean定义:
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="jdbc/oracle"/>
<property name="lookupOnStartup" value="false"/>
<property name="cache" value="true" />
<property name="proxyInterface" value="javax.sql.DataSource" />
</bean>但是出现了下一个错误堆栈:
Invocation of init method failed; nested exception is org.springframework.jndi.JndiLookupFailureException:
JndiObjectTargetSource failed to obtain new target object;
nested exception is javax.naming.NamingException:
CWWKE0800W: An attempt was made to retrieve an initial context for [jdbc/oracle] but no JNDI feature is configured.我将server.xml和ojdbc8.jar共享到容器中。提前谢谢。
发布于 2018-11-28 14:03:23
您需要通过将<feature>jndi-1.0</feature>添加到server.xml的<featureManager>元素来启用JNDI特性,并且您可能希望使用Oracle特定的配置元素properties.oracle,而不是通用的驱动程序配置元素properties。
https://stackoverflow.com/questions/53520956
复制相似问题