빠른 질문. webapp에서 사용하는 다른 jar에있을 때 applicationContext.xml에서 Spring 클래스를 참조 할 수 있습니까?applicationcontext.xml 다른 jar에서 spring servrices
의 JAR WAR 파일에 (내 모든 servries과의 DAO 등을 포함하는 일반적인 항아리),하지만 난 applicationContext.xml를 통해 서비스를 참조 할 때, 나는 다음과 같은 오류가 발생합니다 : -
Error creating bean with name 'com.myproject.common.test.impl.TestServiceImpl' defined in ServletContext resource [/WEB-INF/context/spring-context.xml]: Instantiation of bean failed; nested exception is java.lang.IllegalStateException: No bean class specified on bean definition
(주 스프링-context.xml에이 오류없이 applicationContext.xml로 가져옵니다.)
내 상황에 맞는 XML :
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<bean id="com.myproject.common.test.impl.TestServiceImpl">
<property name="genericDao" ref="genericDao" />
</bean>
</beans>
내 응용 프로그램 패키지를 모두 받고 닷컴 모든 com.myproect.common에서 .myproject.web 내 일반적인 항아리
여러분의 빈 요소는 클래스 속성이 필요
@ compbinatorics가 언급 한 것을 한 번 수행하십시오. jar 파일이 클래스 경로에 있는지 확인하십시오. – MasterV
그 MasterV에 환호, 그것은 작동합니다. – Casper