VIRIT JPA based address book demo at github.com/mstahv/jpa-addressbook

Hi,

I just started with VAADIN and I am trying to compile and run the demo at https://github.com/mstahv/jpa-addressbook with wildfly as suggested.

However, while running I get the following error:

Requested resource
[/VAADIN/widgetsets/com.vaadin.DefaultWidgetSet/com.vaadin.DefaultWidgetSet.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.

How can I solve this?

I tried adding to the pom

com.vaadin
vaadin-client-compiled
${vaadin.version}

Then I can run the demo but as the above artifact is explicitly excluded in the pom this seems not the appropiate way.

Second, the pom refers to the vwscdn-maven-plugin.
It is not clear to why what the purpose of this plug-in is.
Is there some further information?

Thanks in advance.

Hi,

The vwcdn magic is explained
here
. You should issue one “priming build” before you try to deploy your application. I’d assume you just opened the project in eclipse or intelliJ but didn’t do full build? The maven plugin creates a generated class that makes the web app use the corrent CDN widgetset automatically.

Let me know if you can’t make it work.

cheers,
matti

Hi Matti,

Thanks for the answer and the url.

I use Eclipse and did already the examples on the VAADIN site so in principle my setup works.

How do I do this priming build? Is this “mvn clean install jetty:run” as on the CND site?
Because I did “clean install wildfly:run” (the demo assumes wildfly).
It still results in
Requested resource
[/VAADIN/widgetsets/com.vaadin.DefaultWidgetSet/com.vaadin.DefaultWidgetSet.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.

Is there a way to do things locally, that is without CDN?

Thanks.

JG

Hi,

Hmm. You can pretty easily move the project to use default vaadin maven plugin and add a local widgetset, but I’d definitely like to get the CDN stuff fixed. That should make things easier and faster, not harder :frowning:

Do you have this kind of output on your build log?

Widgetset config created to /home/ubuntu/jpa-addressbook/target/generated-sources/vwscdn/in/virit/WidgetSet.java. Public URL: http://cdn.virit.in/ws/vwscdn513c627f88110c5ab1892517ca023f7c/vwscdn513c627f88110c5ab1892517ca023f7c.nocache.js

cheers,
matti

No, I do not have that output.

I have this in my pom:





org.wildfly.plugins
wildfly-maven-plugin
1.0.2.Final


in.virit.vwscdn
vwscdn-maven-plugin
1.3.4


generate-sources

generate






I added pluginmanagement tags because without them eclipse complains “Plugin execution not covered by lifecycle configuration: in.virit.vwscdn:vwscdn-maven-plugin:1.3.4:generate (execution: default, phase: generate-sources)”.

If I remove the pluginmanagement tag eclipse give an error on the maven file (see above) but still runs.
Then the widgeset properly loads.
So it seems that eclipse complains unjustified about the pom.

What is the way to include the widget for production situations. From the link you provided me I understood that
the cdn is mainly intended for development situations.

Best regards and thanks,

JG

Yep, that was the problem. From plugin management section the plugin just isn’t part of the build process and the generated class gets deleted.

The error from Eclipse is just eclipse blaiming that it don’t know what it should do to accomplish the same task (as the Maven plugin). Most often this kind of issues can be just ignored (and/or mark as ignored by eclipse) if you just make the “priming build”. Check out my
recent Maven tutorial
, that discusses e.g. this Eclipse stupidity.

For production you could at this point switch to local widgetset compilation (so that it is compiled into the war file). Then your application don’t depend on our unofficial hobby service. There is also one “hidden” parameter in vwcdn plugin (vwscdn.download) that you could set to true, which makes the plugin download the widgetset into you war file. But even then the build would still be dependent on the experimental service, although the war would be selfcontained.

Note to myself: write step by step instructions to convert vwcdn project to std.

cheers,
matti