Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gwtTemp.gwt.xml not found in classpath #7

Open
TodGilbertHarter opened this issue Feb 5, 2018 · 11 comments
Open

gwtTemp.gwt.xml not found in classpath #7

TodGilbertHarter opened this issue Feb 5, 2018 · 11 comments

Comments

@TodGilbertHarter
Copy link

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.

@nielsbaloe
Copy link
Owner

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:

  1. Vertx will serves files from the targetfolder (if none set, it will use
    "build/development" (when debug is on) or "build/production")
  2. 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").
  3. If debug, FigWheely starts and watches for changes in the sourcefolder - if so, it starts a thread at 4.
  4. VertxUI generates an index.html with a waiting sign and auto-reload, inside the targetfolder.
  5. VertxUI writes a gwTemp.gwt.xml in the sourcefolder because GWT needs that (ugly it is)
  6. GWT transpiles from the source into the targetfolder, writing stuff in targetfolder/a/....
  7. VertxUI generates an index.html which uses targetfolder/a/nocache.js
  8. Done.

Thanks for sharing what went wrong on your machine to let it work out of the box.

Best,
Niels

@nielsbaloe
Copy link
Owner

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...

@TodGilbertHarter
Copy link
Author

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).

@nielsbaloe
Copy link
Owner

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

@r-da
Copy link

r-da commented Jul 5, 2018

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:

  1. git clone https://github.com/nielsbaloe/vertxui.git
  2. cd vertxui/vertxui-core/
  3. mvn clean install
    • Error, due to doclint
  4. 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>
                ...
  1. mvn clean install
    • BUILD SUCCESS
  2. cd ../vertxui-examples/
  3. 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?

@nielsbaloe
Copy link
Owner

nielsbaloe commented Jul 5, 2018 via email

@r-da
Copy link

r-da commented Jul 6, 2018

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?

@r-da
Copy link

r-da commented Jul 9, 2018

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?

@nielsbaloe
Copy link
Owner

nielsbaloe commented Jul 9, 2018 via email

@r-da
Copy link

r-da commented Jul 9, 2018

It was a typo, I meant Java 9.

I'll try to follow your youtube videos, thanks!

Best,
Raffaele

@nielsbaloe
Copy link
Owner

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants