NetBeans配置Spring-Cannot find class [M:\workspace\MySpring\src\com\jin\Chinese.java] for bean with name 'chineseId' defined in class path resource [bean.xml];

 <bean id="obstacle1" class="C:\launchCodeFiles\src\main\java\RunMario.java">

Changed

<bean id="obstacle1" class="RunMario">

class path (package name + class name)

<?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-3.0.xsd">
       
    <bean id="chineseId" class="com.jin.Chinese">
        <property name ="axe" ref="stoneAxeId"></property>
    </bean>
    <bean id="stoneAxeId" class="com.jin.StoneAxe">
    </bean>
</beans>

 

Guess you like

Origin www.cnblogs.com/jinmoon/p/11116424.html