【问题标题】:Appengine + Maven + Spring + EclipseAppengine + Maven + Spring + Eclipse
【发布时间】:2013-02-01 08:09:07
【问题描述】:

我想在 appengine 中使用 maven 和 spring,但是我不能...

我能够使用 appengine 配置 maven(以及使用 appengine 的 spring,但没有 maven),但是当我添加 spring 依赖项并尝试运行它时,出现以下错误:

警告:无法实例化监听器 org.springframework.web.context.ContextLoaderListener java.lang.ClassNotFoundException:org.springframework.web.context.ContextLoaderListener [...] java.lang.ClassNotFoundException: org.springframework.web.filter.CharacterEncodingFilter

我该如何解决这个问题?

我阅读了大量信息,但似乎已经过时了......

谢谢,对不起我的英语。

【问题讨论】:

    标签: eclipse spring google-app-engine maven


    【解决方案1】:

    对于 maven 依赖项,请查看: https://mvnrepository.com/artifact/org.springframework

    确保您声明了 spring-web 依赖项。

    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-web</artifactId>
      <version>${springframework.version}</version>
    </dependency>
    

    请阅读 appengine spring 优化指南,以后可以省去一些麻烦: https://cloud.google.com/appengine/articles/spring_optimization

    【讨论】:

      【解决方案2】:

      如果您在问题中提供更多信息会有所帮助,但我会建议您在 maven Central 中查看 spring 工件:http://search.maven.org/#search%7Cga%7C1%7Corg.springframework 并尝试选择所有适合您的单一版本。我认为他们在 3.2.2.RELEASE

      抱歉,我无法提供更多帮助,但是由于这些天 springframework 文档对于 maven 支持来说有点过时了 (http://www.springsource.org/spring-framework),因此很容易获得混杂的版本,这会导致解决依赖关系的问题。

      尽量只声明最小的依赖集,“mvn dependency:tree”也可以提示你在哪里引入重复的依赖,这可能会导致此类问题。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2012-08-08
        • 2014-12-10
        • 2013-11-22
        • 1970-01-01
        • 1970-01-01
        • 2015-02-27
        • 2013-09-29
        • 2013-04-09
        相关资源
        最近更新 更多