Bug 812324

Summary: Re-deploy of a plugin with changed resource type name and created children fails
Product: [Other] RHQ Project Reporter: Heiko W. Rupp <hrupp>
Component: Core ServerAssignee: RHQ Project Maintainer <rhq-maint>
Status: NEW --- QA Contact: Mike Foley <mfoley>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 4.3CC: hrupp
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Attachments:
Description Flags
Stack trace from console none

Description Heiko W. Rupp 2012-04-13 07:42:48 EDT
I have a plugin (as7), where I have a service "JVM-Definition". And have already created child resources of that type. Now I have changed the name to "JVM Definition". Redeploy leads to a huge stack trace with 

13:38:30,781 ERROR [ResourceMetadataManagerBean] Failure during removal of obsolete ResourceTypes and Subcategories.
java.lang.Exception: Failed to remove {jboss-as-7}JVM-Definiton.
        at org.rhq.enterprise.server.resource.metadata.ResourceMetadataManagerBean.removeResourceTypes(ResourceMetadataManagerBean.java:256)
        at org.rhq.enterprise.server.resource.metadata.ResourceMetadataManagerBean.removeObsoleteTypes(ResourceMetadataManagerBean.java:185)

caused by a foreign-key violation

13:38:30,773 ERROR [JDBCExceptionReporter] FEHLER: Aktualisieren oder Löschen in Tabelle »rhq_resource_type« verletzt Fremdschlüssel-Constraint »rhq_create_res_hist_resource_type_id_fkey« von Tabelle »rhq_create_res_hist«
  Detail: Auf Schlüssel (id)=(10471) wird noch aus Tabelle »rhq_create_res_hist« verwiesen.
Comment 1 Heiko W. Rupp 2012-04-13 07:43:41 EDT
Created attachment 577306 [details]
Stack trace from console
Comment 2 Charles Crouch 2012-04-16 12:44:48 EDT
Commented on wrong bz
Comment 3 Charles Crouch 2012-04-16 13:57:33 EDT
In fact set priority and blocking bugs incorrectly too. Fixing
Comment 4 Charles Crouch 2012-04-23 10:30:11 EDT
Setting medium as per Apr 16 BZ triage