Skip to content

Commit

Permalink
Upgrade GWT to 2.8.0 and Errai 4.0.0.Beta4
Browse files Browse the repository at this point in the history
  • Loading branch information
mbarkley committed Nov 8, 2016
1 parent 6a5b528 commit a8fbbee
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 112 deletions.
21 changes: 3 additions & 18 deletions README.md
Expand Up @@ -5,20 +5,20 @@ This simple demo allows users to create contact entires for an address book. The

Creating contacts is done using a simple JAX-RS endpoint and Errai's typesafe REST caller support (see the `@EventHandler` method for the submit button in `ContactListPage.java`). Every time a new contact is created, the server will fire a CDI event which will be observed by all connected clients (new contacts will automatically appear in the displayed contact lists of all connected clients). The relevant code for firing and observing this CDI event can be found in `ContactStorageServiceImpl.java` and `ContactListPage.java`. The filed contacts are persisted on the server.

This demo is designed to work with a full Java EE 7 server such as Wildfly 8. Although it should be possible to craft a deployment of this demo to a simpler web server, it's much simpler to deploy to an EE 7 capable app server.
This demo is designed to work with a full Java EE 7 server such as WildFly 10. Although it should be possible to craft a deployment of this demo to a simpler web server, it's much simpler to deploy to an EE 7 capable app server.

Prerequisites
-------------

* Maven 3 (run `mvn --version` on the command line to check)
* An unzipped copy of Wildfly 8 (Optional)
* An unzipped copy of WildFly 10 (Optional)

More detailed instructions can be found in our [Setup Tutorial](tutorial-guide/SETUP.adoc)

Build and deploy (production mode)
----------------

To build a .war file and deploy it to the local running Wildfly instance:
To build a .war file and deploy it to the local running WildFly instance:

% mvn clean package wildfly:deploy

Expand Down Expand Up @@ -59,21 +59,6 @@ Then:

See our development guide [here](tutorial-guide/DEVELOP.adoc) for more instructions on setting up dev mode and other details.

Build and deploy as native app to your mobile device
-----------------------------------------------------

The native application will have to know the absolute path to your server or cluster. For this demo you will have to change the REST and Errai Bus endpoint URL in Config.java and App.java (see comments) before building the native application.

To produce the native applications run:

% mvn clean package -Pmobile,wildfly -Dplatform=android

After that you can simply install the native app on your phone or tablet.

e.g for Android run:

% adb install target/template/platforms/android/bin/HelloCordova-debug.apk

Troubleshooting
---------------

Expand Down
42 changes: 2 additions & 40 deletions pom.xml
Expand Up @@ -11,8 +11,8 @@
<name>Errai::Tutorial</name>

<properties>
<errai.version>4.0.0-SNAPSHOT</errai.version>
<gwt.version>2.8.0-rc2</gwt.version>
<errai.version>4.0.0.Beta4</errai.version>
<gwt.version>2.8.0</gwt.version>
<slf4j.version>1.5.11</slf4j.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<errai.dev.context>${project.artifactId}</errai.dev.context>
Expand All @@ -21,7 +21,6 @@
<errai.jboss.home>${project.build.directory}/wildfly-${as.version}</errai.jboss.home>
</properties>

<!-- These must be here in this order because of missing guava-gwt snapshots in the JBoss Public Repository. -->
<repositories>
<repository>
<id>jboss</id>
Expand All @@ -33,11 +32,6 @@
<name>Sonatype Public Snapshots Repo</name>
<url>https://oss.sonatype.org/content/repositories/public</url>
</repository>

<repository>
<id>GOOGLE_SNAPSHOTS</id>
<url>https://oss.sonatype.org/content/repositories/google-snapshots</url>
</repository>
</repositories>

<dependencyManagement>
Expand Down Expand Up @@ -320,37 +314,5 @@
</dependencies>
</profile>

<profile>
<id>mobile</id>
<build>
<plugins>
<plugin>
<groupId>org.jboss.errai</groupId>
<artifactId>cordova-maven-plugin</artifactId>
<version>${errai.version}</version>
<executions>
<execution>
<id>build</id>
<phase>package</phase>
<goals>
<goal>build-project</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<pluginRepositories>
<pluginRepository>
<id>snapshots.jboss.org</id>
<name>JBoss Snapshot Repository</name>
<url>http://snapshots.jboss.org/maven2</url>
<layout>default</layout>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
</project>
12 changes: 6 additions & 6 deletions tutorial-guide/DEVELOP.adoc
@@ -1,6 +1,6 @@
== Development Mode with Errai

In this section we will configure GWT development mode to use the Wildfly Application Server so that it is NOT necessary to manually start the server and deploy a war file before running an Application in dev mode.
In this section we will configure GWT development mode to use the WildFly Application Server so that it is NOT necessary to manually start the server and deploy a war file before running an Application in dev mode.

