3 Replies Latest reply on Dec 19, 2001 4:03 PM by adrian.brock

    Hot Deploying MBean Problem

    patmau

      Hallo all,

      im using JBoss (MX microkernel) 3.0.0alpha(200112191121) and
      create a sar file with a simple MBean which uses jnp's ExternalContext.
      I created a "test.sar" with the following files:

      [jsp@asus] cat META-INF/jboss-service.xml
      <?xml version="1.0" encoding="UTF-8"?>


      external/ldap
      external-ldap.properties
      javax.naming.ldap.InitialLdapContext
      true



      [jsp@asus] cat external-ldap.properties
      java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory
      java.naming.provider.url=ldap://localhost:389/o=JNDITutorial
      java.naming.security.principal=
      java.naming.security.authentication=simple
      java.naming.security.credentials=

      When I hotdeployed the test.sar I got the following Exception:

      16:34:47,938 INFO [AutoDeployer] Auto deploying: file:/opt/java/jboss-3.0.0alpha/deploy/test.sar
      16:34:48,011 ERROR [ServiceController] Could not configure MBean: DefaultDomain:service=ExternalContext,jndiName=external/ldap/asus
      javax.management.MBeanException: Exception thrown in the MBean's setter
      at com.sun.management.jmx.MBeanServerImpl.setAttribute(MBeanServerImpl.java:1421)
      at com.sun.management.jmx.MBeanServerImpl.setAttribute(MBeanServerImpl.java:1331)
      at org.jboss.system.ServiceConfigurator.configure(ServiceConfigurator.java:251)
      at org.jboss.system.ServiceController.install(ServiceController.java:200)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
      at org.jboss.deployment.ServiceDeployer.invoke(ServiceDeployer.java:734) at org.jboss.deployment.ServiceDeployer.deploy(ServiceDeployer.java:232) at org.jboss.deployment.DeployerMBeanSupport.deploy(DeployerMBeanSupport.java:97)
      at java.lang.reflect.Method.invoke(Native Method)

        • 1. Re: Hot Deploying MBean Problem

          Hi,

          One of your setXXX methods is throwing an
          exception.

          Try adding the following code:

          void setXXX(...)
          try
          {
          // Your code
          }
          catch(Exception e)
          {
          log.error(e);
          throw e;
          }

          This should put the stack trace in the log.

          Regards,
          Adrian

          • 2. Re: Hot Deploying MBean Problem
            patmau

            I'm using the org.jboss.naming.ExternalContext
            code and I'm just deploying the jboss-service.xml
            file with a valid property file.

            Should I modify and rebuild jboss to find the problem ?

            I forgot to say that those two files work without any
            problems on jboss 2.2.4 when added to jboss.jcml.

            Thanks,
            Patrick

            • 3. Re: Hot Deploying MBean Problem

              Hi,

              Looking at CVS I can't see any major changes since 2.2.4.

              The most likely problem is the properties file.

              This is suppossed to be a url, but you've just
              specified a file name.

              Where is the properties file?

              Try giving it an absolute url.

              Regards,
              Adrian