8 Replies Latest reply on Oct 10, 2007 3:36 AM by liujw2001

    Help: Mbean exceptions on jboss startup

    sosoict1

      I configured a mbean service for JCA as follow:
      -------------------------------------------------------------------------------------
      my-service.xml
      ------------------------------------------------------------------------------------


      jboss.jca:service=RARDeployer
      <depends optional-attribute-name="ManagedConnectionFactoryName">

      <depends optional-attribute-name="OldRarDeployment">
      jboss.jca:service=RARDeployment,name=FileRA

      NoTransFile



      <depends optional-attribute-name="ManagedConnectionPool">

      0
      50
      5000
      15
      ByContainer


      <depends optional-attribute-name="CachedConnectionManager">
      jboss.jca:service=CachedConnectionManager

      <depends optional-attribute-name="JaasSecurityManagerService">
      jboss.security:service=JaasSecurityManager



      ----------------------------------------------------------------------------------

      When starting jboss, some exceptions were threw out which said:

      org.jboss.deployment.DeploymentException: No Attribute found with name: JNDIName
      at org.jboss.system.ServiceConfigurator.configure(ServiceConfigurator.java:318)
      ...
      ..
      org.jboss.deployment.DeploymentException: Exception setting attribute javax.management.Attribute@d0deb5 on mbean jboss.jca:service=NoTxCM,name=FileRA; - nested throwable: (javax.management.AttributeNotFoundException: not found: ManagedConnectionFactoryName)
      at org.jboss.system.ServiceConfigurator.setAttribute(ServiceConfigurator.java:698)
      at org.jboss.system.ServiceConfigurator.configure(ServiceConfigurator.java:380)
      ...
      ...
      Caused by: javax.management.AttributeNotFoundException: not found: ManagedConnectionFactoryName
      at org.jboss.mx.server.AbstractMBeanInvoker.setAttribute(AbstractMBeanInvoker.java:428)
      at org.jboss.mx.server.MBeanServerImpl.setAttribute(MBeanServerImpl.java:608)

      --------------------------------------------------------------------

        • 1. Re: Help: Mbean exceptions on jboss startup
          sosoict1

          This is the configuration of Mbean:
          -------------------------------------------------------------------------------------
          my-service.xml
          ------------------------------------------------------------------------------------

          <server>
           <mbean code="org.jboss.resource.connectionmanager.NoTxConnectionManager"
           name="jboss.jca:service=NoTxCM,name=FileRA">
           <depends>jboss.jca:service=RARDeployer</depends>
           <depends optional-attribute-name="ManagedConnectionFactoryName">
           <mbean code="org.jboss.resource.connectionmanager.RARDeployment"
           name="jboss.jca:service=NoTxFile,name=FileRA">
           <depends optional-attribute-name="OldRarDeployment">
           jboss.jca:service=RARDeployment,name=FileRA
           </depends>
           <attribute name="JndiName">NoTransFile</attribute>
           </mbean>
           </depends>
          
           <depends optional-attribute-name="ManagedConnectionPool">
           <mbean code="org.jboss.resource.connectionmanager.JBossManagedConnectionPool"
           name="jboss.jca:service=NoTxPool,name=FileRA">
           <attribute name="MinSize">0</attribute>
           <attribute name="MaxSize">50</attribute>
           <attribute name="BlockingTimeoutMillis">5000</attribute>
           <attribute name="IdleTimeoutMinutes">15</attribute>
           <attribute name="Criteria">ByContainer</attribute>
           </mbean>
           </depends>
           <depends optional-attribute-name="CachedConnectionManager">
           jboss.jca:service=CachedConnectionManager
           </depends>
           <depends optional-attribute-name="JaasSecurityManagerService">
           jboss.security:service=JaasSecurityManager
           </depends>
           </mbean>
           </server>
          ----------------------------------------------------------------------------------

          • 2. Re: Help: Mbean exceptions on jboss startup
            sosoict1

            Can someone help me?
            Thank you!

            • 3. Re: Help: Mbean exceptions on jboss startup
              weston.price

              A few thing:

              1) What version of JBoss are you using?

              2) Is there any particular reason you are using the *-service.xml format. This hasn't been used in a long, long time. The new format *-ds.xml is the preferred approach.

              • 4. Re: Help: Mbean exceptions on jboss startup
                liujw2001

                I used jboss4.2 and jboss4.0

                First I don't know the defference between the *-ds.xml and *-servcie.xml, can you tell me?
                The second is I just use a simple test which doesn't use datasource.

                • 5. Re: Help: Mbean exceptions on jboss startup

                   

                  "liujw2001" wrote:
                  I used jboss4.2 and jboss4.0

                  First I don't know the defference between the *-ds.xml and *-servcie.xml, can you tell me?
                  The second is I just use a simple test which doesn't use datasource.

                  You don't need to perform the deployment using the my-service.xml file , using -service.xml pattern for deploying the datasource was used in older version of Jboss , ie in Jboss3.* series .
                  With the latest version of the Jboss the datasource is deployed as the -ds.xml file , the Jboss XSLT deployer would create a -service.xml contents from this -ds.xml and then deploy it as one of the service .
                  You simply need to create the -ds.xml file and Jboss would deploy it .
                  For knowing more details about the datasource configuration you can see here
                  http://wiki.jboss.org/wiki/Wiki.jsp?page=ConfigDataSources



                  • 6. Re: Help: Mbean exceptions on jboss startup
                    liujw2001

                    Thank you for your reply.
                    I'm sorry I don't know how to write this *-ds.xml file.
                    I want to send the source code to your jboss email (vicky.kak@jboss.com) which showed in this forums. Can you help me to finish this *-ds.xml file?
                    Waitting for you reply again.

                    • 7. Re: Help: Mbean exceptions on jboss startup

                      Go through the sample application as explained here
                      http://docs.jboss.org/jbossas/jboss4guide/r5/html/ch7.chapt.html
                      Look at the contents of the notxfs-ds.xml file at the above location .
                      You would need to map the <rar-name> pointing to the rar , if the rar is in the ear then you would have to specify the rar-name as earname.ear#rarname.rar .
                      Read this chapter carefully , all your questions would be answered .

                      • 8. Re: Help: Mbean exceptions on jboss startup
                        liujw2001

                        Thank you very much!
                        The question which had puzzled me for two weeks is resovled now.
                        The following is the configure file:

                        <!DOCTYPE connection-factories PUBLIC
                         "-//JBoss//DTD JBOSS JCA Config 1.5//EN"
                         "http://www.jboss.org/j2ee/dtd/jboss-ds_1_5.dtd">
                        <!--
                         The non-transaction FileSystem resource adaptor service configuration
                        -->
                        <connection-factories>
                         <no-tx-connection-factory>
                         <jndi-name>NoTransFile</jndi-name>
                         <rar-name>resource.ear#file.rar</rar-name>
                         <connection-definition>
                         javax.resource.cci.ConnectionFactory
                         </connection-definition>
                        
                         </no-tx-connection-factory>
                        </connection-factories>

                        Thank every one again!