Tag Archives: glassfish

Testable Java EE 7 Maven Archetype, using Arquillian (Tech Tip #34)

There is a Maven archetype to create Java EE 7 application:

It generates a simple “pom.xml” with Java EE 7 API <dependency>. It does the job to get started with building the application. But how do you test this app ?

Of course, you write unit and integration tests. But how do you run these tests, especially in a container-independent manner ?

That’s where Arquillian comes in!

Arquillian guides explain how to write real tests, but you still need to figure out Maven dependencies, create profiles, figure out container dependencies, and more. That’s still too much work :)

Meet a new Maven archetype that generates a Java EE 7 app, with profiles pre-configured for WildFly and GlassFish.

The four profiles are:

  1. wildfly-remote-arquillian
  2. wildfly-managed-arquillian
  3. glassfish-remote-arquillian
  4. glassfish-embedded-arquillian

The first profile is the most natural to start with. It requires to download WildFly 8.1, unzip and start using ./bin/standalone.sh. Then you can run the test as:

to see the result as:

This is useful if tests need to be executed multiple times on the same WildFly instance.

The second profile is the easiest to start with, and does not require any manual downloading. Using the profile downloads WildFly (8.0.0 at this time) to Maven repository, installs it in the “target” directory, starts the server, deploys the WAR file, runs the test, and stops the server.

“glassfish-remote-arquillian” profile is like “wildfly-remote-arquillian” where an instance of GlassFish is started externally and tests are run in the usual manner. This profile does not work at this moment because of ARQ-1596.

“glassfish-embedded-arquillian” is like “wildfly-managed-arquillian” where GlassFish container is downloaded transparently using the Maven dependencies, starts the container, deploys the app, runs the test, and stops the container.

Archetype source code is at: github.com/javaee-samples/javaee7-archetypes/tree/master/javaee7-archetype and the archetype is published at search.maven.org/#search%7Cga%7C1%7Cjavaee7-arquillian-archetype.

Many thanks to @aslakknutsen for publishing this archetype!

A complete working sample can be checked out from github.com/arun-gupta/wildfly-samples/tree/master/arquillian.

Let us know if you find this useful and how would you use it.

Migrate from GlassFish to JBoss/WildFly or TomEE: RebelLabs

Oracle’s announcement of discontinuing commercial support for GlassFish has left open source developers at a crossroad where they need to make a choice.

glassfish-dish

They can continue using GlassFish Open Source Edition with no commercial support from Oracle. If customers do want production support then they need to rely upon third-party support, for example LodgOn or C2B2 Consulting.

Other option is to chose another open source alternative such as JBoss EAP (commercially supported by Red Hat) or TomEE (commercially supported by Tomitribe).

Earlier Hildeberto Mendonça (@htmfilho) and Efraim Gentil (@efraimgentil) from CEJUG published a great article explaining how to migrate your applications from GlassFish to WildFly. This article explained in detail on how to migrate JDBC resources, JMS resources, and Security Realm.

And now Rebel Labs (@RebelLabs) has published a stellar report – Abandon fish! Migrating from GlassFish to JBoss or TomEE. This 31-page report is very rational and balanced and provide details on migrating applications from GlassFish to JBoss EAP, WildFly, or TomEE.

The report says that there are other open source alternatives as well such as Jetty, Resin, Geronimo, JOnAS, and more. But JBoss/WildFly and TomEE were chosen because of the following reasons:

  • The vibrant developer community around these tools, namely JBoss and Tomcat
  • The amount of documentation available on the web
  • The sponsorship and support by market leaders

WebLogic and WebSphere are not considered as suitable alternatives when migrating from GlassFish because the report says “the most logical decision when migrating from GlassFish is opting for an equivalent open source alternative”.

The report provides a more holistic view with application migration, IDEs, CI servers, testing using Arquillian, and other aspects.

Here are couple of more quotes from the report:

WildFly and JBoss EAP have a well-established history of providing commercial support on top of excellent products

Red Hat is the poster-child in enterprise open source solutions

What’s the need for closed source and heavyweight application servers in the world of JBoss and TomEE ?

