Monday Nov 18, 2013

JMS2@London GlassFish User Group

Some of you may be aware that the London GlassFish User Group got launched a few months ago. The group is organized and sponsored by C2B2 Consulting. C2B2 continues to offer GlassFish support and C2B2 Technical Director Steve Millidge recently offered his pretty level-headed reaction to the discontinuation of Oracle commercial support for GlassFish - it's worth reading for perspective.

The Manchester, UK based JMS 2 specification lead Nigel Deakin recently led a session in the group on the new JMS 2/Java EE 7 features in GlassFish 4. The video for the talk is posted below. There's also my own slide deck on JMS 2 posted on SlideShare (with source PDF and abstract).

Do consider inviting Nigel to give a JMS 2 talk if you are relatively local to him. Also, consider supporting the group if you are local to it. More recently, Nigel presented a JavaOne 2013 technical session titled Easier Messaging with JMS 2.0 as well as a Birds-of-a-Feather session titled What’s Next for JMS?. Stay tuned to Parleys.com for video of the sessions to be posted (the slide decks are already posted on the linked JavaOne Content Catalog).

Friday Nov 15, 2013

MOXy is the New Default JSON-Binding Provider in GlassFish 4

When I talk about JAX-RS 2, JSON-P and Java EE 7 a surprising number of people seem to assume that GlassFish and Jersey does not support JSON binding and just supports lower level JSON processing. It is in fact correct that Java EE 7 has standardized JSON processing (via JSON-P) but not a JSON binding API yet (although such a standardized API is a very strong consideration for Java EE 8 and would build upon the JSON-P work). However Jersey, the popular JAX-RS reference implementation, has long had strong support for JSON binding via MOXy, Jackson and Jettison (now it also has support for JSON-P of course). In fact, in GlassFish/Jersey the default JSON binding provider is MOXy. If you are not familiar with MOXy, it is a very interesting project part of EclipseLink (the JPA reference implementation) that translates JAXB annotations to JSON. In a code driven post, Blaise Doughan of the Oracle EclipseLink team explains the details of using MOXy with JAX-RS in GlassFish.

For more details on Jersey's support for JSON, you should check out the very well-written documentation.

Thursday Nov 14, 2013

JSF Specification Lead Ed Burns Discusses JSF 2.2 and Java EE7

If you are a JSF user you owe it to yourself to know about JSFCentral. Run by key JSF advocate, consultant and JSF in Action author Kito Mann, it's an excellent resource for everything JSF. In a recent podcast on JSFCentral, Kito chats with celebrated JSF specification lead Ed Burns about JSF 2.2 and Java EE 7. It's an extremely insightful but informal discussion between two powerhouses of the JSF ecosystem. The discussion covers JSF 2.2 features such as HTML 5 support, the flow scope, resource library contracts and CDI alignment as well as Java EE 7, all in the context of broader industry trends. You can read the transcript and listen to the podcast here. There's also the brief JSF 2.2 video from Ed Burns on the GlassFish Videos YouTube channel:

More recently, Ed presented a JavaOne 2013 session titled JSF 2.2 New Features in Context. Stay tuned to Parleys.com for video of the session to be posted (the slide deck is already posted on the linked JavaOne Content Catalog).

Wednesday Nov 13, 2013

Tyrus 1.3 Released

Tyrus, the WebSocket 1.0 reference implementation included in GlassFish and WebLogic, released version 1.3 a few days ago. The release contains some valuable features like asynchronous handling of the client-side connectToServer method call, optimized broadcast support and lots of stability and performance improvements (listed below).

One issue that popped up a little too late for getting into 1.3 is TYRUS-263: Accessing SSL protected resource via HTTP proxy. This regression is already fixed in the Tyrus master branch, please let us know whether you consider this feature critical. It might be possible to release 1.3.1 just with this fix.

Tyrus 1.3 is already integrated into GlassFish trunk, so is included in the nightly releases. You can also just remove all tyrus related jars and replace it with the contents of the websocket-ri-archive artifact.

