Hi David,
my apologies for my tardiness with this response. I've been away from the client site for a little while. 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 CMG IT Services. Michael Mihaljevic To: Michael Mihaljevic/Person/DOJ@DOJ Sent by: cc: Michael Subject: RE: [OpenEJB-user] OpenEJB and Jetty Mihaljevic 09/09/2002 14:48 ----- Forwarded by Michael Mihaljevic/Person/DOJ on 09/09/2002 14:44 ----- Michael Mihaljevic To: "David Blevins" <[EMAIL PROTECTED]> cc: 09/09/2002 Subject: RE: [OpenEJB-user] OpenEJB and Jetty(Document link: Michael 14:48 Mihaljevic) David, sure, I'll post these details shortly. Cheers, Michael "David Blevins" To: <[EMAIL PROTECTED]> <david.blevins cc: @visi.com> Subject: RE: [OpenEJB-user] OpenEJB and Jetty Sent by: "David Blevins" <david.blevins @visi.com> 07/09/2002 03:19 Michael, This is great news. This is information other OpenEJB users would surely be interested in. Could you post some of the details on the user list? Namely: what version of Jetty; what IDE and version; jdk version; a few steps for getting Jetty and OpenEJB to play together. Thanks, David > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]] > Sent: Thursday, September 05, 2002 10:48 PM > To: David Blevins > Subject: RE: [OpenEJB-user] OpenEJB and Jetty > > > > Hi David, > > I'll be downloading the new release in the near future. For > the moment, my > problem with Jetty and OpenEJB integration has been solved. > We're now > able to use an IDE to debug our app from servlets to EJBs. > > Cheers, Michael > > > > > > > "David > > Blevins" To: > <[EMAIL PROTECTED]>, "'LASKOWSKI,JACEK > <david.blevins (HP-Poland,ex1)'" > <[EMAIL PROTECTED]> > @visi.com> cc: > <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> > Sent by: Subject: RE: > [OpenEJB-user] OpenEJB and Jetty > "David > > Blevins" > > <david.blevins > > @visi.com> > > > > 06/09/2002 > > 13:16 > > > > > > > > > Michael, > > We just cut OpenEJB 0.8.2 a few minutes ago. We are excited > about this release as it contains some classpath > enhancements, new documentation, and several fixes from Apple. > > Download that here: > https://sourceforge.net/project/showfiles.php?group_id=44351&r > elease_id= > 108833 > > Some details on the classpath changes are here: > https://sourceforge.net/tracker/index.php?func=detail&aid=6037 > 84&group_i > d=44351&atid=460291 > > Drop the new OpenEJB libraries in place of the old ones and > see if the problem doesn't magically go away. > > Let us know how it goes. > > David > > > > -----Original Message----- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED]] On Behalf Of > > [EMAIL PROTECTED] > > Sent: Thursday, September 05, 2002 7:26 PM > > To: LASKOWSKI,JACEK (HP-Poland,ex1) > > Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] > > Subject: RE: [OpenEJB-user] OpenEJB and Jetty > > > > > > > > Hi Jacek, > > > > thanks for your thoughts. It led me to try something that ended my > > misery. > > > > In my original code I use Jetty libraries to create a http > server that > > contains a HttpContext object. The example code from Jetty > allows for > > a classpath to be set for the HttpContext object and the > documentation > > indicates this should include any servlets that have been > developed. > > I found that if I don't specify this claspath programatically then > > the ClassCastException problems disappears. This seems to validate > > your thoughts on separate ClassLoaders for Jetty and OpenEJB. > > > > Thanks again. > > > > Cheers, Michael > > > > > > > > > > > > > > > > > > > > "LASKOWSKI,JAC > > > > EK To: > > "'[EMAIL PROTECTED]'" > > (HP-Poland,ex1 > > <[EMAIL PROTECTED]> > > > > )" cc: > > > > <jacek_laskows Subject: RE: > > [OpenEJB-user] OpenEJB and Jetty > > [EMAIL PROTECTED]> > > > > Sent by: > > > > "LASKOWSKI,JAC > > > > EK > > > > (HP-Poland,ex1 > > > > )" > > > > <jacek_laskows > > > > [EMAIL PROTECTED]> > > > > > > > > 05/09/2002 > > > > 21:56 > > > > > > > > > > > > > > > > > > Hi, > > > > I did, but not with OpenEJB. > > > > It happens when an application manages a bunch of > classloaders, each > > responsible for other class sets. A class is uniquely named by the > > classloader, which loaded the class plus its fully qualified name > > (i.e. the package and the class name). The application is > the servlet > > container - Jetty. It creates the classloaders, and once the class > > unmarshalled (i.e. copied in IntraVM mode) in one > classloader is tried > > to be cast to the same class, *but* in another classloader, the > > clash occurs. > > > > So, I guess you added OpenEJB classes to WEB-INF/lib *and* Jetty's > > CLASSPATH or something like this. In other words, make sure that > > OpenEJB jars are only in one place available for Jetty. Otherwise, > > you'll face the (very subtle) problem with narrow(). > > > > I remember I lost a whole day trying to find out what's > wrong when the > > same problem hit me. It was very important day in my Java career :-) > > > > -Jacek > > > > > -----Original Message----- > > > From: [EMAIL PROTECTED] > > > [mailto:[EMAIL PROTECTED]] > > > Sent: Thursday, September 05, 2002 9:14 AM > > > To: [EMAIL PROTECTED] > > > Subject: [OpenEJB-user] OpenEJB and Jetty > > > > > > > > > Hi, > > > > > > I'm trying to setup a dev environment running Jetty 4.0.5 > > and OpenEJB > > > 0.8.1 with EJBs accessed in locally (intraVM). > > > > > > I've been successful in getting accessing a simple > > HelloWorld ejb from > > > an application but having problems from Jetty. The > problem occurs > > > after the context lookup of the EJB home. When > attempting to narrow > > > the home object or simply just casting it I get a > > > ClassCastException. > > > > > > I've been successful in getting accessing a simple > > HelloWorld ejb from > > > an application but having problems from Jetty. The > problem occurs > > > after attempting to narrow the EJB home object (or just > casting it) > > > returned from the context lookup. The error is a class cast > > > exception. This error does > > > not occur when running exactly the same code in a simple > application > > > (rather than a servlet inside Jetty). > > > > > > Has anyone experienced this problem. > > > > > > Cheers, Michael > > > > > > > > > > > > _________________________________________ > > > ***CONFIDENTIAL*** > > > The information in this message and in any attachments may be > > > confidential. If you are not the intended recipient of this > > message, > > > you must not read, forward, print, copy, disclose, or use > > in any way > > > the information this message or any attachment contains. If you > > > are not the intended recipient, please notify the sender > > > immediately and delete or destroy all copies of this > message and any > > > > attachments. > > > > > > > > > > > > ------------------------------------------------------- > > > This sf.net email is sponsored by: OSDN - Tired of that > > same old cell > > > phone? Get a new here for FREE! > > > https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 > > > _______________________________________________ > > > http://OpenEJB.sf.net > > > OpenEJB-user mailing list [EMAIL PROTECTED] > > > https://lists.sourceforge.net/lists/listinfo/openejb-user > > > > > > > > > > > > > > > > > _________________________________________ > > ***CONFIDENTIAL*** > > The information in this message and in any attachments may be > > confidential. If you are not the intended recipient of this > message, > > you must not read, forward, print, copy, disclose, or use > in any way > > the information this message or any attachment contains. If you are > > not the intended recipient, please notify the sender > immediately and > > delete or destroy all copies of this message and any attachments. > > > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by: OSDN - Tired of that > same old cell > > phone? Get a new here for FREE! > > https://www.inphonic.com/r.asp?r=sourceforge1> &refcode1=vs3390 > > > > > > _______________________________________________ > > http://OpenEJB.sf.net > > OpenEJB-user mailing list [EMAIL PROTECTED] > > https://lists.sourceforge.net/lists/listinfo/openejb-user > > > > > > > > > > _________________________________________ > ***CONFIDENTIAL*** > The information in this message and in any attachments may be > confidential. If you are not the intended recipient of this > message, you must not read, forward, print, copy, disclose, > or use in any way the information this message or any > attachment contains. If you are not the intended recipient, > please notify the sender immediately and delete or destroy > all copies of this message and any attachments. > _________________________________________ ***CONFIDENTIAL*** The information in this message and in any attachments may be confidential. If you are not the intended recipient of this message, you must not read, forward, print, copy, disclose, or use in any way the information this message or any attachment contains. If you are not the intended recipient, please notify the sender immediately and delete or destroy all copies of this message and any attachments.
JettyServer.java
Description: Binary data