Category Archives: jboss

JBoss EAP 7 and NoSQL using Java EE and Docker

JBoss EAP 7 Beta is now released, many congratulations to Red Hat and particularly to the WildFly team!

There are plenty of improvements coming in this release as documented in Release Notes. One of the major themes is Java EE 7 compliance.

JBoss EAP 7 and Java EE 7

IBM and Oracle already provide commercially supported Java EE 7-compliant Application Servers. And now Red Hat will be joining this party soon as well. Although WildFly has supported Java EE 7 for 2+ years but commercial support is a critical for open source to be adopted enterprise-wide. So this is good news!

You can learn all about different Java EE 7 APIs in the DZone Refcardz that I authored along with @alrubinger.

Java EE 7 Refcardz

There are plenty of “hello world” Java EE 7 Samples that should all run with JBoss EAP. Hopefully somebody will update the pom.xml and add a new profile.

Why NoSQL?

If you are building a traditional enterprise application then you might be fine using an RDBMS. There are plenty of advantages of using RDBMS but using a NoSQL database instead has a few advantages:

  • No need to have a pre-defined schema and that makes them a schema-less database. Addition of new properties to existing objects is easy and does not require ALTER TABLE. The unstructured data gives flexibility to change the format of data any time without downtime or reduced service levels. Also there are no joins happening on the server because there is no structure and thus no relation between them.
  • Scalability, agility and performance is more important than the entire set of functionality typically provided by an RDBMS. This set of databases provide eventual consistency and/or transactions restricted to single items but more focus on CRUD.
  • NoSQL are designed to scale-out (horizontal) instead of scale-up (vertical). This is important knowing that databases, and everything else as well, is moving into the cloud. RBDMS can scale-out using sharding but requires complex management and not for the faint of heart. Queries requiring JOINs across shards is extremely inefficient.
  • RDBMS have impedance mismatch between the database structure and the domain classes. An Object Relational Mapping, such as one provided by Java Persistence API or Hibernate is needed in such case.
  • NoSQL databases are designed for less management and simpler data models lead to lower administration cost as well.

So you are all excited about NoSQL now and want to learn more:

  • Why NoSQL?
  • Why do successful enterprises rely on NoSQL?
  • Top 10 Enterprise NoSQL Usecases

In short, there are four different types of NoSQL databases:

  • Document: Couchbase, Mongo, and others
  • Key/Value: Couchbase, Redis, and others
  • Graph: Neo4J, OrientDB, and others
  • Column: Cassandra and others

Java EE 7 provides Java Persistence API that does not provide any support for NoSQL. So how do you get started with NoSQL with JBoss EAP 7?

This blog will show how to query a Couchbase database using simple Java EE application deployed on JBoss EAP 7 Beta.

What is Couchbase?

Couchbase is an open-source, NoSQL, document database. It allows to access, index, and query JSON documents while taking advantage of integrated distributed caching for high performance data access.

Developers can write applications to Couchbase using different languages (Java, Go, .NET, Node, PHP, Python, C) multiple SDKs. This blog will show how you can easily create a CRUD application using Java SDK for Couchbase.

Run JBoss EAP 7

There are two ways to start JBoss EAP 7.

Download and Run

  • Download JBoss EAP 7 Beta and unzip.
  • Start the application server as:

Docker Run

In a containerized world, you just docker run to run your JBoss EAP. However, JBoss EAP image does not exist on Docker Hub and so the image needs to be explicitly built. You still need to explicitly download JBoss EAP and then use the following Dockerfile to build the image:

The image is built as:

And then you can run the JBoss EAP 7 container as:

Notice, how application and management ports are bound to all network interfaces. This will simplify to deploy the application to this JBoss EAP instance later.

Stop the server as we will show an easier way to start it later.

Start Application Server and Database

The Java EE application will provide a HTTP CRUD interface over JSON documents stored in Couchbase. The application itself will be deployed on JBoss EAP 7 Beta. So it would require to start Couchbase and JBoss EAP.

Use the Docker Compose file from github.com/arun-gupta/docker-images/blob/master/jboss-eap7-nosql/docker-compose.yml to start Couchbase and JBoss EAP 7 container:

The application is started as:

The started containers can be seen as:

Configure Couchbase Server

Clone couchbase-javaee application. This Java EE application uses Couchbase Java SDK APIs to connect to the Couchbase server. The bootstrap code is:

and is invoked from Database abstraction.

Couchbase Server can be configured using REST API. These REST APIs are defined in a Maven profile in pom.xml of this application. And so configure Couchbase server as:

Deploy Java EE Application to JBoss

Java EE Application can be easily deployed to JBoss EAP 7 Beta using the WildFly Maven Plugin. This is also defined as a Maven profile in pom.xml as well.

Deploy the application as:

Access the Application

As mentioned earlier, the application provides HTTP CRUD API over JSON documents stored in Couchbase.

