NoClassDefFoundError with mgmt swiftlet under Java 1.4

View: New views
3 Messages — Rating Filter:   Alert me  

NoClassDefFoundError with mgmt swiftlet under Java 1.4

by Chad12 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

This may be a wontfix due to obscurity and Java 1.4. being old/near-deprecated, but I noticed today that if you are running SwiftMQ 7.5.1 under standard Java 1.4.x and connect to it from the cli or Explorer, and try and "enable" JMX (which of course is unavailable on a standard java 1.4. installation) the explorer/cli will hang, and the server will yield:
Got Exception:
    ThreadGroup: mgmt
    ActiveTask : PipelineQueue, dispatchToken=sys$mgmt.dispatchqueue
Stack Trace:
java.lang.NoClassDefFoundError: javax/management/ObjectName
        at com.swiftmq.impl.mgmt.standard.d.propertyChanged(Unknown Source)
        at com.swiftmq.mgmt.Property.setValue(Unknown Source)
        at com.swiftmq.mgmt.Entity$1.execute(Unknown Source)
        at com.swiftmq.mgmt.CommandRegistry.executeCommand(Unknown Source)
        at com.swiftmq.mgmt.RouterConfigInstance$1.execute(Unknown Source)
        at com.swiftmq.mgmt.CommandRegistry.executeCommand(Unknown Source)
        at com.swiftmq.mgmt.RouterConfigInstance.executeCommand(Unknown Source)
        at com.swiftmq.impl.mgmt.standard.v750.DispatcherImpl.visit(Unknown Source)
        at com.swiftmq.mgmt.protocol.v750.CommandRequest.accept(Unknown Source)
        at com.swiftmq.impl.mgmt.standard.v750.DispatcherImpl.visit(Unknown Source)
        at com.swiftmq.impl.mgmt.standard.po.ClientRequest.accept(Unknown Source)
        at com.swiftmq.impl.mgmt.standard.v750.DispatcherImpl.process(Unknown Source)
        at com.swiftmq.impl.mgmt.standard.DispatchQueue.a(Unknown Source)
        at com.swiftmq.impl.mgmt.standard.DispatchQueue.visit(Unknown Source)
        at com.swiftmq.impl.mgmt.standard.po.ClientRequest.accept(Unknown Source)
        at com.swiftmq.tools.pipeline.PipelineQueue.process(Unknown Source)
        at com.swiftmq.tools.queue.SingleProcessorQueue.dequeue(Unknown Source)
        at com.swiftmq.tools.pipeline.PipelineQueue$QueueProcessor.run(Unknown Source)
        at com.swiftmq.impl.threadpool.standard.PoolThread.run(Unknown Source)
I think the only way to fix it is to restart the router; but normal "safe" shutdown will fail - it gets stuck trying to shut down the Management Swiftlet, so you have to kill -9 it. Not a major issue by any means, but possibly could be handled more gracefully?

Re: NoClassDefFoundError with mgmt swiftlet under Java 1.4

by IIT Software :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Well, the reason is that a thread died as you see. This is because the ClassNotFoundException isn't handled and it goes up the stack until the thread dies. We cannot handle everything, e.g. classpath problems, OOMs. We try but SwiftMQ is highly async where one thread waits on another and if one thread dies due to such kind of exceptions, the router turns into an unknown state (which might cause a block in your case).

Re: NoClassDefFoundError with mgmt swiftlet under Java 1.4

by Chad12 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yes, I know the reason, and I'm well aware of how Java exception handling works.

I was suggesting that you handle this particular error, to defend from a non-Java-savvy Production operations user accidentally clicking the button on the Explorer client and causing a major part of the router to completely die and not be able to shut down properly.

It's straightforward to tell which JRE spec code is running in and make decisions accordingly, so not difficult to defend from an error like this.