Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-4008

MBean deployment causes javax.naming.NameNotFoundException: java:comp/BeanManager

XMLWordPrintable

      If you create an MBean in your EJB and deploy the EJB.

      <pre>
      @SuppressWarnings("serial")
      public class Monitor implements MonitorMXBean, Serializable {

      private static final Logger log = LoggerFactory.getLogger(Monitor.class);

      private Boolean enabled = Boolean.FALSE;
      private Long valueOne;

      public Monitor()

      { log.debug("CTOR"); }

      @Override
      public Boolean isEnabled()

      { return enabled; }

      @Override
      public void setEnabled(Boolean enabled)

      { this.enabled = enabled; }

      @Override
      public Long getValueOne()

      { return valueOne; }

      @Override
      public void setValueOne(Long valueOne)

      { this.valueOne = valueOne; }

      }

      </pre>

      And JMX MXBean

      <pre>
      import javax.management.MXBean;

      @MXBean
      public interface MonitorMXBean

      { void setEnabled(Boolean enabled); Boolean isEnabled(); void setValueOne(Long valueOne); Long getValueOne(); }

      </pre>
      17:34:42,455 ERROR [org.jboss.as.weld] (MSC service thread 1-1) JBAS016001: Failed to tear down Weld contexts: javax.naming.NameNotFoundException: java:comp/BeanManager
      at org.jboss.as.naming.InitialContext$DefaultInitialContext.findContext(InitialContext.java:187)
      at org.jboss.as.naming.InitialContext$DefaultInitialContext.lookup(InitialContext.java:231)
      at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:188)
      at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:184)
      at javax.naming.InitialContext.lookup(InitialContext.java:417) [rt.jar:1.8.0_25]
      at javax.naming.InitialContext.lookup(InitialContext.java:417) [rt.jar:1.8.0_25]
      at org.jboss.as.weld.arquillian.WeldContextSetup.teardown(WeldContextSetup.java:108)
      at org.jboss.as.jmx.MBeanRegistrationService.stop(MBeanRegistrationService.java:132) [wildfly-jmx-8.1.0.Final.jar:8.1.0.Final]
      at org.jboss.msc.service.ServiceControllerImpl$StopTask.stopService(ServiceControllerImpl.java:2056) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
      at org.jboss.msc.service.ServiceControllerImpl$StopTask.run(ServiceControllerImpl.java:2017) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_25]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_25]
      at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_25]

      Is this related to: https://issues.jboss.org/browse/WFLY-822 ?

              zfeng@redhat.com Zheng Feng
              darryl.miles@dlmc.co.uk Darryl Miles (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: