Monday Aug 24, 2015

Java API for JSON Binding (JSON-B) 1.0 Early Draft Now Available!

The first early draft of the Java API for JSON Binding (JSON-B) 1.0 is now available for you to review: As discussed below this is distinct from the Java API for JSON Processing (JSON-P) 1.1, which also recently published it's own first early draft. Like all early drafts for JSRs, the goal is to foster dialog, feedback and participation. Although it is just an early draft the thirty-five page specification document is actually fairly far along so providing useful feedback should be easy.

JSON is increasingly becoming the de-facto data interchange format on the web, be it for mobile, HTML5/JavaScript rich-client or microservices applications. While Jersey, EclipseLink, GlassFish and WebLogic have long provided strong support for JSON via EclipeLink MOXy, it has been a goal in the Java EE platform to make JSON a first class citizen to the degree where it can become just another natural serialization format for Java. Towards that goal Java EE 7 provided simple JSON processing support via JSON-P. That support is being beefed up further in Java EE 8 by supporting more JSON standards in JSON-P such as JSON Pointer, JSON-Patch and the like. As a parallel effort Java EE 8 also plans to provide a much higher level JSON binding API via JSON-B. The idea is to make JSON handling in the platform so ubiquitous and easy-to-use that it is almost invisible akin to JAXB in the XML world.

If these are ideas that interest you, now is the time to get involved with JSON-B and join other folks in the community that are already helping out. The JSON-B early draft gives special thanks to Olena Syrota, Oleg Tsal-Tsalko and the Ukraine JUG for their contributions even at this stage. These folks have helped us with feedback, community building as well as evangelizing.

There are many ways for you to get involved as always. You are always welcome to join the expert group proper via the JCP page for the specification. You can always simply join the discussion by subscribing to the JSON-B specification user alias. If you would rather participate as a group through your JUG you can do that easily via Adopt-a-JSR.

Tuesday Aug 04, 2015

JSON-P 1.1 Early Draft Released!

The JSR 374 Expert Group has just posted the first Early Draft of the 'Java API for JSON Processing specification version 1.1' also known as 'JSON-P 1.1 EDR1'. 

This is the first cut of the JSON-P 1.1 API that is slated for inclusion in Java EE 8. The scope of any specification might (slightly) evolve, things might be removed and/or added. For example, the support of JSON Merge Patch wasn't originaly planned when this JSR was started but it is now part of EDR1. On the other hand, support for 'Big JSON' is still being discussed but again, it's a draft, the API will still evolve. 

At this stage, it is important that you read the Javadoc and try the API to provide feedback. There are still plenty of time to adjust things so feedback is really important. To easily get started on JSON-P 1.1, you might want to check those ressources.

On a practical note, the Javadoc *is* the specification so don't look for a PDF specification document. The Early Draft period will be closed on October, 2. In the meantime, the EG is eagerly awating your feedback! As usual, comments and feedback should be sent to the JSON-P users mailing list.

Thursday Jun 11, 2015

JSON-P 1.1 (JSR 374) update: JSON Merge Patch

JSON Merge Patch (RFC 7386) is relatvely new standard in the JSON space. It defines a set of modifications that will be used to transform a target resource; those modifcations are themselves defined in a JSON object. JSON Merge Patch is a very simple standard with a few limitations but it seems to be useful enough. So and in addition to JSON Pointer (RFC  6901) and JSON Patch (RFC 6902), the JSR374 Experts Group has recently decided to adding JSON Merge Patch support to the JSON-P 1.1 API might be useful. You can track the initial works around JSON merge Patch here.

As usual, feedback is always welcome. And to easily get started with JSON-P 1.1, you should watch the recording of the Adopt-a-JSR session that was held recently with Kin-man Chung (JSR 374 Spec Lead). It gives all the required technical details but also set some expectations in terms of the type of feedback that the EG is looking for.

Thursday Apr 16, 2015

JSON-P 1.1 (JSR 374) update: JSON Pointer & JSON Patch

