【发布时间】:2013-03-07 16:40:03
【问题描述】:
GWT、Spring、Maven 和 Eclipse 表现不佳。我试图在我的本地机器上以开发模式运行(一个相当大的)项目。我能够成功构建应用程序,但无法在 Eclipse 中运行它。生产模式在使用mvn gwt:run 从命令行运行时有效。
我已将其缩小为 xsd 架构的问题。它无法在我的 context.xml 文件中解析 <aop:scoped-proxy />。
我正在使用 GWT 2.5、Spring 3.0.5-RELEASE 和 Maven 3.0.4。我已将 spring-aop-3.0.5-RELEASE.jar 明确添加到我的类路径中,但仍然没有运气。
appContext.xml 顶部
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd "
default-init-method="init" default-lazy-init="true">
标准输出
Nested in org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:
Line 131 in XML document from class path resource [appContext.xml] is invalid;
nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c:
The matching wildcard is strict, but no declaration can be found for element
'aop:scoped-proxy'.:
org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is
strict, but no declaration can be found for element 'aop:scoped-proxy'.
日志文件
[main] WARN factory.xml.XmlBeanDefinitionReader - Ignored XML validation warning
org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document
'http://www.springframework.org/schema/aop/spring-aop-2.0.xsd', because 1) could
not find the document; 2) the document could not be read; 3) the root element of
the document is not <xsd:schema>.
【问题讨论】:
-
您是否关注those instructions 来启动您的项目? (顺便说一句,
mvn gwt:run是 DevMode,而不是 prod 模式) -
感谢托马斯的回复。我应该澄清一下,在将
target/<appName>-<version>移动到 www 后,我得到了mvn gwt:run的工作,但我认为这是不正确的。我在 GWT 运行参数中设置了带有-war target/<appName>-<version>的 Eclipse。 -
如果我不将
target/<appName>-<version>复制到www 并运行mvn gwt:run,我会在浏览器中收到以下错误“GWT 模块'客户端'可能需要重新编译。”