Beginner: Running a simple app


Edit

If my problem description is too confusing:

What would also help if someone would just take https://github.com/samie/JavaDayRiga2011 (“Vaadin Tetris”) and create an Vaadin,Eclipse (Windows) project with it and upload the files somewhere or send me the files, then I can just compare what I am doing wrong.

Thanks!


Hello,

I am a reasonable C/C++ and assembler programmer but completely new to a framework like vaadin. Therefore even the simplest beginner task seems to confuses me:

I want to run this: https://github.com/samie/JavaDayRiga2011 (“Vaadin Tetris”)

For this I first created a Vaaden project in Eclipse.

Then I downloaded the 3 sourcefile for the Tetris game. There was a folder JavResources/src/com.example.TetrisG (TetrisG = name of my example project) automatically created.

So I thought I’d create a JavResources/src/TetrisTest folder and move the 3 source files to that via drag and drop.

But how to I tell eclipse to “run” this application now?

When I click on the project => run as => run on server I am still greeted by “Welcome Vaadin user”, the demo project output.

So I tried to modify Project → Deployment descriptor → Servlet mappings → webapp → servlet → initParam → param value from com.example.TetrisG to TetrisTest.Game which didnt do a thing.

Next I tried to just copy Game.Java over TetrisgApplication.java and added the 2 other files in the same folder. Now trying to run this the Server gives me error messages (see attached).

So: Can you tell me in simple steps how to get this very simple 3 files example to run?


Very much appreciated!

Your project is not compiling properly, evident by the little red ‘x’ in the project explorer tab. Fix that first, and report back.

The project is using some client side add-ons so you also need a custom widgetset (compiled from the .gwt.xml file) and the libraries in WebContent etc. The class Game is not a Vaadin application (nor even a component) so you cannot simply refer to it in your web.xml .

Try to add all the files to your project and the libraries on the build path of your project, click the “}>” button in the toolbar to compile the widgetset, use JavaDayDemoApplication as the application class in web.xml, make sure your web.xml contains a correct reference to a widgetset and try again. Effectively, the easiest way is to replace almost all the contents of your newly created project with the files from Git and then not try to modify anything there before getting it running once.

Note also that the Java convention is that package names should be in lowercase and usually of the form com.example.mypackage, i.e. start with reverse order domain name.