Bug 864952

Summary: Cannot connect to secured remote-jmx tomcat connection
Product: [JBoss] JBoss Operations Network Reporter: Jan Martiska <jmartisk>
Component: Plugin -- TomcatAssignee: Charles Crouch <ccrouch>
Status: CLOSED NOTABUG QA Contact: Mike Foley <mfoley>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: JON 3.1.1CC: hbrock, jclere, mhusnain, spinder
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: ? Consequence: When a remote-jmx connection to Tomcat 6 without authentication (com.sun.management.jmxremote.authenticate=false) is set up and the correct credentials are supplied in the JBoss Operations Network (JON) interface, the JMX connection fails and the following error appears: Fix: None Result: None Workaround: The workaround for this problem is to use jconsole to connect to the Tomcat instance using remote JMX.
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-10-25 08:14:06 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jan Martiska 2012-10-10 13:20:22 UTC
I set up a remote-jmx connection to tomcat6 (from JBoss EWS 2.0.0.CR1). If it is unprotected (com.sun.management.jmxremote.authenticate=false), then it works fine. If it is password protected, and I specify wrong credentials in JON, this happens:

javax.security.auth.login.FailedLoginException: Invalid username or password

which is fine. However, if I specify correct credentials, this happens (I turned on agent debugging):

2012-10-10 09:10:19,019 DEBUG [InventoryManager.discovery-1] (rhq.core.pc.inventory.ResourceContainer$ResourceComponentInvocationHandler)- Call to [org.rhq.plugins.jmx.JMXServerComponent.start()] with args [[org.rhq.core.pluginapi.inventory.ResourceContext@b9c7bfc]] failed.
java.util.concurrent.ExecutionException: org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException: Failed to authenticate to managed JVM - principal and/or credentials connection properties are not set correctly.
	at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:262)
	at java.util.concurrent.FutureTask.get(FutureTask.java:119)
	at org.rhq.core.pc.inventory.ResourceContainer$ResourceComponentInvocationHandler.invokeInNewThreadWithLock(ResourceContainer.java:554)
	at org.rhq.core.pc.inventory.ResourceContainer$ResourceComponentInvocationHandler.invoke(ResourceContainer.java:542)
	at $Proxy42.start(Unknown Source)
	at org.rhq.core.pc.inventory.InventoryManager.activateResource(InventoryManager.java:1733)
	at org.rhq.core.pc.inventory.InventoryManager.refreshResourceComponentState(InventoryManager.java:3012)
	at org.rhq.core.pc.inventory.InventoryManager.processSyncInfo(InventoryManager.java:2757)
	at org.rhq.core.pc.inventory.InventoryManager.processSyncInfo(InventoryManager.java:2763)
	at org.rhq.core.pc.inventory.InventoryManager.processSyncInfo(InventoryManager.java:2763)
	at org.rhq.core.pc.inventory.InventoryManager.synchInventory(InventoryManager.java:1105)
	at org.rhq.core.pc.inventory.InventoryManager.handleReport(InventoryManager.java:1079)
	at org.rhq.core.pc.inventory.RuntimeDiscoveryExecutor.call(RuntimeDiscoveryExecutor.java:126)
	at org.rhq.core.pc.inventory.RuntimeDiscoveryExecutor.call(RuntimeDiscoveryExecutor.java:61)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:165)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	at java.lang.Thread.run(Thread.java:679)
Caused by: org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException: Failed to authenticate to managed JVM - principal and/or credentials connection properties are not set correctly.
	at org.rhq.plugins.jmx.JMXServerComponent.start(JMXServerComponent.java:74)
	at sun.reflect.GeneratedMethodAccessor34.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:616)
	at org.rhq.core.pc.inventory.ResourceContainer$ComponentInvocationThread.call(ResourceContainer.java:634)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
	... 3 more

and the JMX connection does not work. By other means, like jconsole, I can connect to that tomcat instance using remote jmx without problems.

Comment 1 Jan Martiska 2012-10-25 08:14:06 UTC
ok I finally found out that it works - the problem was you have to specify the same credentials on two places, which is really unintuitive.. but whatever, closing this one, this is not a bug.

Comment 2 Misha H. Ali 2012-10-25 08:25:30 UTC
Removed from Known Issues for JON.