Below is a list of JIRA entries incorporated into Tyrus 1.3:

  • TYRUS-71: ErroCollector not properly used in AnnotatedEndpoint class.
  • TYRUS-262: @OnOpen fails for programmatically deployed annotated endpoint.
  • TYRUS-261: Text decoder disables Binary decoder if both are configured for the same server endpoint; endpoint cannot receive binary messages anymore.
  • TYRUS-248: Consolidate Extension representation
  • TYRUS-258: Tyrus always creates HTTP session
  • TYRUS-251: DecodeException is not passed to @OnError method
  • TYRUS-252: encoder for primitive types cannot be overridden
  • TYRUS-250: Sec-WebSocket-Protocol header cannot be present when there is no negotiated subprotocol
  • TYRUS-249: WebSocketContainer MaxSessionIdleTimeout is not propagated to Session (server side)
  • TYRUS-257: Async timeout value set on WebSocketContainer is not propagated to RemoteEndpoints (Session#getAsyncRemote())
  • TYRUS-253: DecodeException is not passed to @OnError method from session.getAsyncRemote().sendObject
  • TYRUS-243: WebSocketContainer.connectToServer can block for seconds
  • TYRUS-227: Build failure : AsyncBinaryTest
  • TYRUS-226: Tyrus build error : OnCloseTest
  • TYRUS-247: Make all samples use TestContainer for tests
  • TYRUS-238: Refactor WebSocketEngine (SPI and Impl)
  • TYRUS-157: Submitting tasks to an injected ManagedExecutorService in a ServerEndpoint does not work
  • TYRUS-137: Improve subprotocols/extensions headers parsing
  • TYRUS-133: Some Broadcast(er) API is needed in order to opmtimize chat-like usecases
  • TYRUS-245: ServerEndpointConfig#getConfiigurator returns Configurator not used when getNegotiatedExtensions has been called
  • TYRUS-240: clean up duplicated static fields (strings)
  • TYRUS-230: When Session is invalidated, the close reason is not 1006
  • TYRUS-190: Remove TyrusServetServerContainer (merge with TyrusServerContainer)
  • TYRUS-65: Implement common utilities for testing
  • TYRUS-242: Tyrus does not run on JDK8 compact2 profile
  • TYRUS-237: RemoteEndpoint.Async#sendBinary does not throw IllegalArgumentException when data is null
  • TYRUS-239: Improve WebSocketEngine ByteBuffer handling
  • TYRUS-232: Refactor grizzly/servlet container – Tyrus-SPI
  • TYRUS-235: Fix findbugs errors in tests/servlet
  • TYRUS-234: Remove support for older protocol version
  • TYRUS-229: Session#setMaxIdleTimeout() will kill the session whether or not the session actually timed out
  • TYRUS-225: Invalidation of (Servlet) HttpSession does not invalidate WebSocket Session
  • TYRUS-153: Static map in TyrusRemotEndpoint
  • TYRUS-201: Wrong ServletInputStream#isReady() usage in TyrusHttpUpgradeHandler
  • TYRUS-224: Refactor Connection#write and ConnectionImpl to use CompletionHandler only (no Future)
  • TYRUS-221: wss:// doesn’t appear to function correctly via a http proxy
  • TYRUS-146: Support request from client to secured services (“wss”)
  • TYRUS-223: Message can be writen multiple times when running on Servlet container

Besides trying the release out, you should feel equally free to file new JIRA entries on Tyrus and the rest of the GlassFish codebase for that matter.

Tuesday Nov 12, 2013

Java Developer Days India Trip Report

October 21st through October 25th I spoke at Java Developer Days India. This was three separate but identical one-day events in the cities of Pune (October 21st), Chennai (October 24th) and Bangalore (October 25th). For those with some familiarity with India, other than Hyderabad these cities are India's IT powerhouses.

The events were focused on Java EE. I delivered five sessions on Java EE 7, WebSocket, JAX-RS 2, JMS 2 and EclipeLink/NoSQL. The events went extremely well and was packed in all three cities. More details on the sessions and Java Developer Days India, including the slide decks, posted on my personal blog.

Monday Nov 11, 2013

HTTP Session Invalidation in Servlet/GlassFish

HTTP session invalidation is something most of us take for granted and don't think much about. However for security and performance sensitive applications it is helpful to have at least a basic understanding of how it works in Servlets.

In a brief code centric blog post Servlet specification lead Shing Wai Chan introduces the APIs for session invalidation and explains how you can fine tune the underlying reaper thread for session invalidation when it is needed in GlassFish 4. Don't hesitate to post a question here if the blog is not clear, this is a relatively esoteric topic...

Thursday Nov 07, 2013

6 Facts About GlassFish Announcement

To help clarify the message about the recent roadmap for GlassFish, I decided to put together 6 facts about the announcement, future of GlassFish, and the Java EE platform as a whole: 

"Since Oracle announced the end of commercial support for future Oracle GlassFish Server versions, the Java EE world has started wondering what will happen to GlassFish Server Open Source Edition. Unfortunately, there's a lot of misleading information going around. So let me clarify some things with facts, not FUD."

Read full story here

Monday Nov 04, 2013

Java EE and GlassFish Server Roadmap Update

2013 has been a stellar year for both the Java EE and GlassFish Server communities. On June 12, Oracle and its partners announced the release of Java EE 7, which delivers on three major themes – HTML5, developer productivity, and meeting enterprise demands. The online event attracted over 10,000 views in the first two days!

During the online event, Oracle also announced the availability of GlassFish Server Open Source Edition 4, the world's first Java EE 7 compatible application server. The primary role of GlassFish Server Open Source Edition has been, and continues to be, driving adoption of the latest release of the Java Platform, Enterprise Edition. Oracle also announced the Java EE 7 SDK, which bundles GlassFish Server Open Source Edition 4, as a Java EE 7 learning aid. Last, Oracle publicly announced the Java EE 7 reference implementation based on GlassFish Server Open Source Edition 4. Java EE is a popular platform, as evidenced by the 20+ Java EE 6 compatible implementations available to choose from.

After the launch of Java EE 7 and GlassFish Server Open Source Edition 4, we began planning the Java EE 8 roadmap, which was covered during the JavaOne Strategy Keynote. To summarize, there is a lot of interest in improving on HTML5 support, Cloud, and investigating NoSQL support. We received a lot of great feedback from the community and customers on what they would like to see in Java EE 8.

As we approached JavaOne 2013, we started planning the GlassFish Server roadmap. What we announced at JavaOne was that GlassFish Server Open Source Edition 4.1 is scheduled for 2014. Here is an update to that roadmap.

  • GlassFish Server Open Source Edition 4.1 is scheduled for 2014
  • We are planning updates as needed to GlassFish Server Open Source Edition, which is commercially unsupported
  • As we head towards Java EE 8:
    • The trunk will eventually transition to GlassFish Server Open Source Edition 5 as a Java EE 8 implementation
    • The Java EE 8 Reference Implementation will be derived from GlassFish Server Open Source Edition 5. This replicates what has been done in past Java EE and GlassFish Server releases.
  • Oracle will no longer release future major releases of Oracle GlassFish Server with commercial support – specifically Oracle GlassFish Server 4.x with commercial Java EE 7 support will not be released.
  • Commercial Java EE 7 support will be provided from WebLogic Server.
  • Oracle GlassFish Server will not be releasing a 4.x commercial version

Expanding on that last bullet, new and existing Oracle GlassFish Server 2.1.x and 3.1.x commercial customers will continue to be supported according to the Oracle Lifetime Support Policy.

Oracle recommends that existing commercial Oracle GlassFish Server customers begin planning to move to Oracle WebLogic Server, which is a natural technical and license migration path forward:

  • Applications developed to Java EE standards can be deployed to both GlassFish Server and Oracle WebLogic Server
  • GlassFish Server and Oracle WebLogic Server have implementation-specific deployment descriptor interoperability (here and here).
  • GlassFish Server 3.x and Oracle WebLogic Server share quite a bit of code, so there are quite a bit of configuration and (extended) feature similarities. Shared code includes JPA, JAX-RS, WebSockets (pre JSR 356 in both cases), CDI, Bean Validation, JSF, JAX-WS, JAXB, and WS-AT.
  • Both Oracle GlassFish Server 3.x and Oracle WebLogic Server 12c support Oracle Access Manager, Oracle Coherence, Oracle Directory Server, Oracle Virtual Directory, Oracle Database, Oracle Enterprise Manager and are entitled to support for the underlying Oracle JDK.

To summarize, Oracle is committed to the future of Java EE.  Java EE 7 has been released and planning for Java EE 8 has begun. GlassFish Server Open Source Edition continues to be the strategic foundation for Java EE reference implementation going forward. And for developers, updates will be delivered as needed to continue to deliver a great developer experience for GlassFish Server Open Source Edition. We are planning for GlassFish Server Open Source Edition 5 as the foundation for the Java EE 8 reference implementation, as well as bundling GlassFish Server Open Source Edition 5 in a Java EE 8 SDK, which is the most popular distribution of GlassFish. This will allow GlassFish releases to be more focused on the Java EE platform and community-driven requirements. We continue to encourage community contributions, bug reports, participation on the GlassFish forum, etc. Going forward, Oracle WebLogic Server will be the single strategic commercially supported application server from Oracle.

Disclaimer: The preceding is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract.It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.

Tuesday Oct 29, 2013

*raine Trip Report (Lorraine & Ukraine)

Last week, I had the opportunity to talk about Java EE 7 in Nancy (Lorrraine - France) and Kiev (Ukraine).
The first event was arranged by the local Lorraine JUG while the second one was a largest conference organised by the Ukraine Java User Group. Based on the overall feedback and discussions I had during those two events, it is clear that the WebSocket API (JSR 356) is really a hot topic.

And travel issues aside, I have really enjoyed my time during those two events. Thanks to both JUGs for having me!

A more detailed report can be found on my personal blog.

Thursday Oct 17, 2013

How You Helped Shape Java EE 7...

For many of us working with the JCP for years, the commitment to transparency and openness is very clear. For others, perhaps the most visible sign to date of this high regard for grassroots level input is a survey on Java EE 7 gathered a few months ago. The survey was designed to get open feedback on a number of critical issues central to the Java EE 7 umbrella specification including what APIs to include in the standard. The survey was highly successful with a large number of high quality responses.

With Java EE 7 under our belt and the horizons for Java EE 8 emerging, this is a good time to thank everyone that took the survey once again for their thoughts and let you know what the impact of your voice actually was. I've posted the details on my personal blog. I hope you are encouraged by how your input to the survey helped shape Java EE 7 and continues to shape Java EE 8. Maybe now is the time for you to get more involved :-)?

Tuesday Oct 15, 2013

Securing WebSocket Endpoints

As you know, WebSocket is a key capability standardized into Java EE 7. When I talk to developers, many wonder how WebSockets are to be secured. One very nice characteristic for WebSocket is that it in fact completely piggybacks on HTTP. This means that all the well-understood ways of securing web applications instantly applies to WebSocket including SSL/TLS, Basic Authentication, Digest Authentication, LDAP, role based authorization and all the robust security infrastructure built into modern application servers like GlassFish and WebLogic. In a brief blog post, Pavel Bucek demonstrates how to secure WebSocket endpoints in GlassFish using TLS/SSL. Besides the server-side, he also includes a secure client side code example using the wss: protocol.

For a more complete example, you could look at the code for my joint JavaOne 2013 session with Ryan Cuprak and Bala Muthuvarathan titled "Android and iOS Development with Java EE 7". Do let me know if you need more detailed coverage focused on the topic, I will be happy to put something together on my personal blog.

Monday Oct 14, 2013

A Realistic JBatch Example

While very basic introductory examples are invaluable in explaining a new API, they can fail to do a rich API justice - especially from the perspective of more experienced developers. For some of us, looking at a slightly more involved, realistic example can shed far better light on the practical value proposition for a technology. A very well written recent blog post on the AMIS technology blog does exactly that for the JBatch API standardized in Java EE 7. The author uses JBatch features such as the Job Specification XML, chunked processing, parameter passing, batchlets, job/step listeners, the job context and integration with Java EE in a non-trivial fashion to create an online download manager. I would say if you are interested in JBatch, the blog entry is almost a must read and perhaps one of the best ones written on JBatch so far.

At JavaOne 2013 IBM Distinguished Engineer Brian Martin presented a very useful session on JBatch titled "Three Key Concepts for Understanding JSR 352: Batch Applications for the Java Platform". Stay tuned to Parleys.com for video of the session to be published. The well-written official specification is also a great place to learn more about JBatch.

Friday Oct 11, 2013

Free Java EE 7 Talk via GlassFish User Group/JAX London

Some of you may be aware that the London GlassFish User Group got launched a few months ago. The group is organized and sponsored by C2B2 Consulting. Their very first meeting (on JMS 2) was led by Nigel Deakin, the UK based JMS specification lead.

The group now has organized their second meeting in partnership with JAX London 2013 Community Night on October 29. The meeting will feature an introduction to Java EE 7 with Arun Gupta. Note that the event is free, so you really should not miss it if you are in the greater London area. You can register for the meeting via JAX London or the London GlassFish User Group meet up page.

Further details on the event is posted on the C2B2 site. I did mention the event is free right :-)?

