Compiling VaadinVisualizations2.1.jar and the canvaswidget-1.1.jar in Ant

Hello All,
I am new ant and vaadin. I have used VaadinVisualizations2.1.jar and the canvaswidget-1.1 in my project and want to now build an ant file to compile the widgetsets. I have used
this
to get the basics, but it doesnt seem a lot of help at the moment. Because I am using the above jars I also have gwt-visualization.jar and gwt-incubator-20101117-r1766.jar too. I am using the foolowing ant scripts:

I am getting an error when I try to run the compile-widgetset task. Error is:
Error: Could not find or load main class com.google.gwt.dev.Compiler
Can anybody please tell me what I am doing wrong? What should I be doing? Thank you!

-Madz

I was able to solve the aboeve problem by adding gwt-user and gwt-dev jars. However, I have some doubts:

  • WHat I don’t understand is that the does Vaadin built in compiler for widgetsets uses GWT Compiler?
    I had not included the gwt-user and gwt-dev jars and if I used the widgetset compiler it compiled without complaining.
    then why do I have to include them now?

  • Is there anything that I should change? Please help! I am having gut feeling that I am doing something wrong! As my ant files are still not buiding

For the first point, if you mean the Vaadin plug-in for Eclipse, it automatically downloads those JARs and uses them on the classpath of widgetset compilation. In addition, all client side source code (whether used directly or indirectly) needs to be on the classpath of the GWT compiler.

For the second, what is not working with the Ant script you are using? What errors are you getting?

I am able to compile the widgetset now, however when i try to load the war on the browser it says:
Failed to load the widgetset:
MyProject.gui.widgetset.MyProjectWidgetset.nocache.js?1336051769998

Check where your ant script outputs the compiled widgetset (${client-side-destination}) - maybe it is not output to the correct location (e.g. incorrect project directory) or it is not deployed on the server. Note that the GWT compilation also produces other (debugging etc.) output, which is not required at run-time and might go to a different directory so you might have two or three directories with the name of your widgetset, one of which contains the actual JavaScript files.

Hello Henri,

Thank you for your reply, I was deleting the generated files in my ant file and thats the reason the war never had the js file. When I used the firebug I realised that the script is not getting loaded and rechecked the whole thing. Problem is now solved. Also, if all the files that are generated by the GWT Compiler is not required, then which one of these are safe to be deleted?
I have folder containing the script file and another folder that contains tha symbolmaps and rpcPolicyManifest. I believe that the latter (the one with the symbolmaps and rpcPolicyManifest) is safe to be deleted?

Thank you once again for your kind reply. :slight_smile:

Yes, the latter is not needed - those directories exists to support debugging already deployed applications and for GWT RPC, but GWT RPC is not used with Vaadin and in most cases you’ll want to do debugging locally using different techniques. In any case, they do not need to be deployed with the application.

Thanks a million :slight_smile: