Giter VIP home page Giter VIP logo

archetype-application-example's Introduction

mockapp

Template for a full-blown Vaadin application that only requires a Servlet 3.0 container to run (no other JEE dependencies).

Project Structure

The project consists of the following three modules:

  • parent project: common metadata and configuration
  • mockapp-widgetset: widgetset, custom client side code and dependencies to widget add-ons
  • mockapp-ui: main application module, development time
  • mockapp-production: module that produces a production mode WAR for deployment

The production mode module recompiles the widgetset (obfuscated, not draft), activates production mode for Vaadin with a context parameter in web.xml and contains a precompiled theme. The ui module WAR contains an unobfuscated widgetset, and is meant to be used at development time only.

Workflow

To compile the entire project, run "mvn install" in the parent project.

Other basic workflow steps:

  • getting started
  • compiling the whole project
    • run "mvn install" in parent project
  • developing the application
  • developing the theme
    • run the application as above
    • edit the theme in the ui module
    • optional: see below for precompiling the theme
    • reload the application page
  • client side changes or add-ons
    • edit code/POM in widgetset module
    • run "mvn install" in widgetset module
    • if a new add-on has an embedded theme, run "mvn vaadin:update-theme" in the ui module
  • debugging client side code
    • run "mvn vaadin:run-codeserver" in widgetset module
    • activate Super Dev Mode in the debug window of the application
  • creating a production mode war
    • run "mvn -Pproduction package" in the production mode module or in the parent module
  • testing the production mode war
    • run "mvn -Pproduction jetty:run-war" in the production mode module

Using a precompiled theme

When developing the UI module, Vaadin can compile the theme on the fly on every application reload, or the theme can be precompiled to speed up page loads.

To precompile the theme run "mvn vaadin:compile-theme" in the ui module. Note, though, that once the theme has been precompiled, any theme changes will not be visible until the next theme compilation or running the "mvn clean" target.

When developing the theme, running the application in the "run" mode (rather than in "debug") in the IDE can speed up consecutive on-the-fly theme compilations significantly.

The production module always automatically precompiles the theme for the production WAR.

archetype-application-example's People

Contributors

alvarezguille avatar artur- avatar hesara avatar jojule avatar jouni avatar juhopiirainen avatar mhosio avatar peholmst avatar zch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

archetype-application-example's Issues

Archetype has been crashed using Vaadin 7.5.6 release.

Hi.

I'm trying to use the archetype with the lastest vaadin version (7.5.6), on my "jetty:run" steep, this crashed after the login page...

I'm thinking that this is for the GWT versión, but i'm not sure...

Can you help me about where i can change the gwt version to compile and run tests?

Thanks so much...

captura de pantalla 2015-09-28 a las 0 50 28

captura de pantalla 2015-09-28 a las 0 53 38

Push does not work with vaadin 8.0.4 in this app

I'm trying to use vaadin charts with splineChart updating it every second, but she does not repaint, the push is strange, and in the javascript console, it seems so. @Push on my MyAppUi

A Simple label with Instant.now () the access method

public class Hilo extends Thread {
        @Override
        public void run() {
            while(true) {
                try {
                    Thread.sleep(2000);
                    UI.getCurrent().access(new Runnable() {
                        @Override
                        public void run() {
                            labelHora.setValue("Ahora: "+Instant.now());
                        }                        
                    });              
                }catch(InterruptedException ez) {
                    ez.printStackTrace();
                }
            }
        }      
}

