Vaadin: failed to load widgetset.nocache.js

Marius Manastireanu picture Marius Manastireanu · Jan 11, 2014 · Viewed 29.1k times · Source

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? :)

Answer

atmo picture atmo · Jan 12, 2014

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.