Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vaadin: failed to load widgetset.nocache.js

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

like image 327
Marius Manastireanu Avatar asked Jan 11 '14 19:01

Marius Manastireanu


Video Answer


1 Answers

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.

like image 92
atmo Avatar answered Sep 22 '22 08:09

atmo