Bug 789967

Summary: hornetq plugin: "NoSuchMethodException: org.rhq.plugins.jbossas.JBossASServerComponent.getConnection()" in org.jboss.as.integration.hornetq.jopr.JMSManagerDiscoveryComponent class
Product: [Other] RHQ Project Reporter: Libor Zoubek <lzoubek>
Component: PluginsAssignee: Jay Shaughnessy <jshaughn>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 4.2CC: ccrouch, hrupp, jshaughn, snegrea, theute
Target Milestone: ---   
Target Release: JON 3.1.0   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugzilla.redhat.com/show_bug.cgi?id=817690
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-03 11:10:29 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 782579    
Attachments:
Description Flags
agent log none

Description Libor Zoubek 2012-02-13 06:25:46 EST
Description of problem: I am getting NoSuchMethod exceptions on JON 3.0.1 RC4 right after RHQ server (on local agent) got to inventory. It looks like productization issue to me.


Version-Release number of selected component (if applicable):
Version: 3.0.1.GA
Build Number: dd8a001:c5270fb

How reproducible:always


Steps to Reproduce:
1. install server & agent on same host
2. install eap plugin pack
3. inventory RHQ Server, check agent log does not contain bellow exception
  
Actual results:

java.lang.Exception: Discovery component invocation failed.
        at org.rhq.core.pc.util.DiscoveryComponentProxyFactory$ComponentInvocationThread.call(DiscoveryComponentProxyFactory.java:296
)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        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:636)
Caused by: java.lang.NoSuchMethodException: org.rhq.plugins.jbossas.JBossASServerComponent.getConnection()
        at java.lang.Class.getMethod(Class.java:1622)
        at org.jboss.as.integration.hornetq.jopr.JMSManagerDiscoveryComponent.getProfileService(JMSManagerDiscoveryComponent.java:65)
        at org.jboss.as.integration.hornetq.jopr.JMSManagerDiscoveryComponent.discoverResources(JMSManagerDiscoveryComponent.java:44)
        at sun.reflect.GeneratedMethodAccessor70.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.util.DiscoveryComponentProxyFactory$ComponentInvocationThread.call(DiscoveryComponentProxyFactory.java:292
)
        ... 5 more


Expected results:


Additional info: I've installed 

zip -sf jon-plugin-pack-eap-3.0.1.GA.zip
Archive contains:
  jon-plugin-pack-eap-3.0.1.GA/
  jon-plugin-pack-eap-3.0.1.GA/jopr-jboss-as-5-plugin-4.2.0.JON.3.0.1.GA.jar
  jon-plugin-pack-eap-3.0.1.GA/EULA
  jon-plugin-pack-eap-3.0.1.GA/jopr-jboss-as-plugin-4.2.0.JON.3.0.1.GA.jar
  jon-plugin-pack-eap-3.0.1.GA/jopr-hibernate-plugin-4.2.0.JON.3.0.1.GA.jar
  jon-plugin-pack-eap-3.0.1.GA/jopr-jboss-cache-plugin-4.2.0.JON.3.0.1.GA.jar
  jon-plugin-pack-eap-3.0.1.GA/jopr-jboss-cache-v3-plugin-4.2.0.JON.3.0.1.GA.jar
  jon-plugin-pack-eap-3.0.1.GA/hornetq-jopr-plugin-1.0.0.CR2.jar
  jon-plugin-pack-eap-3.0.1.GA/jopr-rhq-server-plugin-4.2.0.JON.3.0.1.GA.jar
  jon-plugin-pack-eap-3.0.1.GA/README.txt
  jon-plugin-pack-eap-3.0.1.GA/LICENSE

When comparing to jon-plugin-pack-eap-3.0.0.GA I see modcluster-plugin missing, which is probably not related
Comment 1 Mike Foley 2012-02-13 11:59:35 EST
per triage 2/13/2012 (asantos, crouch, foley, loleary)
Comment 2 Stefan Negrea 2012-02-15 15:40:38 EST
Can you please attach the log file with the full error? 

A first look at the error indicates that the agent is trying to discover the AS4 server as an AS5 server (the JMS reference).
Comment 3 Stefan Negrea 2012-02-15 19:30:48 EST
Talking with Ian we discovered that this issue was fixed in HornetQ 1.0.0.Final plugin. JON includes the older 1.0.0.CR2. The latest version of the Hornetq plugin is 2.0.0.Final. 

The problems stems from the fact that the HornetQ plugin has both AS4 and AS5 as parent resource types. Here is the fixed HornetQ issue: https://issues.jboss.org/browse/HORNETQ-454

The side effects from having the reported error are minimal. The only other problem, aside from the logging the error, is that discovery process will attempt to discover HornetQ subresources for every JBoss AS4 server inventoried. The discovery process only fails for the HornetQ resources and is not affected otherwise.

HornetQ plugin downloads: https://repository.jboss.org/nexus/content/repositories/releases/org/hornetq/hornetq-jopr-plugin/


I smoke tested JON3.0.1 with both 2.0.0.Final and 1.0.0.Final and this particular error is no longer present in the log files. However, I see some additional errors with regards to loading default values for config properties for both plugins:


2012-02-15 18:17:41,921 INFO  [InventoryManager.availability-1] (rhq.core.pc.inventory.InventoryManager)- Sending availability report to Server...
2012-02-15 18:21:59,349 WARN  [WorkerThread#0[127.0.0.1:58310]] (rhq.core.pc.configuration.LegacyConfigManagement)- Plugin Error: Invalid JMS Connection Factory Resource configuration returned by HornetQ plugin - Required property 'ha' has a null value in Configuration[id=0, notes=Resource config for JMS Connection Factory Resource w/ id 10431].
2012-02-15 18:21:59,349 WARN  [WorkerThread#0[127.0.0.1:58310]] (rhq.core.pc.configuration.LegacyConfigManagement)- Plugin Error: Invalid JMS Connection Factory Resource configuration returned by HornetQ plugin - Required property 'useDiscovery' has a null value in Configuration[id=0, notes=Resource config for JMS Connection Factory Resource w/ id 10431].
2012-02-15 18:21:59,349 WARN  [WorkerThread#0[127.0.0.1:58310]] (rhq.core.pc.configuration.LegacyConfigManagement)- Plugin Error: Invalid JMS Connection Factory Resource configuration returned by HornetQ plugin - Required property 'cfType' has a null value in Configuration[id=0, notes=Resource config for JMS Connection Factory Resource w/ id 10431].
2012-02-15 18:21:59,349 WARN  [WorkerThread#0[127.0.0.1:58310]] (rhq.core.pc.configuration.LegacyConfigManagement)- Plugin Error: Invalid JMS Connection Factory Resource configuration returned by HornetQ plugin - Required property 'connectorNames' has a null value in Configuration[id=0, notes=Resource config for JMS Connection Factory Resource w/ id 10431].


I was not able to build JON with HornetQ 2.0.0.Final plugin due to missing dependencies from public repositories (error message below). There are no problems with HornetQ 1.0.0.Final plugin.


Missing:
----------
1) org.jboss.man:jboss-managed:jar:2.1.1.SP4

  Try downloading the file manually from the project website.

  Then, install it using the command: 
      mvn install:install-file -DgroupId=org.jboss.man -DartifactId=jboss-managed -Dversion=2.1.1.SP4 -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file there: 
      mvn deploy:deploy-file -DgroupId=org.jboss.man -DartifactId=jboss-managed -Dversion=2.1.1.SP4 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

  Path to dependency: 
  	1) org.jboss.on:jon-plugin-pack-eap:pom:3.0.1-SNAPSHOT
  	2) org.hornetq:hornetq-jopr-plugin:jar:2.0.0.Final
  	3) org.jboss.man:jboss-managed:jar:2.1.1.SP4

2) org.hibernate:hibernate-annotations:jar:3.4.0.GA_CP02

  Try downloading the file manually from the project website.

  Then, install it using the command: 
      mvn install:install-file -DgroupId=org.hibernate -DartifactId=hibernate-annotations -Dversion=3.4.0.GA_CP02 -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file there: 
      mvn deploy:deploy-file -DgroupId=org.hibernate -DartifactId=hibernate-annotations -Dversion=3.4.0.GA_CP02 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

  Path to dependency: 
  	1) org.jboss.on:jon-plugin-pack-eap:pom:3.0.1-SNAPSHOT
  	2) org.hornetq:hornetq-jopr-plugin:jar:2.0.0.Final
  	3) org.hibernate:hibernate-annotations:jar:3.4.0.GA_CP02

----------
2 required artifacts are missing.

for artifact: 
  org.jboss.on:jon-plugin-pack-eap:pom:3.0.1-SNAPSHOT

from the specified remote repositories:
  central (http://repo1.maven.org/maven2),
  brew (http://download.devel.redhat.com/brewroot/repos/jboss-on-3-build/latest/maven/),
  brms (http://download.lab.bos.redhat.com/brewroot/repos/soa-brms-5.2-build/latest/maven/),
  jboss-public-repo-group (http://repository.jboss.org/nexus/content/groups/public/),
  jboss-deprecated-repository (https://repository.jboss.org/maven2/),
  jon (http://jon01.mw.lab.eng.bos.redhat.com:8042/m2-repo/),
  jboss-deprecated-items-group (https://repository.jboss.org/nexus/content/repositories/deprecated/),
  __jpp_repo__ (file:///usr/share/maven2/repository)
Comment 4 Libor Zoubek 2012-02-16 05:34:13 EST
Created attachment 562458 [details]
agent log
Comment 5 Simeon Pinder 2012-02-16 13:16:05 EST
Talked this over with Ian Springer and this is not bad enough to go into 3.0.1 but should be fixed in master.
Comment 6 Ian Springer 2012-02-16 15:42:09 EST
I think we should wait on the HornetQ team to fix the two hornetq plugin issues Stefan described above, as well as a third issue I found, and then to cut a new release (e.g. 2.0.1.Final). We can then upgrade JON master to that version.

I've created HORNETQ JIRA issues for all three bugs:

https://issues.jboss.org/browse/HORNETQ-852
https://issues.jboss.org/browse/HORNETQ-856
https://issues.jboss.org/browse/HORNETQ-857

Andy Taylor said he will work on them when he returns from PTO on Mon, Feb 27.
Comment 7 Jay Shaughnessy 2012-05-01 12:01:42 EDT
This is likely fixed by the upgrade to 2.0.0.Final, which is now the
version for JON 3.1.  We should re-test with a 3.1 build.
Comment 8 Jay Shaughnessy 2012-05-04 16:44:48 EDT
With a JON 3.1.0 RC built with HornetQ 2.0.0.Final I did not get these
warnings.
Comment 9 Libor Zoubek 2012-05-21 06:44:23 EDT
verified on Version: 4.4.0.JON310-SNAPSHOT Build Number: 31b4844
Comment 10 Heiko W. Rupp 2013-09-03 11:10:29 EDT
Bulk closing of old issues in VERIFIED state.