Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/382.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/scala/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 在GWT、GAE、Maven和Spring应用程序中找不到ContextLoaderListener的类_Java_Google App Engine_Gwt_Maven Gae Plugin - Fatal编程技术网

Java 在GWT、GAE、Maven和Spring应用程序中找不到ContextLoaderListener的类

Java 在GWT、GAE、Maven和Spring应用程序中找不到ContextLoaderListener的类,java,google-app-engine,gwt,maven-gae-plugin,Java,Google App Engine,Gwt,Maven Gae Plugin,我对GWT(谷歌网络工具包)、GAE(谷歌应用程序引擎)堆栈非常陌生。我需要写这个应用程序并上传到GAE 该项目使用maven作为构建和部署管理工具 问题是: 1) 我在我的eclipse中将该项目作为Maven项目导入(eclipse配备了m2e eclipse插件、gwt和gae插件) 2) 默认情况下,GAE性质是关闭的,因此当我将其作为GWT Web应用程序运行时,它运行良好 3) 当我打开GAE特性以使用eclipse将其部署到GAE时,它会抛出一个错误,App Engine SDK不

我对GWT(谷歌网络工具包)、GAE(谷歌应用程序引擎)堆栈非常陌生。我需要写这个应用程序并上传到GAE

该项目使用maven作为构建和部署管理工具

问题是:

1) 我在我的eclipse中将该项目作为Maven项目导入(eclipse配备了m2e eclipse插件、gwt和gae插件)

2) 默认情况下,GAE性质是关闭的,因此当我将其作为GWT Web应用程序运行时,它运行良好

3) 当我打开GAE特性以使用eclipse将其部署到GAE时,它会抛出一个错误,App Engine SDK不是有效的目录,,因为maven认为jar是SDK的主目录(我知道这很愚蠢),这在本文中得到了解决

4) 解决方案奏效了,当我移动Maven时,我能够消除这个错误 依赖项位于库选项卡的
Java构建路径的底部

5) 问题在于:这会搞乱Maven在开始时加载的其他依赖项(如Spring的
ContextLoaderListener
),并为此类抛出一个
ClassNotFound
。此外,我觉得它也会给我带来其他例外,因为我将Maven依赖项移到了底部

以下是我的pom文件的相关部分:

<?xml version="1.0" encoding="UTF-8"?>

<properties>
<!-- client -->
<!-- Get the latest GXT release through support 3.0.6... -->
<gxt.version>3.0.1</gxt.version>
<gwt.version>2.5.1</gwt.version>
<gwtp.version>1.0</gwtp.version>
<gin.version>2.0.0</gin.version>
<gwtquery.version>1.3.2</gwtquery.version>


<!-- server -->
<guice.version>3.0</guice.version>
<mysql.version>5.1.26</mysql.version>

<spring.version>3.2.4.RELEASE</spring.version>


<!-- testing -->
<junit.version>4.11</junit.version>
<jukito.version>1.1</jukito.version>

<!-- maven -->
<gwt-maven-plugin.version>2.5.1</gwt-maven-plugin.version>
<maven-surefire-plugin.version>2.6</maven-surefire-plugin.version>
<maven-compiler-plugin.version>2.3.2</maven-compiler-plugin.version>
<maven-resources-plugin.version>2.5</maven-resources-plugin.version>
<maven-processor-plugin.version>2.0.5</maven-processor-plugin.version>
<maven-build-helper-plugin.version>1.7</maven-build-helper-plugin.version>

<target.jdk>1.6</target.jdk>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<!-- REST -->
<resteasy.version>3.0.2.Final</resteasy.version>
<arcbees.version>1.1.1</arcbees.version>

<!-- GAE -->
<gae.version>1.8.4</gae.version>
<gae.home>${settings.localRepository}/com/google/appengine/appengine-java- 
sdk/${gae.version}/appengine-java-sdk-${gae.version}</gae.home>

<webappDirectory>${project.build.directory}/${project.build.finalName}   
</webappDirectory>
</properties>

<build>
    <outputDirectory>${webappDirectory}/WEB-INF/classes</outputDirectory>

    <plugins>



    <plugin>
        <groupId>com.google.appengine</groupId>
        <artifactId>appengine-maven-plugin</artifactId>
        <version>${gae.version}</version>
    </plugin>
  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>${maven-compiler-plugin.version}</version>
    <configuration>
      <source>${target.jdk}</source>
      <target>${target.jdk}</target>
      <encoding>${project.build.sourceEncoding}</encoding>
    </configuration>
  </plugin>

  <plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>gwt-maven-plugin</artifactId>
    <version>${gwt.version}</version>
    <configuration>
      <gwtSdkFirstInClasspath>true</gwtSdkFirstInClasspath>
      <strict>true</strict>

      <testTimeOut>180</testTimeOut>
      <includes>**/*GwtTestSuite.java</includes>
      <excludes>**/*GwtTest.java</excludes>
      <mode>htmlunit</mode>

      <extraJvmArgs>-Xss1024K -Xmx1024M -XX:MaxPermSize=256M</extraJvmArgs>
      <logLevel>INFO</logLevel>
      <style>${gwt.style}</style>

      <copyWebapp>true</copyWebapp>
      <hostedWebapp>${webappDirectory}</hostedWebapp>

      <runTarget>Sample.html</runTarget>
      <modules>
        <module>com.sample.Sample</module>
      </modules>
    </configuration>
    <executions>
      <execution>
        <goals>
          <goal>test</goal>
          <goal>compile</goal>
        </goals>
      </execution>
    </executions>
  </plugin>

 </plugins>


  </build>

  <dependencies>

      <dependency>
    <groupId>com.google.appengine</groupId>
    <artifactId>appengine-api-1.0-sdk</artifactId>
    <version>${gae.version}</version>
