Starting with Vaadin 7

Hi there,
We have been working with Vaadin 6 and Netbeans for a while now and we are really happy sofar.

Now we are trying to setup and run Vaadin 7 applications, but it is becoming a headache since we are not able to compile the widgetset.

Here is my output. Apparently we are using incompatible versions from what I have learned from other posts.

Would be great if someone could give a hint.
Many thanks in advance.

Find attached the POM file.

I am using Netbeans 8.0 + Vaadin 7.0 (tried 7.4.3 before but had same bad luck)

The error info is huge as usual, so I paste only some lines which should give an idea to an experienced user:

cd C:\Users\Xavier\Documents\NetBeansProjects\mavenproject5; “JAVA_HOME=C:\Program Files\Java\jdk1.7.0_25” cmd /c “""C:\Program Files\NetBeans 8.0.2\java\maven\bin\mvn.bat" -Dmaven.ext.class.path="C:\Program Files\NetBeans 8.0.2\java\maven-nblib\netbeans-eventspy.jar" -Dfile.encoding=UTF-8 vaadin:compile"”
Scanning for projects…


Building Vaadin Web Application 1.0-SNAPSHOT

vaadin-maven-plugin:7.0-SNAPSHOT:compile (default-cli) @ mavenproject5 >>>

— maven-resources-plugin:2.5:resources (default-resources) @ mavenproject5 —
[debug]
execute contextualize
Using ‘UTF-8’ encoding to copy filtered resources.
Copying 0 resource

— vaadin-maven-plugin:7.0-SNAPSHOT:resources (default) @ mavenproject5 —
auto discovered modules [com.mycompany.mavenproject5.AppWidgetSet]

1 source files from GWT module com.mycompany.mavenproject5.AppWidgetSet

<<< vaadin-maven-plugin:7.0-SNAPSHOT:compile (default-cli) @ mavenproject5 <<<
Downloading: http://maven.vaadin.com/vaadin-addons/com/vaadin/vaadin-maven-plugin/7.0.0/vaadin-maven-plugin-7.0.0.jar

Downloading: http://repo.maven.apache.org/maven2/com/vaadin/vaadin-maven-plugin/7.0.0/vaadin-maven-plugin-7.0.0.jar

Downloaded: http://repo.maven.apache.org/maven2/com/vaadin/vaadin-maven-plugin/7.0.0/vaadin-maven-plugin-7.0.0.jar (187 KB at 225.3 KB/sec)

— vaadin-maven-plugin:7.0-SNAPSHOT:compile (default-cli) @ mavenproject5 —
auto discovered modules [com.mycompany.mavenproject5.AppWidgetSet]

abr 14, 2015 6:16:19 PM java.util.prefs.WindowsPreferences
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(…) returned error code 5.
Compiling module com.mycompany.mavenproject5.AppWidgetSet
Validating units:
[ERROR]
Errors in ‘jar:file:/C:/Users/Xavier/.m2/repository/com/vaadin/vaadin/7.0-SNAPSHOT/vaadin-7.0-SNAPSHOT.jar!/com/vaadin/client/ApplicationConfiguration.java’
[ERROR]
Line 223: ApplicationConstants.PORTLET_RESOUCE_URL_BASE cannot be resolved
[ERROR]
Errors in ‘jar:file:/C:/Users/Xavier/.m2/repository/com/vaadin/vaadin/7.0-SNAPSHOT/vaadin-7.0-SNAPSHOT.jar!/com/vaadin/client/ApplicationConnection.java’
[ERROR]
Line 622: ApplicationConstants.UIDL_REQUEST_PATH cannot be resolved
[ERROR]
Line 2010: The method getLastonlyTag() is undefined for the type MethodInvocation
[ERROR]
Line 2591: ApplicationConstants.CONNECTOR_PROTOCOL_PREFIX cannot be resolved
[ERROR]
Line 2596: ApplicationConstants.CONNECTOR_RESOURCE_PREFIX cannot be resolved
[ERROR]
Line 2598: ApplicationConstants.CONNECTOR_PROTOCOL_PREFIX cannot be resolved
[ERROR]
Line 2863: ApplicationConstants.HEARTBEAT_REQUEST_PATH cannot be resolved
[ERROR]
Errors in ‘jar:file:/C:/Users/Xavier/.m2/repository/com/vaadin/vaadin/7.0-SNAPSHOT/vaadin-7.0-SNAPSHOT.jar!/com/vaadin/client/MouseEventDetailsBuilder.java’
[ERROR]
Line 61: The method setButton(MouseEventDetails.MouseButton) in the type MouseEventDetails is not applicable for the arguments (int)
[ERROR]
Errors in ‘jar:file:/C:/Users/Xavier/.m2/repository/com/vaadin/vaadin/7.0-SNAPSHOT/vaadin-7.0-SNAPSHOT.jar!/com/vaadin/client/Util.java’
[ERROR]
Line 524: The method isUndefinedHeight(AbstractComponentState) in the type ComponentStateUtil is not applicable for the arguments (ComponentState)
[ERROR]
Line 525: The method isUndefinedWidth(AbstractComponentState) in the type ComponentStateUtil is not applicable for the arguments (ComponentState)
[ERROR]
Errors in ‘jar:file:/C:/Users/Xavier/.m2/repository/com/vaadin/vaadin/7.0-SNAPSHOT/vaadin-7.0-SNAPSHOT.jar!/com/vaadin/client/VCaption.java’
[ERROR]
Line 114: The method hasStyles(AbstractComponentState) in the type ComponentStateUtil is not applicable for the arguments (ComponentState)
[ERROR]
Line 128: Incompatible conditional operand types ComponentState and AbstractFieldState
[ERROR]
Line 129: Cannot cast from ComponentState to AbstractFieldState
[ERROR]
Line 195: The method hasDescription(AbstractComponentState) in the type ComponentStateUtil is not applicable for the arguments (ComponentState)
[ERROR]
Errors in ‘jar:file:/C:/Users/Xavier/.m2/repository/com/vaadin/vaadin/7.0-SNAPSHOT/vaadin-7.0-SNAPSHOT.jar!/com/vaadin/client/ui/AbstractComponentConnector.java’