Download:

  • JBoss EAP (commercial supported by Red Hat for Java EE 6)
  • WildFly (community build for Java EE 7)
  • TomEE (commercially supported by Tomitribe for Java EE 6)

Additionally, you can also look at Windup (scan and report on your Java EE applications and report potential “trouble spots” for migration), WindRide (migrate applications from older version of JBoss to newer versions),  and Tubame (Eclipse plugins that help in migration).

Webinar Replay and Q&A Transcript: WildFly/JBoss EAP instead of GlassFish/WebLogic

jan8-2014-webinar-banner

Replay of the webinar “WildFly for Innovation and Red Hat JBoss EAP for commercial support” is now available.

If you already registered then click on “Already Registered” in the left navigation bar of registration page otherwise register and watch the replay instantly.

The webinar was very well attended with hundreds of viewers and there were lot of questions asked. I’ve captured some of those here:

  • Is it safe (or very bad idea) to develop on WildFly and run in production on EAP?

    The recommended model is to use JBoss EAP for development, testing, and production for an application. There are always differences between WildFly and EAP with former offering bleeding-edge technologies and latter providing a lot more stability with bugfixes and patches. WildFly would be appropriate only for development/evaluation/contribution of new innovative features such as Java EE 7 in the upstream project.

  • If you develop on Wildfly and deploy on EAP  is there a risk Wildfly will move ahead too quickly and EAP will fall behind in capabilities supported?

    WildFly is focused on innovation and moves at a rapid pace. This allows WildFly to easily implement new technologies and provide a platform for enterprise developers to try them out. New features can be added or older features may be removed to provide a better experience for that particular release. There is no requirement to provide a patch release and any support is only through community.

    JBoss EAP is derived from a particular WildFly release and is focused on long term stability and predictability. It is battle tested on a variety of operating systems, JDK, and databases. It goes through rigorous performance testing, regression testing, scalability testing, and other means to ensure that a military-grade product is delivered. API level compatibility is guaranteed across different versions of EAP, this is not a requirement for WildFly. Enterprises that want stability and predictability should look at JBoss EAP. Developers that want bleeding edge technology should look at WildFly.

  • Isn’t JBoss EAP an open source product as well ?

    Yes, JBoss EAP binaries and source code are made available under open source licenses.

  • When will JBoss EAP provide support for Java EE 7 full platform ?

    We’re currently in the planning stages for EAP 7. More details and the roadmap will be presented at Red Hat Summit in San Francisco, April 14-17.

  • EAP 6 would be supporting JEE7?

    EAP 6 will not be fully certified for Java EE 7. Although some selective features, such as WebSocket, may be backported. We’ll have more detail on that at Red Hat Summit in April.

  • Is EAP an alternative to WebSphere?  Why or why not?

    Absolutely. JBoss EAP is a compelling alternative to WebSphere. https://engage.redhat.com/forms/jboss-v-websphere provides all the details. And don’t just take Red Hat’s word for it – JBoss EAP has been a leader (along with WebLogic and WebSphere) in Gartner’s Enterprise Application Server Magic Quadrant for the last five years and many customers have made the migration to JBoss from more expensive proprietary alternatives like WebSphere and WebLogic. You could also reference Get Unstuck with JBoss if appropriate. It contains quite a few resources on this topic.

  • How do you compare Wildfly with alternative open source servers such as  VMWare VFabric  and wso2 app server ?

    Red Hat EWS (Red Hat | JBoss Web Server) is vanilla Tomcat and fully supported by Red Hat. This offering is very comparable to tcServer. VMWare vFabric is optimized for running Spring applications. Spring is one of the technologies supported by WildFly, in addition to many others. WSO 2 supports many Java EE technologies but not a Java EE compliant app sever. WildFly provides full Java EE 7 compliance and EAP 7 will provide commercial support for that in future.

  • So if I recompile the EAP sources I can do whatever I want with the compiled binary ?

    No – you can’t do “whatever”. The open source licenses governing JBoss EAP source code, principally the LGPL, grant you certain permissions subject to conditions that you must comply with. In addition, you may not brand your recompiled EAP sources as “JBoss” or any other Red Hat-owned trademark. This means, for example, that if you distribute or publicly deploy your recompiled binary you must first remove all JBoss and other Red Hat branding, such as logo files. Any recompilation of EAP sources is not JBoss EAP and must not be presented as being a Red Hat or JBoss product.

  • We are using JBoss 5 EAP. Is there any guide for migrating to WildFly or EAP version?

    EAP 5 is based on Java EE 5. WildFly is a Java EE 7 compliant container. Application would need to be manually ported by learning the new Java EE 7 programming capabilities. Migration Guide provides complete details on how to migrate your applications from EAP 5.x to 6.x. JBoss Migration Center offer additional tools that provide configuration migration across different versions of EAP. We strongly encourage you to locate a Red Hat partner and work with them on this.

  • Do Red Hat Engineers commit new features into WildFly before committing into EAP  e.g. WebSockets?

    WildFly is the upstream project which JBoss EAP is based on. All features are committed into WildFly first and allow developers to try the cutting-edge technologies in their development cycles. A version of WildFly is the basis for JBoss EAP, where all the features are battle tested for production deployments.

  • Are no extra ports (random) used for EJB communication and what about hornetQ ports?

    Only two ports are exposed: 8080 for application and 9990 for management in the default profile. All other technologies will handshake over these two ports.

  • Will it support Scala?

    WildFly and JBoss are polyglot application server. Scala (just as many other languages Ruby, Clojure, etc.) can easily be incorporated with Java applications, and even standalone Scala applications are possible on JBoss. There is a number of frameworks that could be useful for developers using JBoss and having a need for building applications using Scala. For example, Escalante is a Scala application server based on JBoss AS 7. Spray provides a REST/HTTP-based integration layer over Scala and Akka and supports any Servlet 3.0 compliant container.

  • Does undertow allow session management using Infinispan ?

    Yes, it does.

  • Where can we see approximate price-list for EAP production deployments in numbers?

    Contact Red Hat sales at http://www.redhat.com/contact/sales for a price list of JBoss EAP.

  • Why has JBoss performance metrics never been published to SpecJ?

    We do performance benchmark testing in our regular test suite and really care about it. We are planning to submit SPECjEnterprise 2010 benchmark numbers on a fully open source stack in future.

  • How CentOS relates to JBoss EAP?

    CentOS is not related to JBoss EAP. CentOS is a community project providing a distribution of Linux, while JBoss EAP is an enterprise-class application server product provided by Red Hat. Red Hat is involved in and contributes to a wide range of open source communities including CentOS and JBoss.org. Complete list of JBoss supported configurations can be found here.

  • When EAP will support websockets as WildFly does

    We are investigating back porting WebSocket support to EAP 6.x. EAP 7 is planned to be Java EE 7 compatible and will support WebSocket. Stay tuned for more details at Red Hat Summit.

  • Is it possible to have a customized JBoss EAP version  that addresses a specific need?

    You can customize the JBoss EAP by manipulating subsystems in configuration files. But we recommend talking to sales so that they can understand your needs better and offer a comprehensive solution.

  • Which version of JBoss EAP 6.x.x will be based on Wildfly 8 ?

    JBoss EAP 6.x will continue to be derived from JBoss AS 7.x.x. We are considering backporting some features of WildFly to EAP 6.x. JBoss EAP 7 will be derived from a future version of WildFly.

  • What will be approximate cost for 8 processor single instance deployment? for EAP 6.2?

    Contact sales for an exact quote.

  • We are moving some of application servers from WL to JBoss. But i find it hard to do it  is there is seamless process which can help in migration ?

    Red Hat has recognized the importance of supporting a first-class program around migration that kicked off in 2013. One of the key enablers in our migration story is Windup, which we are working with several customers and partners to enhance in order to have a more effective and streamlined migration process. More details about migration tools is available here.

  • Does EAP use standard JPA artifacts??

    Yes, JBoss EAP is Java EE 6 compliant and so provides support for JPA 2.

  • Is some presentation comparing WildFly and liberty profile?

    We have competitive content for JBoss EAP and Liberty. Slides are available at https://engineering.redhat.com/pnt/p-347807/Comparing_JBo…eo_slides.pdf and a video is also available at http://www.redhat.com/resourcelibrary/videos/focus-on-not-apples-to-apples-comparing-jboss-enterprise-application-platform-and-ibm-websphere-liberty-profile

    The above video and slides are for an older version of WebSphere Liberty profile. Both are being updated with new versions expected to be released in March 2014.

  • Will Tomcat still be supported in WildFly 8?  If not  does Undertow support the AJP Connector interface? Or will it have a different connector interface?

    Undertow is the new web server for WildFly 8 and Tomcat will not be supported in WildFly 8. AJP Connector is already supported.

  • Is it easy to migrate from JBoss AS 7.1.1 to JBoss eap 6.2?

    As a general rule, we provide seamless migration from upstream projects to corresponding products. Migrating from AS 7.1.x to JBoss EAP 6.2 should be very straight forward. Guides are provided across major versions, for example Migration Guide from EAP 5.x to EAP 6.2 is here. You should also look at JBoss Migration Center for additional tools in this area.

  • Are Wildfly and EAP different installations?  i.e. How to go from Dev evaluation to Production with support?

    Yes, you can’t automagically update a WildFly installation to become EAP – they are separate installations. You need to redeploy your applications and recreate your resources from community projects like WildFly to products like JBoss EAP.

  • Can we pay less for licensing  if we don’t want any support  only right to deploy and documentation?

    Red Hat only charges for subscriptions, there is no licensing cost.

  • OEM licensing? Can we deploy wildfly & EAP depending on customer paying or not paying for EAP?

    Contact sales for an exact quote.

  • Please elaborate: Red Hat JBoss BRMS

    Red Hat JBoss BRMS is a comprehensive platform for business rules management and complex event processing. More details here.

  • Is there a good quickstart for migrating glassfish to EAP from a JMS perspective??  like setting up JMS ConnectionFactory

    Stay tuned, a white paper is coming soon on this topic.

  • How about WildFly with eclipse?

    http://blog.arungupta.me/2013/12/getting-started-jboss-tools-wildfly-techtip-5 shows WildFly and Eclipse integration.

  • paper on JBOSS Clustering vs. Weblogic Clustering. Some module to use on Apache for three tier implementation  like we have mod_weblogic similar for jboss ?

    mod_cluster is a cluster-aware plugin for Apache HTTPD that can be used to provide software-based load balancing for clustered JBoss EAP deployments.

  • What is next for WildFly?

    WildFly 9 feature set and scope is still being discussed. If there are any particular features that you need then please file issues in JIRA. You can also follow the community at @WildFlyAS. We’ll provide more details at JUDCon and Red Hat Summit.

  • Can JBoss EAP be used for evaluation and development without buying a license
    ?

    JBoss EAP is licensed royalty-free. In particular, JBoss EAP can be downloaded from jboss.org and used for evaluation and development without payment of a license fee. If you download JBoss EAP from jboss.org and use it in production you are obligated to purchase a subscription — otherwise you are in breach of the agreement covering the download.

  • What major companies are using EAP currently?

    Mitsubishi, E*Trade, Sprint, GEICO and many others listed here.

  • Are all the features in JBoss 7.1.2 in wildfly 8?

    This is generally true. However the specifications pruned by Java EE (JAX-RPC (JSR 101), JAXR (JSR 93), EJB Entity Beans (part of JSR 153), and Java EE Application Deployment (JSR 88)) are removed from WildFly. Also, JBoss Web is now replaced by Undertow as the web server.

  • If you use WildFly for dev and EAP for production  how do you make sure that the JEE versions are compatible?

    First of all, there is no such thing as “JEE” :-)

    JBoss EAP 5.x is downstream from JBoss AS 5.x and both are Java EE 5 compliant. JBoss EAP 6.x is downstream of JBoss AS 7.x and both are java EE 6 compliant. JBoss EAP 7 will be based on a future version of WildFly and both will be Java EE 7 compliant. Java EE N+1 compliant application server will support Java EE N applications as well. So make sure to choose your development and deployment environments accordingly.

  • Can you please provide some Java EE 7 code samples tested on WildFly ?

    github.com/javaee-samples/javaee7-samples provide a comprehensive source of Java EE 7 samples that runs on WildFly.

  • Does a subscription for JBoss EAP 6 include the ‘JBoss Enterprise SOA Platform’ or similar SOA Platform?

    A subscription for any individual JBoss Enterprise Middleware product includes development use for all of the products in the JBoss Enterprise Middleware portfolio. Please refer to the Red Hat JBoss Subscription Guide for details.

 

