Rest SpringGroovyDynamicElementReader试图将Groovy脚本读取为XML,但失败了

Rest SpringGroovyDynamicElementReader试图将Groovy脚本读取为XML,但失败了,rest,groovy,spring-boot,component-scan,Rest,Groovy,Spring Boot,Component Scan,当我看到Spring Boot时,我喜欢这样的想法: 如果要更改默认值,请快速让开。-Dave Syer,2013年春季一期2GX 没过多久,实用性就打动了我。在尝试使用100%Groovy/NoXMLPET项目启动时,我在两天内发现了两个问题。这里有一个 Groovy配置文件: beans { xmlns([ctx:'http://www.springframework.org/schema/context']) ctx.'component-scan'('base-package':

当我看到Spring Boot时,我喜欢这样的想法:

如果要更改默认值,请快速让开。-Dave Syer,2013年春季一期2GX

没过多久,实用性就打动了我。在尝试使用100%Groovy/NoXMLPET项目启动时,我在两天内发现了两个问题。这里有一个

Groovy配置文件:

beans {
  xmlns([ctx:'http://www.springframework.org/schema/context'])
  ctx.'component-scan'('base-package':'name.abhijitsarkar.moviedatabase')
}
例外情况:

Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read XML document; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Unable to determine validation mode for [Groovy]: cannot open InputStream. Did you attempt to load directly from a SAX InputSource without specifying the validationMode on your XmlBeanDefinitionReader instance?; nested exception is java.io.FileNotFoundException: Groovy cannot be opened because it does not point to a readable resource
    at org.springframework.beans.factory.xml.XmlReaderContext.readDocumentFromString(XmlReaderContext.java:98)
    at org.springframework.beans.factory.xml.XmlReaderContext$readDocumentFromString.call(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
    at org.springframework.beans.factory.groovy.GroovyDynamicElementReader.invokeMethod(GroovyDynamicElementReader.groovy:96)

也发布在Spring论坛上。

很难看出这与Spring Boot有什么关系,但是如果你能分享更多的代码,可能会更容易说出来。你能把一个项目推到github上吗?我开始明白这和Boot没有直接关系。我开了一个JIRA。我的整个项目是。不过,有问题的测试是,由于这个bug,我现在已经从Groovy配置中删除了组件扫描,并使用@ComponentScan将其放在应用程序类中。