迁移到WAS 8.5和java 1.7后出现异常

iyfamqjs  于 2023-01-24  发布在  Java
关注(0)|答案(1)|浏览(133)

我正在将我的应用程序从java 1.5和WAS 6.1迁移到java 1.7和WAS 8.5,我遇到了以下异常。

[8/20/12 12:01:00:286 EDT] 0000006b SystemErr     R org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'xxxDa
taSource' defined in class path resource [applicationContext-datasources.xml]: Invocation of init method failed; nested exception is javax.naming
.ConfigurationException: NamingManager.getURLContext cannot find the factory for this scheme: java
[8/20/12 12:01:00:286 EDT] 0000006b SystemErr     R     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBe
an(AbstractAutowireCapableBeanFactory.java:1338)
[8/20/12 12:01:00:286 EDT] 0000006b SystemErr     R     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean
(AbstractAutowireCapableBeanFactory.java:473)
[8/20/12 12:01:00:286 EDT] 0000006b SystemErr     R     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(Abstra
ctAutowireCapableBeanFactory.java:409)
[8/20/12 12:01:00:286 EDT] 0000006b SystemErr     R     at java.security.AccessController.doPrivileged(AccessController.java:252)
[8/20/12 12:01:00:286 EDT] 0000006b SystemErr     R     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(A
bstractAutowireCapableBeanFactory.java:380)
[8/20/12 12:01:00:286 EDT] 0000006b SystemErr     R     at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFac
tory.java:264)
[8/20/12 12:01:00:286 EDT] 0000006b SystemErr     R     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(Defau
ltSingletonBeanRegistry.java:222)
[8/20/12 12:01:00:286 EDT] 0000006b SystemErr     R     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFacto
ry.java:261)
[8/20/12 12:01:00:287 EDT] 0000006b SystemErr     R     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory
.java:185)
[8/20/12 12:01:00:287 EDT] 0000006b SystemErr     R     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory
.java:164)
[8/20/12 12:01:00:287 EDT] 0000006b SystemErr     R     at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingle
tons(DefaultListableBeanFactory.java:423)
[8/20/12 12:01:00:287 EDT] 0000006b SystemErr     R     at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitializ
ation(AbstractApplicationContext.java:728)
[8/20/12 12:01:00:287 EDT] 0000006b SystemErr     R     at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicatio
nContext.java:380)
[8/20/12 12:01:00:287 EDT] 0000006b SystemErr     R     at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.j
ava:255)
[8/20/12 12:01:00:287 EDT] 0000006b SystemErr     R     at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.jav
a:199)
[8/20/12 12:01:00:287 EDT] 0000006b SystemErr     R     at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderLis
tener.java:45)
[8/20/12 12:01:00:287 EDT] 0000006b SystemErr     R     at scv.cais.cms.jdr.webservice.context.ScvContextLoaderListener.contextInitialized(ScvContex
tLoaderListener.java:21)
[8/20/12 12:01:00:287 EDT] 0000006b SystemErr     R     at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:1651)
[8/20/12 12:01:00:287 EDT] 0000006b SystemErr     R     at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:414)
[8/20/12 12:01:00:287 EDT] 0000006b SystemErr     R     at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:88)
[8/20/12 12:01:00:287 EDT] 0000006b SystemErr     R     at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:169)
[8/20/12 12:01:00:287 EDT] 0000006b SystemErr     R     at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:746)
[8/20/12 12:01:00:287 EDT] 0000006b SystemErr     R     at com.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:634)
[8/20/12 12:01:00:287 EDT] 0000006b SystemErr     R     at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:424)
[8/20/12 12:01:00:287 EDT] 0000006b SystemErr     R     at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:718)
[8/20/12 12:01:00:287 EDT] 0000006b SystemErr     R     at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1170)
[8/20/12 12:01:00:288 EDT] 0000006b SystemErr     R     at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedAppl
icationImpl.java:1370)
[8/20/12 12:01:00:288 EDT] 0000006b SystemErr     R     at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:638)
[8/20/12 12:01:00:288 EDT] 0000006b SystemErr     R     at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:9
68)
[8/20/12 12:01:00:288 EDT] 0000006b SystemErr     R     at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:
769)
[8/20/12 12:01:00:288 EDT] 0000006b SystemErr     R     at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplicationDynamically(ApplicationMg
rImpl.java:1364)
[8/20/12 12:01:00:288 EDT] 0000006b SystemErr     R     at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2169)
[8/20/12 12:01:00:288 EDT] 0000006b SystemErr     R     at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:445
)
[8/20/12 12:01:00:288 EDT] 0000006b SystemErr     R     at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)
[8/20/12 12:01:00:288 EDT] 0000006b SystemErr     R     at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:388
)
[8/20/12 12:01:00:288 EDT] 0000006b SystemErr     R     at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$500(CompositionUnitMgrImpl.jav
a:116)
[8/20/12 12:01:00:288 EDT] 0000006b SystemErr     R     at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$1.run(CompositionUnitMgrImpl.java:663
)
[8/20/12 12:01:00:288 EDT] 0000006b SystemErr     R     at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:5339)
[8/20/12 12:01:00:288 EDT] 0000006b SystemErr     R     at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:5555)
[8/20/12 12:01:00:288 EDT] 0000006b SystemErr     R     at com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:255)
[8/20/12 12:01:00:288 EDT] 0000006b SystemErr     R     at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitM
grImpl.java:677)
[8/20/12 12:01:00:288 EDT] 0000006b SystemErr     R     at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitM
grImpl.java:621)
[8/20/12 12:01:00:288 EDT] 0000006b SystemErr     R     at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:
1256)
[8/20/12 12:01:00:288 EDT] 0000006b SystemErr     R     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[8/20/12 12:01:00:289 EDT] 0000006b SystemErr     R     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:88)
[8/20/12 12:01:00:289 EDT] 0000006b SystemErr     R     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
[8/20/12 12:01:00:289 EDT] 0000006b SystemErr     R     at java.lang.reflect.Method.invoke(Method.java:613)
[8/20/12 12:01:00:289 EDT] 0000006b SystemErr     R     at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:67)
[8/20/12 12:01:00:289 EDT] 0000006b SystemErr     R     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[8/20/12 12:01:00:289 EDT] 0000006b SystemErr     R     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:88)
[8/20/12 12:01:00:289 EDT] 0000006b SystemErr     R     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
[8/20/12 12:01:00:289 EDT] 0000006b SystemErr     R     at java.lang.reflect.Method.invoke(Method.java:613)
[8/20/12 12:01:00:289 EDT] 0000006b SystemErr     R     at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275)
[8/20/12 12:01:00:289 EDT] 0000006b SystemErr     R     at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1196)
[8/20/12 12:01:00:289 EDT] 0000006b SystemErr     R     at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:1060)
[8/20/12 12:01:00:289 EDT] 0000006b SystemErr     R     at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerIntercepto
r.java:831)
[8/20/12 12:01:00:289 EDT] 0000006b SystemErr     R     at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:803)
[8/20/12 12:01:00:289 EDT] 0000006b SystemErr     R     at com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1335)
[8/20/12 12:01:00:289 EDT] 0000006b SystemErr     R     at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
[8/20/12 12:01:00:289 EDT] 0000006b SystemErr     R     at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:1228)
[8/20/12 12:01:00:289 EDT] 0000006b SystemErr     R     at com.ibm.ws.management.application.AppManagementImpl._startApplication(AppManagementImpl.j
ava:1482)
[8/20/12 12:01:00:289 EDT] 0000006b SystemErr     R     at com.ibm.ws.management.application.AppManagementImpl.startApplication(AppManagementImpl.ja
va:1371)
[8/20/12 12:01:00:289 EDT] 0000006b SystemErr     R     at com.ibm.ws.management.application.AppManagementImpl.startApplication(AppManagementImpl.ja
va:1320)
[8/20/12 12:01:00:289 EDT] 0000006b SystemErr     R     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[8/20/12 12:01:00:290 EDT] 0000006b SystemErr     R     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:88)
[8/20/12 12:01:00:290 EDT] 0000006b SystemErr     R     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
[8/20/12 12:01:00:290 EDT] 0000006b SystemErr     R     at java.lang.reflect.Method.invoke(Method.java:613)
[8/20/12 12:01:00:290 EDT] 0000006b SystemErr     R     at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:67)
[8/20/12 12:01:00:290 EDT] 0000006b SystemErr     R     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[8/20/12 12:01:00:290 EDT] 0000006b SystemErr     R     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:88)
[8/20/12 12:01:00:290 EDT] 0000006b SystemErr     R     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
[8/20/12 12:01:00:290 EDT] 0000006b SystemErr     R     at java.lang.reflect.Method.invoke(Method.java:613)
[8/20/12 12:01:00:290 EDT] 0000006b SystemErr     R     at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275)
[8/20/12 12:01:00:290 EDT] 0000006b SystemErr     R     at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1196)
[8/20/12 12:01:00:290 EDT] 0000006b SystemErr     R     at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:1060)
[8/20/12 12:01:00:290 EDT] 0000006b SystemErr     R     at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerIntercepto
r.java:831)
[8/20/12 12:01:00:290 EDT] 0000006b SystemErr     R     at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:803)
[8/20/12 12:01:00:290 EDT] 0000006b SystemErr     R     at com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1335)
[8/20/12 12:01:00:290 EDT] 0000006b SystemErr     R     at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
[8/20/12 12:01:00:290 EDT] 0000006b SystemErr     R     at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:1228)
[8/20/12 12:01:00:290 EDT] 0000006b SystemErr     R     at com.ibm.ws.management.remote.AdminServiceForwarder.invoke(AdminServiceForwarder.java:346)
[8/20/12 12:01:00:290 EDT] 0000006b SystemErr     R     at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1458)
[8/20/12 12:01:00:291 EDT] 0000006b SystemErr     R     at javax.management.remote.rmi.RMIConnectionImpl.access$200(RMIConnectionImpl.java:100)
[8/20/12 12:01:00:291 EDT] 0000006b SystemErr     R     at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.j
ava:1303)
[8/20/12 12:01:00:291 EDT] 0000006b SystemErr     R     at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.jav
a:1391)
[8/20/12 12:01:00:291 EDT] 0000006b SystemErr     R     at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:823)
[8/20/12 12:01:00:291 EDT] 0000006b SystemErr     R     at javax.management.remote.rmi._RMIConnectionImpl_Tie.invoke(Unknown Source)
[8/20/12 12:01:00:291 EDT] 0000006b SystemErr     R     at javax.management.remote.rmi._RMIConnectionImpl_Tie._invoke(Unknown Source)
[8/20/12 12:01:00:291 EDT] 0000006b SystemErr     R     at com.ibm.CORBA.iiop.ServerDelegate.dispatchInvokeHandler(ServerDelegate.java:669)
[8/20/12 12:01:00:291 EDT] 0000006b SystemErr     R     at com.ibm.CORBA.iiop.ServerDelegate.dispatch(ServerDelegate.java:523)
[8/20/12 12:01:00:291 EDT] 0000006b SystemErr     R     at com.ibm.rmi.iiop.ORB.process(ORB.java:523)
[8/20/12 12:01:00:291 EDT] 0000006b SystemErr     R     at com.ibm.CORBA.iiop.ORB.process(ORB.java:1575)
[8/20/12 12:01:00:291 EDT] 0000006b SystemErr     R     at com.ibm.rmi.iiop.Connection.doRequestWork(Connection.java:2992)
[8/20/12 12:01:00:291 EDT] 0000006b SystemErr     R     at com.ibm.rmi.iiop.Connection.doWork(Connection.java:2875)
[8/20/12 12:01:00:291 EDT] 0000006b SystemErr     R     at com.ibm.rmi.iiop.WorkUnitImpl.doWork(WorkUnitImpl.java:64)
[8/20/12 12:01:00:291 EDT] 0000006b SystemErr     R     at com.ibm.ejs.oa.pool.PooledThread.run(ThreadPool.java:118)
[8/20/12 12:01:00:291 EDT] 0000006b SystemErr     R     at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1783)
[8/20/12 12:01:00:291 EDT] 0000006b SystemErr     R Caused by: javax.naming.ConfigurationException: NamingManager.getURLContext cannot find the f
actory for this scheme: java
[8/20/12 12:01:00:291 EDT] 0000006b SystemErr     R     at com.ibm.ws.naming.util.Helpers.checkForUrlContext(Helpers.java:1631)
[8/20/12 12:01:00:291 EDT] 0000006b SystemErr     R     at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:160)
[8/20/12 12:01:00:292 EDT] 0000006b SystemErr     R     at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:179)
[8/20/12 12:01:00:292 EDT] 0000006b SystemErr     R     at org.apache.aries.jndi.DelegateContext.lookup(DelegateContext.java:161)
[8/20/12 12:01:00:292 EDT] 0000006b SystemErr     R     at javax.naming.InitialContext.lookup(InitialContext.java:422)
[8/20/12 12:01:00:292 EDT] 0000006b SystemErr     R     at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:155)
[8/20/12 12:01:00:292 EDT] 0000006b SystemErr     R     at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:88)
[8/20/12 12:01:00:292 EDT] 0000006b SystemErr     R     at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:153)
[8/20/12 12:01:00:292 EDT] 0000006b SystemErr     R     at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:178)
[8/20/12 12:01:00:292 EDT] 0000006b SystemErr     R     at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:95)
[8/20/12 12:01:00:292 EDT] 0000006b SystemErr     R     at org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:105)
[8/20/12 12:01:00:292 EDT] 0000006b SystemErr     R     at org.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(JndiObjectFactoryBean.j
ava:200)
[8/20/12 12:01:00:292 EDT] 0000006b SystemErr     R     at org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.j
ava:186)
[8/20/12 12:01:00:292 EDT] 0000006b SystemErr     R     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMe
thods(AbstractAutowireCapableBeanFactory.java:1369)
[8/20/12 12:01:00:292 EDT] 0000006b SystemErr     R     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBe
an(AbstractAutowireCapableBeanFactory.java:1335)
[8/20/12 12:01:00:292 EDT] 0000006b SystemErr     R     ... 96 more

