1 Reply Latest reply on Oct 5, 2010 6:31 PM by amathewjboss1

    ClassCastException on org.jboss.security.plugins.JBossSecurityContext

    amathewjboss1

      Hi,

       

         I am using Spring 3.0 and Jboss 5.1 and when my Spring MVC controller tries to invoke a remote bean i am getting the below error:

       

      java.lang.ClassCastException: org.jboss.security.plugins.JBossSecurityContext cannot be cast to org.jboss.security.SecurityContext
           org.jboss.security.SecurityContextFactory.createSecurityContext(SecurityContextFactory.java:117)
           org.jboss.security.SecurityContextFactory.createSecurityContext(SecurityContextFactory.java:76)
           org.jboss.ejb3.security.client.SecurityActions$1.run(SecurityActions.java:662)
           java.security.AccessController.doPrivileged(Native Method)
           org.jboss.ejb3.security.client.SecurityActions.createSecurityContext(SecurityActions.java:657)
           org.jboss.ejb3.security.client.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:59)
           org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:74)
           org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62)
           $Proxy16.invoke(Unknown Source)
           org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:207)
           org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:164)
           $Proxy7.authenticateAdminUser(Unknown Source)
           sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           java.lang.reflect.Method.invoke(Method.java:597)
           org.springframework.remoting.rmi.RmiClientInterceptorUtils.invokeRemoteMethod(RmiClientInterceptorUtils.java:110)
           org.springframework.ejb.access.SimpleRemoteSlsbInvokerInterceptor.doInvoke(SimpleRemoteSlsbInvokerInterceptor.java:99)
           org.springframework.ejb.access.AbstractRemoteSlsbInvokerInterceptor.invokeInContext(AbstractRemoteSlsbInvokerInterceptor.java:141)
           org.springframework.ejb.access.AbstractSlsbInvokerInterceptor.invoke(AbstractSlsbInvokerInterceptor.java:189)
           org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
           org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
           $Proxy8.authenticateAdminUser(Unknown Source)
           com.tickets.mvc.admin.security.AdminsecurityController.processLoginForm(AdminsecurityController.java:50)
           sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           java.lang.reflect.Method.invoke(Method.java:597)
           org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:175)
           org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:421)
           org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:409)
           org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:774)
           org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
           org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
           org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
           javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
           javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      

       

        I tried changing the all.pvo/deployers/jbossweb.deployer/META-INF/war-deployers-jboss-beans.xml & all.pvo/deployers/ejb-deployer-jboss-beans.xml to have "org.jboss.security.SecurityContext" in place of "org.jboss.security.plugins.JBossSecurityContext". But that didn't really fix the issue.

       

             <!-- Specify a SecurityContext FQN class name -->
             <property name="securityContextClassName">org.jboss.security.plugins.JBossSecurityContext</property>


      Can some one please help me with your thoughts?