3 Replies Latest reply on Sep 7, 2005 1:25 PM by Brian Stansberry

    What is this JBossGenericPrincipal that keeps getting stuffe

    drpizza Newbie

      I keep getting this in 4.0.2 with clustering enabled:

      java.io.NotSerializableException: org.jboss.web.tomcat.security.JBossGenericPrincipal
       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1075)
       at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)
       at java.util.LinkedList.writeObject(LinkedList.java:755)
       at sun.reflect.GeneratedMethodAccessor157.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:890)
       at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1333)


      Where is this JBossGenericPrincipal coming from? What's creating it and why? And how can I make it go away?



        • 1. Re: What is this JBossGenericPrincipal that keeps getting st
          Scott Stark Master

          Its the standard container for the session principal info. Show the full stack trace of the error.

          • 2. Re: What is this JBossGenericPrincipal that keeps getting st
            drpizza Newbie

             

            2005-08-30 19:36:29,217 INFO [STDOUT] java.io.NotSerializableException: org.jboss.web.tomcat.security.JBossGenericPrincipal
            2005-08-30 19:36:29,217 INFO [STDOUT] at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1075)
            2005-08-30 19:36:29,217 INFO [STDOUT] at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)
            2005-08-30 19:36:29,217 INFO [STDOUT] at java.util.LinkedList.writeObject(LinkedList.java:755)
            2005-08-30 19:36:29,217 INFO [STDOUT] at sun.reflect.GeneratedMethodAccessor157.invoke(Unknown Source)
            2005-08-30 19:36:29,217 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            2005-08-30 19:36:29,217 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:585)
            2005-08-30 19:36:29,217 INFO [STDOUT] at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:890)
            2005-08-30 19:36:29,217 INFO [STDOUT] at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1333)
            2005-08-30 19:36:29,217 INFO [STDOUT] at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)
            2005-08-30 19:36:29,217 INFO [STDOUT] at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
            2005-08-30 19:36:29,217 INFO [STDOUT] at java.io.ObjectOutputStream.access$100(ObjectOutputStream.java:135)
            2005-08-30 19:36:29,217 INFO [STDOUT] at java.io.ObjectOutputStream$PutFieldImpl.writeFields(ObjectOutputStream.java:1512)
            2005-08-30 19:36:29,217 INFO [STDOUT] at java.io.ObjectOutputStream.writeFields(ObjectOutputStream.java:418)
            2005-08-30 19:36:29,217 INFO [STDOUT] at javax.security.auth.Subject$SecureSet.writeObject(Subject.java:1281)
            2005-08-30 19:36:29,217 INFO [STDOUT] at sun.reflect.GeneratedMethodAccessor156.invoke(Unknown Source)
            2005-08-30 19:36:29,217 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            2005-08-30 19:36:29,217 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:585)
            2005-08-30 19:36:29,217 INFO [STDOUT] at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:890)
            2005-08-30 19:36:29,217 INFO [STDOUT] at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1333)
            2005-08-30 19:36:29,217 INFO [STDOUT] at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)
            2005-08-30 19:36:29,217 INFO [STDOUT] at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
            2005-08-30 19:36:29,217 INFO [STDOUT] at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1369)
            2005-08-30 19:36:29,217 INFO [STDOUT] at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:380)
            2005-08-30 19:36:29,217 INFO [STDOUT] at java.util.Collections$SynchronizedCollection.writeObject(Collections.java:1606)
            2005-08-30 19:36:29,217 INFO [STDOUT] at sun.reflect.GeneratedMethodAccessor155.invoke(Unknown Source)
            2005-08-30 19:36:29,217 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            2005-08-30 19:36:29,217 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:585)
            2005-08-30 19:36:29,217 INFO [STDOUT] at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:890)
            2005-08-30 19:36:29,217 INFO [STDOUT] at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1333)
            2005-08-30 19:36:29,217 INFO [STDOUT] at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)
            2005-08-30 19:36:29,217 INFO [STDOUT] at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
            2005-08-30 19:36:29,217 INFO [STDOUT] at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1369)
            2005-08-30 19:36:29,217 INFO [STDOUT] at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:380)
            2005-08-30 19:36:29,217 INFO [STDOUT] at javax.security.auth.Subject.writeObject(Subject.java:919)
            2005-08-30 19:36:29,217 INFO [STDOUT] at sun.reflect.GeneratedMethodAccessor154.invoke(Unknown Source)
            2005-08-30 19:36:29,217 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            2005-08-30 19:36:29,217 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:585)
            2005-08-30 19:36:29,233 INFO [STDOUT] at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:890)
            2005-08-30 19:36:29,233 INFO [STDOUT] at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1333)
            2005-08-30 19:36:29,233 INFO [STDOUT] at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)
            2005-08-30 19:36:29,233 INFO [STDOUT] at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
            2005-08-30 19:36:29,233 INFO [STDOUT] at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)
            2005-08-30 19:36:29,233 INFO [STDOUT] at java.util.HashMap.writeObject(HashMap.java:985)
            2005-08-30 19:36:29,233 INFO [STDOUT] at sun.reflect.GeneratedMethodAccessor89.invoke(Unknown Source)
            2005-08-30 19:36:29,233 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            2005-08-30 19:36:29,233 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:585)
            2005-08-30 19:36:29,233 INFO [STDOUT] at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:890)
            2005-08-30 19:36:29,233 INFO [STDOUT] at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1333)
            2005-08-30 19:36:29,233 INFO [STDOUT] at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)
            2005-08-30 19:36:29,233 INFO [STDOUT] at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
            2005-08-30 19:36:29,233 INFO [STDOUT] at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1369)
            2005-08-30 19:36:29,233 INFO [STDOUT] at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1341)
            2005-08-30 19:36:29,233 INFO [STDOUT] at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)
            2005-08-30 19:36:29,233 INFO [STDOUT] at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
            2005-08-30 19:36:29,233 INFO [STDOUT] at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)
            2005-08-30 19:36:29,233 INFO [STDOUT] at org.jboss.invocation.MarshalledValue.<init>(MarshalledValue.java:57)
            2005-08-30 19:36:29,233 INFO [STDOUT] at org.jboss.web.tomcat.tc5.session.JBossCacheService.getMarshalledValue(JBossCacheService.java:538)
            2005-08-30 19:36:29,233 INFO [STDOUT] at org.jboss.web.tomcat.tc5.session.JBossCacheService.putSession(JBossCacheService.java:155)
            2005-08-30 19:36:29,233 INFO [STDOUT] at org.jboss.web.tomcat.tc5.session.SessionBasedClusteredSession.processSessionRepl(SessionBasedClusteredSession.java:161)
            2005-08-30 19:36:29,233 INFO [STDOUT] at org.jboss.web.tomcat.tc5.session.JBossCacheManager.processSessionRepl(JBossCacheManager.java:475)
            2005-08-30 19:36:29,233 INFO [STDOUT] at org.jboss.web.tomcat.tc5.session.JBossCacheManager.storeSession(JBossCacheManager.java:256)
            2005-08-30 19:36:29,233 INFO [STDOUT] at org.jboss.web.tomcat.tc5.session.InstantSnapshotManager.snapshot(InstantSnapshotManager.java:38)
            2005-08-30 19:36:29,233 INFO [STDOUT] at org.jboss.web.tomcat.tc5.session.ClusteredSessionValve.invoke(ClusteredSessionValve.java:91)
            2005-08-30 19:36:29,233 INFO [STDOUT] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:407)
            2005-08-30 19:36:29,233 INFO [STDOUT] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
            2005-08-30 19:36:29,233 INFO [STDOUT] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
            2005-08-30 19:36:29,233 INFO [STDOUT] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
            2005-08-30 19:36:29,233 INFO [STDOUT] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
            2005-08-30 19:36:29,233 INFO [STDOUT] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
            2005-08-30 19:36:29,233 INFO [STDOUT] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
            2005-08-30 19:36:29,233 INFO [STDOUT] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
            2005-08-30 19:36:29,233 INFO [STDOUT] at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
            2005-08-30 19:36:29,233 INFO [STDOUT] at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
            2005-08-30 19:36:29,233 INFO [STDOUT] at java.lang.Thread.run(Thread.java:595)
            


            • 3. Re: What is this JBossGenericPrincipal that keeps getting st
              Brian Stansberry Master

              It looks like some place in your code the caller's Subject has been stored as a session attribute. The Subject contains the JBossGenericPrincipal.

              If your application needs access to the Subject, another approach may be to use the SecurityAssociationValve, which binds the Subject to the request as a request attribute. To use add

              <Valve className="org.jboss.web.tomcat.security.SecurityAssociationValve" subjectAttributeName="someKey"/>
              


              to the Host element of the server.xml file in the jbossweb-tomcat55.sar. This would bind the subject under request attribute "someKey".