New Webinar on Jan 8: WildFly for Innovation, Red Hat JBoss EAP for Commercial Support

jan8-2014-webinar-banner

On November 4, 2013, Oracle announced that its GlassFish Server 4.x with commercial Java™ EE 7 support won’t be released. If you’re a production user of GlassFish, your options are to take a risk by continuing on an unsupported platform or to migrate your applications elsewhere.

It has always been a good time to consider Red Hat, but now all the more so. WildFly and Red Hat® JBoss® Enterprise Application Platform is an excellent, compelling, and feature-rich alternative to GlassFish and Oracle WebLogic.

In this webinar, I will:

  • Introduce Wildfly and JBoss EAP.
  • Compare and contrast Wildfly and JBoss EAP with Oracle GlassFish and WebLogic.
  • Look at cost considerations.

Date: Jan 8, 2014
Time: 16:00 UTC | 11:00 am (New York) | 5:00 pm (Paris) | 9:30 pm (Mumbai)

Register Now!

Make sure to invite a friend or a colleague!

Java EE Samples Github Organization: Java EE 7 Samples and Hands-on Lab already moved

After 737 commits, 15 contributors, 134 tests, its time for github.com/arun-gupta/javaee7-samples to move to github.com/javaee-samples/javaee7-samples. Similarly Java EE 7 hands-on lab is also moved from github.com/arun-gupta/javaee7-hol to github.com/javaee-samples/javaee7-hol.

