웹 응용 프로그램을 시작할 때 Groovy 스크립트를 실행하려고합니다. 나는 Spring Recipes라는 책의 예를 따르려고합니다. com.apress.springrecipes.interest
Groovy Spring Bean 클래스 경로
콩 패키지는 패키지 com.wer.com
에 src/test/resources
에, 그리고 콩이 곳이다 -
나는 다음과 같은 패키지에 SimpleInterestCalculator 있습니다. 점에서
내 항목은
<lang:groovy id="interestCalculator" script-source="classpath:com/apress/springrecipes/interest/SimpleInterestCalculator.groovy">
<lang:property name="rateCalculator" value="rateCalculator" />
</lang:groovy>
나는 다음과 같은 오류를 얻고있다.
Caused by: org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'simpleInterestCalculator':
Could not determine scripted object type for GroovyScriptFactory:
script source locator [classpath:src/com/apress/springrecipes/interest/SimpleInterestCalculator.groovy];
nested exception is java.io.FileNotFoundException:
class path resource [src/com/apress/springrecipes/interest/SimpleInterestCalculator.groovy] cannot be opened because it does not exist
이미 Spring 애플리케이션 시작시 Groovy 스크립트를 실행하는 방법을 설명했다. 비슷한 새로운 질문을하기 전에 해당 대답을 수락하거나 의견을 말하십시오. –