【问题标题】:Unable to run GWT in dev mode. No declaration can be found for element 'aop:scoped-proxy'?无法在开发模式下运行 GWT。找不到元素“aop:scoped-proxy”的声明?
【发布时间】: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/&lt;appName&gt;-&lt;version&gt; 移动到 www 后,我得到了mvn gwt:run 的工作,但我认为这是不正确的。我在 GWT 运行参数中设置了带有 -war target/&lt;appName&gt;-&lt;version&gt; 的 Eclipse。
  • 如果我不将target/&lt;appName&gt;-&lt;version&gt; 复制到www 并运行mvn gwt:run,我会在浏览器中收到以下错误“GWT 模块'客户端'可能需要重新编译。”

标签: spring gwt


【解决方案1】:

【讨论】:

    【解决方案2】:

    我能够使用mvn gwt:run 让它在开发模式下运行。我第一次遇到问题时很接近。

    我不知道的一件事是?gwt.codesvr=127.0.0.1:9997 在 URL 末尾的重要性。如果没有此 GWT DevMode 实用程序,将无法跟踪用户交互。

    http://localhost:8888/index.html?gwt.codesvr=127.0.0.1:9997

    为了安全起见,我在 Eclipse 中清理并重建了 maven 项目。不知道这是否对它有影响。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-12-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多