Thursday Oct 10, 2013

GlassFish and Friends Party Photos!

As you may know, the now iconic GlassFish and Friend Party took place 8 PM - 10 PM, Sunday, September 22nd at the much coveted Thirsty Bear on the first day of JavaOne 2013. As with previous years, it was a great success with a full house, old friends, new friendships, good conversations and a good time. The photos below speak for themselves (many thanks to Bruno and Arun for taking them):

Just some of the folks attending included Adam Bien, Alexandra Huff, Alexis MP, Anil Gaur, Arun Gupta, Ben Evans, Blaise Doughan, Bruno Borges, David Delabassee, David Heffelfinger, Doug Clarke, Ed Bratt, Ed Burns, Edgar Martinez, Heather VanCura, Jaromir Hamala, Johan Vos, John Clingan, Kerry Wilson, Kirk Pepperdine, Ludovic Champenois, Makito Hashiyama, Mark Heckler, Martijn Verburg, Melissa Jacobus, Mike Lehmann, Murat Yener, Nigel Deakin, Patrick Curran, Paul Sandoz, Rajiv Mordani, Romain Grecourt and Shaun Smith. Regrettably, I could not be there myself this year. Perhaps next year we will see you at the party?

Stay tuned for the videos/slide decks from the GlassFish stories, roadmap and executive panel from the GlassFish Sunday Community event...