'Java API for JSON Processing 1.0' also known as JSON-P (JSR 353) is the standard JSON Processing API that was added in Java EE 7.  JSON-P will be updated and that update (JSON-P 1.1 - JSR 374) should be included in Java EE 8. One of the goals of that revision is to add support for 2 JSON standards namely JSON Patch and JSON Pointer.

By nature JSON is simple and most of the standards in that space are simple as well. JSON Pointer and JSON Patch are 2 IETF RFCs that are closely related. JSON Pointer defines string syntax for identifying a specific value within a JSON document while JSON Patch defines a set (one or more) of operations to apply to a target JSON document. JSON Patch is leveraging JSON Pointer to specify where operation(s) need to be performed in the target JSON document. And a JSON Patch is in itself a JSON document. The most common pattern will be to apply a JSON Patch to transform a JSON document but it will also be possible to obtain a JSON Patch by comparing 2 JSON documents, the returned JSON Patch will then be a 'diff' between the 2 JSON documents.

It is the early day of JSR 374 but the EG is certainly making progress. At this stage, it is already possible to test, amongst other new features, JSON Pointer and JSON Patch as the early build of the JSR 374 RI already support those. Those tests would be a good place to look to understand how the API works. Note that at time of writing, the 'diff' method isn't yet implemented in the early JSR 374 RI build.

Getting feedback early on is really important for the various EGs!  Make sure to look and test the various APIs that will, at some point, be part of Java EE 8.

If you want to know more about the JSON-P 1.1, watch this JavaOne session where Kinman Chung (JSR 374 Specification Lead) explains the plans for JSON-P 1.1. In addition, the Java API for JSON Processing project page, the JSR 374 Users mailing list and Issue Tracker are useful resources to check.

Tuesday Jul 15, 2014

Java API for JSON Binding (JSON-B)

JSON-P (Java API for JSON Processing - JSR-353) provides a portable standard solution to parse, generate, transform, and query JSON using 2 APIs, a streaming API and an object model API based on the streaming API. JSON-P was one of the API added to Java EE7.

But clearly JSON parsing and JSON generation was a first step and only a (important) part of the global equation. To convert Java objects from/to JSON representation, you have to rely on different solutions, different frameworks such as EclipseLink MOXy or Google GSON to just name two! The issue is that, obviously, all those frameworks are all different since there is no standard in that space. This was also clearly reflected in the Java EE 8 Community Survey as JSON Binding was the most asked feature!

Oracle plans to submit a new JSR to solve that particular problem, i.e. the 'Java API for JSON Binding' JSR. The JSON-B JSR aims to define a standard binding layer for converting Java objects to JSON messages and vice versa. JSON-B will leverage and complement JSON-P (JSR 353). The draft proposal for the JSON-B JSR has just been made public to gather feedback and recruit supporters before it is submitted to the JCP in August. JSON-B will be targeted for inclusion in Java EE 8 but will also work with Java EE 7. And timing wise, it is aligned with the current Java EE 8 roadmap.

It's summer time and August isn't that far, so make sure to read the proposal and gives us your feedback quickly!

Tuesday Jul 01, 2014

Java EE @ Java Day Tokyo 2014

Java Day Tokyo 2014 was held on May 22nd. Organized by Oracle Japan, it is the largest Java developer event in the country. Indeed it is really a replacement to JavaOne Japan. This was another highly successful year for the event with a fully sold out venue packed with youthful, energetic developers. Speakers included Steve Chin, Stuart Marks, Simon Ritter, Nandini Ramani, Cameron Purdy and Yoshio Terada. Topics included Java SE, Java EE and JavaFX. Cameron Purdy, Vice President of Development at Oracle responsible for Java EE, shared the Java EE 8 road-map during the opening keynote.

I did talks on Java EE 7/Java EE 8 and aligning Java EE 7 with the HTML 5/JavaScript Rich Client landscape. There were many other very interesting Java EE related session in Japanese and English, including a Java EE adoption story from Rakuten. More details, including slide decks and code, posted on my personal blog.

Tuesday Mar 25, 2014

Java API for JSON Processing (JSR 353)

Computer programs are the most complex things that humans make.” (Douglas Crockford)

