Friday Dec 20, 2013

Server Sent Events (SSE) in Glassfish/Jersey

As you know, HTTP is a stateless protocol. For most use cases in the enterprise, the statelessness of HTTP is a huge boon for scalability - a benefit that is also extended to REST. However, there is a certain class of arguably emerging use cases for which the stateless nature of HTTP is actually a scalability challenge. These use cases require the bidirectional, full-duplex, asynchronous characteristics of stateful protocols such as TCP. Examples include chat-like online collaboration, stock-ticker like command-control/monitoring, online gaming and the like. WebSocket (and the Java API for WebSocket newly included in Java EE 7 :-)) is ideal for these cases. Between the seemingly diametric opposites of plain HTTP and WebSocket, there's also Server Sent Events (SSE). SSE is aimed at yet another scenario - a steam of events generated by the server and consumed passively by the client. Although not standardized in JAX-RS 2/Java EE 7, Jersey/GlassFish includes support for SSE.

In an very detailed blog post, Rahman Usta of the Istanbul JUG explains SSE and demonstrates a non-trivial use of the Jersey/GlassFish support for SSE.

Thursday Feb 28, 2013

Ashwin Rao on HTML5/NetBeans 7.3

As you may know, NetBeans 7.3 is creating quite a buzz in the community. The 122th episode of the Java Spotlight podcast features an interview with NetBeans Group Product Manager Ashwin Rao. Although he generally keeps a pretty low profile, Ashwin is one of the key folks driving NetBeans forward. He talks with Roger Brinkley about the HTML 5 landscape, the new features in NetBeans such as excellent JavaScript editing capabilities powered by the Nashorn engine on par with the Java editor, support for JavaScipt/HTML 5 frameworks like JQuery, AngularJS and backbone.js as well as enhanced browser integration.

 

 

The podcast also covers Java SE 6, Java EE 7, JavaFX and JavaOne India. You can listen to the full podcast here. If you are hungry to learn more about NetBeans 7.3 after you listen to the podcast, you can check out the list of new features and a cool video on the release.

Wednesday Oct 03, 2012

JavaOne: Parleys.com, Spring Vs. Java EE and HTML5 tooling

Parleys.com, a 2012 Duke's Choice Award winner, is an E-Learning platform that host content from different sources (conferences, JUGs meetings, etc.). There is a lot of technical content available for online but also offline consumption, including many sessions on Java EE. Parleys has just released, for free, all the Devoxx 2011 sessions (video and slides sync'ed!).

From a technical point of view, Parleys.com is interesting as they have switched from Spring to Java EE 6 to avoid being locked in a proprietary framework. During the GlassFish Community BoF, Stephan Janssen (Parleys.com and Devoxx founder) also presented how GlassFish is used to support 2000 concurrent Parleys users over a cluster of 2 GlassFish instances.


Talking about Java EE and/or Spring, Harshad Oak has posted an update on the 'Spring Vs. Java EE' panel discussion that took place on Tuesday. As Arun said standards such as Java EE does not necessarily refrain innovation: "JBoss Forge & Arquillian from RedHat are great examples of innovation in the JavaEE community. Standardization is important but innovation does continue even within that framework."


Simplicity, productivity along with HTML5 are the driving themes of Java EE 7. In terms of simplicity and productivity, the developer experience can also be improved by the tooling. Every NetBeans release comes with a large set of improvements, the just released NetBeans 7.3 beta is no exception.
The goal of ‘NB 7.3’s Project Easel’ is to improve HTML5 development, something that will be handy for Java EE 7 developers. Project Easel can, for example, communicate directly to Chrome's WebKit engine, this feature was shown during Sunday's Technical Keynote at the end of the Java EE section. In this beta release, Chrome and the embedded JavaFX browser are the only supported browsers but the NetBeans team plan to add support, over time, for other WebKit based browsers.