18930.xml (6.24 KB)

Hi Carlos,

by quickly looking at your pom.xml file, I think you need to do at least the following changes:

  1. Replace the
    vaadin.plugin.version
    property value with the
    vaadin.version
    value. Like this:

    <vaadin.plugin.version>${vaadin.version}</vaadin.plugin.version>

  2. Do the same with dependencies. As you have the
    vaadin.version
    property set correctly, you should use that property instead of explicit
    7.0.0
    version in your dependencies. So replace the hard coded version values with:

    ${vaadin.version}

I don’t know for sure if these changes are enough to fix your build, but another safe option is to create a new project with one of our
Maven archetypes
.

Hi Teemu,

many thanks for your help. We did as you suggested, and now are getting a different error (posted below).

From my still little understanding we have brought to line the different versions of the vaadin jars. However do you think that maybe any of the other dependencies stated at the pom.xml might be pointing to any incompatible version with the 7.4.3 jars?

Additionally the error appears to originate at some kind of version incompatibility with GWT code incorporated in vaadin, which gets me even more confused, then the gwt code put in the libraries must be correct. So it should be some other dependency which clashes with the current set.

Do you think it is a first level dependency, or it could be any other laying beneath the project first level dependencies? (I mean a dependency of a dependency). That doesn’t make sense to me either since I believe Maven should take care of all that.

Many thanks in advance.
Carlos.

Error Info

cd C:\Users\Xavier\Documents\NetBeansProjects\mavenproject5; “JAVA_HOME=C:\Program Files\Java\jdk1.7.0_25” cmd /c “""C:\Program Files\NetBeans 8.0.2\java\maven\bin\mvn.bat" -Dmaven.ext.class.path="C:\Program Files\NetBeans 8.0.2\java\maven-nblib\netbeans-eventspy.jar" -Dfile.encoding=UTF-8 vaadin:compile"”
Scanning for projects…


Building Vaadin Web Application 1.0-SNAPSHOT

vaadin-maven-plugin:7.4.3:compile (default-cli) @ mavenproject5 >>>

— maven-resources-plugin:2.5:resources (default-resources) @ mavenproject5 —
[debug]
execute contextualize
Using ‘UTF-8’ encoding to copy filtered resources.
Copying 0 resource

— vaadin-maven-plugin:7.4.3:resources (default) @ mavenproject5 —
auto discovered modules [com.mycompany.mavenproject5.AppWidgetSet]

1 source files from GWT module com.mycompany.mavenproject5.AppWidgetSet

<<< vaadin-maven-plugin:7.4.3:compile (default-cli) @ mavenproject5 <<<

— vaadin-maven-plugin:7.4.3:compile (default-cli) @ mavenproject5 —
auto discovered modules [com.mycompany.mavenproject5.AppWidgetSet]