Access the application as:

CRUD operations (GET, POST, PUT, DELETE) can be performed on Airline resource in the application. Complete CRUD API is documented at github.com/arun-gupta/couchbase-javaee.

This blog explained how to access a NoSQL database from JBoss EAP 7.

Read more about Couchbase 4:

  • What’s New in Couchbase Server 4.1
  • Couchbase Server documentation
  • Talk to us on Couchbase Forums
  • Follow @couchbasedev or @couchbase

Learn more about Couchbase in this recent developer-focused webinar:

JBoss EAP gives 509% ROI over closed source application servers

A new study by IDC shows how Red Hat JBoss EAP customers are significantly benefitting over closed source commercial application servers:

JBoss EAP IDC 2015

The study says that a common paradigm with JBoss EAP customers three years ago …

There was uncertainty about whether JBoss EAP would scale as well as more expensive options and whether JBoss EAP was as feature rich, particularly for high-end projects. Those concerns prevented IT operations from going all in on a single software standard. Despite that, customers were pleased with the benefits they were able to achieve from their use of JBoss EAP, and customers were able to achieve an impressive return on investment by adopting this approach.

Sounds familiar?
Does your company still think like that?
Do the closed source vendors still give you that pitch?

The study shares how customers’ perspectives have changed over these years …

Today, we’ve found that JBoss EAP customers are more systematic in their use of JBoss EAP or OpenShift by Red Hat as the standard application server or cloud application platform within a standardized environment. Customers are no longer worried that JBoss EAP is not as sophisticated as more expensive alternatives and now believe it’s at performance parity with its competitors.

There are much more fundamental benefits for developing in open source:

One customer said that because JBoss EAP comes from open source, it is built from a lot of good ideas from the community and the internal design is architected to make it simpler to use than non-community-based alternatives.

That’s why we love Community Powered Innovation!

The cost benefit cannot be over emphasized anyway:

the cost benefit associated with JBoss EAP gave them an affordable opportunity to standardize, whereas they would have been too cost challenged using other options.

And the customers are saying:

We did a cost-benefit analysis. Many of our applications need a development platform for multiple environments … and if we compare JBoss EAP with other solutions … it’s a no-brainer. Night and day

Are customers using it for only new projects? Or migrating their existing mission critical projects to JBoss EAP as well?

Three years ago …

Then it was enough to begin using JBoss EAP for new projects.

And now …

we’ve found that customers made the decision to migrate production applications to the new environment in order to gain speed and compliance benefits from standardizing application operations and change management.

Register and download the report now!

What are you waiting for?

Download JBoss EAP (Java EE 6 compliant) and get full commercial support or WildFly 10 Beta1 to try Java EE 7 and lots of other cool features!

JBoss Heroes – The Road to Awesome!

Juliet made one of the most famous quote in Romeo and Juliet play by William Shakespeare:

What’s in a name? that which we call a rose
By any other name would smell as sweet;

Red Hat announced JBoss Champions a few weeks ago. These are a selected group of community members who are passionate advocate of JBoss technologies. It fosters the growth of individuals that promote adoption of JBoss Projects and/or JBoss Products and actively share their deep technical expertise about it in the community, within their company and their customers or partners. This could be done in forums, blogs, screencasts, tweets, conferences, social media, whitepapers, articles, books, and other means.

The essence, purpose, and intention of the program is still exactly the same. The name is now changed to JBoss Heroes.

JBoss Hero

For completeness, let me repeat the main information in this blog as well.

Founding JBoss Heroes

Proud and excited to announce the first set of JBoss Heroes:

  1. Adam Bien (@AdamBien)
  2. Alexis Hassler (@alexishassler)
  3. Antonin Stefanutti (@astefanut)
  4. Antonio Goncalves (@agoncal)
  5. Bartosz Majsak (@majson)
  6. Francesco Marchioni (@mastertheboss)
  7. Geert Schuring (@geertshuring)
  8. Guillaume Scheibel (@g_scheibel)
  9. Jaikiran Pai
  10. John Ament (@JohnAment)
  11. Mariano Nicolas De Maio (@marianbuenosayr)
  12. Paris Apostolopoulos (@javapapo)

Many congratulations to the first set of JBoss Heroes!

Make sure to wish them using email, tweet, blog, or any other means that is available on their jboss.org profile. Give them a hug when you meet them at a conference. Ask them a tough JBoss question, challenge them! Invite them to your local Java User Group to give a talk about JBoss technology.

Want to nominate a JBoss Hero?

Do you have it in you, and feel worthy of being a JBoss Hero?

Want to nominate yourself, or somebody else?

Send an email to heroes@jboss.org.

Here are some likely candidates:

  • Senior developers, architects, consultants, academia who are using and promoting JBoss technologies using different means
    • Blogs and webinars
    • Publish articles on jboss.org, InfoQ, DZone, etc.
    • Social media
    • Talks at conferences and local JUGs/JBUGs
  • Implemented real-world projects using JBoss technologies
  • Actively answering questions in JBoss forums/StackOverflow
  • Authored a book on JBoss topic
  • Lead a JBoss User Group
  • Mentoring other community members and grooming heroes

Make sure the nominee has a current jboss.org profile and has all the relevant details. Include any references that will highlight your value to the JBoss community. The complete list of criteria is clearly defined at jboss.org/heroes.

Subscribe to the twitter feed of existing @jbossdeveloper/lists/jboss-heroes.

Once again, many congratulations to the first set of JBoss Heroes, and looking forward to many others.

Submit your nomination today!

Are you wondering why the name change? Ask me about it when we meet in person 😉

JBoss EAP 6.4 – Java 8, JSR 356 WebSocket, Kereberos auth for management

JBoss Enterprise Application Platform 6.4, an update to the commercial release of Red Hat’s Java EE 6 compliant application server is now available.

JBoss EAP Logo

Download JBoss EAP 6.4

For current customers with active subscriptions, the binaries can be downloaded from the Customer Support Portal. This also has Installer, Quickstarts, Javadocs, Maven repository, Source Code, and much more.

Bits are also available from jboss.org/products/eap under development terms & conditions; and questions can be posed to the EAP Forum.

New Features in JBoss EAP 6.4

The key new features are:

  • Java 8 Support
  • JSR 356 WebSockets 1.0 support
  • Kerberos auth for management API connections, EJB invocations, and selected database access
  • Hibernate Search included as a new feature
  • Support for nested expressions
  • Ability to read boot errors from the management APIs
  • Display of server logs in the admin console

Read the comprehensive list of new features in JBoss EAP 6.4.

Documentation

Complete documentation is available at Customer Support Portal, and here are quick links:

  • Release Notes
  • Documentation
    • Getting Started Guide
    • Installation Guide
    • Administration and Configuration Guide
    • Development Guide
    • Security Guide
    • Migration Guide

If you are looking for a Java EE 7 compliant application server, then download WildFly.

Announcing JBoss Champions

JBoss Champion

JBoss Champions is a selected group of community members who are passionate advocate of JBoss technologies under a program sponsored by Red Hat. It fosters the growth of individuals that promote adoption of JBoss Projects and/or JBoss Products and actively share their deep technical expertise about it in the community, within their company and their customers or partners. This could be done in forums, blogs, screencasts, tweets, conferences, social media, whitepapers, articles, books, and other means.

Founding JBoss Champions

Proud and excited to announce the first set of JBoss Champions:

  1. Adam Bien (@AdamBien)
  2. Alexis Hassler (@alexishassler)
  3. Antonin Stefanutti (@astefanut)
  4. Antonio Goncalves (@agoncal)
  5. Bartosz Majsak (@majson)
  6. Francesco Marchioni (@mastertheboss)
  7. Geert Schuring (@geertshuring)
  8. Guillaume Scheibel (@g_scheibel)
  9. Jaikiran Pai
  10. John Ament (@JohnAment)
  11. Mariano Nicolas De Maio (@marianbuenosayr)
  12. Paris Apostolopoulos (@javapapo)

Many congratulations to the first set of JBoss Champions! Make sure to wish them using email, tweet, blog, or any other means that is available on their jboss.org profile. Give them a hug when you meet them at a conference. Ask them a tough JBoss question, challenge them! Invite them to your local Java User Group to give a talk about JBoss

Want to nominate a JBoss Champion?

Do you have it in you, and feel worthy of being a JBoss Champion?

Want to nominate yourself, or somebody else?

Send an email to champions@jboss.org.

Here are some likely candidates:

  • Senior developers, architects, consultants, academia who are using and promoting JBoss technologies using different means
    • Blogs and webinars
    • Publish articles on jboss.org, InfoQ, DZone, etc.
    • Social media
    • Talks at conferences and local JUGs/JBUGs
  • Implemented real-world projects using JBoss technologies
  • Actively answering questions in JBoss forums/StackOverflow
  • Authored a book on JBoss topic
  • Lead a JBoss User Group
  • Mentoring other community members and grooming champions

Make sure the nominee has a current jboss.org profile and has all the relevant details. Include any references that will highlight your value to the JBoss community. The complete list of criteria is clearly defined at jboss.org/champions.

Subscribe to the twitter feed of existing JBoss Champions.

Once again, many congratulations to the first set of JBoss Champions, and looking forward to many others. Submit your nomination today!

