以下是尝试在Maven中运行Errai时看到的错误:

$mvn gwt:run-codeserver -Dgwt.bindAddress=0.0.0.0 -Dgwt.module=app.App


我的依赖项可能缺少什么?当我运行时:

$mvn gwt:run


没问题,应用程序运行正常。

错误:

[INFO] Caused by: java.lang.NoClassDefFoundError: org.jboss.errai.marshalling.client.api.MarshallerFactoryImpl
[INFO]  at com.google.gwt.dev.jjs.impl.UnifyAst.searchForTypeBySource(UnifyAst.java:983)
[INFO]  at com.google.gwt.dev.jjs.impl.UnifyAst.access$1500(UnifyAst.java:120)
[INFO]  at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.handleGwtCreate(UnifyAst.java:364)
[INFO]  at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.handleMagicMethodCall(UnifyAst.java:433)
[INFO]  at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.endVisit(UnifyAst.java:237)
[INFO]  at com.google.gwt.dev.jjs.ast.JMethodCall.traverse(JMethodCall.java:243)
[INFO]  at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:361)
[INFO]  at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:273)
[INFO]  ... 44 more
[INFO]       [ERROR] at MarshallerFramework.java(42): GWT.create(MarshallerFactory.class)
[INFO]          com.google.gwt.dev.jjs.ast.JMethodCall
[INFO]       [ERROR] at MarshallerFramework.java(42): (MarshallerFactory) GWT.create(MarshallerFactory.class)
[INFO]          com.google.gwt.dev.jjs.ast.JCastOperation
[INFO]       [ERROR] at MarshallerFramework.java(42): MarshallerFramework.marshallerFactory = (MarshallerFactory) GWT.create(MarshallerFactory.class)
[INFO]          com.google.gwt.dev.jjs.ast.JBinaryOperation
[INFO]       [ERROR] at MarshallerFramework.java(42): MarshallerFramework.marshallerFactory = (MarshallerFactory) GWT.create(MarshallerFactory.class)
[INFO]          com.google.gwt.dev.jjs.ast.JExpressionStatement
[INFO]       [ERROR] at MarshallerFramework.java(40): {
[INFO]   InitVotes.waitFor(MarshallerFramework.class);
[INFO]   MarshallerFramework.marshallerFactory = (MarshallerFactory) GWT.create(MarshallerFactory.class);
[INFO]   ParserFactory.registerParser(new MarshallerFramework$1());
[INFO]   InitVotes.voteFor(MarshallerFramework.class);
[INFO] }
[INFO]          com.google.gwt.dev.jjs.ast.JBlock
[INFO]       [ERROR] at MarshallerFramework.java(37): {
[INFO]   Object.$clinit();
[INFO]   {
[INFO]     InitVotes.waitFor(MarshallerFramework.class);
[INFO]     MarshallerFramework.marshallerFactory = (MarshallerFactory) GWT.create(MarshallerFactory.class);
[INFO]     ParserFactory.registerParser(new MarshallerFramework$1());
[INFO]     InitVotes.voteFor(MarshallerFramework.class);
[INFO]   }
[INFO] }
[INFO]          com.google.gwt.dev.jjs.ast.JBlock
[INFO]       [ERROR] at MarshallerFramework.java(37): {
[INFO]   Object.$clinit();
[INFO]   {
[INFO]     InitVotes.waitFor(MarshallerFramework.class);
[INFO]     MarshallerFramework.marshallerFactory = (MarshallerFactory) GWT.create(MarshallerFactory.class);
[INFO]     ParserFactory.registerParser(new MarshallerFramework$1());
[INFO]     InitVotes.voteFor(MarshallerFramework.class);
[INFO]   }
[INFO] }
[INFO]          com.google.gwt.dev.jjs.ast.JMethodBody
[INFO]       [ERROR] at MarshallerFramework.java(37): private static final void $clinit();
[INFO]
[INFO]          com.google.gwt.dev.jjs.ast.JMethod
[ERROR] [INFO] [ERROR] Compiler returned false
com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries)
[ERROR]     at com.google.gwt.dev.codeserver.Recompiler.compile(Recompiler.java:93)
[ERROR]     at com.google.gwt.dev.codeserver.ModuleState.<init>(ModuleState.java:54)
[ERROR]     at com.google.gwt.dev.codeserver.CodeServer.start(CodeServer.java:88)
[ERROR]     at com.google.gwt.dev.codeserver.CodeServer.main(CodeServer.java:51)

最佳答案

您缺少对代码服务器的依赖,它是:com.google.gwt.gwt-codeserver

我个人在通过Maven运行它时遇到了问题。我改用eclipse run:
名称:GWT_CODESERVER
主要类别:com.google.gwt.dev.codeserver.CodeServer
参数:-workDir ../.codeserver -src src/main/java yourpackage.YourModule
VM ARGS:-Xms750m -Xmx750m -XX:PermSize=200M -XX:MaxPermSize=200M
CLASSPATH:(external jar) gwt-codeserver.jar

关于java - 在SuperDevMode(Maven)中运行时出错,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/16709327/

10-12 20:37