widgetset not found

Have made the API changes in a v6 to v7 conversion, but can’t load the application. Our app used to use the Refresher plugin, but I’ve commented all of that out as part of the transition, so my build contains no add-ons. I have these jars in pom.xml:

        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-server</artifactId>
            <version>${vaadin.version}</version>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-client-compiled</artifactId>
            <version>${vaadin.version}</version>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-themes</artifactId>
            <version>${vaadin.version}</version>
        </dependency>

Where vaadin.version is 7.2.7. When I try to load the app, I get the long pause and eventual “Failed to load widgetset” popup. Server message is:


Requested resource
[/VAADIN/widgetsets/<my_package>.WidgetSet/<my_package>.WidgetSet.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.

Am having a lot of trouble narrowing down this issue to version 7. Can someone tell me what to look for in my workspace (which, obviously, worked with version 6)? Once upon a time, I knew how to debug this.

I have a <my_package>.WidgetSet.gwt.xml file in my war file in VAADIN/widgetsets/ with these contents:

<?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" />

    <!--<inherits name="com.github.wolfie.refresher.RefresherApplicationWidgetset" /> v7 -->
</module>

Am lost about what needs to go where to load v7 apps.

Thanks,
Bobby

Ah, eventually compared this to a generated new v7 app and see that I was missing vaadin-maven-plugin for generating the widgetset into src/main/webapp/VAADIN.

Ok, next hurdle – my css file doesn’t seem to be in use. Back to digging…

Do you have a correct @Theme annotation on your UI class?

In Vaadin 7.3, it is also possible to change the theme on the fly, but I’d still recommend using @Theme where possible.

Finally figured this one out. What hurt was that it seemed to half-work sometimes (e.g. background image would load partly but not fill full screen), and I couldn’t always get the same output based on my changes. Am guessing was hitting some cached data in browser.

After moving our theme elements so they’d be under <top_level>/VAADIN/themes instead of <top_level>/WEB-INF/classes/VAADIN/themes, the piece I was missing was to change our import to load “legacy-reindeer” instead of “reindeer” and that fixed it (yes, moved to the @Theme annotation).

App looks normal again, though I’m having an issue unrelated to this thread. Will get more information and post if I can’t work through it.

Cheers,
Bobby

Henri, just a small followup question about styles. I’d like to make sure I’m understanding everything. During my build I see this (actual paths/names changed):

[INFO]
 --- vaadin-maven-plugin:7.2.7:compile-theme (default) @ <somedir> ---
[INFO]
 Updating theme VAADIN/themes/<mytheme>
[ERROR]
 /Users/bobby/work/ws/<path_stuff>/src/main/webapp/VAADIN/themes/<mytheme>/styles.scss could not be read!
[INFO]
 Theme "VAADIN/themes/<mytheme>" compiled

We have a styles.css file in VAADIN/themes/ instead of a .scss file. I assume I can ignore this error message – is that correct? Once the main v6 → v7 conversion is done we could move to a new way of handling styles, but for now I’ve already made a few thousand changes and don’t want to add more just yet. :slight_smile:

Thanks,
Bobby

I believe you could convert your css to scss and inherit from the valo theme (way better than reindeer in my opinion) you can find the tutorials here

Creating Theme using Sass
and
Valo Theme Getting Started
.

That way you get to keep you styles in addition to valo.

If you have a styles.css file in your theme, it is used. Normally, styles.scss is a very small Sass theme file that imports your theme and wraps it with a theme name selector, so all your rules would automatically start with .mytheme . However, if you want to do minimal migration first, it is ok just to import the legacy version of the old theme you used, and perhaps look at more comprehensive theme migration later.

The “full” theme migration can consist of adding two or three very short .scss files based on what the new project wizard for Vaadin 7.2 creates (Vaadin 7.3 defaults to using Valo, with a little larger a template) and renaming your current main theme file to be able to take advantage of Sass features and of limiting the scope of your theme rules on the page. At the other extreme, you could switch to Valo and potentially rewrite your custom rules (often simpler than before), or you can do anything in between these extremes.