abr 15, 2015 9:49:35 AM java.util.prefs.WindowsPreferences
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(…) returned error code 5.
Compiling module com.mycompany.mavenproject5.AppWidgetSet
Validating units:
[ERROR]
Errors in ‘jar:file:/C:/Users/Xavier/.m2/repository/com/vaadin/vaadin-client/7.4.3/vaadin-client-7.4.3.jar!/com/google/gwt/aria/client/RoleImpl.java’
[ERROR]
Line 26: The type Role cannot be a superinterface of RoleImpl; a superinterface must be an interface
[ERROR]
Line 37: The method getAriaAtomicProperty(Element) of type RoleImpl must override or implement a supertype method
[ERROR]
Line 42: The method getAriaBusyState(Element) of type RoleImpl must override or implement a supertype method
[ERROR]
Line 47: The method getAriaControlsProperty(Element) of type RoleImpl must override or implement a supertype method
[ERROR]
Line 52: The method getAriaDescribedbyProperty(Element) of type RoleImpl must override or implement a supertype method
[ERROR]
Line 57: The method getAriaDisabledState(Element) of type RoleImpl must override or implement a supertype method
[ERROR]
Line 62: The method getAriaDropeffectProperty(Element) of type RoleImpl must override or implement a supertype method
[ERROR]
Line 67: The method getAriaFlowtoProperty(Element) of type RoleImpl must override or implement a supertype method
[ERROR]
Line 72: The method getAriaGrabbedState(Element) of type RoleImpl must override or implement a supertype method
[ERROR]
Line 77: The method getAriaHaspopupProperty(Element) of type RoleImpl must override or implement a supertype method
[ERROR]
Line 82: The method getAriaHiddenState(Element) of type RoleImpl must override or implement a supertype method
[ERROR]
Line 87: The method getAriaInvalidState(Element) of type RoleImpl must override or implement a supertype method
[ERROR]
Line 92: The method getAriaLabelledbyProperty(Element) of type RoleImpl must override or implement a supertype method
[ERROR]
Line 97: The method getAriaLabelProperty(Element) of type RoleImpl must override or implement a supertype method
[ERROR]
Line 102: The method getAriaLiveProperty(Element) of type RoleImpl must override or implement a supertype method
[ERROR]
Line 107: The method getAriaOwnsProperty(Element) of type RoleImpl must override or implement a supertype method
[ERROR]
Line 112: The method getAriaRelevantProperty(Element) of type RoleImpl must override or implement a supertype method
[ERROR]
Line 117: The method getName() of type RoleImpl must override or implement a supertype method
[ERROR]
Line 122: The method getTabindexExtraAttribute(Element) of type RoleImpl must override or implement a supertype method
[ERROR]
Line 127: The method remove(Element) of type RoleImpl must override or implement a supertype method
[ERROR]
Line 133: The method removeAriaAtomicProperty(Element) of type RoleImpl must override or implement a supertype method
[ERROR]
Line 138: The method removeAriaBusyState(Element) of type RoleImpl must override or implement a supertype method
[ERROR]
Line 143: The method removeAriaControlsProperty(Element) of type RoleImpl must override or implement a supertype method
[ERROR]
Line 148: The method removeAriaDescribedbyProperty(Element) of type RoleImpl must override or implement a supertype method
[ERROR]
Line 153: The method removeAriaDisabledState(Element) of type RoleImpl must override or implement a supertype method
[ERROR]
Line 158: The method removeAriaDropeffectProperty(Element) of type RoleImpl must override or implement a supertype method
[ERROR]
Line 163: The method removeAriaFlowtoProperty(Element) of type RoleImpl must override or implement a supertype method
[ERROR]
Line 168: The method removeAriaGrabbedState(Element) of type RoleImpl must override or implement a supertype method
[ERROR]
Line 173: The method removeAriaHaspopupProperty(Element) of type RoleImpl must override or implement a supertype method
[ERROR]
Line 178: The method removeAriaHiddenState(Element) of type RoleImpl must override or implement a supertype method
[ERROR]
Line 183: The method removeAriaInvalidState(Element) of type RoleImpl must override or implement a supertype method
[ERROR]
Line 188: The method removeAriaLabelledbyProperty(Element) of type RoleImpl must override or implement a supertype method
[ERROR]
Line 193: The method removeAriaLabelProperty(Element) of type RoleImpl must override or implement a supertype method
[ERROR]
Line 198: The method removeAriaLiveProperty(Element) of type RoleImpl must override or implement a supertype method
[ERROR]
Line 203: The method removeAriaOwnsProperty(Element) of type RoleImpl must override or implement a supertype method
[ERROR]
Line 208: The method removeAriaRelevantProperty(Element) of type RoleImpl must override or implement a supertype method
[ERROR]
Line 213: The method removeTabindexExtraAttribute(Element) of type RoleImpl must override or implement a supertype method
[ERROR]
Line 218: The method set(Element) of type RoleImpl must override or implement a supertype method
[ERROR]
Line 224: The method setAriaAtomicProperty(Element, boolean) of type RoleImpl must override or implement a supertype method
[ERROR]
Line 229: The method setAriaBusyState(Element, boolean) of type RoleImpl must override or implement a supertype method
[ERROR]
Line 234: The method setAriaControlsProperty(Element, Id…) of type RoleImpl must override or implement a supertype method
[ERROR]
Line 235: The method set(Element, IdReference…) in the type Attribute is not applicable for the arguments (Element, Id)
[ERROR]
Line 239: The method setAriaDescribedbyProperty(Element, Id…) of type RoleImpl must override or implement a supertype method
[ERROR]
Line 240: The method set(Element, IdReference…) in the type Attribute is not applicable for the arguments (Element, Id)
[ERROR]
Line 244: The method setAriaDisabledState(Element, boolean) of type RoleImpl must override or implement a supertype method
[ERROR]
Line 249: The method setAriaDropeffectProperty(Element, DropeffectValue…) of type RoleImpl must override or implement a supertype method
[ERROR]
Line 254: The method setAriaFlowtoProperty(Element, Id…) of type RoleImpl must override or implement a supertype method
[ERROR]
Line 255: The method set(Element, IdReference…) in the type Attribute is not applicable for the arguments (Element, Id)
[ERROR]
Line 259: The method setAriaGrabbedState(Element, GrabbedValue) of type RoleImpl must override or implement a supertype method
[ERROR]
Line 264: The method setAriaHaspopupProperty(Element, boolean) of type RoleImpl must override or implement a supertype method
[ERROR]
Line 269: The method setAriaHiddenState(Element, boolean) of type RoleImpl must override or implement a supertype method
[ERROR]
Line 274: The method setAriaInvalidState(Element, InvalidValue) of type RoleImpl must override or implement a supertype method

