javax.naming.ConfigurationException NamingManager.getURLContext无法找到此方案的工厂:迁移到WAS 8.5和java 1.7后的java

时间:2016-11-01 18:33:12

标签: java spring websphere-8

在将应用程序从Java 5迁移到7并将WAS 6.1迁移到WAS 8.5.5.1之后,在部署应用程序时,我遇到以下异常:

Caused by: javax.naming.ConfigurationException: NamingManager.getURLContext cannot find the factory for this scheme: java
    at com.ibm.ws.naming.util.Helpers.checkForUrlContext(Helpers.java:1631)
    at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:160)
    at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:179)
    at org.apache.aries.jndi.DelegateContext.lookup(DelegateContext.java:161)
    at javax.naming.InitialContext.lookup(InitialContext.java:422)
    at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:124)
    at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:86)
    at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:122)
    at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:147)
    at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:90)
    at org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:101)
    at org.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(JndiObjectFactoryBean.java:164)
    at org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:151)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1057)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1024)

这是来自一个我无法修改的Jar内部的弹簧上下文文件。这是上下文文件内容:

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">

    <bean lazy-init="true" id="test-jndiLocalContext" class="org.springframework.jndi.JndiObjectFactoryBean">
        <property name="jndiName" value="java:comp/env"/>
    </bean>

</beans>

我已按照javax.naming.ConfigurationException after migrating to WAS 8.5 and java 1.7中的建议行事 并在https://www.link-intersystems.com/blog/2014/06/15/how-to-fix-ibm-websphere-jndi-exception-cannot-find-the-factory-for-this-scheme-java/

将网络应用版本从2.4更改为2.5并将ibm-web-bnd.xmi转换为ibm-web-bnd.xml文件,但没有运气。它仍然给我同样的问题。看起来问题出现在包含spring context xml的Jar文件中。

任何人都可以建议可能的建议或解决方案。

非常感谢

0 个答案:

没有答案