Octocat

Java EE samples organization is a new GitHub organization, instead of a personal repo, and will provide a common ground for everybody in the community to contribute.

Moving these two repos to an organization opens up room for growth. If you have any Java EE 6/7 samples, tests, applications, hands-on lab or any other guides then feel free to transfer/create a new repository and contribute. This new organization would provide a common ground for all app server vendors like Red Hat, Oracle, IBM and Tomitribe to contribute. Independent consultants and every body else is welcome to contribute content too.

This will be a new central location for all samples around Java EE – truly showing the power of Community Powered Innovation!

Ready to contribute ?

  • Arquillian Hackergarten provide instructions on how to contribute unit tests to Java EE 7 Samples. WildFly and GlassFish CI jobs polls the workspace every 15 minutes.
  • Convert Java EE 7 hands-on lab to AsciiDoc by assigning an issue to yourself.

This will be one organization to rule them all :-)

Thanks to Aslak Knutsen, the Arquillian man, for the nudge!

GlassFish Commercial is Dead, WildFly and JBoss EAP to the Rescue

I, along with several others, spent 6+ years at Oracle creating and nurturing the GlassFish community. ~852 blog entries on blogs.oracle.com/arungupta/tags/glassfish vouch for that. I still remember when our team got a presidential award at Sun Microsystems for growing the downloads from 0 to 5 million in 3 years. I was also popularly known as “GlassFish Guy” all around the world. Lots of fond memories …

left Oracle and joined Red Hat a little over 4 weeks ago. Even though we have a competing (better 😉 project in WildFly and product in JBoss EAP but will always have high respect for GlassFish. It is the Reference Implementation as required by JCP and so by design will be always at the leading edge of technology. One of common myths I had to unravel all the time was that GlassFish can be used as a production application server because Sun/Oracle offered commercial support for it.

This was changed by Oracle’s announcement to abandon commercial support for GlassFish. Specifically …

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.

This means GlassFish will continue to be at the leading edge of technology (hopefully) but is now merely reduced to a toy. You can use GlassFish as a reference to ensure your code is using pure Java EE 7 APIs but any production deployments should seriously think twice before considering it as a choice of application server. This is also expressed by Antonio Goncalves:

GlassFish will stay open source. Yes, but with no commercial support it will not be used in organizations

Earlier today GlassFish plugin for Eclipse was removed from java.net. I suspect we’ll continue to see more news items like this making GlassFish truly for reference only.

This also means that today there are no vendors offering commercial support for Java EE 7 applications. Johan Vos from Lodgon jumped on the opportunity and offered commercial support for GlassFish. Johan (disclaimer: a great friend) is extremely knowledgeable about the internals and the codebase so he would be your good bet in case you want production support.

This decision from Oracle makes business sense as having two application server from one company is always confusing. This is the reason Sun (unfortunately) could not survive and Oracle will. David Blevins explained wonderfully in his post that open source isn’t free. In addition to WildFly, TomEE is the only open source application server that is now commercially supported by Tomitribe.

The announcement also said:

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

This would again make sense from Oracle’s perspective, at least for license, but not so much from customers or community perspective. Forester research analyst John Rhymer was quoted on that:

Folks that prefer GlassFish as their Oracle-supported production Java server now are looking at a big rise in costs

Agreed that Java EE is the common binding thread between the two application servers and there is some support for deployment descriptors across the two application servers. But that’s where the connection stops. Migrating an application from GlassFish to WebLogic is like migrating from one application server to another application server, and InfoQ agrees with that. They even said:

This needs more planning and effort, compared to moving to GlassFish with commercial support, or switching from WildFly to JBoss EAP. 

Deployment descriptor interoperability is good to get started with but Markus Eisele explained in his blog entry R.I.P. GlassFish – Thanks for all the fish.:

Even that both WLS and GF understand at least a bit of each others deployment descriptors there is a high risk buried in here that such a setting is the road to trouble.

Even if there is a knowledge of deployment descriptors but is that how the application will go into production as well ? What if support for GlassFish deployment descriptors is dropped from WebLogic ? Migrate again ?

Oracle also talks about shared code between GlassFish and WebLogic. If applications are built using standard Java EE APIs then the underlying implementations does not really matter much. Anyway most migration effort is associated with monitoring, management, clustering, and administration which is completely different between the GlassFish and WebLoigic servers. Customers estimating the level of effort to migrate away from GlassFish have the same analysis to perform for WebLogic or JBoss Enterprise Application Platform. Antonio also highlighted this aspect:

WildFly and JBoss have the same code base, GlassFish and Weblogic don’t (and that makes a huge difference between RedHat and Oracle app servers)

Commercial GlassFish customers who want to explore a migration to WebLogic will need to evaluate the cost of both code and license migration. Oracle has not announced any license credit or reduced upgrade pricing for commercial GlassFish customers considering migration to WebLogic. The latest Oracle price list dated October 17, 2013 lists the per processor price of GlassFish at $5,000 and WebLogic Server Enterprise Edition at $25,000, you do the Math!

JBoss EAP calculator helps you compare ongoing subscription cost of JBoss EAP and upfront license and ongoing support/maintenance costs of WebLogic and WebSphere. As shown in the EAP calculator there is 92% savings using JBoss EAP over WebLogic over 3 years.

6 Facts blog talk about WebLogic is not always more expensive than Oracle GlassFish Server. The blog seems correct on the cost analysis but it does not mention that WebLogic Standard Edition does not offer any clustering and failover capabilities. That also makes the Standard Edition that much less attractive an offering. You get what you pay for!

WildFly is the bleeding edge innovation engine for Red Hat and JBoss EAP allows customers to consume open source with ease. If you are looking for an open source application platform with commercial support from a large vendor, then your only choice is Red Hat.

We are open and this is also stated in a very objective opinion from Sharat Chander (a great friend and my ex-colleague):

 

Here is one tweet that I saw after the announcement and we’ll continue to see more of these …

What can you do ?

  • WildFly 8 is getting ready to be released and is passing ~99% TCK for Java EE 7 compliance. Make sure to try your applications on WildFly and report any bugs. Tech Tip #1 shows how to get started.
  • Watch a Deep Dive into WildFly 8 and Java EE 7 webinar to learn more about WildFly 8.
  • Download JBoss EAP and try your applications on it. You can always reach out to Red Hat Consulting if you need help with migration efforts.
  • Try your Java EE 6 applications on OpenShift (deployed on JBoss EAP 6) or Java EE 7 applications using WildFly cartridge.

Red Hat and I are here to help!