Parent pom

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>

   <groupId>com.guayoyolabs.goliat</groupId>
   <artifactId>goliat-webapp</artifactId>
   <packaging>pom</packaging>
   <version>1.0-SNAPSHOT</version>
   <name>goliat-webapp-parent</name>

   <properties>
   	<vaadin.version>8.0.4</vaadin.version>
   	<vaadin.plugin.version>8.0.4</vaadin.plugin.version>
   	<jetty.plugin.version>9.2.3.v20140905</jetty.plugin.version>
   	<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
   	<maven.compiler.source>1.8</maven.compiler.source>
   	<maven.compiler.target>1.8</maven.compiler.target>
   </properties>

   <build>
   	<plugins>
   		<plugin>
   			<groupId>org.apache.maven.plugins</groupId>
   			<artifactId>maven-compiler-plugin</artifactId>
   			<version>3.0</version>
   		</plugin>
   		<plugin>
   			<groupId>org.apache.maven.plugins</groupId>
   			<artifactId>maven-resources-plugin</artifactId>
   			<version>2.6</version>
   		</plugin>
   	</plugins>
   	<pluginManagement>
   		<plugins>
   			<plugin>
   				<groupId>org.apache.maven.plugins</groupId>
   				<artifactId>maven-war-plugin</artifactId>
   				<version>3.0.0</version>
   				<configuration>
   					<failOnMissingWebXml>false</failOnMissingWebXml>
   				</configuration>
   			</plugin>
   			<plugin>
   				<groupId>com.vaadin</groupId>
   				<artifactId>vaadin-maven-plugin</artifactId>
   				<version>${vaadin.plugin.version}</version>
   			</plugin>
   			<plugin>
   				<groupId>org.apache.maven.plugins</groupId>
   				<artifactId>maven-jar-plugin</artifactId>
   				<version>2.5</version>
   			</plugin>
   			<plugin>
   				<groupId>org.apache.maven.plugins</groupId>
   				<artifactId>maven-source-plugin</artifactId>
   				<version>2.4</version>
   			</plugin>
   		</plugins>
   	</pluginManagement>
   </build>

   <dependencyManagement>
   	<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-bom</artifactId>
   			<version>${vaadin.version}</version>
   			<type>pom</type>
   			<scope>import</scope>
   		</dependency>
   	</dependencies>
   </dependencyManagement>

   <repositories>
   	<repository>
   		<id>vaadin-addons</id>
   		<url>http://maven.vaadin.com/vaadin-addons</url>
   	</repository>
   </repositories>

   <profiles>
   	<profile>
   		<!-- Vaadin pre-release repositories -->
   		<id>vaadin-prerelease</id>
   		<activation>
   			<activeByDefault>false</activeByDefault>
   		</activation>

   		<repositories>
   			<repository>
   				<id>vaadin-prereleases</id>
   				<url>http://maven.vaadin.com/vaadin-prereleases</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>
   		<pluginRepositories>
   			<pluginRepository>
   				<id>vaadin-prereleases</id>
   				<url>http://maven.vaadin.com/vaadin-prereleases</url>
   			</pluginRepository>
   			<pluginRepository>
   				<id>vaadin-snapshots</id>
   				<url>https://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
   				<releases>
   					<enabled>false</enabled>
   				</releases>
   				<snapshots>
   					<enabled>true</enabled>
   				</snapshots>
   			</pluginRepository>
   		</pluginRepositories>
   	</profile>
   </profiles>
 <modules>
   <module>goliat-webapp-widgetset</module>
   <module>goliat-webapp-backend</module>
   <module>goliat-webapp-ui</module>
   <module>goliat-webapp-production</module>
 </modules>
