WebSphere6.1 上部署war包时,报错连不上jndi
本帖最后由 lhyhh1024 于 2012-09-13 10:39:26 编辑 最近在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上部署项目,往各位大侠不吝赐教。
[解决办法]
问题已解决。