main website home
  • About this blog

    This blog features updates, opinions, and technical notes from Caucho engineers about Caucho products, the enterprise Java industry, and PHP. Caucho Technology is the creator of the Resin Application Server and the Quercus PHP in Java engine. A leader in Java performance since 1998, Caucho is a Sun JavaEE licensee with over 9000 customers worldwide.
  • Tags

    ajaxworld bam candi cdi cloud cluster comet configuration deploy devoxx eclipse ejb embedded flash flex google app engine hessian hmtp ioc java ee 6 javaone javazone jms messaging newsletter nyjug osgi php pomegranate quercus resin resin 4.0 REST servlet sfjug silicon valley code camp spring testing training tssjs watchdog webbeans web profile websockets wordpress
  • Meta

    • Register
    • Log in
    • Entries RSS
    • Comments RSS
    • WordPress.org
« Java CanDI Injection in subetha
JSR-299 (CanDI) Proposed Final Draft »

pomegranate modules

As a quick introduction to pomegranate (I’m crushed for time today), here’s a quick diagram that shows the basic module structure for a typical pomegranate configuration.

Pomegranate is designed to solve the module versioning and classloader issues from an enterprise-application perspective. Although we’re doing a bit of classloader magic behind the scenes, the developer perspective is fairly simple and clean:

  1. remove jars from your .war
  2. drop them in Resin’s project-jars directory
  3. declare jar dependencies in Maven .pom files
  4. import them to your web-app with WEB-INF/pom.xml or in your resin-web.xml

Pomegranate resolves the module versions, and builds a classloader graph for the web-app. The module graph looks like the following:

pomegranate module usage

Tags: module, osgi, pomegranate

This entry was posted on Wednesday, June 10th, 2009 at 10:07 am and is filed under Engineering. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

10 Responses to “pomegranate modules”

  1. Caucho Technology » Blog Archive » Why OSGi is cool, but not for most enterprise apps… Says:
    June 16th, 2009 at 11:12 am

    [...] wrote a quick overview of Pomegranate and we’ll soon have real docs for it, but I wanted to give the story of how we [...]

  2. alag Says:
    July 31st, 2009 at 4:31 am

    You might take a look at POMStrap http://pomstrap.prefetch.com/en/ which has approximately the same goal.

  3. jstrachan Says:
    July 31st, 2009 at 7:21 am

    I love this idea as a simple alternative to OSGi!

    I wondered if we could spin up a little OSS project somewhere neutral (say google code?) where we could describe the spec of how a pom.xml style dependency mechanism should work with any servlet container - then try get servlet containers to also implement it so it can become a common adopted standard?

    e.g. we could patch the maven war command to optionally generate the pom.xml in WEB-INF. I was chatting to Greg from Jetty and he’s happy to support this model too - so we could get Maven, Resin and Jetty all supporting this simple alternative to OSGi?

    Incidentally a suggestion from Greg was to consider putting pom.xml in the WEB-INF/lib, so when folks look in the lib dir for dependencies, they see the pom.xml there?

  4. Emil Says:
    July 31st, 2009 at 9:27 am

    alag: Thanks for the link! After just a quick pass, I don’t think that POMStrap is quite the same. They look like they’re inverting the classloader hierarchy, while we’re using a classloader cloud model. The difference is that the classloading is not transitive in any direction with our approach.

    jstrachan: I like the idea. I’ll check with the rest of the team to see what they think. Standardization, specs, interoperability… all good stuff.

  5. neotyk Says:
    August 5th, 2009 at 12:46 pm

    Awesome idea, congrats!

    I’m working on Grizzly Servlet Container and would like to have this great feature there as well.
    Please keep us posted on OSSing pomegranate.

  6. ferg Says:
    August 5th, 2009 at 1:33 pm

    I’ve posted a rough draft of a Pomegranate spec at http://blog.caucho.com/?p=225

  7. alag Says:
    August 7th, 2009 at 2:59 am

    Emil: from my experience, not having transitive classloader could lead you to lot of ClassNotFound exceptions as most modules around here are not design with clean/strict dependency definition in mind.

  8. ankur Says:
    August 17th, 2009 at 5:13 am

    I downloaded the src of resin 4.0.0 and 4.0.1 but couldn’t find the pomegranate module while building locally.

  9. ferg Says:
    August 17th, 2009 at 12:18 pm

    It’s integrated with the Resin classloader in 4.0.1. Look at com.caucho.loader.EnvironmentClassLoader, ArtifactManager, Artifact, ArtifactClassLoader.

    To alag. I think you’re right about the transitivity, but we also need a way to make a link intransitive for certain configurations. I’m hoping for another draft in a day or two.

  10. ankur Says:
    August 17th, 2009 at 11:22 pm

    Thanks for the info. In my project, I have 1 interface and 2 implementations. Each implementation has its own set of JAR dependencies some of which of may overlap. I am trying to see if I can use Pomegranate as an out-of-the-box solution for this. Any help is highly appreciated.

Leave a Reply

You must be logged in to post a comment.


Caucho Technology is proudly powered by WordPress and Quercus®
Entries (RSS) and Comments (RSS).

  • HOME |
  • CONTACT US |
  • DOCUMENTATION |
  • BLOG |
  • WIKI 4 |
  • WIKI 3 |
  • Resin: Java Application Server
Copyright (c) 1998-2012 Caucho Technology, Inc. All rights reserved.
caucho® , resin® and quercus® are registered trademarks of Caucho Technology, Inc.
resin® is a cloud optimized, java® application server that supports the java ee webprofile ®