Maven Vaadin vaadin-archetype-sample issue.

Hello,

I’ve seen various forms of this error on other posts, but none of the resolutions seem to fit for my issue. I’m trying to add some add-ons to my existing Vaadin application. But before doing that, I just want to build the sample as a first attempt at using add-ons. I end up in an identical error on both my linux machine and my windows machine. I’ll indicate the steps followed by the error.

Enviroment:

Apache Maven 3.0.4 (r1232337; 2012-01-17 11:44:56+0300)
Maven home: C:\Program Files\Apache Software Foundation\apache-maven-3.0.4
Java version: 1.7.0_07, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.7.0_07\jre
Default locale: en_US, platform encoding: Cp1252
OS name: “windows 7”, version: “6.1”, arch: “x86”, family: “windows”

Commands:
– First I build the project (I realize the parameters below should be customized, it doesn’t matter for the example.)

mvn archetype:generate -DarchetypeGroupId=com.vaadin -DarchetypeArtifactId=vaadin-archetype-sample -DarchetypeVersion=LATEST -DgroupId=your.company -DartifactId=project-name -Dversion=1.0 -Dpackaging=war 

– I modify POM.xml to use Java 1.7. And modify the maven compiler plugin to explicitly set a version so that maven does not complain


...
 <plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-compiler-plugin</artifactId>
   <configuration>
     <source>1.7</source>
     <target>1.7</target>
     <compilerVersion>1.7</compilerVersion>
   </configuration>
   <version>2.5.1</version>
 </plugin>
...

– Then I run the add-on compilation sequence


mvn gwt:clean
mvn vaadin:update-widgetset
mvn gwt:compile
mvn package
mvn jetty:run

Error:

Once I load http://localhost:8080/project-name I get the following error:

I notice that the colorpicker isn’t in the deployement folder’s lib directory so I add

    
<dependency>
   <groupId>org.vaadin.addons</groupId>
   <artifactId>vaadin-colorpicker</artifactId>
   <version>1.1.0</version>
</dependency>

to the pom. And then run the commands again, this time the jar is in the lib folder. But the error is still the same.

I think my web.xml and *.gwt.xml files are correct… well they are as the vaadin-archetype-sample set them.

Web.xml


<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
    <display-name>Vaadin Web Application</display-name>
    <context-param>
        <description>Vaadin production mode</description>
        <param-name>productionMode</param-name>
        <param-value>false</param-value>
    </context-param>
    <servlet>
        <servlet-name>Vaadin Application Servlet</servlet-name>
        <servlet-class>com.vaadin.terminal.gwt.server.ApplicationServlet</servlet-class>
        <init-param>
            <description>Vaadin application class to start</description>
            <param-name>application</param-name>
            <param-value>your.company.ColorPickerApplication</param-value>
        </init-param>
        <init-param>
            <param-name>widgetset</param-name>
            <param-value>your.company.gwt.ColorPickerWidgetSet</param-value>
        </init-param>
    </servlet>
    <servlet-mapping>
        <servlet-name>Vaadin Application Servlet</servlet-name>
        <url-pattern>/*</url-pattern>
    </servlet-mapping>
</web-app>

ColorPickerWidgetSet.gwt.xml


<module>
	<!-- Inherit DefaultWidgetSet -->
	<inherits name="com.vaadin.terminal.gwt.DefaultWidgetSet" /> 
	<!-- WidgetSet default theme -->	
	<stylesheet src="colorpicker/styles.css"/>  
</module>

Going to the address [quote]
http://localhost:8080/project-name/VAADIN/widgetsets/your.company.gwt.ColorPickerWidgetSet
[/quote] Give the following list:

which I guess should tell me that the compilation process may have worked and the configuration is f*ed up somewhere. There are no [ERROR]
or [WARNING]
lines from maven except the ones from mvn:update-widgetset which I understand is ok.

A zip of the cleaned project is attached.

My gratitude to anyone that can help before I loose my sanity.
12534.zip (15.4 KB)

So changing

mvn vaadin:update-widgetset

to

mvn vaadin:update-widgetset install

magically makes it work. I’m guessing the install puts some files somewhere so they are accessible. Does anyone have an explanation for me? Thanks.

This sounds quite strange - and it working after “install” excludes a lot of potential causes.

Check your widgetset compilation log to see if the color picker was actually included. Then see if there are multiple copies of the compiled widgetset in your project (e.g. under target).

Maybe your classpath order is such that source folders and the classes folder are in the wrong order, although normally that should not happen with Maven.
There will be two copies of the .gwt.xml file, one under src/… and the other under target/… and normally the target should update the one in the source directory before it is copied to target.