[jboss-jira] [JBoss JIRA] Created: (JGRP-993) InstanceNotFoundException when destroying jchannel (TP.ProtocolAdapter not found in MBean server)

Stefan Anzinger (JIRA) jira-events at lists.jboss.org
Wed Jun 17 07:12:56 EDT 2009


InstanceNotFoundException when destroying jchannel (TP.ProtocolAdapter not found in MBean server)
-------------------------------------------------------------------------------------------------

                 Key: JGRP-993
                 URL: https://jira.jboss.org/jira/browse/JGRP-993
             Project: JGroups
          Issue Type: Bug
    Affects Versions: 2.6.9
         Environment: Windows
            Reporter: Stefan Anzinger
            Assignee: Bela Ban
            Priority: Minor


When using shared transport with org.jgroups.jmx.JChannel there occurs a javax.management.InstanceNotFoundException when destroying the cannel.
It has no major impact as the exception is caught and not thrown outside of jgroups. Unfortunately the exception is logged as error where obviously is no error.

See the testcase and exception:

import java.io.ByteArrayInputStream;
import org.w3c.dom.*;
import javax.management.MBeanServer;
import javax.management.MBeanServerFactory;
import javax.xml.parsers.*;
import junit.framework.TestCase;


public class TestJGroups extends TestCase {
    /**
     * Tests the receiveLocalMessages feature on multiplex
     * channels.
     * 
     * <h2>Course of action</h2>
     * <ol>
     *   <li>Creates tow physical channels</li>
     *   <li>For each physical channel a mux channel is created</li>
     *   <li>Receive Local messages is turned off on the mux channels</li>
     *   <li>Local address has to be set manually after connecting the physical channels (This may be done automatically)</li>
     *   <li>Message is sent from the first mux to the second mux channel</li>
     * </ol>
     * 
     * @throws Exception
     */
    public void testSharedTransport() throws Exception
    {
        MBeanServer mbeanserver = MBeanServerFactory.createMBeanServer("testserver");
        org.jgroups.jmx.JChannel channel1 = new org.jgroups.jmx.JChannel();
        channel1.setClusterConfig(getConfig("singletonA"));
        channel1.setObjectName("test:service=Channel");
        channel1.create();
        channel1.setClusterName("Cluster1");
        channel1.start();
        channel1.stop();
        channel1.destroy();
        MBeanServerFactory.releaseMBeanServer(mbeanserver);
    }
    
    
    private Element getConfig(String singletonName) throws Exception {
        String config = 
            "<config>                                                                           " +
            "  <UDP mcast_recv_buf_size=\"80000\" mcast_send_buf_size=\"150000\"                " +
            "      mcast_port=\"32233\" mcast_addr=\"228.0.0.1\"                                " +
            "      ip_ttl=\"32\" singleton_name=\"" + singletonName + "\"/>                     " +
            "  <PING/>                                                                          " +
            "  <FD_SOCK/>                                                                       " +
            "  <VERIFY_SUSPECT timeout=\"15000\"/>                                              " +
            "  <pbcast.NAKACK gc_lag=\"50\" retransmit_timeout=\"300,600,1200,2400,48000\"/>    " +
            "  <UNICAST timeout=\"600,1200,2000,25000\"/>                                       " +
            "  <FRAG frag_size=\"8096\"/>                                                       " +
            "  <pbcast.STABLE desired_avg_gossip=\"20000\" max_bytes=\"500000\"/>               " +
            "  <pbcast.GMS print_local_addr=\"true\" join_timeout=\"60000\" shun=\"true\" />    " +
            "</config>                                                                          ";
        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        DocumentBuilder db = dbf.newDocumentBuilder();
        Document d = db.parse(new ByteArrayInputStream(config.getBytes()));
        return d.getDocumentElement();
    }

}


2009-06-17 13:05:49,409 [main] ERROR - org.jgroups.jmx.JmxConfigurator - failed to unregister test:service=Channel,protocol=TP.ProtocolAdapter
javax.management.InstanceNotFoundException: test:service=Channel,protocol=TP.ProtocolAdapter
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getMBean(DefaultMBeanServerInterceptor.java:1010)
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.unregisterMBean(DefaultMBeanServerInterceptor.java:354)
	at com.sun.jmx.mbeanserver.JmxMBeanServer.unregisterMBean(JmxMBeanServer.java:527)
	at org.jgroups.jmx.JmxConfigurator.unregisterProtocols(JmxConfigurator.java:121)
	at org.jgroups.jmx.JChannel.destroy(JChannel.java:256)
	at com.j2fe.clustering.impl.TestJGroups.testSharedTransport(TestJGroups.java:41)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at junit.framework.TestCase.runTest(TestCase.java:154)
	at junit.framework.TestCase.runBare(TestCase.java:127)
	at junit.framework.TestResult$1.protect(TestResult.java:106)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.framework.TestResult.run(TestResult.java:109)
	at junit.framework.TestCase.run(TestCase.java:118)
	at junit.framework.TestSuite.runTest(TestSuite.java:208)
	at junit.framework.TestSuite.run(TestSuite.java:203)
	at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list