16

I'm using Vaadin 6.8.2 and Maven to develop an application.

I've tried to add the Calendar add-on (1.3.0 - the version for Vaadin 6) to my project by following step by step the tutorial from this link: https://vaadin.com/book/vaadin6/-/page/addons.maven.html

However, I when I try to load my application in browser I get the following error:

Failed to load the widgetset: /myproject/VAADIN/widgetsets/my.company.ProjectWidgetSet/my.company.ProjectWidgetSet.nocache.js

If I look in the console, I see this:

INFO: Requested resource [VAADIN/widgetsets/my.company.ProjectWidgetSet/my.company.ProjectWidgetSet.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.

Did you run in similar problems? Any help, please? :)

Marius Manastireanu
  • 2,461
  • 5
  • 19
  • 29

4 Answers4

13

You need to compile your widgetset. To enable it, you need something like this in your pom:

        <!-- vaadin update widgetset step 1: need (re)build? -->
        <plugin>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-maven-plugin</artifactId>
            <version>1.0.2</version>
            <executions>
                <execution>
                    <goals>
                        <goal>update-widgetset</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

        <!-- vaadin update widgetset part 2: compile -->
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>gwt-maven-plugin</artifactId>
            <version>2.3.0-1</version>
            <configuration>
                <webappDirectory>src/main/webapp/VAADIN/widgetsets</webappDirectory>
                <extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>
                <runTarget>clean</runTarget>
                <hostedWebapp>${project.build.directory}/${project.build.finalName}</hostedWebapp>
                <noServer>true</noServer>
                <port>8080</port>
                <soyc>false</soyc>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>resources</goal>
                        <goal>compile</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

When in place, recompile your app. You should see something similar to what is described in chapter 15.5.3 following the link you provided. It takes some time to compile the widgetset, so it cannot go unnoticed.

You also need a ProjectWidgetSet.gwt.xml and a reference to it in web.xml, but since the error message you are getting already mentions ProjectWidgetSet (as opposed to DefaultWidgetset), I am guessing you already did that.

atmo
  • 403
  • 3
  • 6
  • I don't get it. I had similar plugins declared in the pom.xml file (because I created the project with vaadin-archetype), I also had the custom .gwt.xml file declared and referecened in the web.xml file, and it didn't work. However, I copied your declarations for the pom.xml.. and it worked.. Thanks atmo for taking the time to help me! I appreciate it :) – Marius Manastireanu Jan 12 '14 at 11:35
9

I had the same problem 'Failed to load the widgetset: ' and it came up when I tried to run the Vernotologist demo application by fetching from svn. To solve this:

  1. Goto your gwt.xml file and make sure it is selected in the project explorer in eclipse
  2. Make sure your Vaadin in eclipse plugin is installed
  3. Find the Compile Widgetset Button in Eclipse Toolbar which comes as part of the vaadin plugin and looks like a gear. Click it
  4. Step 3 will compile the widget set for you
  5. Restart server and re-run your application

Source: 16.2.2. Compiling the Widget Set from Book of Vaadin at this link: https://vaadin.com/book/-/page/gwt.eclipse.html

flavio.donze
  • 7,432
  • 9
  • 58
  • 91
Zeecitizen
  • 91
  • 1
  • 4
3

This is an old thread but in more recent versions of Vaadin (7.x.x) the solution is quite different. No GWT plugin needed:

<plugin>
    <groupId>com.vaadin</groupId>
    <artifactId>vaadin-maven-plugin</artifactId>
    <configuration>
        <extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>
        <webappDirectory>${basedir}/src/main/webapp/VAADIN/widgetsets</webappDirectory>
        <hostedWebapp>${basedir}/src/main/webapp/VAADIN/widgetsets</hostedWebapp>
        <noServer>true</noServer>
        <draftCompile>false</draftCompile>
        <style>OBF</style>
        <compileReport>true</compileReport>
        <runTarget>http://localhost:8080/</runTarget>
        <widgetsetMode>cdn</widgetsetMode>
    </configuration>
    <executions>
        <execution>
            <goals>
                <goal>compile-theme</goal>
                <goal>update-widgetset</goal>
                <goal>compile</goal>
            </goals>
        </execution>
    </executions>
</plugin>

Also, make sure your ProjectWidgetSet.gwt.xml is inside resources/my/company/ folder before compiling the above.

GiovanyMoreno
  • 389
  • 3
  • 13
-2

I had same problem "failed to load widgetset.nocache.js" but I solved it by reinstalling the "vaadin" plugin

steps : 1) help -> eclipse market place -> search for vaadin ->(if it is already installed)uninstall it and again install it by clicking on the "installed" button 2)recompile the project and run it