Try out the WAS V9 beta with some deployed Java EE 7 samples. You can alternatively grab the source code of the samples from GitHub and deploy them yourself.
The WebSphere Application Server (WAS) V9 beta is available on IBM Bluemix where you can try it out. It has some pre-deployed Java EE 7 samples so that you can explore some of the newly-supported Java EE 7 technologies.
If you prefer to get more hands-on and deploy the samples for yourself, you can find the samples on GitHub. These applications will run on both WAS V9 beta and on Liberty (which already supports Java EE 7 Full Platform). Let’s take a closer look at these samples.
What are the Java EE 7 samples?
Here’s a quick overview of the Java EE 7 samples that are pre-deployed in the WAS V9 beta:
- shows how to set up WebSocket endpoints using annotations or programmatically
- exercises opening, reading from, writing to, and closing a WebSocket connection
- demonstrates the use of encoders, decoders, the PathParam annotation, and Pong message processing
- shows how to use some of the new Expression Language (EL 3.0) functions
- demonstrates a use of lambda expressions, concatenation, and new operators
- provides a simple sample of a stand-alone servlet that shows EL in use without JavaServer Pages (JSP)
- demonstrates how to use non-blocking I/O by using new APIs added to ServletInputStream and ServletOutputStream
- explores the usage of the ReadListener and WriteListener interface APIs
- exercises the JSR 352 batch implementation
- provides a sample of a batchlet and one batch job that sleeps for a user-defined number of seconds
- uses a web interface wrapped around the batch application to provide an easier access to the batch functions
- provides five servlets that parse and display data based on different implementations for processing JSON code
- uses a web interface designed to provide an easier access to JSON-P functions
- uses the simplified API of JMS 2.0
- contains two servlets for performing Point to Point and Publish/Subscribe messaging
- provides an example how to send or receive messages to a queue and also to publish and subscribe messages from a topic
The Java EE 7 samples are pre-deployed on to a WAS server on Bluemix so that you can just try them out straight away on a WAS in the cloud. If you prefer to get more hands-on, though, you can find the source code for the samples on GitHub, which you can download and deploy yourself.
Downloading and deploying the samples to WAS on the cloud
To download and deploy the Java EE 7 samples to WAS on the cloud yourself:
- Download the source code for a sample from GitHub and build your application using a Liberty server. The following articles describe how to use Maven to download and build the sample depending on whether you prefer to work from the command line or from within Eclipse:
- Most sample applications can be deployed without any further preparation but sample.javaee7.sleepybatchlet and sample.javaee7.jms require resources to be created before you attempt to deploy application on WAS in the cloud. Check the README.md files for each of those samples for detailed instructions.
- To deploy to WAS (whether in the cloud or on a local installation), you have two options:
- Using the graphical WAS administrative console
Deploying using wsadmin
- Navigate to your
bindirectory of your WAS installation. For example :
- Run the following command:
./wsadmin.sh -profileName AppSrv01 -lang jython -c "AdminApp.install('/opt/sample_name.war', '[ -MapWebModToVH [[ .* .* default_host ]] -appname sample_name]')"
Deploying using the WAS administrative console
- In your web browser, go to the WAS administrative console; for example:
- Log in with your user name and password.
- Click Applications > New Application.
- Select the New Enterprise Application link.
- Using the Local file system option, click Browse, and select the
.warfile that you built using Maven earlier.
- Click Next to follow the wizard using the default options until the Finish button is displayed.
- When the Confirm changes section is displayed, click Save.
- Click Applications > Application Types > WebSphere enterprise applications.
- Select the check box next to the sample application, and click Start.
- Use your browser to access application home page; for example: