Problems trying to compile HTML version

Anything libgdx related goes here!

Problems trying to compile HTML version

Postby doomtoo » Mon Apr 30, 2012 7:16 am

I used the setup-ui to create a new project, made sure it compiled and ran in Java/Desktop, Android, HTML, then imported my source files from an existing project into it.

I have the Desktop, and Android version working now, but now having issues with getting the HTML version compiling/ running.

When I try to use Google->GWT Compile, I get in the console:

Code: Select all
[ERROR] Errors in 'file:/C:/android/workspace/AckmiDressUp/AckmiDressUp/src/com/ackmi/ackmi_dress_up/Game.java'
[ERROR] Line 767: No source code is available for type javax.xml.parsers.SAXParserFactory; did you forget to inherit a required module?
....
[ERROR] Errors in 'file:/C:/android/workspace/AckmiDressUp/AckmiDressUp/src/com/ackmi/ackmi_dress_up/GameScreen.java'
[ERROR] Line 151: No source code is available for type aurelienribon.tweenengine.TweenManager; did you forget to inherit a required module?
...


And when I go to Debug As -> Web application I get in the console:

Code: Select all
Caused by: java.lang.ClassNotFoundException: aurelienribon.tweenengine.Tweenable
   at com.google.gwt.dev.shell.CompilingClassLoader.findClass(CompilingClassLoader.java:1061)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)


I know it is having problems with the tweenable jar class I am using, and possibly the SAXParseFactory, but I am not sure what is going wrong, if it's something I need to change, limitations of jars being included, ect.

I've tried adding the tweenable jar to the buildpath library, import statements for the class in 'GWTLauncher', but nothing has changed.
(using latest nightlies, superjumper compiled fine for all projects)
Any ideas?
Check out my website, and let me know what kind of tutorials you want!
http://www.chrismweb.com
doomtoo
 
Posts: 143
Joined: Mon Jun 13, 2011 6:03 am
Location: Arizona

Re: Problems trying to compile HTML version

Postby Obli » Mon Apr 30, 2012 7:40 am

Actually, you need to understand how GWT works: it translates your java source files into javascript files. What is important here is that it translates SOURCE files. GWT doesn't care for compiled .class files, only eclipse does. GWT needs sources, so it can read them and translate them.

How does it works?
Two options:
  • You can put all the source files in the "client" directory of the GWT project.
  • You can reference external libraries/projects from your GWT project. However, these external things require a module definition for GWT to be able to link them. Libgdx already has it built-in, that's why you can link it to your project. The other libraries you are using do not have one, so they are unusable.

However, I can help you solve the latest issue: you seem to use a very old release of the engine (aurelienribon.tweenengine.Tweenable doesn't exist anymore). The latest version includes a module definition, so you can still use it as an external jar. You only need to put a new "inherit" line in your module definition (the .gwt.xml file) pointing to "aurelienribon.tweengine".
Obli
 
Posts: 616
Joined: Mon Jan 10, 2011 6:18 pm
Location: Bordeaux, France

Re: Problems trying to compile HTML version

Postby doomtoo » Tue May 01, 2012 4:57 am

Thanks, that helps. I updated the Tween engine (thanks for the link), I had updated all the jars, but for some reason it was not recompiling and still using the deleted version.

I am not finding much info on getting the SAX Parser working with GWT, or source for it to add to the project. It is in:
javax.xml.parsers.SAXParser;
javax.xml.parsers.SAXParserFactory;

But if I can find the source code for those, and put it in the "client" folder it should work? Any resources you could recommend for understanding how it works better? ;)


Thanks!
Check out my website, and let me know what kind of tutorials you want!
http://www.chrismweb.com
doomtoo
 
Posts: 143
Joined: Mon Jun 13, 2011 6:03 am
Location: Arizona

Re: Problems trying to compile HTML version

Postby Obli » Tue May 01, 2012 8:50 am

As many of us, you're discovering that working with GWT is the most painful thing in the world :p
Actually, it seems that GWT caches pretty much everything, and I never found where. Replacing a library doesn't update its files and GWT continues to use the old version. I created dozens of new projects before making it working properly...

For the SAX parser, yo may want to look to the Apache Xerces implementation of it: http://xerces.apache.org/xerces-j/
You can also try to replace it with the libgdx XmlReader class.
Obli
 
Posts: 616
Joined: Mon Jan 10, 2011 6:18 pm
Location: Bordeaux, France


Return to Libgdx

Who is online

Users browsing this forum: Bing [Bot], ItemRendaro and 6 guests