Oleg Gelezcov
Oleg Gelezcov

Reputation: 3

Error with Maven Dependencies in PlayN project

I try learn PlayN, after creating Maven Project and adding dependency to pom.xml

enter code here
<dependency> 
  <groupId>com.threerings</groupId> 
  <artifactId>tripleplay</artifactId> 
  <version>1.0</version> 
</dependency> 

I use classes from tripleplay library for menu system, such as showed in Showcase demo project. When run project as Java application all ok, but when run as html application I got errors like this

ant.bat run-html

.... [java] com.google.gwt.dev.jjs.InternalCompilerException: Failed to get JNode [java] at com.google.gwt.dev.jjs.impl.TypeMap.get(TypeMap.java:140) [java] at com.google.gwt.dev.jjs.impl.TypeMap.get(TypeMap.java:71) [java] at com.google.gwt.dev.jjs.impl.BuildTypeMap.getType(BuildTypeMap.java:730) [java] at com.google.gwt.dev.jjs.impl.BuildTypeMap.createField(BuildTypeMap.java:570) [java] at com.google.gwt.dev.jjs.impl.BuildTypeMap.access$300(BuildTypeMap.java:99) [java] at com.google.gwt.dev.jjs.impl.BuildTypeMap$BuildDeclMapVisitor.visit(BuildTypeMap.java:180) [java] at org.eclipse.jdt.internal.compiler.ast.FieldDeclaration.traverse(FieldDeclaration.java:285) [java] at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.traverse(TypeDeclaration.java:1232) [java] at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.traverse(CompilationUnitDeclaration.java:687) [java] at com.google.gwt.dev.jjs.impl.BuildTypeMap.createPeersForNonTypeDecls(BuildTypeMap.java:637) [java] at com.google.gwt.dev.jjs.impl.BuildTypeMap.exec(BuildTypeMap.java:514) [java] at com.google.gwt.dev.jjs.impl.BuildTypeMap.exec(BuildTypeMap.java:523) [java] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.precompile(JavaToJavaScriptCompiler.java:599) [java] at com.google.gwt.dev.jjs.JavaScriptCompiler.precompile(JavaScriptCompiler.java:33) [java] at com.google.gwt.dev.Precompile.precompile(Precompile.java:284) [java] at com.google.gwt.dev.Precompile.precompile(Precompile.java:233) [java] at com.google.gwt.dev.Precompile.precompile(Precompile.java:145) [java] at com.google.gwt.dev.Compiler.run(Compiler.java:232) [java] at com.google.gwt.dev.Compiler.run(Compiler.java:198) [java] at com.google.gwt.dev.Compiler$1.run(Compiler.java:170) [java] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:88) [java] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:82) [java] at com.google.gwt.dev.Compiler.main(Compiler.java:177) [java] [ERROR] <no source info>: public class tripleplay.ui.Interface [java] extends java.lang.Object [java] /* fields */ [java] public final [unresolved] playn.core.Pointer.Listener plistener [java] public final [unresolved] playn.core.Keyboard.Listener klistener [java] protected final [unresolved] playn.core.Pointer.Listener _delegate [java] protected final [unresolved] Unresolved type react.Value<playn.core.Keyboard.Listener> _focused [java] protected final [unresolved] List<Unresolved type tripleplay.ui.Root> _roots [java] protected final [unresolved] List<Unresolved type tripleplay.ui.Root> _dispatch [java] protected final [unresolved] List<Unresolved type java.lang.Runnable> _actions what wrong? Thanks

Upvotes: 0

Views: 626

Answers (1)

samskivert
samskivert

Reputation: 3704

It's strange that the GWT compiler would crash, rather than generating a normal error message. But it looks like you need to add the tripleplay GWT module to your GWT project.

In your game you'll have a file that's named something like:

mygame/html/src/main/java/mypackage/mygame/MyGame.gwt.xml

In that file, you need to add:

<inherits name="tripleplay.TriplePlay"/>

That will let GWT know that it can and should use the TriplePlay source code when compiling things to JavaScript.

Upvotes: 2

Related Questions