On Sep 14, 2007, at 4:28 PM, Dario Laverde wrote:

Karan, thanks for updating the (Tomcat) New Instructions page (I just needed to know
how you did the lookup), however:

Placing the restrictions up top like that will just scare off users - the implication is that it won't work on Windows. I think the instructions can be reduced to a few simple steps (and you should probably skip all the Tomcat
installation steps)

1) unzip openejb-tomcat-3.x.x-SNAPSHOT-bin.zip into the Tomcat's webapps folder
(btw no need to start/stop Tomcat at this point)

2) Non-Windows users: go to http://localhost:8080/openejb/install

Windows users: a) remove Tomcat's lib/annotations-api.jar (add an explanation here)
                  b) edit Tomcat's bin/catalina.bat file ....

If you can document the changes that need to be made to the catalina.bat file, I can add them to the installer code. Also to avoid the windows locking problem, we could remove the annotations- api.jar in the bat file since it runs before the server starts (and locks the files).

3) restart Tomcat

caveats:
- There is no security integration
- Injection is work in progress.. i.e. @EJB, @Resource, @PersistenceContext...

As for the remark "support older versions of Tomcat if there were enough demand, but it is doubtful there will be since OpenEJB 3 requires Java5", well Tomcat 5.5 runs on Java5 and is still quite prevalent (many sites/hosting providers will not move to
Tomcat 6 until 6.1).

If you have the time, it would be great to get 5.5 going also.

So I gave it a try on 5.5 and got the "LifeCyle" class (from catalina.jar) not found
via the webapp classloader.

Looking at the code, we only use this class to get some constant values which could be inlined:

public interface Lifecycle {
    public static final String INIT_EVENT = "init";
    public static final String START_EVENT = "start";
    public static final String BEFORE_START_EVENT = "before_start";
    public static final String AFTER_START_EVENT = "after_start";
    public static final String STOP_EVENT = "stop";
    public static final String BEFORE_STOP_EVENT = "before_stop";
    public static final String AFTER_STOP_EVENT = "after_stop";
    public static final String DESTROY_EVENT = "destroy";
    public static final String PERIODIC_EVENT = "periodic";
// snip


Probably a dumb question, but could 5.5 be supported as
well if we added all the OpenEJB jars into Tomcat's lib folder?

Class loading is only one aspect of the integration. We also need to hook deployment so we can support annotations and other things like JPA. The OpenEJBListener lets us know when each Web context is loaded, so can preprocess the application before tomcat loads any classes.

Which begs the
question, is OpenEJB a feature request to be streamlined into Tomcat in the future?

Isn't that what we are doing now? A very clean and simple integration into Tomcat.

And what exactly is the story behind annotations-api.jar at Tomcat anyway (why is
there)?

It is the annotation classes that Tomcat needs so it can process annotations on servlet classes. The jar is a hodgepodge of classes from the commons annotations, ejb, jpa, and webservice specs. The jar was developed over time based on changes from the different committees. The problem is they missed some changes and have deviated from the specs in a few cases, which causes stuff like OpenJPA to blow up when the Tomcat annotation classes are present.


-dain

Reply via email to