10 Replies Latest reply on Feb 5, 2008 11:35 AM by brian.stansberry

    change default partition name

    cervatz

      Hi!

      I am using EJB3.0 and I am trying to change the partition name of my jboss cluster but I have the following error during startup:

      --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
      ObjectName: jboss.j2ee:jar=ejbccv.ejb3,name=AdminManagementBean,service=EJB3
      State: FAILED
      Reason: javax.naming.NameNotFoundException: DefaultPartition not bound
      I Depend On:
      persistence.units:jar=ejbccv.ejb3.jar,unitName=ccvPersistence


      I guess the EJB does not find the partition ... I solved the problem hard coding the name of my partition in the EJB with the following annotation:

      @Clustered(partition="mypartition")

      and EJBs began to work fine, but is this the only way to set a different name for the partition when using EJBs? Is it not possibile to set it using an xml definition file or something like that? What do I have to write in it?

      Thank you very much,
      Enrico

        • 1. Re: change default partition name
          brian.stansberry

          In jboss.xml, for each clustered bean:

          <clustered>true</clustered>
          <cluster-config>
           <partition-name>mypartition</partition-name>
          </cluster-config>
          


          This is supported, I believe, since RC9; before it wasn't.

          In the next EJB3 release, if you just use the plain @Clustered annotation (no attribute), it will default to the partition named by system property jboss.partition.name (i.e. the property that's set by the -g startup switch.)

          • 2. Re: change default partition name
            cervatz

            The solution you suggested works fine!
            Thank you very much!
            Enrico

            • 3. Re: change default partition name
              angelee

              I can not find any documentation on JBoss AS 4.2. What am I doing wrong?

              I changed all of the DefaultPartition to MYPartition in
              deploy/cluster-service.xml.

              e.g. FROM: {jboss.partition.name:DefaultPartition}
              TO: {jboss.partition.name:MYPartition}

              and in conf/standardjboss.xml

              e.g. FROM: {jboss.partition.name:DefaultPartition}
              TO: {jboss.partition.name:MYPartition}

              I start the instance with this command:
              # /opt/jboss-4.2.0.GA/bin/run.sh -c all -b10.40.0.35

              and I get this error:


              13:58:21,525 ERROR [URLDeploymentScanner] Incomplete Deployment listing:

              --- MBeans waiting for other MBeans ---
              ObjectName: jboss.ha:service=HASingletonDeployer
              State: CONFIGURED
              I Depend On:
              jboss:service=DefaultPartition
              jboss.system:service=MainDeployer

              ObjectName: jboss:service=FarmMember,partition=DefaultPartition
              State: CONFIGURED
              I Depend On:
              jboss:service=DefaultPartition
              jboss.web:service=WebServer
              jboss.system:service=MainDeployer

              --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
              ObjectName: jboss:service=DefaultPartition
              State: NOTYETINSTALLED
              Depends On Me:
              jboss.ha:service=HASingletonDeployer
              jboss:service=FarmMember,partition=DefaultPartition


              13:58:21,736 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-10.40.0.35-8080
              13:58:21,797 INFO [AjpProtocol] Starting Coyote AJP/1.3 on ajp-10.40.0.35-8009
              13:58:21,833 INFO [Server] JBoss (MX MicroKernel) [4.2.0.GA (build: SVNTag=JBoss_4_2_0_GA date=200705111440)] Started in 57s:637ms

              • 4. Re: change default partition name
                brian.stansberry

                There's no need to edit the cluster-service.xml file.

                Start JBoss with:

                # /opt/jboss-4.2.0.GA/bin/run.sh -c all -b10.40.0.35 -g MYPartition

                • 5. Re: change default partition name
                  angelee

                  That worked great. Thanks for the quick reply!

                  • 6. Re: change default partition name
                    klejs

                     

                    "bstansberry@jboss.com" wrote:
                    In jboss.xml, for each clustered bean:
                    In the next EJB3 release, if you just use the plain @Clustered annotation (no attribute), it will default to the partition named by system property jboss.partition.name (i.e. the property that's set by the -g startup switch.)


                    Which release of JBoss did you mean by saying "In the next EJB3 release"? Was that JBoss 4.2.0?

                    Thanks in advance

                    /K

                    • 7. Re: change default partition name
                      brian.stansberry

                      Yep. JBoss 4.2.0.

                      • 8. Re: change default partition name
                        canty28

                        We are using JBOSS 4.0.3SP1 . Is there a way of changing the default partition name.

                        • 9. Re: change default partition name

                          Hi, I'm trying to set the partition name in properties-service.xml instead of using the "-g" startup argument. But it only works with the startup argument. Why I can't get it to work with the properties file?

                          I.E.

                          jboss.partition.name=myPartition


                          vs

                          ./run.sh -g myPartition c- all


                          • 10. Re: change default partition name
                            brian.stansberry

                            Probably a dependency issue; i.e. the services that use jboss.partition.name have already deployed and read the value before properties-service.xml deploys.

                            Try adding

                            <depends>jboss:type=Service,name=SystemProperties</depends>


                            to the ClusterPartition mbean in cluster-service.xml.