Loading...
Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

How to add the widgetset in Root class extended web application ?

Ashutosh Gupta
7 years ago Jul 08, 2015 4:21am

Hi

I want to add the theme and widgetset into my web application. I want to use spring security role -right base authentication, thats why I am extending the Root class of Vaadin. I have added the Theme at the Root extended class as annotation and I wrote the widgetset pkg into web.xml. But during build it is showing errors - 

I am attaching the pom.xml, web.xml and the error log. Please suggest me the correct way.   
Thanks   :)

pom.xml
_________________________________________________________________________

<properties>
        <vaadin.version>7.4.0</vaadin.version>
        <vaadin.plugin.version>${vaadin.version}</vaadin.plugin.version>
        <jetty.plugin.version>9.2.3.v20140905</jetty.plugin.version>
        <project.source.version>1.7</project.source.version>
        <project.target.version>1.7</project.target.version>
        <project.encoding>UTF-8</project.encoding>
    </properties>

    <repositories>
        <repository>
            <id>vaadin-addons</id>
            <url>http://maven.vaadin.com/vaadin-addons</url>
        </repository>
        <repository>
            <id>vaadin-snapshots</id>
            <url>https://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.0.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin</artifactId>
            <version>7.0.0.alpha3</version>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-server</artifactId>
            <version>${vaadin.version}</version>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-push</artifactId>
            <version>${vaadin.version}</version>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-client</artifactId>
            <version>${vaadin.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- Needed when using the widgetset optimizer (custom ConnectorBundleLoaderFactory). 
            For widgetset compilation, vaadin-client-compiler is automatically added 
            on the compilation classpath by vaadin-maven-plugin so normally there is 
            no need for an explicit dependency. -->

    <dependency>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-client-compiler</artifactId>
        <version>${vaadin.version}</version>
        <scope>provided</scope>
    </dependency>
            
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-themes</artifactId>
            <version>${vaadin.version}</version>
        </dependency>

        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator</artifactId>
            <version>4.2.0.Final</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.0</version>
                <configuration>
                    <encoding>${project.encoding}</encoding>
                    <source>${project.source.version}</source>
                    <target>${project.target.version}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.6</version>
                <configuration>
                    <encoding>${project.encoding}</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.3</version>
                <configuration>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                    <!-- Exclude some unnecessary files generated by the GWT compiler. -->
                    <packagingExcludes>WEB-INF/classes/VAADIN/gwt-unitCache/**,
                        WEB-INF/classes/VAADIN/widgetsets/WEB-INF/**</packagingExcludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-maven-plugin</artifactId>
                <version>${vaadin.plugin.version}</version>
                <configuration>
                    <extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>
                    <webappDirectory>${basedir}/target/classes/VAADIN/widgetsets</webappDirectory>
                    <draftCompile>false</draftCompile>
                    <compileReport>false</compileReport>
                    <style>OBF</style>
                    <strict>true</strict>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>update-widgetset</goal>
                            <goal>compile</goal>
                            <!-- disabled by default to use on-the-fly theme compilation -->
                            <!-- <goal>compile-theme</goal> -->
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.4</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
                <version>2.6.1</version>
                <!-- Clean up also any pre-compiled themes -->
                <configuration>
                    <filesets>
                        <fileset>
                            <directory>src/main/webapp/VAADIN/themes</directory>
                            <includes>
                                <include>**/styles.css</include>
                                <include>**/styles.scss.cache</include>
                            </includes>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>

            <!-- The Jetty plugin allows us to easily test the development build by 
                running jetty:run on the command line. -->
            <plugin>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <version>${jetty.plugin.version}</version>
                <configuration>
                    <scanIntervalSeconds>2</scanIntervalSeconds>
                </configuration>
            </plugin>
        </plugins>

        <pluginManagement>
            <plugins>
                <!--This plugin's configuration is used to store Eclipse m2e settings 
                    only. It has no influence on the Maven build itself. -->
                <!-- TODO Remove when http://dev.vaadin.com/ticket/14924 is resolved -->
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>com.vaadin</groupId>
                                        <artifactId>
                                            vaadin-maven-plugin
                                        </artifactId>
                                        <versionRange>[7.1.11,)</versionRange>
                                        <goals>
                                            <goal>resources</goal>
                                            <goal>update-widgetset</goal>
                                            <goal>compile</goal>
                                            <goal>compile-theme</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore></ignore>
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>

    </build>

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"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
    id="WebApp_ID" version="3.0">
    <context-param>
        <param-name>productionMode</param-name>
        <param-value>false</param-value>
    </context-param>
    <servlet>
        <servlet-name>Vaadin 7 Servlet</servlet-name>
        <servlet-class>com.vaadin.terminal.gwt.server.ApplicationServlet</servlet-class>
        <init-param>
            <param-name>root</param-name>
            <param-value>in.co.comp.BeanValidationRoot</param-value>
        </init-param>
        <init-param>
            <param-name>widgetset</param-name>
            <param-value>in.co.comp.MyAppWidgetset</param-value>
        </init-param>
    </servlet>
    <servlet-mapping>
        <servlet-name>Vaadin 7 Servlet</servlet-name>
        <url-pattern>/*</url-pattern>
    </servlet-mapping>
</web-app>

Error log
____________________________________________________________________________

[INFO]    Validating units:
[INFO]       [ERROR] Errors in 'jar:file:/C:/Users/ashutosh.gupta/.m2/repository/com/vaadin/vaadin-client/7.4.0/vaadin-client-7.4.0.jar!/com/google/gwt/aria/client/RoleImpl.java'
[INFO]          [ERROR] Line 26: The type Role cannot be a superinterface of RoleImpl; a superinterface must be an interface
[INFO]          [ERROR] Line 37: The method getAriaAtomicProperty(Element) of type RoleImpl must override or implement a supertype method
[INFO]          [ERROR] Line 42: The method getAriaBusyState(Element) of type RoleImpl must override or implement a supertype method
[INFO]          [ERROR] Line 47: The method getAriaControlsProperty(Element) of type RoleImpl must override or implement a supertype method
[INFO]          [ERROR] Line 52: The method getAriaDescribedbyProperty(Element) of type RoleImpl must override or implement a supertype method
[INFO]          [ERROR] Line 57: The method getAriaDisabledState(Element) of type RoleImpl must override or implement a supertype method
[INFO]          [ERROR] Line 62: The method getAriaDropeffectProperty(Element) of type RoleImpl must override or implement a supertype method
[INFO]          [ERROR] Line 67: The method getAriaFlowtoProperty(Element) of type RoleImpl must override or implement a supertype method
[INFO]          [ERROR] Line 72: The method getAriaGrabbedState(Element) of type RoleImpl must override or implement a supertype method
[INFO]          [ERROR] Line 77: The method getAriaHaspopupProperty(Element) of type RoleImpl must override or implement a supertype method
[INFO]          [ERROR] Line 82: The method getAriaHiddenState(Element) of type RoleImpl must override or implement a supertype method
[INFO]          [ERROR] Line 87: The method getAriaInvalidState(Element) of type RoleImpl must override or implement a supertype method
[INFO]          [ERROR] Line 92: The method getAriaLabelledbyProperty(Element) of type RoleImpl must override or implement a supertype method
[INFO]          [ERROR] Line 97: The method getAriaLabelProperty(Element) of type RoleImpl must override or implement a supertype method
[INFO]          [ERROR] Line 102: The method getAriaLiveProperty(Element) of type RoleImpl must override or implement a supertype method
[INFO]          [ERROR] Line 107: The method getAriaOwnsProperty(Element) of type RoleImpl must override or implement a supertype method
[INFO]          [ERROR] Line 112: The method getAriaRelevantProperty(Element) of type RoleImpl must override or implement a supertype method
[INFO]          [ERROR] Line 117: The method getName() of type RoleImpl must override or implement a supertype method
[INFO]          [ERROR] Line 122: The method getTabindexExtraAttribute(Element) of type RoleImpl must override or implement a supertype method
[INFO]          [ERROR] Line 127: The method remove(Element) of type RoleImpl must override or implement a supertype method
[INFO]          [ERROR] Line 133: The method removeAriaAtomicProperty(Element) of type RoleImpl must override or implement a supertype method
[INFO]          [ERROR] Line 138: The method removeAriaBusyState(Element) of type RoleImpl must override or implement a supertype method
[INFO]          [ERROR] Line 143: The method removeAriaControlsProperty(Element) of type RoleImpl must override or implement a supertype method
[INFO]          [ERROR] Line 148: The method removeAriaDescribedbyProperty(Element) of type RoleImpl must override or implement a supertype method
[INFO]          [ERROR] Line 153: The method removeAriaDisabledState(Element) of type RoleImpl must override or implement a supertype method
[INFO]          [ERROR] Line 158: The method removeAriaDropeffectProperty(Element) of type RoleImpl must override or implement a supertype method
[INFO]          [ERROR] Line 163: The method removeAriaFlowtoProperty(Element) of type RoleImpl must override or implement a supertype method
[INFO]          [ERROR] Line 168: The method removeAriaGrabbedState(Element) of type RoleImpl must override or implement a supertype method
[INFO]          [ERROR] Line 173: The method removeAriaHaspopupProperty(Element) of type RoleImpl must override or implement a supertype method

Thanks   :)