Wednesday Oct 09, 2013

Using NoSQL with EclipseLink and JPA?

NoSQL is obviously a hot topic in the enterprise these days, at least at the water cooler if not in the production data center. The momentum is such that despite being seen as a stalwart of relational databases, Oracle too has entered the NoSQL ecosystem with Oracle NoSQL. Naturally, the question of how to use NoSQL databases in Java EE applications (specifically existing Java EE 5 and Java EE 6 applications) comes up all too often. As it so turns out there are a number of very interesting initiatives out there to radically simplify the usage of NoSQL databases in Java EE applications by creating JPA based facades over them (strictly speaking, JPA as it stands today is not intended to support NoSQL from a purely standards standpoint). Such efforts include one from non other than the team behind the Oracle JPA reference implementation EclipseLink. In a code driven blog post, Huseyin Akdogan demonstrates how to use MongoDB using EclipseLink NoSQL. You are also welcome to check out my own slide deck covering using NoSQL databases in Java EE with or without a JPA flavored API (using just plain CDI):

Interestingly, NoSQL support featured quite prominently in the results of a survey around JCP standards put together by the London Java Community (LJC). It would be interesting to hear your thoughts as well.

Robert Greene, John Bracken and Shaun Smith held both a technical session titled "Building Oracle NoSQL Database Applications with EclipseLink" and a BOF titled "Java Persistence for NoSQL" at JavaOne 2013 on this topic. Stay tuned to Parleys.com for the video recordings of the sessions.