2 Replies Latest reply on Dec 21, 2005 10:43 AM by Scott Stark

    MBean being registered twice

    aidan davis Newbie

      Hi, I am trying to write a service that will initiate Jackrabbit on startup, I've suceeded in doing this but it appears jboss is trying to register my mbean twice, I'm getting a 'DeploymentException....already registered mbean'.
      I've done a search throughout my jboss directory and is no duplicate config entry as far as I'm aware. The service itself is working fine....

      My service interface extends org.jboss.system.Service and the service implementation simply extends this interface....here're my config files:

      jboss-service:

      <?xml version="1.0" encoding="UTF-8"?>



      <mbean code="com.sms.core.JCR.JCRServiceImpl"
      name="sms.jcr:service=JCRService"
      xmbean-dd="meta-inf/jcr-xmbean.xml">
      jboss:service=Naming




      jcr-xmbean:
      <?xml version="1.0" encoding="UTF-8"?>

      <!DOCTYPE mbean PUBLIC "-//JBoss//DTD JBOSS XMBEAN 1.0//EN" "http://www.jboss.org/j2ee/dtd/jboss_xmbean_1_2.dtd">


      JCR MBean service



      <state-action-on-update value="keep-running"/>
      <persistence-manager value="org.jboss.mx.persistence.ObjectStreamPersistenceManager"/>

      com.sms.core.JCR.JCRServiceImpl

      JNDI Name
      jndiName
      java.lang.String





      Location of JCR Repository
      jCRLocation
      java.lang.String





      Location of JCR Repository config file
      jCRConfLocation
      java.lang.String





      start


      stop




      Help would be very much appreciated.

        • 1. Re: MBean being registered twice
          aidan davis Newbie

          Anyone?

          jboss-service.xml

          <?xml version="1.0" encoding="UTF-8"?>
          
          <server>
          
           <mbean code="com.sms.core.JCR.JCRServiceImpl"
           name="sms.jcr:service=JCRService"
           xmbean-dd="meta-inf/jcr-xmbean.xml">
           <depends>jboss:service=Naming</depends>
           </mbean>
          
          </server>


          jcr-xmbean.xml

          <?xml version="1.0" encoding="UTF-8"?>
          
          <!DOCTYPE mbean PUBLIC "-//JBoss//DTD JBOSS XMBEAN 1.0//EN" "http://www.jboss.org/j2ee/dtd/jboss_xmbean_1_2.dtd">
          
          <mbean>
           <description>JCR MBean service</description>
           <descriptors>
           <persistence persistPolicy="OnUpdate"
           persistPeriod="10"
           persistLocation="${jboss.server.data.dir}"
           persistName="JCRService.ser"/>
           <currencyTimeLimit value="10"/>
           <state-action-on-update value="keep-running"/>
           <persistence-manager value="org.jboss.mx.persistence.ObjectStreamPersistenceManager"/>
           </descriptors>
           <class>com.sms.core.JCR.JCRServiceImpl</class>
           <attribute access="read-write" getMethod="getJndiName" setMethod="setJndiName">
           <description>JNDI Name</description>
           <name>jndiName</name>
           <type>java.lang.String</type>
           <descriptors>
           <value value="java:/JCRRepositoryService"/>
           </descriptors>
           </attribute>
           <attribute access="read-write" getMethod="getJCRLocation" setMethod="setJCRLocation">
           <description>Location of JCR Repository</description>
           <name>jCRLocation</name>
           <type>java.lang.String</type>
           <descriptors>
           <value value="c:/temp/rep"/>
           </descriptors>
           </attribute>
           <attribute access="read-write" getMethod="getJCRConfigLocation" setMethod="setJCRConfigLocation">
           <description>Location of JCR Repository config file</description>
           <name>jCRConfLocation</name>
           <type>java.lang.String</type>
           <descriptors>
           <value value="c:/temp/rep/repository.xml"/>
           </descriptors>
           </attribute>
           <operation>
           <name>start</name>
           </operation>
           <operation>
           <name>stop</name>
           </operation>
          </mbean>


          • 2. Re: MBean being registered twice
            Scott Stark Master

            There is not sufficient info here to tell what is going on. The lower case meta-inf name is not valid generally, but can be used for your own resources paths. That is the only anomoloy in this info.