participate


JMX - jconsole no longer works with Java 6.0, it did with 5.0
This question is not answered.

<<   Back to Forum  |   Give us Feedback
5 Duke Stars available
This topic has 7 replies on 1 page.
IAslanidis
Posts:5
Registered: 10/12/07
jconsole no longer works with Java 6.0, it did with 5.0   
Nov 6, 2007 1:42 AM
 
 
Hello,

We are having a very important issue. We have reproduced the situation in 10 out of 10 computers, all with the same result, even in fresh installations.

Using jconsole, we are connecting to the following service (BEA weblogic 10): service:jmx:rmi:///jndi/iiop://host:7001/weblogic.management.mbeanservers.runtime

In the jconsole provided in any revision of Java 5.0 (1.5) it works, that is to say, it is able to connect to the service.

On the other hand, there is no way to accomplish this using Java 6.0. The connection fails with the following error:

Nov 6, 2007 10:27:56 AM com.sun.corba.se.impl.orb.ORBImpl checkShutdownState
WARNING: "IOP01210228: (BAD_OPERATION) This ORB instance has been destroyed, so no operations can be performed on it"
org.omg.CORBA.BAD_OPERATION: vmcid: SUN minor code: 228 completed: No
at com.sun.corba.se.impl.logging.ORBUtilSystemException.orbDestroyed(ORBUtilSystemException.java:586)
at com.sun.corba.se.impl.logging.ORBUtilSystemException.orbDestroyed(ORBUtilSystemException.java:608)
at com.sun.corba.se.impl.orb.ORBImpl.checkShutdownState(ORBImpl.java:1289)
at com.sun.corba.se.impl.orb.ORBImpl.create_any(ORBImpl.java:1078)
at com.sun.corba.se.impl.javax.rmi.CORBA.Util.writeAny(Util.java:296)
at javax.rmi.CORBA.Util.writeAny(Util.java:80)
at org.omg.stub.javax.management.remote.rmi._RMIServer_Stub.newClient(Unknown Source)
at javax.management.remote.rmi.RMIConnector.getConnection(RMIConnector.java:2309)
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:277)
at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:248)
at sun.tools.jconsole.ProxyClient.tryConnect(ProxyClient.java:361)
at sun.tools.jconsole.ProxyClient.connect(ProxyClient.java:297)
at sun.tools.jconsole.VMPanel$2.run(VMPanel.java:279)


We have also create our own application to do this and although the same piece of code compiles under both JDKs, it fails to run with exactly the same error under Java 6.0.

Does anyone know why this is happening and if there is a way to work around it?

TIA.
 
dfuchs
Posts:416
Registered: 1/5/06
Re: jconsole no longer works with Java 6.0, it did with 5.0   
Nov 7, 2007 9:40 AM (reply 1 of 7)  (In reply to original post )
Helpful
 
Hi,

I believe the JMXServiceURL is incorrect. It should be:
service:jmx:iiop:///jndi/iiop://host:7001/weblogic.management.mbeanservers.runtime

not
service:jmx:rmi:///jndi/iiop://host:7001/weblogic.management.mbeanservers.runtime

For some reason URLs of the form
service:jmx:rmi:///jndi/iiop://host:port/name

worked in JDK 1.5 on the client side although they shouldn't have (since the actual protocol here is iiop, not rmi)

Hope this helps,

-- daniel
http://blogs.sun.com/jmxetc
 