Before starting this, you should:

Expand All @@ -20,7 +20,7 @@ click "Next"
it is selected
* Click "Finished"

=== Setting up DevMode for Wildfly 8
=== Setting up DevMode for WildFly 10

Note that you will only need to go through this step if you're upgrading an existing Errai App. If you've just downloaded the errai-tutorial this configuration is already set up for you.

Expand All @@ -34,7 +34,7 @@ Currently to use this feature, you must be using errai 3.0.0 or greater. Here is
</dependency>
-------------------------------------------------------------------------------

This new dependency contains a ServletLauncher, which the gwt-maven-plugin will use to control the Wildfly AS instance.
This new dependency contains a ServletLauncher, which the gwt-maven-plugin will use to control the WildFly AS instance.

Additionally, the plugin configuration has changed. First we have the new gwt-maven-plugin configuration:

Expand Down Expand Up @@ -101,7 +101,7 @@ Additionally, we have added a new execution for the maven-dependency plugin:
</plugin>
-------------------------------------------------------------------------------

This new execution will unpack a Wildfly Application Server and unzip it into your target directory.
This new execution will unpack a WildFly Application Server and unzip it into your target directory.

Finally, at the top of the pom we've included the following necessary properties:

Expand All @@ -116,9 +116,9 @@ Finally, at the top of the pom we've included the following necessary properties
</properties>
-------------------------------------------------------------------------------

=== Managing an External Wildfly Instance (**Optional**)
=== Managing an External WildFly Instance (**Optional**)

One of the extra JVM arguments we gave to the gwt-maven-plugin, errai.jboss.home, is used to tell the launcher where $WILDFLY_HOME is located. *It is necessary to set this to the path of your $WILDFLY_HOME.* In the configuration above, this is done for you for the Wildfly installation that is provided by maven.
One of the extra JVM arguments we gave to the gwt-maven-plugin, errai.jboss.home, is used to tell the launcher where $WILDFLY_HOME is located. *It is necessary to set this to the path of your $WILDFLY_HOME.* In the configuration above, this is done for you for the WildFly installation that is provided by maven.

But if you wish to use a different application server, you can do so by changing the pom property *errai.jboss.home* near the top of the *pom.xml*.

Expand Down
18 changes: 9 additions & 9 deletions tutorial-guide/FAQ.adoc
Expand Up @@ -8,7 +8,7 @@ Would you like to share a solution to a problem? Send your pull request to https
By default, the older JBossLauncher instance is started using a copy of `$JBOSS_HOME/standalone/configuration/standalone-full.xml`
while the newer EmbeddedWildflyLauncher uses `$JBOSS_HOME/standalone/configuration/standalone.xml`.

=== How can I specify a different configuration file for Jboss/Wildfly?
=== How can I specify a different configuration file for Jboss/WildFly?
If you are using the older JBossLauncher, add this to your pom.xml in the `extraJvmArgs` part of the gwt-maven-plugin configuration:

