The code is exactly as described on the tutorial http://mina.apache.org/jmx-integration.html
I've also included it on the bottom..

Even stranger is that I made an own MBean using the same pattern as here and it showed fine also under Eclipse. veeery weird..


<code>
// Create an acceptor
final IoAcceptor acceptor = new SocketAcceptor();

// add JMX stuff
IoServiceManager serviceManager = new IoServiceManager( acceptor );
serviceManager.startCollectingStats(1000);
MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
ObjectName name = new ObjectName("mina.example.http.server:type=IoServiceManager");
mbs.registerMBean(serviceManager, name);

// Create a service configuration
SocketAcceptorConfig cfg = new SocketAcceptorConfig();
...
</code>

Mark Webb wrote:
could you send me your code? My first guess is that you don't have your JMX
bean set up properly and/or registered.

On 5/22/07, Eero Nevalainen <[EMAIL PROTECTED]> wrote:

I'm using JDK 5. I gave the argument
-Dcom.sun.management.jmxremote

to the "VM arguments" list under "Run as"->"Run"->"Arguments". Without
the option the jconsole doesn't of course show any VMs running.

Mark Webb wrote:
> are you using JDK 5 or 6 in Eclipse?  I think for version 5, you must
add a
> command line argument to the JVM.
>
> On 5/22/07, Eero Nevalainen <[EMAIL PROTECTED]> wrote:
>>
>> Hi,
>>
>> I went through the JMX tutorial and started it on Eclipse. The JConsole
>> wasn't showing the IoServiceManager mbean. Works fine when started
>> normally from a command line. Anyone else experience this?
>>
>> Also another question: Am I risking some horrible, horrible fate by
>> placing this call on my code?
>>
>> Runtime.getRuntime().addShutdownHook(new Thread() {
>>         public void run() {
>>                 acceptor.unbindAll();
>>         }
>> });
>>
>> -Eero Nevalainen
>>
>
>
>





Reply via email to