2013-05-09 90 views
2

如何摆脱这种错误的:ClassNotFoundException的:com.google.gwt.junit.server.JUnitHostImpl

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) 

我已经试过:

  • mvn clean
  • Eclipse项目清理

但仍然存在错误。

+0

你缺少含'com.google.gwt.junit.server.JUnitHostImpl' – 2013-05-09 19:04:43

+0

罐子有没有问题的足够信息。您可以包括pom.xml中也说哪个Maven的目标(S)你想执行? – 2013-05-10 13:22:07

回答

-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应用。

+5

对于这个答案是对别人有用,你必须至少说你从默认的,以及为什么改变什么。 – 2013-05-10 13:24:13

+0

我同意@JonathanFuerth。这将是非常有益的,如果发生了什么变化,你会召唤出。 – Jonathan 2014-01-10 19:53:52

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中解决这个问题的建议,this answer

相关问题