Adam Bien's Weblog

Tuesday Oct 27, 2009

Is Glassfish v3 Ready For Production?

Glassfish v3 is not released yet. The daily builds, however, are surprisingly stable and worth evaluation. Glassfish v3 is the reference (open source) implementation of Java EE 6 but comes also with some "interesting" extensions like OSGI support. I tested the following areas so far:

  • JSF 2.0 (navigation, data binding)
  • EJB 3.1 -  (Stateless, Singleton and Stateful Beans) and WAR deployment
  • EJB 3.1 embeddable container
  • JPA 2.0
  • Bean Validation (JSR-303)
  • JMS
  • REST (JSR-311)
  • WebServices (JSR-181)
  • Incremental deployment and EAR / WAR deployment
  • Migration of Glassfish v2 into v3
  • JSF 2.0 -> EJB 3.1 -> JPA 2.0 -> JSR-303 combination
  • Various administration console tasks
  • Most of the http://kenai.com/projects/javaee-patterns/ projects were tested / developed with Glassfish v3
Although I filed some bugs / enhancements - none of them were a real show stopper so far. Glassfish v3 is worth consideration for real world projects, but it is still fairly new technology. If you like innovation - go for it. If you don't need the Java EE 6 features, Glassfish v2 is still a good choice.


NEW: Java EE 7 Testing and Quality Workshop

A book about rethinking Java EE Patterns

Comments:

Thanks Adam. GFv2.1.1 should ship any day now.

Posted by Alexis MP on October 27, 2009 at 12:32 PM CET #

Adam,

would you consider this even in a clustered environment or only as single instance?

-Markus

Posted by Markus Eisele on October 27, 2009 at 01:42 PM CET #

Hi Markus,

see: http://www.adam-bien.com/roller/abien/entry/ha_without_clustering

thanks,

adam

Posted by Adam Bien on October 28, 2009 at 03:15 PM CET #

Hi man. Can you share some knowledge on how to deploy (correctly) EAR in glassfish v3?

here is a link to my post in java.net: http://forums.java.net/jive/thread.jspa?threadID=68567&tstart=0

I have problems with loading jar files from the ear in glassfish v3. It works perfectly in glassfish v2.1.

Thank you and great post. Any help will be really welcome.

Posted by dpandulev on October 28, 2009 at 05:05 PM CET #

Hi Dpandulev,

NetBeans < 6.8b has a bug. It creates an invalid EAR. I guess this is your problem.

I tested EAR deployment in "exploded" and archive format. It worked in either case.

Just check out a random http://kenai.com/projects/javaee-patterns/ project and try it.

thanks for the nice post!,

adam

Posted by Adam Bien on October 28, 2009 at 05:38 PM CET #

Thanks for the fast answer but i use eclipse and glassfish eclipse plug-in. I generate the EAR and deploy it by the plug-in. It work's with NO problems in GF v2.1.

Posted by dpandulev on October 28, 2009 at 06:03 PM CET #

Hi Dpandulev,

try to deploy with that: asadmin deploy --property compatibility=v2 foo.ear

It is the GF v2 compatibility mode...

thanks!,

adam

Posted by Adam Bien on October 29, 2009 at 12:26 AM CET #

Adam, do you know if GF v3 processes mixed exploded/archived ear ? The v2.1 had a problem with that. When I deployed an EAR with JBoss Seam session bean jar with netbeans, it exploded my ear but kept the Seam jar archived, and GF issued an exception and caused deployment to fail. To circumvent this problem, I used to deploy the app as a web module, without EJB support.

Posted by Geraldo Luiz on October 29, 2009 at 08:10 PM CET #

Well, as for GF3 b70 I cannot start the GUI-Admin. I get a ServletError. I checked the server.log and I found that there is a NullPointerException when trying to load the default theme for the GUI.

Posted by Carlos on October 30, 2009 at 04:18 PM CET #

Hi Adam..

I am ting to make CriteriaQuery work on Java EE 5. I is possible to make it work?
I am using eclipslelink 2.0 M11.
Any suggestion.

Tanks

Posted by Elvis Ratzlaff on November 10, 2009 at 09:24 PM CET #

Hi Elvis,

Java EE 5 comes with JPA 1.0. For criteria you will need JPA 2.0 and so Java EE 6. If you hack the server (replace the JPA API), it should be possible. Otherwise you will get a problem with the API...

thanks!

adam

Posted by Adam Bien on November 11, 2009 at 11:31 AM CET #

Hi Adam,

How did you manage to get JSR-303 working with GFv3?

I tried with instructions found here:

wiki.glassfish.java.net/Wiki.jsp?page=V3Jsr303BeanValidationIntegration

But Hibernate seems to require JPA 2.0 in order to work. So I changed to EclipseLink to get JPA 2.0 but it seems to have so many bugs that I had to back down.

Is there any way to get Validation and JPA 1.0 working together if JPA 2.0 implementations are not quite ready yet?

ps. liked your book

Posted by jukka on March 25, 2010 at 03:52 PM CET #

@Jukka,

JSR-303 just works with GF v3 out-of-the-box. I didn't configured anything - just unzipped Glassfish and hacked the application. I used, however, EclipseLink and not Hibernate...

My advice: be lazy :-)

Thanks for your nice feedback regarding my book!,

adam

Posted by Adam Bien on March 26, 2010 at 02:44 PM CET #

Hi Adam,

Yep, I can get it working with EclipseLink too but EclipseLink had some bugs with cascading persist so I thought that I don't want to fix one problem by creating an unknown amount of new ones. Are you aware that there is a JPA2.0 implementation that is ready for production?

Tschüss!

Posted by jukka on March 27, 2010 at 02:02 PM CET #

Post a Comment:
  • HTML Syntax: NOT allowed
realworldpatterns.com
...the last 150 posts
...the last 10 comments
Links
License