Re: Custom Realm ClassLoader issues?

2001-12-12 Thread Craig R. McClanahan



On 4 Dec 2001, Scott Ganyo wrote:

 Date: 04 Dec 2001 17:06:41 -0500
 From: Scott Ganyo [EMAIL PROTECTED]
 Reply-To: Tomcat Users List [EMAIL PROTECTED]
 To: Tomcat Users List [EMAIL PROTECTED]
 Subject: Custom Realm  ClassLoader issues?

 Hi all,

 I've written a custom Realm that I'm attempting to use for
 authentication under Tomcat 4.0.  Within that class I'm using JavaSpaces
 to do the messaging to the authentication service that I wrote.  Each
 piece works independantly, but together they are failing.  What happens
 is this:

 1. Realm: Posts authentication Message to Space.
 2. Auth Service: Retrieves Message, performs authentication
 3. Auth Service: Posts auth response Message to Space
 4. Realm: Retrieves Message

 The trouble is that at the point when the Realm retrieves the Entry from
 the Space (4), I get a ClassCastException when I attempt to cast it to a
 Message.  I know it is a Message, though, as I can print it out and
 verify it.  Thus, it seems like it is a ClassLoader issue...?


I don't know JavaSpaces at all, but I've seen similar things happen with
RMI programming when you did not have ALL the Jar files you need in the
right class path.  Can you write a stand-alone Java application that
simulates what the Realm does, and have it work correctly?  If so, the
classpath required to make it work might give you some hints about what
has to go into server/lib.

 BTW: I put all Jini jars in the server/lib and my classes in the
 server/classes directory so that my Realm has access to the appropriate
 classes.  Would this be related?  Is there a better way?

That's the right way to do things.  (You could also JAR your files from
server/classes into a JAR file in server/lib, but that is essentially
equivalent.)

 Thanks for any suggestions,

 Scott


Craig


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Custom Realm ClassLoader issues?

2001-12-04 Thread Scott Ganyo

Hi all,

I've written a custom Realm that I'm attempting to use for
authentication under Tomcat 4.0.  Within that class I'm using JavaSpaces
to do the messaging to the authentication service that I wrote.  Each
piece works independantly, but together they are failing.  What happens
is this:

1. Realm: Posts authentication Message to Space.
2. Auth Service: Retrieves Message, performs authentication
3. Auth Service: Posts auth response Message to Space
4. Realm: Retrieves Message

The trouble is that at the point when the Realm retrieves the Entry from
the Space (4), I get a ClassCastException when I attempt to cast it to a
Message.  I know it is a Message, though, as I can print it out and
verify it.  Thus, it seems like it is a ClassLoader issue...?

BTW: I put all Jini jars in the server/lib and my classes in the
server/classes directory so that my Realm has access to the appropriate
classes.  Would this be related?  Is there a better way?

Thanks for any suggestions,

Scott



--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]