Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Jetty and JBoss EJB3

JBoss have released with an alpha version of an embeddable EJB3 implementation. It is available for download

Here are the steps required to get jboss-EJB-3.0_Embeddable_ALPHA_5 working with Jetty:

  • make sure you're using jre 1.5
  • download and unzip it
  • go to the docs/embedded-tutorial/embedded-war directory and build it (just type ant).
  • unjar the war file in docs/embedded-tutorial/embedded-war/build/standalone.war to your $jetty.home/webapps directory.
  • move all of the jars in $jetty.home/webapps/standalone/WEB-INF/lib except for tutorial.jar to $jetty.home/lib/ext/jboss Note 1
  • finally, edit the $jetty.home/webapps/standalone/EmbeddedEJB3.jsp file. The JNDI lookups for the beans in this file don't work and don't match the documentation, so you need to change them. Find the lines:
    Code Block
    CustomerDAOLocal local = (CustomerDAOLocal)ctx.lookup(CustomerDAOLocal.class.getName());
    CustomerDAORemote remote = (CustomerDAORemote)ctx.lookup(CustomerDAORemote.class.getName());
    change them to:
    Code Block
    CustomerDAOLocal local = (CustomerDAOLocal)ctx.lookup("CustomerDAOBean/local");
    CustomerDAORemote remote = (CustomerDAORemote)ctx.lookup("CustomerDAOBean/remote");
  • start jetty:
    Code Block
    java -jar start.jar
  • surf to http://localhost:8080/standalone/EmbeddedEJB3.jsp to test EJB3s in Jetty with the JBoss supplied demo

Note 1: Besides being a good idea to move the jboss jars out of the webapp if you intend on using them with other webapps, it seems to be necessary (at least for now) to avoid a strange ClassNotFound exception.

Contact the core Jetty developers at
private support for your internal/customer projects ... custom extensions and distributions ... versioned snapshots for indefinite support ... scalability guidance for your apps and Ajax/Comet projects ... development services from 1 day to full product delivery