[
https://issues.jboss.org/browse/WFLY-4008?page=com.atlassian.jira.plugin....
]
Amos Feng commented on WFLY-4008:
---------------------------------
[~dlmiles], can you provide me all the codes as it looks like we meet the same issue but
I don't use @MXBean annotation ?
MBean deployment causes javax.naming.NameNotFoundException:
java:comp/BeanManager
----------------------------------------------------------------------------------
Key: WFLY-4008
URL:
https://issues.jboss.org/browse/WFLY-4008
Project: WildFly
Issue Type: Bug
Components: CDI / Weld, JMX, Naming
Affects Versions: 8.1.0.Final
Reporter: Darryl Miles
Assignee: Stuart Douglas
Labels: mbean
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 ?
--
This message was sent by Atlassian JIRA
(v6.3.8#6338)