使用java 1.6时未收到此错误
下面是我用于资源绑定的web.xml片段

<resource-ref id="xxx-data-source">
            <description>XXX Datasource</description>
            <res-ref-name>jdbc/xxxDatasource</res-ref-name>
            <res-type>javax.sql.DataSource</res-type>
            <res-auth>Container</res-auth>
            <res-sharing-scope>Shareable</res-sharing-scope>
        </resource-ref>

我可以在删除java时绕过此错误:数据源名称中的comp/env前缀
例如:我在用

jdbc.jdr.datasource=jdbc/XxxDatasource

代替

jdbc.jdr.datasource=java:comp/env/jdbc/XxxDatasource

但是我不能把这个从所有的地方(在一些jar里)移走。
以前有人遇到过这个问题吗?
谢谢

k4emjkb1

k4emjkb11#

即使答案来晚了,我希望它能帮助一些人。
我也面临着一个

javax.naming.ConfigurationException: NamingManager.getURLContext cannot find the factory for this scheme: java

在我的例子中,它的出现是因为我在web.xml中使用了3.0版本和ibm-web-bnd.xmi描述符。
当我使用ibm-web-bnd.xml描述符时,它可以正常工作。
所以在我看来你应该用

  • 对于Web应用程序版本〈= 2.4,使用ibm-bnd-web.xmi描述符
  • 对于Web应用程序版本〉= 2.5,使用ibm-bnd-web.xml描述符

我还写了一篇博客,讲述我在这个问题上的经历
https://www.link-intersystems.com/blog/2014/06/15/how-to-fix-ibm-websphere-jndi-exception-cannot-find-the-factory-for-this-scheme-java/

相关问题