websphere6.0下部署war包,异常javax.naming.NameNotFoundException: Namenotfound java:
websphere6.0下部署war包,异常javax.naming.NameNotFoundException: Namenotfound java:
web.xml配置:
<resource-ref id="ResourceRef_1">
<description>DB Connection</description>
<res-ref-name>oscdb</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
spring.xml 配置
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<value>oscdb</value>
</property>
<property name="resourceRef">
<value>true</value>
</property>
</bean>
那位大侠有遇到此类问题,请一起讨论一下,谢谢!!!
异常日志如下:
************* End Display Current Environment *************
[12-10-31 14:56:00:812 CST] 0000007f javaURLContex E NMSV0310E: 由于服务器运行时无法将“java:”名称上的 JNDI 操作的线程与任何 J2EE 应用程序组件相关联,该操作无法完成。当使用“java:”名称的 JNDI 客户机不在服务器应用程序请求的线程中执行时,就会出现这种情况。确保 J2EE 应用程序不在静态代码块或该 J2EE 应用程序创建的线程中对“java:”名称执行 JNDI 操作。此类代码不必在服务器应用程序请求的线程中运行,因此不受“java:”名称上的 JNDI 操作支持。异常堆栈跟踪:
javax.naming.ConfigurationException [Root exception is javax.naming.NameNotFoundException: Name not found in context "java:".]
at com.ibm.ws.naming.java.javaURLContextImpl.throwConfigurationExceptionWithDefaultJavaNS(javaURLContextImpl.java:411)
at com.ibm.ws.naming.java.javaURLContextImpl.lookup(javaURLContextImpl.java:388)
at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:201)
at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:142)
at javax.naming.InitialContext.lookup(InitialContext.java:363)
at com.paraview.jar.core.tools.ServiceLocator.getInitialContext(ServiceLocator.java:182)
at com.paraview.jar.core.tools.ServiceLocator.<init>(ServiceLocator.java:57)
at com.paraview.jar.core.tools.ServiceLocator.getInstance(ServiceLocator.java:73)
at com.paraview.jar.core.tools.ConnDefImpl.getDataSource(ConnDefImpl.java:64)
at com.para.osc.framework.common.base.BaseDaoEntity.getConnection(BaseDaoEntity.java:25)
at com.paraview.jar.core.tools.ConnDefImpl.getConn(ConnDefImpl.java:96)
at com.paraview.jar.core.table.TableImpl.<init>(TableImpl.java:92)
at com.paraview.jar.core.table.TableImpl.getInstance(TableImpl.java:279)
at com.paraview.jar.core.factory.TableFactory.getTableHandler(TableFactory.java:40)
at com.paraview.jar.core.factory.TableFactory.getTableHandler(TableFactory.java:66)
at com.para.osc.framework.common.base.BaseDaoImpl.getTableInterface(BaseDaoImpl.java:21)
at com.para.osc.framework.common.base.DaoImpl.queryList(DaoImpl.java:424)
at com.para.osc.framework.security.service.impl.PrPasswordLogServiceImpl.query(PrPasswordLogServiceImpl.java:374)
at com.para.osc.framework.security.service.impl.PrPasswordLogServiceImpl$$FastClassByCGLIB$$b6a96355.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)
at com.para.osc.framework.security.service.impl.PrPasswordLogServiceImpl$$EnhancerByCGLIB$$e2453cb0.query(<generated>)
at com.para.osc.framework.security.service.impl.PrEmployeeRequestLogServiceImpl.doProcessApplyPwdCheckOnline(PrEmployeeRequestLogServiceImpl.java:628)
at com.para.osc.framework.security.service.impl.PrEmployeeRequestLogServiceImpl$$FastClassByCGLIB$$fdf29789.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)
at com.para.osc.framework.security.service.impl.PrEmployeeRequestLogServiceImpl$$EnhancerByCGLIB$$34c6beac.doProcessApplyPwdCheckOnline(<generated>)
at com.para.osc.framework.common.quartz.TimingFlowJobTasks$1.callback(TimingFlowJobTasks.java:48)
at com.para.osc.framework.common.quartz.ThreadSyncComponent.syncRun(ThreadSyncComponent.java:80)
at com.para.osc.framework.common.quartz.TimingFlowJobTasks.doApplyPwdCheckOnlineJob(TimingFlowJobTasks.java:44)
at sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:615)
at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:273)
at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:311)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:113)
at org.quartz.core.JobRunShell.run(JobRunShell.java:223)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
at java.lang.Thread.run(Thread.java:797)
Caused by: javax.naming.NameNotFoundException: Name not found in context "java:".