Today (i.e. Wednesday 3rd) is also the final exhibition day, so make sure to visit the Java EE and the GlassFish pods on the Java DEMOgrounds (Hilton Grand Ballroom, 9:30 am - 5:00 pm).
Finally, here are some Java EE and GlassFish related activities worth attending today if you are at JavaOne :
Wednesday October 3rd
Time Title Location
8:30-9:30am What's New in Servlet 3.1: An Overview Parc 55 Mission
8:30-9:30am Bean Validation 1.1: What's New Under the Hood Parc 55
Cyril Magnin II/III
10:00-11:00am JSR 353: Java API for JSON Processing Parc 55 Mission
10:00-12:00pm Tutorial : Integrating Your Service into the GlassFish PaaS Platform Parc 55 Devisidero
11:30-12:30pm What's New in JSF: A Complete Tour of JSF 2.2 Parc 55
Cyril Magnin I
11:30-12:30pm Best of Both Worlds: Java Persistence with NoSQL and SQL Parc 55 Mission
1:00-2:00pm Sharding Middleware to Achieve Elasticity and High Availability in the Cloud Parc 55
Market Street
1:00-2:00pm Pimp My RESTful Java Applications Parc 55
Cyril Magnin I
3:00-4:00pm Migrating Spring to Java EE Parc 55
Cyril Magnin II/III
4:30-5:30pm JavaEE.Next(): Java EE 7, 8, and Beyond Parc 55
Cyril Magnin II/III
4:30-5:30pm HTML5 WebSocket and Java Parc 55
Cyril Magnin I
4:30-5:30pm Easy Middleware for Your Embedded Device Nikko Ballroom II/III

Monday Oct 01, 2012

The first day of JavaOne is already over!

In the past Sunday used to be a more relaxing day with ‘just’ some JavaOne activities going on. Sunday used to be a soft day to prepare yourself for an exhausting week. This is now over as JavaOne is expanding; Sunday is now an integral part of the conference. One of the side effect of this extra day is that some activities related to JavaOne and OpenWorld such as MySQL Connect are being push to start a day earlier on Saturday (can you spot the pattern here?).

On the GlassFish front, Sunday was a very busy day! It started at the Moscone Center with the annual GlassFish Community Event where the Java EE 7 and GF 4 roadmaps were presented and discussed. During the event, different GlassFish users such as ZeroTurnaround (the JRebel guys), Grupo RBS and IDR Solutions shared their views on GF, why they like GF but also what could be improved. The event was also a forum for the GF community to exchange with some of the key Java EE / GlassFish Oracle Executives and the different GF team members.

The Java Strategy Keynote and the JavaOne Technical Keynote were held in the Masonic Auditorium later in the after-noon. Oracle executives have presented the plans for Java SE, Java FX and Java EE. Here are some personal takeaways from those keynotes.

Modularity
Modularity is a big deal. We know by now that Project Jigsaw will not be ready for Java SE 8 but in any case, it is already possible (and encouraged) to test Jigsaw today.
In the future, Java EE plan to rely on the modularity features provided by Java SE, so Project Jigsaw is also relevant for Java EE developers.
Shorter term, to cover some of the modular requirements, Java SE will adopt the approach that was used for Java EE 6 and the notion of Profiles. This approach does not define a module system per say; Profiles is a way to clearly define different subsets of Java SE to fulfill different needs (e.g. the full JRE is not required for a headless application). The introduction of different Profiles, from the Base profile (10mb) to the Full Profile (+50mb), has been proposed for Java SE 8.

Embedded
Embedded is a strong theme going forward for the Java Plaform. There is now a dedicated program : Java Embedded @ JavaOne

Java by nature (e.g. platform independence, built-in security, ability easily talks to any back-end systems, large set of skills available on the market, etc.) is probably the most suited platform for the Internet of Things.

You can quickly be up-to-speed and develop services and applications for that space just by using your current Java skills. All you need to start developing on ARM is a 35$ Raspberry Pi ARM board (25$ if you are cheap and can live without an ethernet connection) and the recently released JDK for Linux/ARM. Obviously, GlassFish runs on Raspberry Pi.

If you wan to go further in the embedded space, you should take a look Java SE Embedded, an optimized, low footprint, Java environment that support the major embedded architectures (ARM, PPC and x86).