-----------------------------------------
Expand All @@ -17,14 +17,14 @@ If you are using the older JBossLauncher, add this to your pom.xml in the `extra

`$CONFIG_FILE` must be the name (*without* any parent directories) of a file in `$JBOSS_HOME/standalone/configuration`.

If you are using the newere EmbeddedWildflyLauncher, add the following to `extraJvmArgs` instead:
If you are using the newer EmbeddedWildflyLauncher, add the following to `extraJvmArgs` instead:

-----------------------------------------
-Derra.jboss.args="-c $CONFIG_FILE"
-Derrai.jboss.args="-c $CONFIG_FILE"
-----------------------------------------

=== How can I pass other options to the JVM running Jboss/Wildfly?
The older JBossLauncher ran Wildfly in a separate JVM. To give it's JVM arguments: in your pom.xml add the following to the `extraJvmArgs`
=== How can I pass other options to the JVM running Jboss/WildFly?
The older JBossLauncher ran WildFly in a separate JVM. To give it's JVM arguments: in your pom.xml add the following to the `extraJvmArgs`
in the gwt-maven-plugin configuration (where `$JAVA_OPTS` is the string of options):

-----------------------------------
Expand All @@ -33,18 +33,18 @@ in the gwt-maven-plugin configuration (where `$JAVA_OPTS` is the string of optio

For the newer EmebeddedWildflyLauncher, arguments can be passed directly through `extraJvmArgs`.

=== How do I change the port for remote debugging Jboss/Wildfly?
=== How do I change the port for remote debugging Jboss/WildFly?
For the older JBossLauncher, you can configure the debug port of the JVM running wildfly in your pom.xml, by adding the following to the
`extraJvmArgs` in the gwt-maven-plugin configuration (where `$PORT` is the desired port number):

------------------------------
-Derrai.jboss.debug.port=$PORT
------------------------------

With the newer WildflyEmbeddedLauncher, Wildfly runs in the same JVM as the gwt compiler.
With the newer EmbeddedWildflyLauncher, WildFly runs in the same JVM as the gwt compiler.

=== Can I use my own instance of Jboss/Wildfly instead of the one provided?
=== Can I use my own instance of Jboss/WildFly instead of the one provided?
Absolutely. If your project is based off of the errai-tutorial project, there are only two steps:
* Set the `errai.jboss.home` property at the top of the pom.xml to the absolute path of your `$WILDFLY_HOME`
* In the plugins tag in the pom.xml, remove the maven-dependency-plugin configuration
The Dev Mode launcher will now start the Wildfly instance located at `$WILDFLY_HOME`.
The Dev Mode launcher will now start the WildFly instance located at `$WILDFLY_HOME`.
42 changes: 8 additions & 34 deletions tutorial-guide/RUN.adoc
Expand Up @@ -52,24 +52,24 @@ Errai.
** The location of html and css files, and any other resources to be
served to clients.

=== Starting Wildfly
=== Starting WildFly

To run this demo, we'll be deploying it to the Wildfly Application Server.
To start a standalone instance of Wildfly, run
To run this demo, we'll be deploying it to the WildFly Application Server.
To start a standalone instance of WildFly, run

----------------------------------------
$WILDFLY_HOME/bin/standalone.sh
----------------------------------------

where `$WILDFLY_HOME` is the path to Wildfly folder you unzipped from the
where `$WILDFLY_HOME` is the path to WildFly folder you unzipped from the
link:SETUP.adoc[setup] instructions.

Now go to http://localhost:8080 in your web browser. If the server is
running correctly, you should see a Wildfly welcome page.
running correctly, you should see a WildFly welcome page.

=== Building and Deploying

It's time to really get things started. While the Wildfly server is still
It's time to really get things started. While the WildFly server is still
running, run the command

---------------------------------
Expand Down Expand Up @@ -108,9 +108,9 @@ least two browser windows open. Try submitting complaints with one
window and see them live update to the admin screen. Or open two admin
windows and completing complaints.

*Note*: By default, Wildfly will only serve the application locally. If
*Note*: By default, WildFly will only serve the application locally. If
you would like to try the demo on multiple devices, you can configure
Wildfly to bind to all addresses by editing
WildFly to bind to all addresses by editing
`$WILDFLY_HOME/standalone/configuration/standalone.xml`. Take just these lines:

-----------------------------------------------------------------
Expand All @@ -127,32 +127,6 @@ And replace them with this:
</interface>
-------------------------

=== Build and deploy as native app to your mobile device

The native application will have to know the absolute path to your
server or cluster. For this demo you will have to change the REST
and Errai Bus endpoint URL in Config.java and App.java (see comments)
before building the native application. Make sure that your application
server instance is bound to an IP address that can be reached from your
mobile device. The section <<verify-deployment, Verify Deployment>>
desribes how to change the binding address of Wildfly AS.

To produce the native applications run:

----
% mvn clean package -Pmobile,jboss7
----

After that you can simply install the native app on your phone or tablet.

Note that you will need to enable development options on your device and
have the Android SDK installed on your local machine.

For deploying the native application to your Android device simply execute:
----
% adb install target/template/platforms/android/bin/HelloCordova-debug.apk
----

What's Next?
~~~~~~~~~~~~

Expand Down
10 changes: 5 additions & 5 deletions tutorial-guide/SETUP.adoc
Expand Up @@ -10,7 +10,7 @@ with the rest of the tutorial:

* JDK (6 or 7)
* Maven (3.x)
* Wildfly 8 (Optional -- necessary for production, but not development mode)
* WildFly 10 (Optional -- necessary for production, but not development mode)
* Eclipse IDE (with the M2E plugin)
Although it is possible to use counterparts for some of these tools, we
Expand Down Expand Up @@ -41,15 +41,15 @@ version of Maven and follow the
http://maven.apache.org/download.cgi#Installation_Instructions[installation
instructions].

Wildfly
WildFly
~~~~~~~

Wildlfy is an Application Server which we will use to host our Errai
Application locally. In the tutorial we will be using
Wildfly 8.1.0.Final.
WildFly 10.0.0.Final.

You can download a zip file with Wildfly 8
http://download.jboss.org/wildfly/8.1.0.Final/wildfly-8.1.0.Final.zip[here].
You can download a zip file with WildFly 10
http://download.jboss.org/wildfly/10.0.0.Final/wildfly-10.0.0.Final.zip[here].
No installation is necessary. Simply unzip it to wherever you would like
the application's directory to be located.

Expand Down

0 comments on commit a8fbbee

Please sign in to comment.