8 Replies Latest reply on Mar 3, 2011 12:18 PM by srinivas s

    Getting error as : Error creating MBeanProxy: jboss.cache:service=TreeCache

    srinivas s Newbie

      I am trying to configure JBoss Tree Cache  with JBoss Portal Server. I have followed the steps as given in the jboss documentation to change the following files.

       

      META-INF/jboss-service.xml

      and hibernate.config.xml in jboss-portal.sar/conf/hibernate,

                                             jboss-portal.sar/conf/user,

                                             jboss-portal.sar/conf/portal,

                                             jboss-portal.sar/conf/portlet   files.

       

      But I am getting the exception as :

       

      Getting error as : Error creating MBeanProxy: jboss.cache:service=TreeCache

       

       

      Please help me out on this.

        • 1. Getting error as : Error creating MBeanProxy: jboss.cache:service=TreeCache
          srinivas s Newbie

          The Complete Configuration Details are mentiond below:

           

          I have downloaded JBoss Poral Server 2.7.2 and added the file "mysql-ds" in the "jboss-portal-2.7.2\server\default\deploy\" directory. When I start the portal, it is working fine. But when I make changes for JBoss Tree Cache as given in the jboss documentation (jboss-portal-2.7.2/docs/portal/referenceGuide/html_single/index.html#d0e7561)   by making changes in the below files:

           

           

          As mentioned in the documentation, I am getting an error as :

           

          11:37:45,541 WARN  [ServiceController] Problem starting service portal:service=Hibernate,type=Instance

          org.hibernate.cache.CacheException: java.lang.RuntimeException: Error creating MBeanProxy: portal:service=TreeCache,type=hibernate

              at org.jboss.hibernate.jbc.cacheprovider.JmxBoundTreeCacheProvider.start(JmxBoundTreeCacheProvider.java:129)

              at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:183)

              at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)

              at org.jboss.portal.jems.hibernate.SessionFactoryBinder.createSessionFactory(SessionFactoryBinder.java:413)

              at org.jboss.portal.jems.hibernate.SessionFactoryBinder.startService(SessionFactoryBinder.java:249)

              at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)

              at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:196)

              at org.jboss.portal.jems.as.system.AbstractJBossService.start(AbstractJBossService.java:73)

              at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

              at java.lang.reflect.Method.invoke(Method.java:585)

              at org.jboss.portal.jems.as.system.JBossServiceModelMBean$ServiceMixin.execute(JBossServiceModelMBean.java:486)

              at org.jboss.portal.jems.as.system.JBossServiceModelMBean$ServiceMixin.startService(JBossServiceModelMBean.java:452)

              at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)

              at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:196)

              at org.jboss.portal.jems.as.system.JBossServiceModelMBean$6.invoke(JBossServiceModelMBean.java:374)

              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.system.ServiceController$ServiceProxy.invoke(ServiceController.java:995)

              at $Proxy0.start(Unknown Source)

              at org.jboss.system.ServiceController.start(ServiceController.java:417)

              at org.jboss.system.ServiceController.start(ServiceController.java:435)

              at org.jboss.system.ServiceController.start(ServiceController.java:435)

              at org.jboss.system.ServiceController.start(ServiceController.java:435)

              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:304)

              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 $Proxy199.start(Unknown Source)

              at org.jboss.deployment.XSLSubDeployer.start(XSLSubDeployer.java:197)

              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.GeneratedMethodAccessor26.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:304)

              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)

          Caused by: java.lang.RuntimeException: Error creating MBeanProxy: portal:service=TreeCache,type=hibernate

              at org.jboss.mx.util.MBeanProxyExt.init(MBeanProxyExt.java:415)

              at org.jboss.mx.util.MBeanProxyExt.<init>(MBeanProxyExt.java:99)

              at org.jboss.mx.util.MBeanProxyExt.create(MBeanProxyExt.java:394)

              at org.jboss.mx.util.MBeanProxyExt.create(MBeanProxyExt.java:349)

              at org.jboss.hibernate.jbc.cacheprovider.JmxBoundTreeCacheProvider.start(JmxBoundTreeCacheProvider.java:118)

              ... 122 more

          Caused by: javax.management.InstanceNotFoundException: portal:service=TreeCache,type=hibernate is not registered.

              at org.jboss.mx.server.registry.BasicMBeanRegistry.get(BasicMBeanRegistry.java:523)

              at org.jboss.mx.server.MBeanServerImpl.getMBeanInfo(MBeanServerImpl.java:666)

              at org.jboss.mx.util.MBeanProxyExt.init(MBeanProxyExt.java:407)

              ... 126 more

           

           

          I am struggling for this from the past 2 days. Can anybody let me know, is there any other change I need to make the Jboss cache available ?

          • 2. Getting error as : Error creating MBeanProxy: jboss.cache:service=TreeCache
            Prabhat Jha Master

            First I would like to point to you that JBoss Portal is not in active development. GateIn (http://jboss.org/gatein) is our current portal on community side.

             

            Second when dealing with clustering issues, it's better to have the enterprise version and support contract where you are more likely to get precise help.

             

            Now back to your quesiton: What are you trying to achieve? JBP 2.7.2 has a seprate download for clustered portal and that already uses JBoss Cache. Why would you not use that instead?

            • 3. Getting error as : Error creating MBeanProxy: jboss.cache:service=TreeCache
              srinivas s Newbie

              A small mistake in the above post: I have used the directory :

              jboss-portal-2.7.2\server\all\deploy\.    (In my unix box which is clustering enabled and in it I am testing the change)

              • 4. Getting error as : Error creating MBeanProxy: jboss.cache:service=TreeCache
                srinivas s Newbie

                I have my production machine which is already using the same jboss portal bundled version 2.7.2. So I am trying to replicate with the same bundled version so that the testing will have the same environemnt.

                • 5. Getting error as : Error creating MBeanProxy: jboss.cache:service=TreeCache
                  Prabhat Jha Master

                  There is jboss-portal-ha.sar in "all" server configuration. See the configuration files there or deploy your app in "all" configuraiton.

                  • 6. Getting error as : Error creating MBeanProxy: jboss.cache:service=TreeCache
                    Prabhat Jha Master

                    Obviously, we crossed each other in our replies. My point is deploy your app in server config which has jboss-portal-ha.sar and you will have clustered JBoss Portal.

                    • 7. Getting error as : Error creating MBeanProxy: jboss.cache:service=TreeCache
                      srinivas s Newbie

                      yes, after doing that, I am getting the exception as follows:

                      (pastebin url): http://pastebin.com/hKJiGLWG

                      • 8. Getting error as : Error creating MBeanProxy: jboss.cache:service=TreeCache
                        srinivas s Newbie

                        Atlast , I have got the two jboss portal clustered nodes up and running with the below configuration changes, including the changes specified in the JBoss portal 2.7.2 documentation.

                         

                        1. In Portal/Portlet/Instance/User hibernate.cfg.xml   adde the following  properties

                        <property name="hibernate.cache.provider_class">org.jboss.hibernate.jbc.cacheprovider.JmxBoundTreeCacheProvider</property>
                        <property name="hibernate.treecache.mbean.object_name">portal:service=TreeCache,type=hibernate</property>

                        Shimilarly make the changes to portal, portlet and user modules.


                        2. Download the below jar and add the jar to jboss-portal-2.7.2/server/all/lib
                        hibernate-jbc-cacheprovider-1.0.1.GA.jar

                        See if there is any other version of the jar, replace it with the above jar.

                        3. In instance, user, portal, portlet modules, in domain.hbm.xml, replace the word “read-write” in <cache-usage> tag with the work “transactional”.

                        4. In instance, user, portal, portlet modules, in hibernate.cfg.xml, make the secondary level cache to true.
                        Below is the tag for reference:
                        <property name="cache.use_second_level_cache">true</property>
                        5. in jboss-service.xml for ObjectDeploymentFactory there is a attribute which is set to true by default
                           <!-- Set to false in clustered mode, otherwise set to true -->
                        <attribute name="RegistrationControlledByService">true</attribute>
                        Set it false.

                        *** Now even the servers are up with TreeCache, if I update the data in one node, then the data is not replicating in the other node simultaneously. Please let me know, if there is any other configuration change that needs to be done...!