Maven and vaadin and add-ons, oh my!

I have been struggling with using an add-in (codemirror) in a vaadin project controlled by maven. It appears, that if I do a gwt:compile, it finds the add-on and compiles the widgetset, but the js files get put in the target/ZYZ folder, where XYZ is the folder I put in web.xml, as follows:

widgetset XYZ

When I run mvn tomcat:run, it appears that the browser is looking for the js files in the VAADIN/XYZ/… tree.

  1. Where is this mapping configured?
  2. Does anyone have an example (complete!!) pom file that has everything properly configured for vaadin 6.6.2, to compile the widgetsets in the correct (package?) goal?

It seems that most of what I have found has been for older versions…

Thanks!

Vaadin looks like the answer to our UI development! (Now I just have to make it work :)> )

Can anyone tell me how to change the status so it shows “waiting for answer”?

Thanks.

OK, I think I’m getting closer. mvn package is now deploying the js files to the correct location.

$ ls -al target/mapper-gui-1.0/VAADIN/

total 16

drwxr-xr-x 4 erics erics 4096 Jun 21 13:52 .

drwxr-xr-x 6 erics erics 4096 Jun 21 14:18 …

drwxr-xr-x 3 erics erics 4096 Jun 21 13:49 themes

drwxr-xr-x 4 erics erics 4096 Jun 21 13:54 widgetsets

$ ls -al target/mapper-gui-1.0/VAADIN/widgetsets/com.novexinc.mapper.MyAppWidgetSet/com.novexinc.mapper.MyAppWidgetSet.nocache.js

-rw-r–r-- 1 erics erics 6366 Jun 21 13:54 target/mapper-gui-1.0/VAADIN/widgetsets/com.novexinc.mapper.MyAppWidgetSet/com.novexinc.mapper.MyAppWidgetSet.nocache.js

$

However!!

When I hit the server, I get:

com.vaadin.terminal.gwt.server.AbstractApplicationServlet serveStaticResourcesInVAADIN

INFO: Requested resource [VAADIN/widgetsets/com.novexinc.mapper.MyAppWidgetSet/com.novexinc.mapper.MyAppWidgetSet.nocache.js]
not found from filesystem or through class loader. Add widgetset and/or theme JAR to your classpath or add files to WebContent/VAADIN folder.

I can get the content from the VAADIN/themes folder but not the VAADIN/widgetsets folder.

This is after running mvn clean package tomcat:run which uses an internal tomcat server, so there should not be anything cached.

Any help would be appreciated!

An update: mvn jetty:run works! However, mvn tomcat:run does not. Sigh…

OK… I’m down to this:
When I do mvn jetty:run , everything seems to work.
If I do tomcat:run, I get the error:
Jun 22, 2011 10:58:45 AM com.vaadin.terminal.gwt.server.AbstractApplicationServlet serveStaticResourcesInVAADIN

INFO: Requested resource [VAADIN/widgetsets/MyAppWidgetSet/MyAppWidgetSet.nocache.js]
not found from filesystem or through class loader. Add widgetset and/or theme JAR to your classpath or add files to WebContent/VAADIN folder.

Note that the browser is actually requesting:
http:/myhost:8080/myapp/VAADIN/widgetsets/MyAppWidgetSet/MyAppWidgetSet.nocache.js where myapp is the context root of my application. This produces an error.

If I request:
http:/myhost:8080/VAADIN/widgetsets/MyAppWidgetSet/MyAppWidgetSet.nocache.js (without /myapp) I get the file.

What’s weird, is that requesting:
http://myhost:8080/myapp/VAADIN/themes/myapptheme/styles.css works.

So, I have concluded that there is some kind of mapping error running vaadin in tomcat, but I’m not sure what to do about it…
My web.xml has the following (default) mapping:

Vaadin Application Servlet
/*

I know it’s something simple/stupid, but I can’t figure out why the VAADIN/themes folder is accessable, but the VAADIN/widgetsets folder is not. They both exist.

Please help if you can… I have had no replies to this thread whatsoever.

I ran into this problem a couple of times too… could be an eclipse problem. One time I fixed it by creating a new theme folder and setting it in the application… very strange! If you have further infos, workarounds or whatsoever please share

I’ve also experienced this problem; i.e.

The VAADIN/themes folder is accessable, but the VAADIN/widgetsets folder is not. They both exist.

I find that Jetty does
not
have this problem only the
J2EE edition of Eclipse’s embedded Tomcat support
. This is the one mentioned in the Vaadin book, for example.

However, for Tomcat fans, I found that this Eclipse plugin does work:

http://www.eclipsetotale.com/tomcatPlugin.html

  • and this has the benefit that it notices immediate changes to compiled Eclipse classes without any noticeable delay in re-deployment because it does some class hotswapping magic.

(Plus integrated debugging with the Eclipse debug client, of course).