Bug 536166 (RHQ-545)

Summary: Test updating a configuration definition on a package type
Product: [Other] RHQ Project Reporter: Jason Dobies <__jdobies>
Component: Core ServerAssignee: RHQ Project Maintainer <rhq-maint>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0CC: asantos, jshaughn
Target Milestone: ---Keywords: Task
Target Release: ---   
Hardware: All   
OS: All   
URL: http://jira.rhq-project.org/browse/RHQ-545
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-05-13 12:23:37 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:

Description Jason Dobies 2008-06-06 11:53:00 EDT
This is to address a specific feature request for JON.

In the AS plugin, under the EAR and WAR package types, there is a configuration property that is constrained to function as an enumeration (used in selecting between the deploy and farm directories when deploying). This will be removed as part of the feature request, being replaced with likely just a simple text field. A few properties of the change:

- The property itself may be removed and replaced with a new property. This might be ugly for packages that are already inventoried with a configuration value for this property as I'm not sure what will happen if the definition and configuration values get out of sync. I suspect it should be OK; the value will simply become a dead artifact in the database and never used again.
- Alternatively, the property may have its constraints removed, thus changing it from being a selection into a free text field. If done carefully, this should have no ramifications on the existing values. However, as compared to the above suggestion which would be a simpler property add and remove, this is the modification of constraints on an existing property, which is potentially more complex to handle as an update.
- If the constraints are removed, the description of the property will change to reflect it's new usage. The metadata parser needs to account for this and properly update the definition in the database.
Comment 1 Jason Dobies 2008-06-09 17:11:18 EDT
I was able to successfully remove the constraint, turning the enumerated value into open ended text.
Comment 2 Jason Dobies 2008-06-09 17:18:15 EDT
I tried deleting the property and adding a new one (i.e. removing deployDirectory and added fullDeployDirectory). Upon server restart, it blew up with the following exception:

2008-06-09 17:14:56,389 INFO  [org.rhq.enterprise.server.core.plugin.ProductPluginDeployer] Deploying RHQ plugin JBossAS (JBoss Application Server), version 2.0.1-SNAPSHOT...
2008-06-09 17:15:10,171 ERROR [org.rhq.enterprise.server.core.plugin.ProductPluginDeployer] Unable to deploy RHQ plugin [/home/jdob/code/rhq/trunk/dev-container/jbossas/server/default/deploy/rhq.ear/rhq-downloads/rhq-plugins/rhq-jbossas-plugin-2.0.1-SNAPSHOT.jar]
javax.ejb.EJBException: java.lang.IllegalArgumentException: org.hibernate.ObjectDeletedException: deleted instance passed to merge: [org.rhq.core.domain.configuration.definition.PropertyGroupDefinition#<null>]
	at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:63)
	at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
	at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
	at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
	at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
	at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
	at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:106)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
	at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
	at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
	at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:214)
	at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:184)
	at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:81)
	at $Proxy306.registerPlugin(Unknown Source)
	at org.rhq.enterprise.server.core.plugin.ProductPluginDeployer.registerPluginJar(ProductPluginDeployer.java:386)
	at org.rhq.enterprise.server.core.plugin.ProductPluginDeployer.access$000(ProductPluginDeployer.java:74)
	at org.rhq.enterprise.server.core.plugin.ProductPluginDeployer$LatchedPluginDeploymentService.executeService(ProductPluginDeployer.java:290)
	at org.rhq.enterprise.server.core.concurrency.LatchedServiceController$LatchedService.run(LatchedServiceController.java:187)
	at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.IllegalArgumentException: org.hibernate.ObjectDeletedException: deleted instance passed to merge: [org.rhq.core.domain.configuration.definition.PropertyGroupDefinition#<null>]
	at org.hibernate.ejb.AbstractEntityManagerImpl.merge(AbstractEntityManagerImpl.java:230)
	at org.jboss.ejb3.entity.TransactionScopedEntityManager.merge(TransactionScopedEntityManager.java:188)
	at org.rhq.enterprise.server.resource.metadata.ResourceMetadataManagerBean.updateContentDefinitions(ResourceMetadataManagerBean.java:655)
	at org.rhq.enterprise.server.resource.metadata.ResourceMetadataManagerBean.updateType(ResourceMetadataManagerBean.java:310)
	at org.rhq.enterprise.server.resource.metadata.ResourceMetadataManagerBean.updateType(ResourceMetadataManagerBean.java:295)
	at org.rhq.enterprise.server.resource.metadata.ResourceMetadataManagerBean.updateTypes(ResourceMetadataManagerBean.java:155)
	at org.rhq.enterprise.server.resource.metadata.ResourceMetadataManagerBean.registerPlugin(ResourceMetadataManagerBean.java:134)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
	at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
	at org.rhq.enterprise.server.authz.RequiredPermissionsInterceptor.checkRequiredPermissions(RequiredPermissionsInterceptor.java:153)
	at sun.reflect.GeneratedMethodAccessor127.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
	at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
	at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
	at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
	at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
	... 22 more
Caused by: org.hibernate.ObjectDeletedException: deleted instance passed to merge: [org.rhq.core.domain.configuration.definition.PropertyGroupDefinition#<null>]
	at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:129)
	at org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:687)
	at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:669)
	at org.hibernate.engine.CascadingAction$6.cascade(CascadingAction.java:245)
	at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:268)
	at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:216)
	at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:169)
	at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
	at org.hibernate.event.def.DefaultMergeEventListener.cascadeOnMerge(DefaultMergeEventListener.java:407)
	at org.hibernate.event.def.DefaultMergeEventListener.entityIsPersistent(DefaultMergeEventListener.java:152)
	at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:126)
	at org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:687)
	at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:669)
	at org.hibernate.engine.CascadingAction$6.cascade(CascadingAction.java:245)
	at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:268)
	at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:216)
	at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:169)
	at org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java:296)
	at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java:242)
	at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:219)
	at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:169)
	at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
	at org.hibernate.event.def.DefaultMergeEventListener.cascadeOnMerge(DefaultMergeEventListener.java:407)
	at org.hibernate.event.def.DefaultMergeEventListener.entityIsPersistent(DefaultMergeEventListener.java:152)
	at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:126)
	at org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:687)
	at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:669)
	at org.hibernate.engine.CascadingAction$6.cascade(CascadingAction.java:245)
	at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:268)
	at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:216)
	at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:169)
	at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
	at org.hibernate.event.def.DefaultMergeEventListener.cascadeOnMerge(DefaultMergeEventListener.java:407)
	at org.hibernate.event.def.DefaultMergeEventListener.entityIsPersistent(DefaultMergeEventListener.java:152)
	at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:126)
	at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:53)
	at org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:677)
	at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:661)
	at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:665)
	at org.hibernate.ejb.AbstractEntityManagerImpl.merge(AbstractEntityManagerImpl.java:227)
	... 46 more
Comment 3 Jason Dobies 2008-06-09 17:18:39 EDT
Assigning to Heiko to look into as part of the metadata update fixing.
Comment 4 Red Hat Bugzilla 2009-11-10 16:11:32 EST
This bug was previously known as http://jira.rhq-project.org/browse/RHQ-545
This bug is incorporated by RHQ-511