Java Stack Training: GWT Lab #1

Support and Announcements for the Tech Java Web Application Platform (setup, configuration, bugs, feedback).
Locked
isomz
New Member
Posts: 6
Joined: Sun Jul 18, 2010 6:32 pm
Location: Hollister, California, USA

Java Stack Training: GWT Lab #1

#1

Post by isomz »

I am just getting involved with LDS Tech and I am working my way through the training material. I am having trouble running the very first lab...Pretty sad, I know. I might just have some configuration problems.

I'm running a Mac with OS X and using Firefox as my browser. Everything seems to compile OK in the IDE. But when I launch the index.html page as instructed nothing happens. I was expecting some text or something but all I see is a blank page. The browser doesn't throw out any errors. I thought it might be a popup so I disabled my popup blocker but still nothing. Any ideas on what I could be doing wrong? Any tips on troubleshooting would be greatly appreciated.
YoungstromMJ
Member
Posts: 101
Joined: Mon Mar 29, 2010 3:11 pm
Location: Utah, USA

#2

Post by YoungstromMJ »

Hello isomz, Sorry for the delay in response. We have a bunch of guys that are on vacation for fall break.

Anyway, When you do the GWT compile does Eclipse ask you for your "WAR" directory? What did you choose? src/main/webapp should work in that situation. Do you see a directory in src/main/webapp that looks like it was generated? Should have a *.nocache.js file in it?

Mike
isomz
New Member
Posts: 6
Joined: Sun Jul 18, 2010 6:32 pm
Location: Hollister, California, USA

#3

Post by isomz »

Eclipse does not ask me for a WAR directory when I compile. In the dialog that pops up when I compile it only asks to select the project, select logging and output settings and select/add Entry Point modules.

As for the output directory, the full path that contains the output files is "/Applications/LDSTech/workspace/Hello GWT World/war/org.lds.gwt.HelloWorld/." That directory contains four *.cache.html files and a single *.nocache.js file. All are updated when I compile. My "index.html" file is also in that directory along with a "hosted.html" file and a clear.cache.gif file.

Here's the output of my build:

Code: Select all

Compiling module org.lds.gwt.HelloWorld
   Compiling 4 permutations
      Compiling permutation 0...
      Compiling permutation 1...
      Compiling permutation 2...
      Compiling permutation 3...
   Compile of permutations succeeded
Linking into /Applications/LDSTech/workspace/Hello GWT World/war/org.lds.gwt.HelloWorld.
   Link succeeded
   Compilation succeeded -- 21.939s
I did some more poking around and I found the Google settings pages in the project properties dialog. In there I found a checkbox that says "This project has a WAR directory." That checkbox was not checked. However, when I check it and attempt to select a WAR directory I do not see the path that you suggested. When I pick something else, I get an error telling me that the "web.xml file does not exist" in the selected path.

I hope some of this information is helpful. Thanks for your patience.
WheelerMM
Church Employee
Church Employee
Posts: 8
Joined: Mon Mar 29, 2010 3:39 pm
Location: United States, Salt Lake City, Utah

#4

Post by WheelerMM »

Ok, try this. In your index.html file change the src attribute of your script file from src=".nocache.js" to src="org.lds.gwt.HelloWorld.nocache.js". Recompile and then try viewing the page again. Let me know if that doesn't do it for you.

Matt W.
isomz
New Member
Posts: 6
Joined: Sun Jul 18, 2010 6:32 pm
Location: Hollister, California, USA

#5

Post by isomz »

I replaced the src attribute in the script tag like you suggested, but still no dice. I get the same behavior. Everything compiles OK, but no message when I open the HTML page.
WheelerMM
Church Employee
Church Employee
Posts: 8
Joined: Mon Mar 29, 2010 3:39 pm
Location: United States, Salt Lake City, Utah

#6

Post by WheelerMM »

Can you verify that you are changing the index.html page in src/org/lds/gwt/public folder, and not the one in the war directory? If you change the one in the war, when you compile, it will be overridden by the one in src/org/lds/gwt/public. That said, you could possibly change the one in the war folder and then not compile, but for good measure I would do it the other way. If you did make the changes in the src/org/lds/gwt/public folder and it still doesn't work, we will try some other options.

Thanks,
Matt W.
isomz
New Member
Posts: 6
Joined: Sun Jul 18, 2010 6:32 pm
Location: Hollister, California, USA

#7

Post by isomz »

Thanks for your help. I finally got it working.

I was closely inspecting the index.html file and I noticed that the part of the script tag in question was in double double quotes:

src=""org.lds.GWT.HelloWorld.nocache.js""

When I removed one set of quotes, it worked.

Then, I tried going back to just ".nocache.js" and that still does not work.

Does this indicate that there is something amiss with my settings?
WheelerMM
Church Employee
Church Employee
Posts: 8
Joined: Mon Mar 29, 2010 3:39 pm
Location: United States, Salt Lake City, Utah

#8

Post by WheelerMM »

No problem. I am glad it is working. The org.lds.gwt.HelloWorld.nocahce.js contains the js resulting from your compile. I would not expect .nocache.js to work - and think that it is probably just the default value placed in that file when it is created. I think your settings are ok, and that the steps we outlined somehow do not trigger this value to be inserted in the src attribute automatically. I tested the lab myself and got the same result you did. I am not sure if the plugin changed since we wrote the training, or if we just overlooked this, but regardless, I think it is an issue on our side, and I will file a bug for it. We will plan to either modify the training documentation to have people add that as one of the steps, or make it so that it is added automatically by the GWT plugin while executing the other steps.

Thanks,
Matt W.
Locked

Return to “Java Web Project Support (Stack)”