Jules, the fix is very easy, you don't have to make JBossUserRealm serializable, instead, when you do SecurityAssociation.setPrincipal() don't pass it 'this' which is JBossUserPrincipal, rather pass along a new SimplePrincipal() which corresponds to the name stored in JBossUserPrincipal. The JBoss security infrastructure only checks the name, the Principal object does not have to be the same everytime. Doublecheck with Scott but this fix worked nicely for me.
------------------------------------------------------------------------- Anatoly Akkerman Computer Science Dept. Courant Institute of Mathematical Sciences, NYU 715 Broadway, #719 Tel: 212 998-3493 New York, NY 10003 Fax: 212 995-4123 ------------------------------------------------------------------------- On Sat, 12 Jan 2002, Jules Gosnell wrote: > > Marc, > > My understanding of this Exception popping up in the web testsuite was > that serialisation was occuring because optimisation was not. Therefore > I have not invested time in the alterations to JBossUserRealm to make it > Serializable. > > What is the situation here? Is this still the case - or does it have to > be Serialisable ? > > > Jules > > 13:50:14,485 INFO [Jetty] SecureEJBServlet: init > 13:50:14,628 ERROR [StatelessSessionContainer] invoke returned an > exception > java.io.NotSerializableException: org.jboss.jetty.JBossUserRealm > at > java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1148) > at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366) > at > java.io.ObjectOutputStream.outputClassFields(ObjectOutputStream.java:1827) > > at > java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:480) > > at > java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1214) > at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366) > at java.rmi.MarshalledObject.<init>(MarshalledObject.java:95) > at > >org.jboss.invocation.MarshalledInvocation.writeExternal(MarshalledInvocation.java:312) > > at > java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1172) > at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366) > at java.rmi.MarshalledObject.<init>(MarshalledObject.java:95) > at org.jboss.ejb.Container.invoke(Container.java:648) > at > com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555) > > at > com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523) > > at > org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:113) > at > >org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:149) > > at org.jboss.proxy.ejb.GenericProxy.invoke(GenericProxy.java:182) > at org.jboss.proxy.ejb.HomeProxy.invoke(HomeProxy.java:194) > at $Proxy17.create(Unknown Source) > at > org.jboss.test.web.servlets.SecureEJBServlet.processRequest(SecureEJBServlet.java:51) > > at > org.jboss.test.web.servlets.SecureEJBServlet.doGet(SecureEJBServlet.java:79) > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) > at > org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:291) > at > org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:542) > > at org.mortbay.http.HttpContext.handle(HttpContext.java:1265) > at org.mortbay.http.HttpContext.handle(HttpContext.java:1219) > at org.mortbay.http.HttpServer.service(HttpServer.java:725) > at org.mortbay.http.HttpConnection.service(HttpConnection.java:745) > at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:918) > at org.mortbay.http.HttpConnection.handle(HttpConnection.java:760) > at > org.mortbay.http.SocketListener.handleConnection(SocketListener.java:138) > > at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:287) > at org.mortbay.util.ThreadPool$JobRunner.run(ThreadPool.java:715) > at java.lang.Thread.run(Thread.java:484) > 13:50:14,632 WARN [Jetty] WARNING: Servlet Exception for > /jbosstest/restricted/SecureEJBAccess > java.lang.reflect.UndeclaredThrowableException: > java.io.NotSerializableException: org.jboss.jetty.JBossUserRealm > <<no stack trace available>> > > 13:50:19,504 INFO [JBossUserRealm#JBossTest Servlets] > JBossUserPrincipal: jduke > > > _________________________________________________________ > Do You Yahoo!? > Get your free @yahoo.com address at http://mail.yahoo.com > > > _______________________________________________ > Jboss-development mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/jboss-development > _______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development