Bug 753264

Summary: AS5 plugin: value of namingUrl connection prop is not correctly discovered for an EAP 5.1.1 instance
Product: [Other] RHQ Project Reporter: Ian Springer <ian.springer>
Component: PluginsAssignee: Charles Crouch <ccrouch>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: high Docs Contact:
Priority: high    
Version: 4.2CC: ccrouch, hbrock, hrupp, jshaughn
Target Milestone: ---   
Target Release: RHQ 4.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-08-31 10:09:36 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 745494    

Description Ian Springer 2011-11-11 18:22:28 UTC
Here's the error that occurs when I try to start/activate the Resource:

org.rhq.core.clientapi.agent.PluginContainerException: Failed to start component for resource Resource[id=10700, type=JBossAS Server, key=/home/ips/Applications/jboss-eap-5.1.1/jboss-as/server/all, name=127.0.0.51 all, parent=jetengine, version=EAP 5.1.1].
	at org.rhq.core.pc.inventory.InventoryManager.activateResource(InventoryManager.java:1601)
	at org.rhq.core.pc.inventory.AvailabilityExecutor.checkInventory(AvailabilityExecutor.java:202)
	at org.rhq.core.pc.inventory.AvailabilityExecutor.checkInventory(AvailabilityExecutor.java:238)
	at org.rhq.core.pc.inventory.AvailabilityExecutor.call(AvailabilityExecutor.java:127)
	at org.rhq.core.pc.inventory.AvailabilityExecutor.call(AvailabilityExecutor.java:55)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.RuntimeException: Naming URL 'jnp://jboss:service=Naming
            Port:***CHANGE_ME***' is not valid: Illegal character in authority at index 6: jnp://jboss:service=Naming
            Port:***CHANGE_ME***
	at org.rhq.plugins.jbossas5.ApplicationServerComponent.validateNamingURL(ApplicationServerComponent.java:435)
	at org.rhq.plugins.jbossas5.ApplicationServerComponent.connectToProfileService(ApplicationServerComponent.java:357)
	at org.rhq.plugins.jbossas5.ApplicationServerComponent.start(ApplicationServerComponent.java:180)
	at sun.reflect.GeneratedMethodAccessor27.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.rhq.core.pc.inventory.ResourceContainer$ComponentInvocationThread.call(ResourceContainer.java:552)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	... 3 more

Comment 1 Ian Springer 2011-11-11 19:59:51 UTC
(02:44:14 PM) ips: to discover the jnp url, we first look for the jnp.url file that eap writes out 
(02:44:56 PM) ips: if we can't find that or fail to parse it, we fallback to parsing config files to try to find it (conf/service-config.xml, etc.)
(02:45:16 PM) ips: that config parsing code was most likely snarfed from the as4 plugin
(02:45:48 PM) ips: but the format of how the naming service is declared in jboss-service.xml has changed in 5.x
(02:46:00 PM) ips: so our parser was returning junk 
(02:46:59 PM) ips: however, it's a pretty rare case that we would fail to find that jnp.url file. that file is created by the server the first time it starts up, but toward the end of startup
(02:47:45 PM) ips: so the user would have to run an agent server scan within 20 seconds or so of starting the eap 5.x instance for the first time
(02:48:01 PM) ips: (which is what i did)
(02:48:18 PM) ips: the other edge case would be if the user manually deleted the jnp.url file
(02:49:18 PM) ips: in any case, i fixed the parser code so it returns null rather than junk for the jnp address and port if it can't find it using the old 4.x style

Comment 2 Ian Springer 2011-11-11 20:31:24 UTC
Fixed in master - commit ab9b8b0:

http://git.fedorahosted.org/git/?p=rhq/rhq.git;a=commitdiff;h=ab9b8b0

Comment 3 Ian Springer 2011-11-14 17:17:07 UTC
QE, please test this in master, so we can decide if we want to cherry pick the fix into the jon3 branch.

Comment 4 Jay Shaughnessy 2013-02-26 22:09:39 UTC
Moving to verified.  master fixed.

Comment 7 Heiko W. Rupp 2013-08-31 10:09:36 UTC
Bulk close of old bugs in VERIFIED state.