当前位置: 代码迷 >> Web前端 >> Websphere6.1部署项目时报错,连接不下jndi Name not found in context "java:"
  详细解决方案

Websphere6.1部署项目时报错,连接不下jndi Name not found in context "java:"

热度:1273   发布时间:2012-10-07 17:28:51.0
Websphere6.1部署项目时报错,连接不上jndi Name not found in context "java:"
最近在websphere 上部署一个项目时,总是报下面的错误,在tomcat上是好的。websphere上我已经配置好jndi 测试连接也是通过的。网上查了很多资料,还是没有好的解决办法。我用的是spring ,数据源是这样配置的
<bean id="baseDaoEntity" class="com.para.osc.framework.common.base.BaseDaoEntity" init-method="initEntity">
<property name="dataSource" ref="dataSource" />
<property name="dataBaseType">
<value>MYSQL</value>
</property>
<property name="jndiName">
<value>jdbc/oscdb</value>
</property>
</bean>

javax.naming.ConfigurationException: A JNDI operation on a "java:" name cannot be completed because the serverruntime is not able to associate the operation's thread with any J2EE application component. This condition can occur when the JNDI client using the "java:" name is not executed on the thread of a server application request. Make sure that a J2EE application does not execute JNDI operations on "java:" names within static code blocks or in threads created by that J2EE application. Such code does not necessarily run on the thread of a server application request and therefore is not supported by JNDI operations on "java:" names. [Root exception is javax.naming.NameNotFoundException: Name not found in context "java:".]

小弟是初次在websphere上部署项目
  相关解决方案