[CONTROLLER-623] ManagementFactory.getPlatformMBeanServer() does not work in karaf Created: 13/Jul/14 Updated: 19/Oct/17 Resolved: 17/Mar/16 |
|
| Status: | Resolved |
| Project: | controller |
| Component/s: | config |
| Affects Version/s: | Helium |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | Ed Warnicke | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: Mac OS |
||
| Attachments: |
|
| External issue ID: | 1359 |
| Description |
|
This bug was discovered in the context of: https://git.opendaylight.org/gerrit/#/c/8963/ trying to do the Karaf work. The shell script that starts karaf on line 410 has This causes the config subsystem to break in karaf due to its many uses of: If you You will get an exception like the one in the attachment. This is rooted in karaf JMX RBAC as enforced by the: This can be solved in two ways: 1) Remove from the bin/karaf the 2) Write a ConfigManagementFactory with a getPlatformMBeanServer() that does Note... the right thing for karaf looks something like: Map<String,String> h = new HashMap<String,String>(); JMXConnector connector = JMXConnectorFactory.connect(serviceURL, h); |
| Comments |
| Comment by Ed Warnicke [ 13/Jul/14 ] |
|
This is the exception trace that you get if you use and in karaf do: feature:install odl-config-startup and wait a minute or so. |
| Comment by Ed Warnicke [ 13/Jul/14 ] |
|
Attachment pastebin has been added with description: Exception trace |
| Comment by Ed Warnicke [ 13/Jul/14 ] |
|
Side note: What's actually happening here is that Karaf introduced RBAC for JMX in 3.0, and its tweaked down so hard you really can't use ManagementFactory.getPlatformMBeanServer() (I am honestly unqualified to know if its tweaked down too hard or not) |
| Comment by Ed Warnicke [ 13/Jul/14 ] |
|
Correction to one liner for building and running karaf: cd controller/opendaylight/distribution/opendaylight-karaf/;mvn clean install;cd target/;unzip -o distribution.opendaylight-karaf-1.4.2-SNAPSHOT.zip; cd distribution.opendaylight-karaf-1.4.2-SNAPSHOT/bin;./karaf |
| Comment by Robert Varga [ 18/Jul/14 ] |
|
So I think we need to go for option #2, which I think will need to occur by installing a platform support bundle:
Note that adding a remote connector may introduce failure modes which we have not accounted for (like, the connection going down). |
| Comment by Maros Marsalek [ 10/Sep/14 ] |
|
Workaround is present in ODL and its being fixed in karaf 3.0.2 (according to Ed) |