vertxui
vertxui copied to clipboard
gwtTemp.gwt.xml not found in classpath
Tried setting up the examples as outlined in your video (gotta say, videos are arse as documentation, but I'm not complaining, it was a lot better than nothing!) Anyway, I got a warning about gwtTemp.gwt.xml not being in the classpath, which I really have no clue what that implies when I start up any of the example servers.
Once I've started a server, invariably attempting to bring up the UI with a browser seems to fail. The Hello World example simply keeps reloading the page in a tight loop, the energy calculator couldn't find a resource at /a/something and died with a 404. I got SOMEWHERE, the server runs, it generates a default HTML and serves it up, and there aren't any error messages on the server side except that one warning at start, but honestly my understanding of how VertxUI content is being generated and served up is too fragmentary to work out what the issues might even be. I think there's some conceptual stuff here that is just assumed to be understood, but I don't even have it enough to get the context of what is happening really.
The concept is nice, transpiling a reasonable lightweight UI framework from Java. I'd use it in a heartbeat but there's got to be a way to create a more comprehensive tutorial in order to get far enough up the learning curve to be able to construct a basic working application and bootstrap myself to where I can proceed.
Hi,
Thanks for your comment.
Well, I would love to improve it so that it works out of the box. As it usually does I assume. But, I'm not sure what the issue is. There is actually nothing to explain regarding the bootstrap, it is as simple as..... starting the application. So I wonder, what did you do to get it working?
For now, I assume this explanation is missing. I'll improve it and add it to the documentation. When you start the server, this happens when the VertxUI handler is added to the webserver:
- Vertx will serves files from the targetfolder (if none set, it will use "build/development" (when debug is on) or "build/production")
- VertxUI starts looking for a sourcefolder. ("src", "src/main", "src/main/java", "src/test"or "src/test/java"). If it is found (usually is within an IDE), then it continues, otherwise we're done ("production").
- If debug, FigWheely starts and watches for changes in the sourcefolder - if so, it starts a thread at 4.
- VertxUI generates an index.html with a waiting sign and auto-reload, inside the targetfolder.
- VertxUI writes a gwTemp.gwt.xml in the sourcefolder because GWT needs that (ugly it is)
- GWT transpiles from the source into the targetfolder, writing stuff in targetfolder/a/....
- VertxUI generates an index.html which uses targetfolder/a/nocache.js
- Done.
Thanks for sharing what went wrong on your machine to let it work out of the box.
Best, Niels
If you did not get it working, can you tell me, which IDE are you using on which platform? I wonder whether there are any read/write permission issues or not...
Hi Niels, Thanks for the helpful comments. I am using Eclipse (Oxygen, I think it is pretty much up to date). So, how is 'targetfolder' determined? It seems that gwTemp.gwt.xml isn't getting written, and I am guessing that leads to nothing being generated in targetfolder/a/nocache.js Taking a wild guess, hehe, I would imagine the Maven 'target' directory is a good candidate for where the targetfolder should end up? I'm still a bit uncertain about how best to actually arrange a production application. I'm far from really getting there, but I guess that part can wait...
So, I really haven't done anything special, just basically what is in your video, imported the project(s) and set up the classpath. I see you were using Java 9, is that a requirement? I don't have a Java 9 JDK installed currently, but that isn't a big deal if I need it.
Thanks again! I think this is overall a great concept and I would MUCH rather do stuff in Java vs slogging through the arcana of Scala, or Clojure, or even bothering to learn Kotlin (and I'm not sure Kotlinjs is really all that great yet anyway).
Hi,
As mentioned in step 1, the targetfolder is "build/development" (when debug is on) or "build/production". When you didn't change a letter in the code, then debug is "on" so you can find stuff in projectfolder/build/development . It is not "target" because I'm building and running with gradle, not with maven.
Anyhow, the gwtTemp.gwt.xml is not written in the target folder. It is written in the sourcefolder of your project. The sourcefolder is dynamicly searched for as mentioned in step 2: "src", "src/main", "src/main/java", "src/test"or "src/test/java" are all tried out as base folders. One of these is default in Eclipse anyway, so you should not worry about that.
Creating a production version, would be for the client: just copy everything from "build/production" and serve those files. For the server: just create a normal executable out of the whole project (with maven or gradle, or any other builder you prefer).
In the video I was using JDK 8, but the latest is running with JDK 9. Unless Eclipse complains that you can't build, you can.
Is there an error message thrown at you? Can you share some runtime info? Because then we can step out of the theoretical stuff and actually start to get it working ;)
Super thanks! Niels
Hi Niels, I've tried to run your examples using eclipse, netbeans and even command line, without success. Steps followed, under ubuntu linux 18.04 with JDK 10.0.1 by oracle and apache-maven-3.5.2:
-
git clone https://github.com/nielsbaloe/vertxui.git
-
cd vertxui/vertxui-core/
-
mvn clean install
- Error, due to doclint
- Edit pom.xml to add -Xdoclint:none
...
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<configuration>
<additionalparam>-Xdoclint:none</additionalparam>
</configuration>
...
-
mvn clean install
- BUILD SUCCESS
-
cd ../vertxui-examples/
-
mvn clean compile
- BUILD SUCCESS
Now I have a problem. From command line I am not able to start the ExampleHelloWorld. Netbeans starts it with the following command and output:
$ mvn "-Dexec.args=-classpath %classpath live.connector.vertxui.samples.server.helloWorld.ExampleHelloWorld" -Dexec.executable=java -Dexec.classpathScope=runtime org.codehaus.mojo:exec-maven-plugin:1.5.0:exec
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building live.connector:vertxui-samples 1.01
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- exec-maven-plugin:1.5.0:exec (default-cli) @ vertxui-samples ---
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by io.netty.util.internal.PlatformDependent0$1 (file:/home/raffaele/.m2/repository/io/netty/netty-common/4.1.8.Final/netty-common-4.1.8.Final.jar) to field java.nio.Buffer.address
WARNING: Please consider reporting this to the maintainers of io.netty.util.internal.PlatformDependent0$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
lug 05, 2018 6:23:39 PM live.connector.vertxui.samples.server.AllExamplesServer lambda$start$1
INFORMAZIONI: Initialised:
http://localhost:8088/ajax
http://localhost:8088/figwheely.js
http://localhost:8088/
.Compile error(s): Loading inherited module 'gwtTemp'
[ERROR] Unable to find 'gwtTemp.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?
How can I start the examples at least from the command line?
Hi,
I'm afraid ithas not been tested with JDK 10 yet. It should work perfectly in eclipse and netbeans with JDK 9. There is something going wrong here with the reflection which has been further restricted in JDK 10, I still have to fix that I'm afraid.
Niels
Ok ... as you can see on oracle web site, jdk-9 is no more downloadable. However I have a version of jdk-9 installed on my pc, and retried the above steps, however I have the same error output as above.
Java vm:
$ java -version
java version "9.0.4"
Java(TM) SE Runtime Environment (build 9.0.4+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.4+11, mixed mode)
Error running live.connector.vertxui.samples.server.helloWorld.ExampleHelloWorld:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building live.connector:vertxui-samples 1.01
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- exec-maven-plugin:1.5.0:exec (default-cli) @ vertxui-samples ---
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by io.netty.util.internal.PlatformDependent0$1 (file:/home/raffaele/.m2/repository/io/netty/netty-common/4.1.8.Final/netty-common-4.1.8.Final.jar) to field java.nio.Buffer.address
WARNING: Please consider reporting this to the maintainers of io.netty.util.internal.PlatformDependent0$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
lug 06, 2018 11:12:17 AM live.connector.vertxui.samples.server.AllExamplesServer lambda$start$1
INFORMAZIONI: Initialised:
http://localhost:8088/ajax
http://localhost:8088/figwheely.js
http://localhost:8088/
.Compile error(s): Loading inherited module 'gwtTemp'
[ERROR] Unable to find 'gwtTemp.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?
Exactly how do you run vertxui using which JVM and IDE version? And how do you build the deployable jar?
Hi, I am still not able to run any of the examples, using java 8. Could you please write a simple step-by-step tutorial?
Hi,
You really really have to use Java 9. It is not compatible with 8 or before because the runtime model of Java changed quite a bit with Java 9.... The pom.xml files also all scream that you really need Java 9, so I am a bit surprised that you can actually fire it up using Java 8.
I can not tell you how extremely busy I am, however, when I have time I will rewrite a bit (the same runtime piece that I had to rewrite for Java 9, bleah) for Java 10 with pleasure.
There are several youtube movies that I made which show you how it works in Eclipse or in IntelliJ, see
https://www.youtube.com/watch?v=ZusasYDjMKo
https://www.youtube.com/watch?v=ctVG_8v_Fqk
Thank you for question!
Best!
Niels
It was a typo, I meant Java 9.
I'll try to follow your youtube videos, thanks!
Best, Raffaele
Can you try again with the latest sourcecode? Its all update to Java 10 now. And I had some help from rondinif ;)
Only thing I can add is, in IntelliJ, make sure that the working folder is the folder /vertxui-examples . If not, it cannot track down properly where the source is and not write down this temporary gwt file.
Can you re-check? Thanks!