JSON (JavaScript Object Notation) is a widely used, lightweight, simple data-interchange format. JSON is not so new but there is, since a few months, a formal ECMA standardising JSON: "ECMA 404 - The JSON Data Interchange Format". ECMA 404 is probably the sweetest and easiest specification to read and grasp! The document is 14 pages long but if you remove all the decorations, the specification itself is not even 7 pages long!

Java API for JSON Processing (JSR 353) is one of the 4 new APIs added to Java EE 7 alongs with the Batch API (JSR 352), the WeSocket API (JSR 356) and the Concurrency Utilities for Java EE API (JSR 236). JSR 353 provides an API to parse, transform, and query JSON data using the object model or the streaming mode.

Java has a long history of various JSON APIs but the value of JSON-P (JSR 353) is the fact that it has been standardised. That means that we can expect this API to work seamlessly on any Java EE 7 implementations, i.e. GlassFish 4, JEUS 8 and WildFly 8 today. And this is juts the beginning, we can also expect the adoption of JSON-P API to rapidly grow. For example, the upcoming WebLogic 12.1.3 will add support for various Java EE 7 APIs including JSON-P, see here.

It should be mentioned that binding is not yet covered by this specification but JSON-B is high on the wish-list for Java EE 8.

To know more about JSON-P, you can read the JSON-P chapter of the Java EE 7 Tutorial or watch the 'JSR 353: JSON Processing API in Action' session from last JavaOne.

Thursday Aug 08, 2013

An Overview of JSON-P

JSON is quickly becoming the de facto data interchange format on the web, especially with powerful JavaScript clients, Ajax, REST and HTML 5 WebSockets. This is why JSON-P (or more formally the Java API for JSON Processing) is such a key part of the Java EE 7 release. It is intended to provide a standard, vendor-neutral, ubiquitous solution for parsing, generating and querying JSON. In a brief OTN article, JSON-P specification lead Jitendra Kotamraju (or Jitu as he prefers to be called) overviews JSON-P. He discusses the basics of JSON, JSON-P, the DOM-like Object Model API and the StAX-like Streaming API. There's also the 20-minute JSON-P presentation on the GlassFish videos YouTube channel and my own slide deck below:

You can also check out the very well written JSON-P section of the official Java EE 7 Tutorial or try things out with the newly released Java EE 7 SDK.

Thursday Jun 28, 2012

EclipseLink 2.4 Released: RESTful Persistence, Tenant Isolation, NoSQL, and JSON

EclipseLink 2.4 is released as part of Eclipse Juno release train. In addition to providing the Reference Implementation for JPA 2.0, the key features in the release are:

  • RESTful Persistence - Expose Java Persistence units over REST using either JSON or XML
  • Tenant Isolation - Manage entities for multiple tenants in the same application
  • NoSQL - NoSQL support for MongoDB and Oracle NoSQL
  • JSON - Marshaling and unmarshaling of JSON object
Eclipse Link 2.4

Here is the complete list of bugs fixed in this release. The landing page provide the complete list of documentation and examples. Read Doug Clarke's blog for a color commentary as well.

This release is already integrated in the latest GlassFish 4.0 promoted build.

Try the functionality and give us feedback at GlassFish Forum or EclipseLink Forum.

Friday Jan 06, 2012

Tab Sweep - JSON, OSGi, GlassFish+NetBeans experience, JAXB and JodaTime, file uploads & more

Recent Tips and News on Java, Java EE 6, GlassFish & more :

Radio Receiver