</project>`




<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>goliat-webapp</artifactId>
        <groupId>com.guayoyolabs.goliat</groupId>
        <version>1.0-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>goliat-webapp-widgetset</artifactId>
    <name>goliat-webapp-widgetset</name>
    <packaging>jar</packaging>

    <dependencies>
        <!-- Versions for these are configured in the parent POM -->
        <dependency>
			<groupId>com.vaadin</groupId>
			<artifactId>vaadin-charts</artifactId>
			<version>4.0.0</version>
		</dependency>
		<dependency>
			<groupId>com.vaadin</groupId>
			<artifactId>vaadin-push</artifactId>
		</dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-client</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-client-compiler</artifactId>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-maven-plugin</artifactId>
                <configuration>
                    <extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>
                    <webappDirectory>${basedir}/target/classes/VAADIN/widgetsets</webappDirectory>
                    <draftCompile>true</draftCompile>
                    <compileReport>false</compileReport>
                    <!-- Change to PRETTY (or possibly DETAILED) to get
                    unobfuscated client side stack traces. A better approach
                    for debugging is to use Super Dev Mode -->
                    <style>OBF</style> 
                    <strict>true</strict>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>update-widgetset</goal>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Vaadin-Package-Version>1</Vaadin-Package-Version>
                            <Vaadin-Widgetsets>com.guayoyolabs.goliat.GoliatWidgetset</Vaadin-Widgetsets>
                        </manifestEntries>
                    </archive>
                    <!-- Exclude some unnecessary files generated by the 
                        GWT compiler. -->
                    <excludes>
                        <exclude>VAADIN/gwt-unitCache/**</exclude>
                        <exclude>VAADIN/widgetsets/WEB-INF/**</exclude>
                    </excludes>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

When I try to login, I get this exception, this log uses version 8.0.5 of vaadin with all original unmodified only, and only the label to push

abr 25, 2017 12:07:03 PM com.vaadin.server.DefaultErrorHandler doDefault GRAVE: com.vaadin.ui.declarative.DesignException: Unable to load component for design at com.vaadin.ui.declarative.Design$DefaultComponentFactory.resolveComponentClass(Design.java:201) at com.vaadin.ui.declarative.Design$DefaultComponentFactory.createComponent(Design.java:154) at com.vaadin.ui.declarative.Design$DefaultComponentFactory.createComponent(Design.java:163) at com.vaadin.ui.declarative.Design$DefaultComponentFactory.createComponent(Design.java:163) at com.vaadin.ui.declarative.Design$DefaultComponentFactory.createComponent(Design.java:163) at com.vaadin.ui.declarative.Design$DefaultComponentMapper.tagToComponent(Design.java:245) at com.vaadin.ui.declarative.DesignContext.instantiateComponent(DesignContext.java:569) at com.vaadin.ui.declarative.DesignContext.readDesign(DesignContext.java:505) at com.vaadin.ui.CssLayout.readDesign(CssLayout.java:354) at com.vaadin.ui.declarative.DesignContext.readDesign(DesignContext.java:526) at com.vaadin.ui.declarative.Design.designToComponentTree(Design.java:484) at com.vaadin.ui.declarative.Design.read(Design.java:587) at example.samples.crud.ProductFormDesign.(ProductFormDesign.java:38) at example.samples.crud.ProductForm.(ProductForm.java:64) at example.samples.crud.SampleCrudView.(SampleCrudView.java:52) at example.samples.MainScreen.(MainScreen.java:33) at example.MyUI.showMainView(MyUI.java:57) at example.MyUI$1.loginSuccessful(MyUI.java:47) at example.samples.authentication.LoginScreen.login(LoginScreen.java:119) at example.samples.authentication.LoginScreen.access$1(LoginScreen.java:117) at example.samples.authentication.LoginScreen$1.buttonClick(LoginScreen.java:85) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:510) at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:211) at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:174) at com.vaadin.server.AbstractClientConnector.fireEvent(AbstractClientConnector.java:1029) at com.vaadin.ui.Button.fireClick(Button.java:370) at com.vaadin.ui.Button$1.click(Button.java:57) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:155) at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:116) at com.vaadin.server.communication.ServerRpcHandler.handleInvocation(ServerRpcHandler.java:445) at com.vaadin.server.communication.ServerRpcHandler.handleInvocations(ServerRpcHandler.java:410) at com.vaadin.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:274) at com.vaadin.server.communication.PushHandler.lambda$new$71(PushHandler.java:145) at com.vaadin.server.communication.PushHandler.callWithUi(PushHandler.java:235) at com.vaadin.server.communication.PushHandler.onMessage(PushHandler.java:489) at com.vaadin.server.communication.PushAtmosphereHandler.onMessage(PushAtmosphereHandler.java:87) at com.vaadin.server.communication.PushAtmosphereHandler.onRequest(PushAtmosphereHandler.java:77) at org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:223) at org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:115) at org.atmosphere.container.Servlet30CometSupport.service(Servlet30CometSupport.java:68) at org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:2284) at org.atmosphere.websocket.DefaultWebSocketProcessor.dispatch(DefaultWebSocketProcessor.java:593) at org.atmosphere.websocket.DefaultWebSocketProcessor$3.run(DefaultWebSocketProcessor.java:345) at org.atmosphere.util.VoidExecutorService.execute(VoidExecutorService.java:101) at org.atmosphere.websocket.DefaultWebSocketProcessor.dispatch(DefaultWebSocketProcessor.java:340) at org.atmosphere.websocket.DefaultWebSocketProcessor.invokeWebSocketProtocol(DefaultWebSocketProcessor.java:447) at org.atmosphere.container.JSR356Endpoint$3.onMessage(JSR356Endpoint.java:260) at org.atmosphere.container.JSR356Endpoint$3.onMessage(JSR356Endpoint.java:257) at org.eclipse.jetty.websocket.jsr356.messages.TextWholeMessage.messageComplete(TextWholeMessage.java:56) at org.eclipse.jetty.websocket.jsr356.endpoints.JsrEndpointEventDriver.onTextFrame(JsrEndpointEventDriver.java:215) at org.eclipse.jetty.websocket.common.events.AbstractEventDriver.incomingFrame(AbstractEventDriver.java:160) at org.eclipse.jetty.websocket.common.WebSocketSession.incomingFrame(WebSocketSession.java:302) at org.eclipse.jetty.websocket.common.extensions.ExtensionStack.incomingFrame(ExtensionStack.java:214) at org.eclipse.jetty.websocket.common.Parser.notifyFrame(Parser.java:220) at org.eclipse.jetty.websocket.common.Parser.parse(Parser.java:258) at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.readParse(AbstractWebSocketConnection.java:613) at org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillable(AbstractWebSocketConnection.java:468) at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:610) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:539) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.ClassNotFoundException: com$vaadin$ui$VerticalLayout at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50) at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:348) at com.vaadin.ui.declarative.Design$DefaultComponentFactory.resolveComponentClass(Design.java:196) ... 68 more

I removed the form, to continue testing and get the same error, an NPE in UI.getCurrent ().access ()

image

Exception in thread "Thread-58" java.lang.NullPointerException
at example.samples.crud.SampleCrudView$Hilo.run(SampleCrudView.java:76)
abr 25, 2017 12:36:45 PM com.vaadin.server.DefaultErrorHandler doDefault
GRAVE:
java.lang.NullPointerException

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.