</dependency>
<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>servlet-api</artifactId>
    <version>2.5</version>
    <scope>provided</scope>
</dependency>

<!-- GXT -->
<!-- http://docs.sencha.com/gxt-guides/3/ -->
<dependency>
  <groupId>com.sencha.gxt</groupId>
  <artifactId>gxt</artifactId>
  <version>${gxt.version}</version>
</dependency>
<dependency>
  <groupId>com.sencha.gxt</groupId>
  <artifactId>gxt-chart</artifactId>
  <version>${gxt.version}</version>
</dependency>

<!-- Google Web Toolkit -->
<dependency>
  <groupId>com.google.gwt</groupId>
  <artifactId>gwt-user</artifactId>
  <version>${gwt.version}</version>
</dependency>

    <!-- GWT-Platform -->
    <dependency>
      <groupId>com.gwtplatform</groupId>
      <artifactId>gwtp-mvp-client</artifactId>
      <version>${gwtp.version}</version>
    </dependency>
    <dependency>
      <groupId>com.gwtplatform</groupId>
      <artifactId>gwtp-dispatch-client</artifactId>
      <version>${gwtp.version}</version>
    </dependency>
    <dependency>
      <groupId>com.gwtplatform</groupId>
      <artifactId>gwtp-dispatch-server-guice</artifactId>
      <version>${gwtp.version}</version>
    </dependency>
    <dependency>
        <groupId>com.gwtplatform</groupId>
        <artifactId>gwtp-dispatch-rest</artifactId>
        <version>${gwtp.version}</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.gwtplatform</groupId>
      <artifactId>gwtp-dispatch-shared</artifactId>
      <version>${gwtp.version}</version>
    </dependency>

    <!-- DI -->
    <dependency>
      <groupId>com.google.inject</groupId>
      <artifactId>guice</artifactId>
      <version>${guice.version}</version>
    </dependency>
    <dependency>
      <groupId>com.google.inject.extensions</groupId>
      <artifactId>guice-servlet</artifactId>
      <version>${guice.version}</version>
    </dependency>
    <dependency>
      <groupId>com.google.inject.extensions</groupId>
      <artifactId>guice-assistedinject</artifactId>
      <version>${guice.version}</version>
    </dependency>
    <dependency>
      <groupId>com.google.gwt.inject</groupId>
      <artifactId>gin</artifactId>
      <version>${gin.version}</version>
    </dependency>

    <dependency>
        <groupId>com.googlecode.gwtquery</groupId>
        <artifactId>gwtquery</artifactId>
        <version>${gwtquery.version}</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
            <groupId>com.arcbees</groupId>
            <artifactId>guicy-resteasy</artifactId>
            <version>${arcbees.version}</version>
    </dependency>

    <dependency>
       <groupId>mysql</groupId>
       <artifactId>mysql-connector-java</artifactId>
       <version>${mysql.version}</version>
    </dependency>

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

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

3.0.1
2.5.1
1
2.0.0
1.3.2
3
5.1.26
3.2.4.1发布
4.11
1.1
2.5.1
2.6
2.3.2
2.5
2.0.5
1.7
1.6
UTF-8
UTF-8
3.0.2.3最终版本
1.1.1
1.8.4
${settings.localRepository}/com/google/appengine/appengine java-
sdk/${gae.version}/appengine java sdk-${gae.version}
${project.build.directory}/${project.build.finalName}
${webappDirectory}/WEB-INF/classes
com.google.appengine
appengine maven插件
${gae.version}
org.apache.maven.plugins
maven编译器插件
${maven编译器plugin.version}
${target.jdk}
${target.jdk}
${project.build.sourceEncoding}
org.codehaus.mojo
GWTMaven插件
${gwt.version}
符合事实的
符合事实的
180
**/*gwtestsuite.java
**/*GwtTest.java
htmlunit
-Xss1024K-Xmx1024M-XX:MaxPermSize=256M
信息
${gwt.style}
符合事实的
${webappDirectory}
Sample.html
com.sample.sample
测验
编写
com.google.appengine
appengine-api-1.0-sdk
${gae.version}
javax.servlet
servlet api
2.5
假如
com.sencha.gxt
gxt
${gxt.version}
com.sencha.gxt
gxt图表
${gxt.version}
com.google.gwt
gwt用户
${gwt.version}
com.gwtplatform
gwtp mvp客户端
${gwtp.version}
com.gwtplatform
gwtp调度客户端
${gwtp.version}
com.gwtplatform
gwtp调度服务器GUI
${gwtp.version}
com.gwtplatform
gwtp调度休息
${gwtp.version}
假如
com.gwtplatform
gwtp调度共享
${gwtp.version}
com.google.inject
圭斯
${guice.version}
com.google.inject.extensions
guice servlet
${guice.version}
com.google.inject.extensions
guice助理项目
${guice.version}
com.google.gwt.inject
杜松子酒
${gin.version}
com.googlecode.gwtquery
格瓦特奎里
${gwtquery.version}
假如
com.arcbees
吉西·赖斯特轻松
${arcbees.version}
mysql
mysql连接器java
${mysql.version}
org.springframework
春季方面
${spring.version}
org.springframework
弹簧网
${spring.version}
有谁能建议一种解决这个问题的方法吗


感谢您一直阅读到最后。

您是否使用
mvn软件包
将依赖项复制到您的
目标//WEB-INF/lib
,并使用正确的WAR目录?看,我正确地使用了war目录。但是我不确定我是否
mvn包
it。谢谢你的提示。将检查此项并更新如果您没有运行
mvn包
(或类似程序,如
mvn war:explodesd
),则通常不会有
target/
)。因此,如果您正确使用war目录,就意味着您在某个时候使用了mvn包。