I am trying to do a custom authentication realm for tomcat that talks to our
ejb layer rather than talking straight to the database. I have placed my
custom realm and a cut-down client version of weblogic (based on
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4315 - to prevent xml and
jndi conflicts) in tomcat server/lib, along with the stubs my code needs to
access the ejbs.

The custom realm works fine as long as it does not do the ejb lookup. The
ejb lookup code works fine as long as it is not in the custom realm. When I
put them together I get the error below. It looks like it initialises the
initialContext but fails as soon as I try to get the home interface.

It fails on these lines in my authenticate method:
Object object = context.lookup("foo/bar/Class");
ClassHome puf = (ClassHome)javax.rmi.PortableRemoteObject.narrow(object,
ClassHome.class);

The version of the stubs in tomcat server/lib is exactly the same as the
version of the stubs in weblogic.

I am using tomcat 4.0.1 and weblogic 6.1sp2.

If anybody has any ideas I would be extremely grateful.

Lisa

-------------------------------------------------------------


javax.naming.CommunicationException.  Root exception is
java.rmi.UnmarshalException: failed to unmarshal class java.lang.Object;
nested exception is:
        java.io.StreamCorruptedException: Unknown code in readObject 4
java.io.StreamCorruptedException: Unknown code in readObject 4
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:448)
        at
java.io.ObjectInputStream.skipToEndOfBlockData(ObjectInputStream.java
:1493)
        at
java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1216)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:386)
        at
java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java:226
2)
        at
java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:51
9)
        at weblogic.rmi.internal.StubInfo.readObject(StubInfo.java:73)
        at java.lang.reflect.Method.invoke(Native Method)
        at
java.io.ObjectInputStream.invokeObjectReader(ObjectInputStream.java:2
213)
        at
java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1410)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:386)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
        at
weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedO
bjectInputStream.java:110)
        at
weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedO
bjectInputStream.java:123)
        at weblogic.rmi.internal.ObjectIO.readObject(ObjectIO.java:56)
        at
weblogic.rmi.internal.BasicRemoteRef.unmarshalReturn(BasicRemoteRef.j
ava:232)
        at
weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteR
ef.java:263)
        at
weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteR
ef.java:229)
        at weblogic.rmi.internal.ProxyStub.invoke(ProxyStub.java:35)
        at $Proxy0.lookup(Unknown Source)
        at
weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:339)
        at javax.naming.InitialContext.lookup(InitialContext.java:350)
        at
org.apache.catalina.realm.RealmHelper.authenticate(RealmHelper.java:6
8)
        at org.apache.catalina.realm.DRRealm.authenticate(DRRealm.java:75)
        at
org.apache.catalina.authenticator.FormAuthenticator.authenticate(Form
Authenticator.java:263)
        at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica
torBase.java:459)

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to