Hibernate OGM: NoSQL solutions for Java EE (Hanginar #4)

Hibernate OGM Hibernate OGM brings the power and simplicity of JPA for NoSQL datastores.

It provides one standard way to access a variety of NoSQL datastores such as Infinispan, Ehcache, MongoDB, Neo4J. And support for others is coming. It even allows rich querying capabilities and convert them into datastore-specific query (if supported). You can even mix/match Persistence Unit in persistence.xml for a RBDMS and NoSQL datastore.

This hanginar (#1, #2, #3) with Emmanuel Bernard (@emmanuelbernard) shows how to get started with Hibernate OGM. It specifically addresses the following questions:

  • What NoSQL datastores are supported?
  • Can I build support for other datastores?
  • What application servers can it run on?
  • Do I need Hibernate for it, or does it work with EclipseLink?
  • Can I have a SQL and NoSQL PU in persistence.xml and access them from Java EE application?
  • Can I use this in Java SE applications?

Learn everything about Hibernate OGM at hibernate.org/ogm/.

Source code used in the webinar is at github.com/hibernate/hibernate-demos/tree/hanginar-201501.

Enjoy!

Enable Arquillian on an existing Java EE project, using Forge Addon (Tech Tip #54)

Tech Tip #34 explained how to create a testable Java EE 7 application. This is useful if you are starting a new application. But what if you already have an application and Arquillian-enable it ?

That’s where Forge and Forge-Arquillian add-on comes in handy. That’s how I added support for Arquillian in javaee7-simple-sample. The updated source code is at github.com/arun-gupta/javaee7-continuous-delivery.

Lets see what was done!

  1. Download and install Forge. You can download ZIP and unzip in your favorite location, or just use the following command that does it for you:
  2. Clone the simple-javaee7-sample repo
  3. Change the directory to javaee7-simple-sample and start Forge:
  4. Install the Forge-Arquillian add-on:
  5. Configure Arquillian add-on and install WildFly adapter:
    The list of adapters is diverse as shown:
    This allows you to configure the container of your choice. This will add the following profile to your “pom.xml”:
    The profile includes the “wildfly-arquillian-container-remote” dependency which allows Arquillian to connect with a WildFly running in remote “mode”. The default host is “localhost” and port is “8080”. The “maven-surefire-plugin” is passed a “arquillian.launch” configuration property with the value “arquillian-wildfly-remote”. This is matched with a “container” qualifier in the generated “arquillian.xml”.

    “arquillian.xml” is used to define configuration settings to locate or communicate with the container. In our case, WildFly is running on default host and port and so there is no need to update this file. The important part to note is that the “container” qualifier matches with the “arquillian.launch” qualifier value.

    This file. More details about this configuration file are available here.

  6. Until FORGE-2148 is fixed, you also need to add a JAX-RS implementation as well, and the corresponding JAXB provider. This test is using RESTEasy and so the following needs to be added:

    This can be added either in the profile or project-wide dependencies.

And now you are ready to test!

Download WildFly 8.1 and unzip. Start the server as:

Run the tests:

And now you’ve Arquillian-enabled your existing project!

Once again, the complete source code is available at github.com/arun-gupta/javaee7-continuous-delivery.

File any issues here.

Enjoy!

Data as a Service: JBoss Data Virtualization and Hadoop powering your Big Data solutions

Guest blog by Syed Rasheed (@Junooni).

Red Hat and Cloudera, announce the formation of a strategic alliance. From JBoss perspective, the key objective of the alliance is to leverage big data enterprise-wide and not let Hadoop become another data silo. Cloudera combined with Red Hat JBoss Data Virtualization integrates Hadoop with existing information sources including data warehouses, SQL and NoSQL databases, enterprise and cloud applications, and flat and XML files. The solution creates business-friendly, reusable and virtual data models with unified views by combining and transforming data from multiple sources including Hadoop. This creates integrated data available on-demand for external applications through standard SQL and web services interfaces.

The reality at vast majority of organization is that data is spread across too many applications and systems. Most organizations don’t know what they’ve lost because their data is fragmented across the organization. This problem does not go away just because an organization is using big data technology like Hadoop; in fact, they get more complicated. Some organizations try to solve this problem by hard coding the access to data stores. This simple approach inefficiently breaks down silos and brings lock-in with it. Lock-in makes applications less portable, a key metric for future proofing IT. This approach also impedes organizational agility because hard coding data store access is time consuming and makes IT more complex, incurring technical debt. Successful business need to break down the data silos and make data accessible to all the applications and stakeholders (often a requirement for real time contextual services).

redhat-jboss-datavirt

A much better approach to solving this problem is abstraction through data virtualization. It is a powerful tool, well suited for the loose coupling approach prescribed by the Modern Enterprise Model. Data virtualization helps applications retrieve and manipulate data without needing to know technical details about each data store. When implemented, organizational data can be easily accessed using a simple REST API or via familiar SQL interface.

Data Virtualization (or an abstracted Data as a Service) plugs into the Modern Enterprise Platform as a higher-order layer, offering the following advantages:

  • Better business decisions due to organization wide accessibility of all data
  • Higher organizational agility
  • Loosely coupled services making future proofing easier
  • Lower cost

Data virtualization is therefore a critical part of the big data solution. It facilitates and improves the use of big data in the enterprise by:

  • Abstracting big data into relational-like views
  • Integration with existing enterprise sources
  • Adding real time query capabilities to big data
  • Providing full support for standard based interfaces like REST and OData in addition JDBC and ODBC.
  • Adding security and governance to the big data infrastructure
  • Flattening data siloes through a unified data layer.

Want to learn more, download, and get started with JBoss Data Virtualization visit http://www.jboss.org/products/datavirt

Data Virtualization by Example https://github.com/datavirtualizationbyexample

Interested in community version then visit http://teiid.jboss.org/

Java EE 7, JBoss, WildFly, Devoxx4Kids, and Parties at JavaOne 2014

JavaOne 2014 is about a week away, although some of festivities will start next Friday! This is going to be my 16th JavaOne in as many years and I’ve really enjoyed participating in each one of them. As always, there is great content lined up with rockstar speakers. This conference is a confluence of movers and shakers in the Java world and provides plenty of opportunities to engage with them. This is going to be my first year as Red Hatter and looking forward to catching up with friends and colleagues.

And in case you are wondering, and care about it, here are my engagements for that week:

Saturday, Sep 27

Devoxx4Kids Day
7pm – 11:30pm: NetBeans Party

Sunday, Sep 28

8am – 9:30am, Java Champions Brunch
7pm – 8:30pm: Duke Choice Awards
8pm – 11pm: Java EE Appreciation Event

Monday, Sep 29

8:30am – 10:30am Java EE 7 Soup to Nuts Tutorial [TUT1952]
11:30pm – 12:30pm Meet the Experts on Java EE and HTML5 Enterprise Application Development
1:30pm – 2:00pm Java EE 7 Essentials book signing at O’Reilly Booth

Tuesday, Sep 30

8:30am – 10:30am: Devoxx4Kids for Parents Tutorial [TUT1878]
12:30pm – 1:30pm: Lessons learned from real-life Java EE 7 Deployments [CON2450]
2:30pm – 4pm: Java EE Hackergarten
6pm – 9pm: Oracle Authors Appreciation Party
7pm – 9pm: JavaOne IGNITE
7pm – 10pm: PartyOne
7pm – 9:30: Java Champions Social
8pm – 8:45pm: Technology Evangelists Gathering [BOF12166]

Wednesday, Oct 1

1pm – 1:30pm: Book signing on Java EE and HTML5 Enterprise Application Development book (OOW bookstore in Moscone South, Upper Hall Lobby)
4pm – 6:30pm: #JavaOneStreak meetup, Hilton San Francisco Union Square, Sutter

Thursday, Oct 2

11:50: Broadening JCP Program Participation [CON9775]

I’ll also be running my own “hallway track” and so feel free to meet there. Of course, you can catch me at Red Hat booth as well!

There are lots of Red Hat speakers and sessions at the conference as well. And if you are not able to attend a Red Hat session then you can check out the mini-sessions in the exhibit hall.

See ya there!

Load Balance WebSockets using Apache HTTPD (Tech Tip #48)

JBoss EAP 6.3 provides a technology preview of WebSocket and WildFly have supported them as part of Java EE 7 compliance.

github.com/javaee-samples/javaee7-samples/tree/master/websocket provide tons of Java EE 7 samples that run on WildFly. If you are interested in similar functionality on JBoss EAP 6.3 then github.com/jboss-developer/jboss-eap-quickstarts/tree/6.4.x-develop/websocket-hello is a quickstart. In addition, there are a few more samples at github.com/arun-gupta/jboss-samples/tree/master/eap63.

One of the common questions asked related to WebSockets is how to how to load balance  them. This Tech Tip will explain that for WildFly and JBoss EAP 6.3.

First, what are the main components ?

  • At least Apache HTTPD 2.4.5 is required. Now HTTPD binaries are not available for Mac but fortunately compiling instructions are explained clearly in Tech Tip #45.
  • mod_proxy_wstunnel is an Apache module that provides support for tunneling of Web Socket connections to a backend Web Sockets server, such as WildFly or JBoss EAP. It is a support module to mod_proxy that provide support for a number of popular protocols as well as several different load balancing algorithms. The connection is automagically upgraded to a WebSocket connection.  And all the modules are already included in the modules directory.
  • mod_proxy_balancer module is required that provides load balancing for HTTP and other protocols.

Let’s go!

  1. Download and unzip WildFly 8.1.
  2. Start WildFly 8.1 in domain mode using ./bin/domain.sh.
  3. Download this chat sample, rename the file to “chat.war” and deploy to “main-server-group” as:
    The only difference from the original Java EE 7 WebSocket Chat sample is the addition of System.getProperty("jboss.node.name") to display the name of WildFly instance serving the application. The source code is available at github.com/arun-gupta/wildfly-samples/tree/master/websocket-loadbalance.
  4. Uncomment the following lines in /usr/local/apache2/conf/httpd.conf:
    This will enable all the required modules.
  5. Add the following code fragment at the end of “httpd.conf”:
    Proxy is a container for proxied resources and is creating a load balancing group in this case using balancer directive. BalancerMember adds a member to this load balancing group.  ProxyPass is a standard directive that maps remote servers running on different ports into the space of the local server. In this case, WildFly is started in domain mode and so starts two instances on port 8080 and 8230. Both of these instances are mapped to localhost:80, which is where Apache HTTPD is running by default.

The deployed chat sample is now accessible at localhost:8080/chat (first instance in the managed domain), localhost:8230/chat (second WildFly instance in the managed domain), and localhost/chat (via Apache HTTPD).

Now even if you kill one of the WildFly instances, the other instance will continue to serve the client. Note, this only gives application availability as there is no session failover in this.

This was also verified on JBoss EAP 6.3 and there are a few differences:

  1. Use the sample from github.com/arun-gupta/jboss-samples/tree/master/eap63/websocket-chat instead.
  2. The generated archive name is different and so the command would look slightly different too:
  3. Configure “httpd.conf” as:

And that’s it!

Watch this live in action:

An important point to understand is that there is no concept of “sticky sessions” in WebSocket as, unlike HTTP, there is a direct and “permanent” connection between the client and the server in this case.

Enjoy!

Java EE 6 Sample, with HTML5, jQuery, Hybrid mobile: aka Ticket Monster (Tech Tip #44)

Java EE 7 was released last year, Java EE 8 preparations have already started, so what tempts me to write a blog about Java EE 6 ?

A few reasons …

  • Even though Java EE 5 was the first version where some of the specs were updated to simplify the platform, Java EE 6 is where higher productivity became the primary focus and kicked into high gear.
  • All commercially available application servers are still Java EE 6 compliant.
  • Java EE 7 is pretty cool and provide an awesome bunch of new technologies like WebSocket, Batch, JSON, and Concurrency. But customers are still sticking around with older version of the platform because these applications, servers, and environments cannot change overnight.

So if you are looking for a real-world Java EE 6 sample application that:

  • Use Eclipse for building a Java EE 6 application
  • Build persistence layer with JPA2 and Bean Validation
  • Build business services with JAX-RS
  • Building the User Interface with HTML5
  • Building Administration UI with JBoss Forge
  • Building statistics dashboard using HTML5 and JavaScript
  • Hybrid mobile version of the app using Apache Cordova

In addition, it also shows:

  • Deploy your application on a local instance or a remote instance running in OpenShift
  • Run tests against your JBoss instance

Ticket Monster is your ultimate source. It not only shows how the key Java EE 6 technologies can be used together but also integrate jQuery, HTML5, and mobile version of the application as well.

The video below gives a quick preview of the application:

An instance of Ticket Monster can be previewed at ticketmonster-jdf.rhcloud.com or timo-milestogo.rhcloud.com.

So how do you get started ?

  1. Download Ticket Monster 2.6.0 (with tutorials). Corresponding source code is at github.com/jboss-developer/ticket-monster/tree/2.6.0.Final-with-tutorials.
  2. Set up Red Hat Maven repositories as explained here. If you don’t care reading through the instructions, overwrite .m2/settings.xml with this settings.xml.
  3. Build the WAR of your application
  4. To run on local JBoss instance:
    • Download JBoss EAP 6.3
    • Unzip and start as
    • Deploy the application as
      This will also build the application again.

      The application is now accessible at localhost:8080/ticket-monster.

  5. To run on JBoss instance in OpenShift
    • Create a JBoss EAP 6 application in OpenShift
    • Add PostgreSQL cartridge for this application
    • Create an archive as

      This will use the installed PostgreSQL cartridge for persistence.

    • Clone the git workspace from OpenShift

      The actual git url will be specific to your application.

    • Copy generated WAR file to git workspace and rename to ROOT.war

    • Remove existing source and pom.xml from git workspace, add WAR, and push

    • Access the application at htp://<appname-domainname>.rhcloud.com.The following video shows the steps for running TicketMonster on OpenShift:

Ask your questions about Ticket Monster at jbossdeveloper@lists.jboss.org.
Enjoy!

JBoss Middleware: Accelerate, Integrate, Automate

RHJB_Middleware_Logotype_RGB-Gray_0213_cw_300

Ever wondered how to understand multiple Red Hat JBoss middleware offerings ?

Mike Piech (@mpiech), GM of JBoss Middleware Business Unit explains them in a succinct video:

Its structured in three buckets:

Accelerate – Building things faster

  • JBoss Enterprise Application Platform provides an innovative modular, cloud-ready architecture, powerful management and automation, and world class developer productivity. It is Java™ EE 6 certified and features powerful yet flexible management, improved performance and scalability, and many new features to maximize developer productivity.
  • Red Hat JBoss Web Server is the only enterprise-class web server solution you need for large-scale websites and lightweight web applications. It provides a more secure and a more stable environment of open source web software, like Apache and Tomcat.
  • Red Hat JBoss Developer Studio provides superior support for your entire development lifecycle. It includes a broad set of tooling capabilities and support for multiple programming models and frameworks, including Java™ Enterprise Edition 6, HTML5, and many other popular technologies. It provides developer choice in supporting multiple JVMs, productivity with Maven, and in testing with Arquillian. It is fully tested and certified to ensure that all its plug-ins, runtime components, and their dependencies are compatible with each other.
  • Red Hat JBoss Data Grid gives you a straightforward approach to overcoming data obstacles, providing the ability to quickly access accurate, real-time information, meet high uptime requirements, streamline interaction with complex and rigid data tiers, and handle unprecedented transaction volumes.
  • Red Hat JBoss Portal is a proven solution for building high-impact, self-service applications

Integrate – Pull the pieces together

  • Red Hat JBoss Fuse is a flexible, small-footprint enterprise service bus (ESB) that enables rapid integration across the extended enterprise. Integration everywhere – on-premise or in the cloud.
  • Red Hat JBoss A-MQ is a flexible, high-performance messaging platform that delivers information reliably, enabling real-time integration and the Internet of Things (IOT).
  • Red Hat JBoss Fuse Service Works is a platform that creates reusable, changeable, and flexible business services that hide the complexity of connecting to different applications in your enterprise. It sets the stage for faster and easier cloud applications, mobile applications, and business process development projects.
  • Red Hat JBoss Data Virtualization is a lean, virtual data integration solution that unlocks trapped data and delivers it as easily consumable, unified, and actionable information. JBoss Data Virtualization makes data spread across physically diverse systems—such as multiple databases, XML files, and Hadoop systems—appear as a set of tables in a local database.

Automate – Automate significant parts of your business

  • Red Hat JBoss BRMS is a comprehensive platform for business rules management and complex event processing. Organizations can incorporate sophisticated decision logic into line-of-business applications and quickly update underlying business rules as market conditions change.
  • Red Hat JBoss BPM Suite is a comprehensive platform for business process management. It includes all the business rules and complex event processing (CEP) capabilities of Red Hat JBoss BRMS [business rules management system], along with advanced tools and runtime support for Business Process Model and Notation v2.0 (BPMN2)-compliant business processes.

And this is also shown in the following image:

accelerate-integrate-automate

Learn all about it at:

  • http://www.redhat.com/products/jbossenterprisemiddleware/
  • Get a quick overview in this technology brochure
  • Why choose JBoss Middleware over IBM Web’s fear ?
  • Why choose JBoss Middleware over Oracle conFusion ?

JBoss EAP 6.3 now available!

JBoss EAP 6.3 is now available!

jboss-eap-logo

This release brings continued progress on the road to making EAP the most manageable and secure Java EE 6-compliant Application Server for traditional and cloud based workloads. It also continues the core themes of the EAP 6 major version family of better user experience, improved manageability, and enhanced performance.

Where to download ?

For current customers with active subscriptions, the Beta can be downloaded from the customer support portal.

For community users developing applications that will be deployed on a supported EAP, the bits will soon be made available from www.jboss.org/products/eap under development terms & conditions, and questions can be posed to the EAP Forum.

Where are docs ?

Complete documentation is available on customer support portal, and here are quick links:

  • Release Notes
  • Administration and Configuration Guide
  • Development Guide
  • Getting Started Guide
  • Installation Guide
  • Migration Guide
  • Security Guide

What’s new ?

  • PicketLink enhancements
  • Domain recovery improvements
  • Support for PKCS11 keystores
  • Web management console
    • Patching available
    • Testing DataSources
    • Unified navigation labels
    • Opt-in analytics collection
  • Deployment overlay enhancement
  • Support for Microsoft Windows Server 2012 R2 and Red Hat Enterprise Linux 7

Complete list of new features is described here.

Some of the features are available in Tech Preview mode such as WebSockets, adding/removing modules using JBoss CLI, multi-JSF and many more.

Features like JBoss OSGi, STOMP with HornetQ, mod_jk and mod_cluster with Apache on RHEL 7 and some others are not supported.

If you are looking for a Java EE 7-compliant Application Server, then download WildFly.

Adding Java EE 7 Batch Addon to JBoss Forge ? – Part 7 (Tech Tip #41)

This is the seventh part (part 1part 2, part 3, part 4, part 5) of a multi-part video series where Lincoln Baxter (@lincolnthree), George Gastaldi (@gegastaldi) and I are interactively building a Forge addon to add Java EE 7 Batch functionality. So far, here is what different parts have shown:

  • Part 1 showed how to get started with creating an addon, add relevant POM dependencies, build and install the addon using Forge shell, add a new command batch-new-jobxml, and add --reader--processor--writer parameters to the newly added command.
  • Part 2 showed how to identify classes for each CLI parameter that already honor the contract required by the Batch specification.
  • Part 3 showed how parameters can be made required, created templates for reader, processor, and writer, validated the specified parameters.
  • Part 4 added a new test for the command and showed how Forge can be used in debug mode.
  • Part 5 fixed a bug reported by a community member and started work to make processor validation optional.
  • Part 6 upgraded from 2.6.0 to 2.7.1 and started work on reader, processor, and writer template files.

This part shows:

  • Merged the request by George in the workspace
  • Reader, processor, and writer source files are created if they do not exist

Enjoy!

As always, the evolving source code is available at github.com/javaee-samples/forge-addons.

Next episode will add a new test for this functionality.

Red Hat JBoss Data Grid 6.3 is now available!

Red Hat’s JBoss Data Grid is an open source, distributed, in-memory key/value data store built from the Infinispan open source software project. Whether deployed in client/server mode or embedded in a Java Virtual Machine, it is built to be elastic, high performance, highly available and to scale linearly.

JBoss Data Grid is accessible for both Java and non-Java clients. Using JBoss Data Grid, data is distributed and replicated across a manageable cluster of nodes, optionally written to disk and easily accessible using the REST, Memcached and Hot Rod protocol, or directly in process through a traditional Java Map API.

  • Download bits
  • Supported configurations
  • Component details

The key features of JBoss Data Grid are:

  • Schema-less key/value store for storing unstructured data
  • Querying to easily search and find objects
  • Security to store and restrict access to your sensitive data
  • Multiple access protocols with data compatibility for applications written in any language, using any framework
  • Transactions for data consistency
  • Distributed execution and map/reduce API to perform large scale, in-memory computations in parallel across the cluster
  • Cross-datacenter replication for high availability, load balancing and data partitioning

What’s new in 6.3 ?

  • Expanded security for your data
    • User authentication via Simple Authentication and Security Layer (SASL)
    • Role based authorization and access control to Cache Manager and Caches
    • New nodes required to authenticate before joining a cluster
    • Encrypted communication within the cluster
  • Deploy into Apache Karaf and WebLogic
    • Use as an embedded or distributed cache in Red Hat JBoss Fuse integration flows
  • Enhanced map/reduce
    • Improved scalability by storing computation results directly in the grid instead of pushing them back to the application
    • Takes advantages of hardware’s parallel processing power for greater computing efficiencies
  • New JPA cache store that preserves data schema
  • Improved remote query and C# Hot Rod client in technology preview
  • JBoss Data Grid modules for JBoss Enterprise Application Platform (JBoss EAP)

The complete list of new and updated features is described here.

How can this be installed on JBoss EAP ?

JBoss Data Grid has 2 deployment modes:

  • Library mode (embedded distributed caches)
  • Client-Server mode (remote distributed cache) – Install the Hot Rod client JARs in EAP, and have application reference these jars to use the Hot Rod protocol to connect to the JBoss Data Grid Server (remote cache).

Why a new C# client ?

The remote Hot Rod client is aware of the cluster topology and hashing scheme on Server and can get to a (k,v) entry in a single hop. In contrast, REST and memcached usually require an extra hop to get to an entry. As a results, Hot Rod protocol has higher performance, and is the preferred protocol (in Client-Server mode). JBoss Data Grid 6.1 only had a Java Hot Rod client – for all other languages, customers had to use memcached or REST. JBoss Data Grid 6.2 added C++ Hot Rod client. And now JBoss Data Grid 6.3 added a Tech Preview of C# client.

Infinispan has a lot more Hot Rod clients.

How would somebody use JBoss Data Grid with JBoss Fuse ?

The primary purpose is caching in integration workflows.

For example, remote JBoss Data Grid can be used with Fuse to cache search results.
REST can be used to communicate with a remote cache, but Hot Rod can now be used starting with JBoss Data Grid 6.3.

Fuse currently has camel-cache component which is based on EHCache. There is also a new camel-infinispan component was released in the community.

We plan to productize the camel-infinispan component in a future release.

Why would somebody use JBoss Data Grid on WebLogic ?

Customers who run WebLogic stack and eventually want to migrate to JBoss stack can start migration by replacing Oracle Coherence with JBoss Data Grid. And here is a comparison between the two offerings:

The complete documentation is available here and quick references are below:

  • Release Notes
  • Getting Started Guide
  • Administration and Configuration Guide
  • API Documentation
  • Developer Guide
  • Infinispan Query Guide
  • Feature Support Document

Some useful references:

  • Getting started with Infinispan Refcard
  • Infinispan 6.x user guide