0 Replies Latest reply on Aug 19, 2011 1:20 PM by phillip hamer

    Reasons for custom SecurityProxyFactory exception?

    phillip hamer Newbie

      Hello,

       

          I am relatively new to JBoss and have been working on setting up security for an application I work with. I am using JBoss AS 6 and was interested in setting up a custom security proxy as described somewhat in the JW article:

       

      http://www.javaworld.com/javaworld/jw-02-2002/jw-0215-ejbsecurity.html

       

      I was interested in implementing a class instance that implements the jboss securityProxy. I have the securityproxy class (shortend for brevity):

       

      public class securityproxy implements SecurityProxy {

       

        public securityproxy(Object arg0)

                {

        }

       

       

      public void init(Class beanHome, Class beanRemote, Class beanLocalHome, Class beanLocal, Object securityMgr)  throws InstantiationException {

      }

       

      public void init(Class beanHome, Class beanRemote, Object securityMgr) throws InstantiationException {

      }

       

      public void setEJBContext(EJBContext ctx) {

      }

       

      public void invokeHome(Method m, Object[] args) throws SecurityException {

      }

       

      public void invoke(Method m, Object[] args, Object bean) throws SecurityException {

      }

       

      And the SecurityProxyFactory class:

       

      public class securityproxyfactory implements SecurityProxyFactory {

       

       

                public SecurityProxy create(Object proxyDelagate) {

       

                SecurityProxy securityproxy = new securityproxy(proxyDelagate);

       

                               return (SecurityProxy) securityproxy;

                }

      }

       

       

      I also configured the SecurityProxyFactoryClassName in the JBoss legacy-conf-service.xml file:

       

          <!-- ==================================================================== -->

          <!-- Security                                                             -->

          <!-- ==================================================================== -->

         

          <!-- JAAS security manager and realm mapping -->

          <mbean code="org.jboss.security.plugins.JaasSecurityManagerService"

              name="jboss.security:service=JaasSecurityManager">

                     :

                     :

              <attribute name="SecurityProxyFactoryClassName">com.test.securityproxyfactory</attribute>

          </mbean>

       

       

      My isssue is that when the JBoss server starts, I get an java.io.NotSerializable exception:

       


      at org.jboss.profileservice.bootstrap.AbstractProfileServiceBootstrap.activate(AbstractProfileServiceBootstrap.java:112) [:0.2.2]

      at org.jboss.profileservice.resolver.BasicResolverFactory$ProfileResolverFacade.deploy(BasicResolverFactory.java:87) [:0.2.2]

      at org.jboss.profileservice.bootstrap.AbstractProfileServiceBootstrap.start(AbstractProfileServiceBootstrap.java:91) [:0.2.2]

      at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:132) [:6.0.0.Final]

      at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:56) [:6.0.0.Final]

      at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:827) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]

      at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:417) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]

      at java.lang.Thread.run(Thread.java:662) [:1.6.0_24]

      Caused by: java.io.NotSerializableException: com.test.securityproxyfactory


      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164) [:1.6.0_24]

      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330) [:1.6.0_24]

      at java.rmi.MarshalledObject.<init>(MarshalledObject.java:101) [:1.6.0_24]

      at org.jnp.interfaces.MarshalledValuePair.<init>(MarshalledValuePair.java:65) [:5.0.5.Final]

      at org.jnp.interfaces.NamingContext.createMarshalledValuePair(NamingContext.java:1429) [:5.0.5.Final]

      at org.jnp.interfaces.NamingContext.bind(NamingContext.java:642) [:5.0.5.Final]

      ... 82 more

       

       

      So my question is what am I missing here?

       

      Any help would be appreciated, thanks!

       

      P. H.