Finally, Oracle has recently introduced Java Embedded Suite, a new solution that brings modern middleware capabilities to the embedded space. Java Embedded Suite is an optimized solution that leverage Java SE Embedded but also GlassFish, Jersey and JavaDB to deploy advanced value added capabilities (eg. sensor data filtering and) deeper in the network, closer to the devices.

JavaFX
JavaFX is going strong! Starting from Java SE 7u6, JavaFX is bundled with the JDK. JavaFX is now available for all the major desktop platforms (Windows, Linux and Mac OS X). JavaFX is now also available, in developer preview, for low end device running Linux/ARM. During the keynote, JavaFX was shown running on a Raspberry Pi!

And as announced during the keynote, JavaFX should be fully open-sourced by the end of the year; contributions are welcome!.

There is a strong momentum around JavaFX, it’s the ideal client solution for the Java platform. A client layer that works perfectly with GlassFish on the back-end. If you were not convince by JavaFX, it’s time to reconsider it!

As an old Chinese proverb say “One tweet is worth a thousand words!”

HTML5, Project Avatar and Java EE 7
HTML5 got a lot of airtime too, it was covered during the Java EE 7 section of the keynote. Some details about Project Avatar, Oracle’s incubator project for a TSA (Thin Server Architecture) solution, were diluted and shown during the keynote.

On the tooling side, Project Easel running on NetBeans 7.3 beta was demo’ed, including a cool NetBeans debugging session running in Chrome!

HTML 5, Project Avatar and Java EE 7 deserve separate posts...

Feedback
We need your feedback! There are many projects, JSRs and products cooking : GlassFish 4, Project Jigsaw, Concurrency Utilities for Java EE (JSR 236), OpenJFX, OpenJDK to name just a few. Those projects, those specifications will have a profound impact on the Java platform for the years to come! So if you have the opportunity, download, install, learn, tests them and give feedback! Remember, you can "Make the Future Java!"


Finally, the traditional GlassFish Party at the Thirsty Bear concluded the first JavaOne day. This party is another place where the community can freely exchange with the GlassFish team in a more relaxed, more friendly (but sometime more noisy) atmosphere. Arun has posted a set of pictures to reflect the atmosphere of the keynotes and the GlassFish party.


You can find more details on the others Java EE and GlassFish activities here.

Wednesday Jan 11, 2012

JSF and HTML 5 intersection - Server Sent Events

Note: if you're reading this using a feedreader, please make sure you've updated to the updated TheAquarium feed.

Roger Kitain from the GlassFish JSF team has made available a recent article he wrote for JAX's Java Tech Journal titled "JSF 2 and HTML 5 Server Sent Events".

The article explores how one of many many HTML5 technologies, Server Sent Events (SSE), can be incorporated in a JSF UI. It includes sample code for creating JSF composite components used for a stock quote application that features server-initiated page refreshes (using SSE).

ALT_DESCR

While not as powerful as the WebSocket protocol, HTML 5 Server Sent Events can used to provide partial page refresh without moving away from the HTTP protocol.

.

Wednesday Sep 28, 2011

Ed Burns discusses JSF and HTML5

Ed Burns, the JSF spec lead, has a blog post discussing HTML5 in JSF 2.2 and identifying Metadata, Sectioning and Form elements as the key areas to evolve in the specification.

ALT_DESCR

We've previously discussed support for WebSocket in GlassFish/Grizzly but the wider HTML5 standard, while still somewhat of a moving target, cannot be ignored.

Expect more concrete news and progress in the coming weeks and months in both specifications and implementations.

Thursday Mar 24, 2011

WebSockets support in GlassFish 3.1 (and Grizzly)

There is no need to wait for Java EE 7 or GlassFish 4.0 to use the WebSocket protocol. As we've covered in the past the bottom line is that you can use WebSockets today with GlassFish 3.1.

ALT DESCR

GlassFish 3.1 (Grizzly 1.9.32) implements the -76 version of the WebSocket Protocol and was used to created this series of screencasts. Justin has many more details on what can be done with the stable and supported release of GlassFish. This version of WebSockets is reported to be supported by Google Chrome 6, Safari 5.0.1, and Firefox 4.0 (although disabled by default).

