Servlets - Tomcat, Resin, etc.

|  |  |  | FAQ Servlets |

Main
Welcome!
Download
Mailing Lists
The Team

Users
Quickstart
Hello World!
CMP Example
CMP Guide
Deploy
Startup
Validation
Configuration
Support
Request Feature
FAQ

Servers
Local Server
Remote Server
Tomcat

Integrators
Why OpenEJB
Overview
Design
Specification
Presentation

Developers
Custom Services
Release Plan
Source Code
SourceForge

Servlets - Tomcat, Resin, etc.

- Can I use OpenEJB from Tomcat?
- Can I use OpenEJB from Resin?
- Can I use OpenEJB from Jetty?

## Can I use OpenEJB from Tomcat?

Sure you can, it's pretty easy in fact. You can find setup instructions here

## Can I use OpenEJB from Resin?

It's been done, but so far no users have posted the relevant details. If you have any information on it, please post them to the OpenEJB user list.

## Can I use OpenEJB from Jetty?

We have this information from our Australian friend Michael Mihaljevic who reports his team uses OpenEJB with Jetty for development, giving them a full local environment that allows them to debug their Servlets and EJBs end-to-end.

Here is what he had to say:

    Our development team has put in place local Servlet and EJB containers
    that can be run and debugged from the servlet code to EJB code within an
    IDE environment ( we are using JDeveloper 3.2.3).

    We are using:
    - Jetty 4.0.5
    - OpenEJB 0.8.1 (using IntraJVM)
    - JVM 1.2.2 (from JDeveloper)

    Initially when we attempted to setup the Jetty / OpenEJB dev environment,
    we were getting errors when executing servlet code that was narrowing or
    casting the Object returned from the JNDI lookup of an EJB.  A suggestion
    from the OpenEJB Forum (thanks Jacek) indicated it may be a classloader
    problem.  In the end it was a problem in the Jetty code.  It allows for a
    classpath to be specified for a HttpContext object that pointed at the
    servlet classes.  Removing this line of code from the Jetty Server
    resolved the EJB lookup problem.

    I've included a sample JettyServer.java source that simply creates a Jetty
    HttpServer.

    (See attached file: JettyServer.java)

    When running this code, the classpath should include:
    - OpenEJB libraries
    - Jetty libraries
    - EJB component code
    - Servlet component code.

    I haven't included sample servlet and ejb code, but this is relatively
    straightforward.  The OpenEJB components are used in IntraJVM mode. Once
    all this is setup, its possible to run and debug both servlet and ejb code
    end to end.

    This configuration has helped provided our team with a useful local dev
    environment.

    Cheers,

    Michael Mihaljevic

Java, EJB, JDBC, JNDI, JTA, Sun, Sun Microsystems are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and in other countries. XML, XML Schema, XSLT and related standards are trademarks or registered trademarks of MIT, INRIA, Keio or others, and a product of the World Wide Web Consortium. All other product names mentioned herein are trademarks of their respective owners.