Issue Details (XML | Word | Printable)

Key: SM-883
Type: Improvement Improvement
Status: In Progress In Progress
Priority: Major Major
Assignee: Grant McDonald
Reporter: Grant McDonald
Votes: 1
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
ServiceMix

MBean registration in Websphere returns different objectName

Created: 17/Mar/07 02:11 AM   Updated: 22/Sep/07 07:32 AM
Component/s: servicemix-core
Affects Version/s: 3.0.1, 3.1
Fix Version/s: None

Time Tracking:
Original Estimate: 2 hours
Original Estimate - 2 hours
Remaining Estimate: 2 hours
Remaining Estimate - 2 hours
Time Spent: Not Specified
Remaining Estimate - 2 hours

File Attachments:
  Size
Zip Archive Licensed for inclusion in ASF works PatchTo3.0.1.zip 2007-04-05 01:46 AM David Potter 10 kB
Zip Archive Licensed for inclusion in ASF works PatchToCurrentVersion.zip 2007-04-05 01:46 AM David Potter 11 kB
Text File Licensed for inclusion in ASF works SM-883-MBeanRegistration.patch 2007-04-18 06:12 AM David Potter 6 kB
Environment: Windows XP SP1, Ubuntu Linux, Java 1.5


 Description  « Hide
Description courtesy of David Potter:

When running serviceMix V3.0 on WebSphere 6.1.0.0 I get the following error
after stopping and starting serviceMix from the WebSphere console.

ERROR - ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'jbi' defined in ServletContext resource
[/WEB-INF/servicemix.xml]: Invocation of init method failed;
nested exception is
javax.jbi.JBIException: javax.management.InstanceAlreadyExistsException:
org.apache.servicemix:Name=ManagementContext,cell=SD1464Node01Cell,Type=SystemService,ContainerName=ServiceMix,node=SD1464Node01,process=server1

I have traced the error to the fact that when you register an mbean IBM adds
additional information to the bean. So when serviceMix regesters the bean
org.apache.servicemix:Name=ManagementContext,Type=SystemService,ContainerName=ServiceMix
IBM, in the method
com.ibm.ws.management.PlatformMBeanServer.registerMBean(PlatformMBeanServer.java:469)
, adds the attributes cell=SD1464Node01Cell,
node=SD1464Node01,process=server1

These means that when we try to unregister the bean on application shutdown
we cannot find it (as we look the been up by name).

Solution Ideas:

1) In AsyncBaseLifeCycle.doInit() use queryNames() instead of isRegistered().
Care would need to be taken in unregistering the bean is case the bean is
not ours.

2) After a bean is registered, update its name (or the complete bean) with the
name of the bean returned by the register operation. (this is preferred)



 All   Comments   Work Log   Change History   Subversion Commits   FishEye   Crucible      Sort Order: Ascending order - Click to sort in descending order
David Potter added a comment - 05/Apr/07 01:46 AM
I have include 2 patches. A tested patch to version 3.0.1 (the version that we are currently running) and untested file with the patch applied to the current version of Service Mix.

Additional comments:
There is a similar fix in spring org/springframework/jmx/support/MBeanRegistrationSupport.java version 2-0-1.

I think that there is a similar problem in the current versionof ActiveMQ.

If JMX is turned off for serviceMix then the problems in spring and ActiveMQ do not appear.

David Potter


Grant McDonald added a comment - 06/Apr/07 06:24 AM
David,

When supplying patches can you please supply them in unified diff format from the root of the trunk (preferably using svn diff and aggregated to one patch file) since this makes them much easier to apply in addition to being able to easily see the changes.

Thanks,

Grant


David Potter added a comment - 18/Apr/07 06:12 AM
Attached patch in diff format as requested.

Guillaume Nodet added a comment - 02/May/07 01:46 PM
Grant, is this patch ready to be applied ? Will you check it in 3.1 branch ? Or should it be delayed to 3.1.2 ?

Grant McDonald added a comment - 03/May/07 01:45 AM
Please delay it until 3.1.2 unless there is a screaming need for it. I am in the process of testing on WebSphere 6.1 and the patch wasn't seeming to work as advertised so more investigation is needed on my part before I am comfortable that it should be applied as is.

Guillaume Nodet added a comment - 03/May/07 08:06 PM
Sure, no problem. Thanks for letting us know.