As browsers move to implement newer versions of the WebSocket protocol, you'll need to get into bleeding edge territory (i.e. not supported) and use a more recent version of Grizzly. Either update GlassFish 3.1 to the fresh from the oven version 1.9.33 (see Justin' blog about this) or use grizzly 2.0 directly. The -06 version in particular is supported in 1.9.33. Whichever version you end up using, don't forget to enable support for WebSocket in GlassFish.

Check out also this recent slide deck from Justin.

Thursday Oct 21, 2010

46 GlassFish Videos! 31K Views!

We have been adding videos to our YouTube channel: GlassFishVideos.  The latest video is from Vince, where he covers the features he has been adding (see GlassFish 3.1 and NetBeans 6.10).

GlassFishVideos now has 46 videos grouped into different playlists. Stats as I write this note are 10,029 channel views, 31,518 upload views and 248 subscribers, which is pretty good for a channel we started in late July; we are declaring it a success and will continue to post videos there.

Below is the full list of videos; subscribe to the channel to stay informed.

HTML5 Series (3)

OSGi enabled Java EE Applications (6)

JavaOne 2010 (2)

GlassFish 3.1 Series (8)

GlassFish 3.0 Series (7)

More GlassFish v3 Videos (5)

JavaEE 6 and GlassFish 3 with Eclipse Series (5)

Java EE 6 and GlassFish 3 with NetBeans 6.9 Series (5)

The GlassFish v2 Classic (1)

Fun Videos

We also have a few fun videos, including some old Sun Promo Videos.

Monday Oct 18, 2010

Another HTML5 and GlassFish Video: 2D APIs and Client SQL DB

More HTML5 from Santiago, this time showing how to use the 2D APIs and the client SQL DB APIs.

As previously, Santiago provides a Blog Post and sources, which should run on the latest GlassFish 3.1 Milestone and your favorite WebSockets-enabled browser (or device).

Santiago also provides a screencast, now available at GlassFishVideos as part of the new HTML5 playlist. The screencast is in HD, if you expand it into full-screen you can easily read the code in the NetBeans IDE.

PS. GlassFishVideos already has 44 videos; subscribe to get the notifications as we upload new content there.

Sunday Oct 17, 2010

NetBeans 7.0 Milestone 2 is here - lot's in store!

ALT DESCR

Just like GlassFish, the NetBeans folks have been busy working on their next release (read "6.10 renamed to 7.0"). Milestone 2 of NetBeans 7 is now available and it has a lot in store for web and server-side developers: Java EE 6 enhancements, support for GlassFish 3.1 and Oracle WebLogic Server, but also interesting new Web features.

Regarding Java EE 6 enhancements, EL (Expression Language, heavily used in JSF 2) now has error checking, finds usages in JSF or CDI managed beans, offers refactoring, bundle resources support, useful tooltips and hints. CDI offers qualifier auto-creation, "Inspect CDI" contextual menu, and more. But you'll also find JAX-RS wizard enhancements, support for JSF components suites (PrimeFaces), BeanValidation (constraint and validation.xml) wizards, and JPA integration of BeanValidation and JAXB.

On the Web front, json source formatting, HTML 5 editing support (see this recent GlassFish HTML 5 blog and video), and better HTML validation are also of interest.

Hot off the heels of the Maven 3 final release, NetBeans now ships with an embedded distribution which has been in fact used for a while to interpret Maven projects. Numerous other bugs have been fixed. If you use Maven (2 or 3) you should give this milestone a try.

The NetBeans/GlassFish integration got even better with GlassFish 3.1 support, application-scoped resources (including glassfish-resources.xml editing), better Web Services testing, easier domain creation, access to remote server log, and restart in debug mode. NetBeans also now allows EJB and ACC modules to be deployed as standalone artifacts, while debugging an EAR file that contains an ACC client will now start two debugging sessions, one on the client, one on the server. Check Vince's blog for all the details.