IAslanidis
Posts:5
Registered: 10/12/07
Re: jconsole no longer works with Java 6.0, it did with 5.0   
Nov 8, 2007 3:04 AM (reply 2 of 7)  (In reply to #1 )
 
 
Thank you for your reply; however, I am still getting problems. Now it does connect, but it breaks loose as if there was something wrong with java 6.0. Is there anything that I am missing?

Now I get the following errors after connecting to BEA WebLogic 10 through jconsole:

Nov 8, 2007 10:36:05 AM com.sun.corba.se.impl.encoding.CDRInputStream_1_0 read_value
WARNING: "IOP00810211: (MARSHAL) Exception from readValue on ValueHandler in CDRInputStream"
org.omg.CORBA.MARSHAL: vmcid: SUN minor code: 211 completed: Maybe
at com.sun.corba.se.impl.logging.ORBUtilSystemException.valuehandlerReadException(ORBUtilSystemException.java:6500)
at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1045)
at com.sun.corba.se.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:253)
at com.sun.corba.se.impl.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:1892)
at com.sun.corba.se.impl.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:2311)
at com.sun.corba.se.impl.io.IIOPInputStream.defaultReadObjectDelegate(IIOPInputStream.java:570)
at com.sun.corba.se.impl.io.InputStreamHook.defaultReadObject(InputStreamHook.java:183)
at java.util.HashMap.readObject(HashMap.java:1016)
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:597)
at com.sun.corba.se.impl.io.IIOPInputStream.invokeObjectReader(IIOPInputStream.java:1694)
at com.sun.corba.se.impl.io.IIOPInputStream.inputObject(IIOPInputStream.java:1212)
at com.sun.corba.se.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:400)
at com.sun.corba.se.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:327)
at com.sun.corba.se.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:293)
at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1034)
at com.sun.corba.se.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:253)
at com.sun.corba.se.impl.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:1892)
at com.sun.corba.se.impl.io.IIOPInputStream.inputRemoteMembersForReadFields(IIOPInputStream.java:2070)
at com.sun.corba.se.impl.io.IIOPInputStream.readFields(IIOPInputStream.java:2008)
at com.sun.corba.se.impl.io.InputStreamHook.readFields(InputStreamHook.java:216)
at javax.management.modelmbean.DescriptorSupport.readObject(DescriptorSupport.java:1270)
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:597)
at com.sun.corba.se.impl.io.IIOPInputStream.invokeObjectReader(IIOPInputStream.java:1694)
at com.sun.corba.se.impl.io.IIOPInputStream.inputObject(IIOPInputStream.java:1212)
at com.sun.corba.se.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:400)
at com.sun.corba.se.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:327)
at com.sun.corba.se.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:293)
at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1034)
at com.sun.corba.se.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:253)
at com.sun.corba.se.impl.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:1892)
at com.sun.corba.se.impl.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:2311)
at com.sun.corba.se.impl.io.IIOPInputStream.defaultReadObjectDelegate(IIOPInputStream.java:570)
at com.sun.corba.se.impl.io.InputStreamHook.defaultReadObject(InputStreamHook.java:183)
at javax.management.modelmbean.ModelMBeanAttributeInfo.readObject(ModelMBeanAttributeInfo.java:524)
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:597)
at com.sun.corba.se.impl.io.IIOPInputStream.invokeObjectReader(IIOPInputStream.java:1694)
at com.sun.corba.se.impl.io.IIOPInputStream.inputObjectUsingFVD(IIOPInputStream.java:1548)
at com.sun.corba.se.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:398)
at com.sun.corba.se.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:327)
at com.sun.corba.se.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:293)
at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1034)
at com.sun.corba.se.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:253)
at com.sun.corba.se.impl.io.ValueHandlerImpl.read_Array(ValueHandlerImpl.java:756)
at com.sun.corba.se.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:325)
at com.sun.corba.se.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:293)
at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1034)
at com.sun.corba.se.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:253)
at com.sun.corba.se.impl.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:1892)
at com.sun.corba.se.impl.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:2311)
at com.sun.corba.se.impl.io.IIOPInputStream.defaultReadObjectDelegate(IIOPInputStream.java:570)
at com.sun.corba.se.impl.io.InputStreamHook.defaultReadObject(InputStreamHook.java:183)
at javax.management.MBeanInfo.readObject(MBeanInfo.java:669)
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:597)
at com.sun.corba.se.impl.io.IIOPInputStream.invokeObjectReader(IIOPInputStream.java:1694)
at com.sun.corba.se.impl.io.IIOPInputStream.inputObjectUsingFVD(IIOPInputStream.java:1548)
at com.sun.corba.se.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:398)
at com.sun.corba.se.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:327)
at com.sun.corba.se.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:293)
at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1034)
at com.sun.corba.se.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:253)
at com.sun.jmx.remote.internal.PInputStream.read_value(Unknown Source)
at org.omg.stub.javax.management.remote.rmi._RMIConnection_Stub.getMBeanInfo(Unknown Source)
at javax.management.remote.rmi.RMIConnector$RemoteMBeanServerConnection.getMBeanInfo(RMIConnector.java:1037)
at com.tango.jmx.connection.JMXAgentConnectionJSR.getJMXModelService(JMXAgentConnectionJSR.java:128)
at com.tango.jmx.server.JMXSources.refreshSource(JMXSources.java:80)
at com.tango.jmx.server.JMXSources.<init>(JMXSources.java:66)
at com.tango.jmx.server.JMXServer.addSourceToStructure(JMXServer.java:97)
at com.tango.jmx.server.JMXServer.addJMXSource(JMXServer.java:88)
at server.ServiceManager.generatePetitions(ServiceManager.java:107)
at server.ServiceManager.getData(ServiceManager.java:68)
at server.Service.getData(Service.java:47)
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:597)
at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)
at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)
at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:453)
at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
at org.apache.axis.transport.http.SimpleAxisWorker.execute(SimpleAxisWorker.java:428)
at org.apache.axis.transport.http.SimpleAxisWorker.run(SimpleAxisWorker.java:155)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.io.InvalidClassException: javax.management.Descriptor; UnsupportedOperationException accessing no-arg constructor
at com.sun.corba.se.impl.io.IIOPInputStream.inputObject(IIOPInputStream.java:1157)
at com.sun.corba.se.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:400)
at com.sun.corba.se.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:327)
at com.sun.corba.se.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:293)
at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1034)
... 96 more
Caused by: java.lang.UnsupportedOperationException
at com.sun.corba.se.impl.io.ObjectStreamClass.newInstance(ObjectStreamClass.java:927)
at com.sun.corba.se.impl.io.IIOPInputStream.inputObject(IIOPInputStream.java:1143)
... 100 more
 
dfuchs
Posts:416
Registered: 1/5/06
Re: jconsole no longer works with Java 6.0, it did with 5.0      
Nov 8, 2007 9:26 AM (reply 3 of 7)  (In reply to #2 )
Helpful
 
Hi,

After some research it unfortunately appears to be a known bug:

Bug ID: 6614558 jmx interop JDK5 - JDK6 issue when calling getMBeanInfo
http://bugs.sun.com/view_bug.do?bug_id=6614558

The problem appears on the client side (JDK 6) when unmarshalling ModelMBeanInfo sent
by a JDK 5 server over IIOP.

Note that the bug only occurs with RMI/IIOP.
If you can switch to RMI/JRMP it will go away.

-- daniel
http://blogs.sun.com/jmxetc
 
dfuchs
Posts:416
Registered: 1/5/06
Re: jconsole no longer works with Java 6.0, it did with 5.0   
Nov 12, 2007 9:46 AM (reply 4 of 7)  (In reply to #3 )
 
 
Hi, see possible work around here:

http://blogs.sun.com/jmxetc/entry/proxying_a_jmx_connection_adapting

Hope this helps,

-- daniel
http://blogs.sun.com/jmxetc
 
IAslanidis
Posts:5
Registered: 10/12/07
Re: jconsole no longer works with Java 6.0, it did with 5.0   
Nov 13, 2007 12:31 AM (reply 5 of 7)  (In reply to #4 )
 
 
Thank you for your help.

Unfortunately the proposed workaround is invalid, meaning that it forces the installation of JDK 5 in the side of the client. What we need is a way to directly interact with JDK 6 in the client and JDK 5 in the server without installing neither JDK 5 in the client nor JDK 6 in the server.
 
dfuchs
Posts:416
Registered: 1/5/06
Re: jconsole no longer works with Java 6.0, it did with 5.0   
Nov 13, 2007 1:46 PM (reply 6 of 7)  (In reply to #5 )
 
 
Hi,

Well, in that case you can simply start the poxy on the server side.

Hope this helps,

-- daniel
http://blogs.sun.com/jmxetc
 
Pascal.Liu
Posts:1
Registered: 11/29/07
Re: jconsole no longer works with Java 6.0, it did with 5.0   
Nov 29, 2007 6:59 PM (reply 7 of 7)  (In reply to #6 )
 
 
Hi, I faced similar problems access MBeans to Weblogic Server 10 from client under JDK(JRE) 6.0
, but my way of workaround may be helpful:

Do not use jmx support jar files from Weblogic Server10, use that from 9 instead. Here I use
weblogic.jar & webservices.jar
and it works fine.

the following is my test program (looks ugly, but only for test)
public class MyConnection {
    private static MBeanServerConnection connection;
 
    private static JMXConnector connector;
 
    public static void initConnection(String hostname, String portString,
            String username, String password) throws IOException,
            MalformedURLException {
        String protocol = "t3";
        Integer portInteger = Integer.valueOf(portString);
        int port = portInteger.intValue();
        String jndiroot = "/jndi/";
        String mserver = "weblogic.management.mbeanservers.domainruntime";
        JMXServiceURL serviceURL = new JMXServiceURL(protocol, hostname, port,
                jndiroot + mserver);
        Hashtable h = new Hashtable();
        h.put(Context.SECURITY_PRINCIPAL, username);
        h.put(Context.SECURITY_CREDENTIALS, password);
        h.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES,
            "weblogic.management.remote");
        connector = JMXConnectorFactory.connect(serviceURL, h);
        connection = connector.getMBeanServerConnection();
 
    }
 
    public static void getComplidatedObject() throws Exception {
        //String name = "com.bea:Location=examplesServer,Name=examplesServer,ServerRuntime=examplesServer,Type=JDBCServiceRuntime";\
        String name = "com.bea:Name=DomainRuntimeService,Type=weblogic.management.mbeanservers.domainruntime.DomainRuntimeServiceMBean";
        String attribute = "ServerRuntimes";
        ObjectName on = new ObjectName(name);
        Object obj = connection.getAttribute(on, attribute);
        //Method m = obj.getClass().getMethod("getState", new Class[] {});
        //Object result = m.invoke(obj, null);
        //System.out.println(result);
        System.out.println(obj.getClass().isArray());
    
        System.out.println(obj);
        
    }
    
    public static void discovery() throws Exception {
        String mbeanType = "*:*";
 
        ObjectName patialObjectName = new ObjectName(mbeanType);
 
        Set mbeans = connection.queryNames(patialObjectName, null);
 
        long overallTime = System.currentTimeMillis();
 
        for (Iterator itr = mbeans.iterator(); itr.hasNext();) {
            ObjectName mbean = (ObjectName) itr.next();
            String sMBeanFullName = mbean.getCanonicalName();
 
            MBeanInfo mbeanInfo = connection.getMBeanInfo(mbean);
            MBeanAttributeInfo mbeanAttrInfoArray[] = mbeanInfo.getAttributes();
 
            if (mbeanAttrInfoArray == null) {
                continue;
            }
 
            String sMBeanDescription = mbeanInfo.getDescription();
            String s = mbeanInfo.getClassName();
            System.out.println("====================");
            System.out.println(sMBeanFullName);
            for (int i = 0; i < mbeanAttrInfoArray.length; i++) {
                
                MBeanAttributeInfo attrInfo = mbeanAttrInfoArray[i];
                
                if (attrInfo.isReadable()) { 
                    //If attribute datatype is supported, add it to the list for this mbean
                    String sAttrDataType = attrInfo.getType();
 
                    String sAttrName = attrInfo.getName();
                    String sAttrDescription = attrInfo.getDescription();
                
                    System.out.println("Name:" + sAttrName + "\nType:" + sAttrDataType + "\nDesc:" + sAttrDescription);
                } //end if
            }
        }
    }
    
    public static void main(String[] args) throws Exception {
        
        String hostname = "192.168.1.24";
        String portString = "7001";
        String username = "weblogic";
        String password = "weblogic";
        MyConnection c = new MyConnection();
        initConnection(hostname, portString, username, password);
        c.printNameAndState();
        c.discovery();
        c.getComplidatedObject();
        c.printNameAndState();
        connector.close();
    }
 
    public static ObjectName[] getServerRuntimes() throws Exception {
        ObjectName service = new ObjectName(
        "com.bea:Name=DomainRuntimeService,Type=weblogic.management.mbeanservers.domainruntime.DomainRuntimeServiceMBean");
 
        return (ObjectName[]) connection.getAttribute(service, "ServerRuntimes");
    }
 
    public void printNameAndState() throws Exception {
        ObjectName[] serverRT = getServerRuntimes();
        System.out.println("got server runtimes");
        int length = (int) serverRT.length;
        for (int i = 0; i < length; i++) {
            MBeanInfo mb = connection.getMBeanInfo(serverRT[i]);
            System.out.println(mb.getClassName());
            String name = (String) connection.getAttribute(serverRT[i], "Name");
            String state = (String) connection.getAttribute(serverRT[i],
                "State");
            System.out.println("Server name: " + name + ".   Server state: " + state);
        }
    }
 
This topic has 7 replies on 1 page.
Back to Forum
 
Read the Developer Forums Code of Conduct

Click to email this message Email this Topic

Edit this Topic
  
 
 
Forums Statistics
    Users Online : 23
  • Guests : 117

About Sun forums
  • Sun Forums is a large collection of user generated discussions. It is here to help you ask questions, find answers, and participate in discussions.

    Check out our guide on Getting started with Sun Forums for a full walkthrough of how to best leverage the benefits of this community.

Powered by Jive Forums