Marius Manastireanu
Marius Manastireanu

Reputation: 2576

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

Upvotes: 16

Views: 32737

Answers (5)

SonjaJan
SonjaJan

Reputation: 9

Please check your WEB-INF/config I just took "WEB-INF/config" from working magnolia project and it help me to loose that annoying vaadin error.

Upvotes: 0

user11022909
user11022909

Reputation: 1

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

Upvotes: -2

GiovanyMoreno
GiovanyMoreno

Reputation: 429

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.

Upvotes: 3

Zeecitizen
Zeecitizen

Reputation: 91

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

Upvotes: 9

atmo
atmo

Reputation: 403

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.

Upvotes: 13

Related Questions