3 Replies Latest reply on Dec 8, 2009 1:22 AM by S K

    Single Sign On problem in cluster environment

    S K Newbie

      Hello,

      I am using multiple web based application in JBoss (4.2.2.GA) which runs in cluster environment. I am trying to integrate single sign on across these applications. I have modified deploy/jboss-web.deployer/server.xml following the instructions here http://www.jboss.org/community/wiki/JBossWebSingleSignOn. Though in the documentation the directory name is jbossweb.sar, but I could not find any such directory in my deploy directory. Instead jboss-web.deployer seemed to be of very similar purpose. So i modified server.xml of this directory. But with these modifications, when I start the jboss server, it throws the following exception:

      10:24:18,204 ERROR [Catalina] Catalina.start:
      LifecycleException: Caught exception looking up TransactionManager from TreeCache: java.lang.NullPointerException
       at org.jboss.web.tomcat.service.sso.TreeCacheSSOClusterManager.start(TreeCacheSSOClusterManager.java:924)
       at org.jboss.web.tomcat.service.sso.ClusteredSingleSignOn.start(ClusteredSingleSignOn.java:411)
       at org.apache.catalina.core.StandardPipeline.start(StandardPipeline.java:232)
       at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1049)
       at org.apache.catalina.core.StandardHost.start(StandardHost.java:747)
       at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1044)
       at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
       at org.apache.catalina.core.StandardService.start(StandardService.java:515)
       at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
       at org.apache.catalina.startup.Catalina.start(Catalina.java:576)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:296)
       at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.web.tomcat.service.JBossWeb.startService(JBossWeb.java:440)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
       at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
       at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
       at org.jboss.deployment.SubDeployerInterceptor.invokeNext(SubDeployerInterceptor.java:124)
       at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:109)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
       at $Proxy0.start(Unknown Source)
       at org.jboss.system.ServiceController.start(ServiceController.java:417)
       at org.jboss.system.ServiceController.start(ServiceController.java:435)
       at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy4.start(Unknown Source)
       at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
       at sun.reflect.GeneratedMethodAccessor24.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy9.deploy(Unknown Source)
       at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
       at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
       at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
       at $Proxy0.start(Unknown Source)
       at org.jboss.system.ServiceController.start(ServiceController.java:417)
       at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy4.start(Unknown Source)
       at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy5.deploy(Unknown Source)
       at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
       at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
       at org.jboss.Main.boot(Main.java:200)
       at org.jboss.Main$1.run(Main.java:508)
       at java.lang.Thread.run(Thread.java:595)
      


      Can some one please tell me what's going wrong? Any help will be of great heap to me.

      Thanks,
      Sahid

        • 1. Re: Single Sign On problem in cluster environment
          Brian Stansberry Master

          Hmm, Tomcat's LifecycleException doesn't follow the normal Java 1.4+ exception chaining mechanism, (i.e. Caused by:.... in the stack trace) so it's unclear what the problem is.

          Please post the section of your server.xml where you declare the SSO valve. Use the Code button above.

          • 2. Re: Single Sign On problem in cluster environment
            S K Newbie

            Here is the host configuration from my server.xml.

             <Host name="localhost"
             autoDeploy="false" deployOnStartup="false" deployXML="false"
             configClass="org.jboss.web.tomcat.security.config.JBossContextConfig"
             >
            
             <!-- Uncomment to enable single sign-on across web apps
             deployed to this host AND to all other hosts in the cluster.
            
             If this valve is used, do not use the standard Tomcat SingleSignOn
             valve shown above.
            
             Valve uses a JBossCache instance to support SSO credential
             caching and replication across the cluster. The JBossCache
             instance must be configured separately. By default, the valve
             shares a JBossCache with the service that supports HttpSession
             replication. See the "jboss-web-cluster-service.xml" file in the
             server/all/deploy directory for cache configuration details.
            
             Besides the attributes supported by the standard Tomcat
             SingleSignOn valve (see the Tomcat docs), this version also
             supports the following attributes:
            
             cookieDomain see above
            
             treeCacheName JMX ObjectName of the JBossCache MBean used to
             support credential caching and replication across
             the cluster. If not set, the default value is
             "jboss.cache:service=TomcatClusteringCache", the
             standard ObjectName of the JBossCache MBean used
             to support session replication.
             -->
            
             <Valve className="org.jboss.web.tomcat.service.sso.ClusteredSingleSignOn"/>
            
            
             <!-- Check for unclosed connections and transaction terminated checks
             in servlets/jsps.
            
             Important: The dependency on the CachedConnectionManager
             in META-INF/jboss-service.xml must be uncommented, too
             -->
             <Valve className="org.jboss.web.tomcat.service.jca.CachedConnectionValve"
             cachedConnectionManagerObjectName="jboss.jca:service=CachedConnectionManager"
             transactionManagerObjectName="jboss:service=TransactionManager" />
            
             </Host>
            

            After some thorough observation I saw the following line also in my jboss server log (when it starts):
            09:49:18,935 INFO [TreeCache] No transaction manager lookup class has been defined. Transactions cannot be used
            

            Not sure if that is the problem. But in my TreeCache configuration I do have a TransactionManagerLookupClass defined. to be precise this is relevant excerpt from jboss-web-cluster.sar/META-INF/jboss-service.xml :
            <!-- Make sure to specify BatchModeTransactionManager only! -->
             <attribute name="TransactionManagerLookupClass">org.jboss.cache.BatchModeTransactionManagerLookup</attribute>
            

            Please let me know if you need any other information.

            Thanks,
            Sahid

            • 3. Re: Single Sign On problem in cluster environment
              S K Newbie

              Thank you Brian for your response. However it was my mistake. In TreeCache configuration I had set CacheMode as LOCAL. Changing that to REPL_SYNC solved the problem. So I suppose that was the problem. Sorry for the stupid mistake.

              Thanks,
              Sahid