JSON to Java with JDK6 (Julien)
What does the future hold for OSGi without leader Peter Kriens? (JAXenter)
JavaCloudGuy: Glassfish (Java EE 6) is now available as option in #cumulogic (Twitter)
JAXB and Joda-Time: Dates and Times (Blaise)
JAX-RS Tip of the Day: Using YUI2 and YUI3 DataTables with Jersey and jQuery (John)
JAX-RS @MatrixParam example (mkyong)
First experiences and getting started with GlassFish 3.1 and NetBeans 7.x – it’s a breeze (Lucas)
Maven's WAR Overlay: What are WAR Overlays? (DZone)
Book Review for "Java EE 6 with GlassFish Application Server" (Rick)
Managing unmanaged beans in CDI (Nicolas)
Using Bean Validation together with ExtVal in JPA and JSF (Edwin)
Java EE 6 using WebLogic 12c and NetBeans (Video) (Arun)
Spark, A micro Web Framework (
Multiple File Upload Examples (John Yeary)
Released: NetBeans Platform 7, The Book (Geertjan)
Java 7: Understanding the Phaser (Niklas)
Where's my log file? (Nigel @ Open Messaging)
Sample: Java EE 6 + Wicket + NetBeans + GlassFish + MySQL (Geertjan)
Using Jsp in a Jersey JAX-RS RESTful application (François)
How to change the Glassfish server log level from command line (François)


With 10 YES votes, another candidate Java EE 7 JSR has been accepted by the JCP Executive Committee: JSR 353, Java API for JSON Processing.

If you can't wait for the final version (currently scheduled for Q3 2012) and further integration with JavaSE, you may find Julien Viet's recent post to be of interest.


Wednesday Dec 07, 2011

Lesser-advertised Java JSRs

As you may have already read here, Java EE 7 (JSR 342) is well on its way with some JSRs having reached the early draft status (e.g. JAX-RS 2.0, JSF 2.2, CDI 1.1, ...).


On the other hand, you may not have heard of the following JSRs that are all candidates for inclusion in the Java EE Platform:
State Management (JSR 350) was recently filed by Oracle to offer a standard API for a state management subsystem (examples of state include HTTPSession and any state associated with CDI scoping annotations).
Batch (JSR 352) was covered here just recently as it has recently passed the Review Ballot.
Concurrency Utilities for Java EE (JSR 236) is building on JSR-166 (java.util.concurrency) to provide a clean abstraction for threaded code in a managed environment. It has been ongoing for several years and should be revived and completed in time for Java EE 7.
Java API for JSON Processing (JSR 353) is a parsing API for manipulating (reading or writing) JSON content. Binding (JAXB-style) is not in the scope of this newly submitted JSR.

The exact list of JSRs that will be part of Java EE 7 is up to the expert group to decide. Arun has more details on the status of each JSR.

Tuesday Oct 28, 2008

... JSON with Jersey, JSF with NB and GMaps, Comet, GF ESB and Fuji M2, Andy, iPhone and Oprah

A compilation of today's news of interest:

Radio Receiver Icon

Jakub has published a new Enterprise Tip on Jersey showing how to Configure JSON for RESTful Web Services in Jersey 1.0. Jersey is the production-quality, reference implementation of JAX-RS, the JCP standard for RESTful Web Services. JAX-RS is part of Java EE 6, but it can also be used separately. Jersey is part of GFv3 Prelude.

On JSF - first the NetBeans team shows how to Start Developing JSF Applications with the new NetBeans releases, including the forthcoming NB 6.5. Then Arun shows how to use JSF and Google Maps using Gmaps4JSF, Facelets and Mojarra on GlassFish v3 Prelude.

Comet and Atmosphere - JFA recently presented on Atmosphere - his new portable Comet framework - at the Silicon Valley JUG. The slides are Now Available.

GlassFish ESB is getting very close to its first Release Candidate (and GA/FCS release) (Milestone 2 Download) but I just noticed I had not spotlighted Mike's excellent Screencast on GlassFish ESB. Check it out and notice it is a multi-parter - very well done.

While we await GF ESB v2, we are already working on the next generation, which is based on Project Fuji. Fuji Milestone 2 released last week, and here are two additional posts: Nikki on Interceptors in Fuji and Derek on the Proxy bundle.

Andy B is adjusting his time involvement at Sun so he can spend more time with Arista Networks, "one of his startup companies" that is focused on the 10 Gigabit Ethernet switching business. The Original NYTimes Article was followed by a Clarification.

And today's toys includes Google Earth on iPhone, and Oprah endorses Kindle. Of the two, I think Oprah's endorsement will have the largest impact - is the time for the electronic reader finally here?

NB. I am a few days behind in reporting news; I'll try to catch up in the next day or two.