Support for Oracle WebLogic Server is a new feature and now shows as a server in the "Services" tab. If interested, check out this short yet useful video showing support for JSF 2.0 (integrated in the recent WebLogic release), datasource creation and deployment, directory-based deployment and more.

For further details on these new features, please read this Milestone 2 New and Noteworthy document. The final release of NetBeans IDE 7.0 is planned for March 2011.

Wednesday Oct 13, 2010

WebSockets and HTML5 on GlassFish

Santiago has started writing about HTML5 and GlassFish 3.

Last week he showed a simple Web application that controls an HTML5 video object remotely (post).  The example works using WebSockets connected from the server to two browser windows - playback activity in the master window is reflected instantaneously on the slave window.  Simple code but helps understand how these features can be used.

This week Santiago created a screencast (HD) based on that example and posted it to GlassFishVideos. I just placed it in a HTML5 playlist together with an earlier video from Alexis on WebSockets support in Milestone 2 of GlassFish 3.1.

I'll use this opportunity to capture a few key links on this area, hopefully it will save you some time.

HTML5 really is a collection of specifications, carried in different places: W3C, WHAT WG, IETF.  Some of the specifications relate to document syntax/semantics, some to (JavaScript) APIs, some to protocols.  The whole set is available as a (large) single document: Web Applications 1.0; a nice table is in the WHAT's FAQ: What are the various versions of the spec.

A good entry point is WhatWG.org, which includes the specs for Web Applications 1.0, HTML 5 and Web Workers and plenty of other good content like FAQ and Wiki. HTML 5 properly describes the document format and semantics (Wikipedia,  WHAT's Editors Draft, W3C Editor's Draft). There are many HTML5 tutorials out there; I like Mark Pilgrim's Dive into HTML5 (avail under CC-BY-3.0 License).

Websockets (Wikipedia, API@W3C, Protocol@IETF) is the technology used in Santiago's example. Gregor Roth recently published a two part series that also covered WebSockets as well as Server-Sent Events, a higher-level API intended to manipulate the DOM from the server side.

Expect more HTML5 posts and videos; in the meantime, enjoy!

Update: some Twitter feedback suggested we tried the HTML 5 video enclosure, so we did! Feedback is welcome on how tit works for your browser and the video can be seen here on YouTube.

Saturday Oct 09, 2010

GlassFish Tips and Links #11: CDI, EJB 3.1, Spring, HTML5, Maven, JCP, Forks...

Recent Tips and News on Java EE 6 & GlassFish:

Informational Sign

Tips

TOTD #145: CDI Events - a light-weight producer/consumer in Java EE 6
Enterprise JavaBeans 3.1 with Contexts and Dependency Injection: The Perfect Synergy
Spring to Java EE – A Migration Experience
Problem with Grails on Glassfish v3?
Web Sockets and HTML5 in Glassfish
Book Review: Java EE 6 with GlassFish 3 Application Server

Links and News

• Maven 3 has been released: Sonatype, InfoQ
• GlassFish as Best Practices in Software Development (Johan)
• TSS Thread: Moving from Spring to Java EE 6: The Age of Frameworks is Over
GlassFish jobs at Indeed.com crosses 780 Flower NFA Update (Using GlassFish)
Proposed Maven Artifact Naming and Versioning for JavaEE
• Standards are Good for You: JBoss 6 Moving Towards JavaEE 6 with M5

Conferences

Java2Days 2010; Reports: Arun, Ivan: d1 & d2, Alexis.
Hudson User meetup in Tokyo (Nov 12th)
Silicon Valley Code Camp
• eBIG SIG: JavaEE 6 = Less Code + More Power (Oct 20th)
JavaOne Brazil (Dec 7th thru 9th)

Recent Sites Seen Running on GlassFish

• HPCSense uses GlassFish - twitter
ParaFarmacia, Mas Barata - Netcraft

JCP News and Future of Java

Now OPEN -- Nominations for EC seats
• TSS Thread: The Future of Java: forking, death, or stasis
• More Forking Opinions: Sacha and Greg.
• Java.Net Poll: Free Java? Closed Java? Evolving JCP? What's the Most Likely Path?