(and so on…)

18931.xml (6.32 KB)

You should
remove
the following two dependencies, as there is no longer a plain
vaadin
artifact and I think it should be enough to have the
vaadin-maven-plugin
defined in the
plugins
section (and your dependency has also a wrong 1.0.1 version).



com.vaadin
vaadin
7.0.0.alpha3
jar


com.vaadin
vaadin-maven-plugin
1.0.1
jar

Hi Teemu,

since this line of progress was going to take very long, and having presumed that the origin of the problem is a wrong archetype definition (wrong pool of dependencies apparently otherwhise it should succeed, can that happen? since it comes directly from the maven repository isn’t it?), I tried to create a new project but this time from the VaadinPlugin in Netbeans and it compiles fine.

Now I have the problem of running the application, but compilation runs fine. I have detected that the problem lies in the fact that Maven is not placing the web.xml file in the targetted docBase. Is there some setting that prevents that. Is that behavior expected?. Tomcat doesn’t recognise the resource as a web application unless I put that file there. I tried it by copying the web.xml from another vaadin app and changing the widgetset and application names and worked smoothly!

So my problem now lies on a wrong deployment in Tomcat due to a missconfiguration of Maven. Or something I am missing regarding Maven and Tomcat.

Can you help?

Regards,

Carlos.

Hi Teemu,

I think we have solved it. The web.xml is required for Servlet implementations prior to 3.0. I am working with Tomcat 6.0 which implements version 2.5, therefore I believe if I upgraged to a newer version I would have my problem solved.

In the mean I plainly create a WEB-INF/web.xml in my WebPages folder and solved.

Many thanks for your support. I would only appreciate if you could tell me from your experience if you believe I could be right about what I stated before regarding the maven archetype. Is it possible that an archetype from the maven respository pools incompatible library versions?. Otherwhise why doesn’t it work from the very beginning?

Carlos.

Hi,

glad to hear that you got the problem resolved. I cannot really say much about your problem without seeing the details of your project. In any case when using Maven, the standard path for the
web.xml
file should be
src/main/webapp/WEB-INF/web.xml

Typically I have created my projects using a Maven archetype from the command line and then imported the created project into Eclipse, without any issues.

Hi Teemu,

ok then I will try to live with that. Thanks for your time. The only disadvantage is that I haven’t got to create the web.xml automatically

Regards,

Carlos Conti.