Dominic Weiser
Dominic Weiser

Reputation: 1456

Vaadin 7.1.0 - DefaultWidgetSet can't be found

I am new to Vaadin and I am trying to do some Tests with this technology. I Set up my project as a Maven Project under Eclipse with a Tomcat 7 Server.

At first I started with Vaadin 7.0.0 and everything works fine. Now I change the Version from 7.0.0 to 7.1.0 because I like to test the push functionality. With Vaadin 7.0.0 everything works fine, but since I changed the Version I get the 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.

I've read that the DefaultWidget is created by Vaadin but how can I do that?

Upvotes: 0

Views: 6198

Answers (2)

Saurabh Ande
Saurabh Ande

Reputation: 427

Adding vaadin-client-compiled worked for me as mentioned in https://vaadin.com/forum/thread/2485026/2496683

<dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-client-compiled</artifactId>
        </dependency>

Upvotes: 0

Abbas
Abbas

Reputation: 3258

Unless you add new client-side components to a Vaadin project, you don't need to compile a WidgetSet. However, the default configuration of Vaadin assumes that you have one. To get past this error simply remove the <init-param> tag for the widgetset in your web.xml.

<servlet>
    <servlet-name>Your-SERVLET-NAME</servlet-name>
    <servlet-class>com.vaadin.server.VaadinServlet</servlet-class>
    <init-param>
        <param-name>UI</param-name>
        <param-value>com.example.MyUI</param-value>
    </init-param>
    <init-param>
        <param-name>widgetset</param-name>
        <param-value>another.path</param-value>
    </init-param>
</servlet>

Alternatively, you can create an .xml file in the same package (e.g. MyWSet.xml) as your UI class, and reference it in your web.xml.

MyWSet.xml in com.example package:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.7.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/1.7.0/distro-source/core/src/gwt-module.dtd">
<module>
    <inherits name="com.vaadin.DefaultWidgetSet" />
</module>

The right web.xml:

<servlet>
    <servlet-name>Your-SERVLET-NAME</servlet-name>
    <servlet-class>com.vaadin.server.VaadinServlet</servlet-class>
    <init-param>
        <param-name>UI</param-name>
        <param-value>com.example.MyUI</param-value>
    </init-param>
    <init-param>
        <param-name>widgetset</param-name>
        <param-value>com.example.MyWSet</param-value>
    </init-param>
</servlet>

Remember, you don't need the .xml suffix in your web.xml. Finally, run mvn vaadin:compile to compile this widgetset.

Upvotes: 1

Related Questions