2

How do I get rid of this error:

java.lang.ClassNotFoundException: com.google.gwt.junit.server.JUnitHostImpl
[ERROR]     at java.net.URLClassLoader$1.run(URLClassLoader.java:359)
[ERROR]     at java.net.URLClassLoader$1.run(URLClassLoader.java:348)
[ERROR]     at java.security.AccessController.doPrivileged(Native Method)
[ERROR]     at java.net.URLClassLoader.findClass(URLClassLoader.java:347)
[ERROR]     at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
[ERROR]     at com.google.appengine.tools.development.IsolatedAppClassLoader.loadClass(IsolatedAppClassLoader.java:213)

I've tried:

  • mvn clean
  • Eclipse project clean

But still the error is there.

4

2 回答 2

1

我删除了:

<inherits name='com.google.gwt.junit.JUnit'/>

从我的 *.gwt.xml 和

<servlet>
    <servlet-name>jUnitHostImpl</servlet-name>
    <servlet-class>com.google.gwt.junit.server.JUnitHostImpl</servlet-class>
</servlet>
<servlet-mapping>
    <servlet-name>jUnitHostImpl</servlet-name>
    <url-pattern>/MyProject/junithost/*</url-pattern>
</servlet-mapping>

按照这个答案的建议,从我的 web.xml 解决这个问题。

于 2015-01-29T19:41:25.337 回答
-2

我发现问题出在maven-war-plugin插件上:

         <plugin>
            <!-- Copies static web files from src/main/webapp to target/${webappDirectory} -->
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.1.1</version>
            <executions>
               <execution>
                  <!-- the exploded goal gets executed during compile phase -->
                  <phase>compile</phase>
                  <goals>
                     <goal>exploded</goal>
<!--                      <goal>war</goal> -->
                  </goals>
               </execution>
            </executions>
            <configuration>
            <failOnMissingWebXml>false</failOnMissingWebXml>
                <warName>${project.artifactId}</warName>
                <!-- Exclude GWT client local classes from the deployment, lest
                classpath scanners such as Hibernate and Weld get confused when the webapp 
                is bootstrapping. -->
                <packagingExcludes>**/javax/**/*.*,**/client/local/**/*.class</packagingExcludes>
                <warSourceExcludes>WEB-INF/web.xml</warSourceExcludes>             
                <!-- the exploded war structure ends up in target/${webappDirectory} -->
                <webappDirectory>${webappDirectory}</webappDirectory>
            </configuration>
         </plugin>

我从这里复制了这个配置:

https://github.com/errai/errai/blob/master/errai-jpa/demos/errai-jpa-demo-todo-list/pom.xml

作为在 CapeDwarf 环境中运行我的 Errai 应用程序的假定修复程序。

于 2013-05-10T01:48:32.687 回答