Stefan,
I'm heads down on some stuff for my day job right now so I'll just paste in
some stuff from a couple previous posts to TOMCAT-DEV and TOMCAT-USER. When
I come up for air (hopefully by the end of the week) I'm going to merge the
changes I made to my new embedded Tomcat class into EmbededTomcat.java and
post the diffs.
Here are the two posts I made a while back. I hope this is useful.
-- Sent 11/27/00 to TOMCAT-USERS ----------------------------------------
I'm beating my head against a wall with EmbededTomcat and I'm hoping someone
here can help me out.
Here's where I stand. I've got an application that initializes the
EmbededTomcat class. I can access a servlet using the HttpConnectionHandler
on port 8080. My servlet gets instantiated, init() gets called, doGet()
gets called and everything seems OK until I get a NullPointerException in
SessionInterceptor.beforeBody() because the context manager has not been
initialized by calling SessionInterceptor.setContextManager(). What am I
missing?
Also, I'd like to use AjpConnectionHandler so that I can use IIS as my web
server. I don't see anything in EmbededTomcat to create an
AjpConnectionHandler endpoint, only HttpConnectionHandlers. I added a new
method, addAjpEndPoint(), to do this and it seems to work (of course I get
the same null pointer as above). Is there anything wrong with this
approach?
BTW, shouldn't EmbededTomcat be named EmbeddedTomcat :-)
--Sent 11/29/00 to TOMCAT-DEV--------------------------------------
I made some comments on the tomcat-user list a few days ago about my attempt
to use EmbededTomcat in 3.2. I've hacked together something that works for
me. When I get it cleaned up I'll post the code.
Bascially I had the following problems
1) Using EmbededTomcat seems to require using a security manager. I
haven't tracked down why, yet, I just added a security policy that opens
everything up.
2) The contexts' context manager wasn't being set. I had to change the
order in which things got created and add a call to
context.setContextManager() in addContext().
3) There was no way to mark contexts as not reloadable.
Again, I was able to embed Tomcat inside my app and it is working. The
EmbededTomcat class is a good starting point for this but you will need to
do some work.
----------------------------------------
-----Original Message-----
From: Stefán F. Stefánsson [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 20, 2000 3:57 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: 3.x submitters [was RE: [MY_OPINION] Tomcat 3.x]
Hi Marc.
First I wanted to start off by wishing you the best of luck as a
committer. I'm very happy to see you take the time to volunteer for
3.x.
I just have a little question about section 2. There you say that
"EmbededTomcat doesn't work at all". What do you mean? I'm using it in
a product here (which is not out yet so we don't have any credits
anywhere, Jon... I'll make sure that's fixed ASAP though) and it works
fine... It took a lot of effort though... one of which is to play around
with policy files. I agree that it needs cleaning up and more/better
documentation but I wouldn't go as far as to say that it doesn't work.
Could I take a look at your EmbededTomcat class? What I'm mostly
worried about are the addCustomEndpoint additions I made to the class,
you're not gonna take those out are you.... *shiver* ;o)
Kind regards and thanks again!
Stefan Freyr