JDK 8旧程序抛出异常 - >找不到处理程序类java.lang.ClassNotFoundException:

时间:2017-11-12 16:14:49

标签: java spring

最近我得到了新工作并正在努力。但是最近我需要在运行的Windows计算机上安装JDK 1.8,其中有一个调度程序作业程序,然后现在它抛出异常,如下所示。我不知道为什么?

<?xml version="1.0" encoding="UTF-8"?>
<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 id="applicationContext"
        class="org.springframework.context.support.ClassPathXmlApplicationContext">
        <constructor-arg>
            <list>
                <value>applicationContext.xml</value>
                <value>applicationContext-datasource.xml</value>
                <value>applicationContext-smtp.xml</value>
            </list>
        </constructor-arg>
    </bean>

</beans>

applicationContextDef.xml

<?xml version="1.0" encoding="UTF-8"?>
<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 id="propertyConfigurer"
        class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="locations">
            <list>
                <value>mail.properties</value>
                <value>datasource.properties</value>
            </list>
        </property>
    </bean>
</beans>

的applicationContext.xml

datasource.jndi.name=AWIP_DB
datasource.jndi.provider=t3://web-application04.xxxx.com:7101
## datasource.properties
selector {width: 100px; height: 250px;}

cannot change the spring version

1 个答案:

答案 0 :(得分:0)

<bean id="propertyPlaceholderConfigurer"
    class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="locations">
        <list>
            <value>classpath:config.properties</value>
        </list>
    </property>
</bean>

请使用classpath 添加配置。

上面的示例显示了如何使用applicationContext.xml进行配置。