This content has been marked as final.
Show 3 replies
-
1. Re: Upgrading Tomcat plugin, metric names not updated
genman Sep 5, 2013 6:46 PM (in response to genman)It seems that the upgrade failed in some way. By looking at the logs:
2013-09-04 20:20:26,811 ERROR [org.rhq.enterprise.server.core.plugin.ProductPluginDeployer] Failed to register RHQ plugin file [file:/usr/local/rhq-server-4.5.1/jbossas/server/default/deploy/rhq.ear/rhq-downloads/rhq-plugins/jopr-tomcat-plugin-4.9.0-SNAPSHOT.jar] javax.ejb.EJBTransactionRolledbackException: java.lang.IllegalArgumentException: The property [name] marked as required in the configuration definition of [Tomcat Connector] has no attribute 'default' at org.jboss.ejb3.tx.Ejb3TxPolicy.handleInCallerTx(Ejb3TxPolicy.java:87) at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:130) at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
so somehow the existing descriptor failed validation, hence no upgrade was performed. The code:
private void updateResourcePluginConfiguration(Resource resource, ConfigurationDefinitionUpdateReport updateReport) { Configuration pluginConfiguration = resource.getPluginConfiguration(); boolean modified = false; @SuppressWarnings("unused") int numberOfProperties = pluginConfiguration.getProperties().size(); ConfigurationTemplate template = updateReport.getConfigurationDefinition().getDefaultTemplate(); Configuration templateConfiguration = template.getConfiguration(); for (PropertyDefinition propertyDef : updateReport.getNewPropertyDefinitions()) { if (propertyDef.isRequired()) { Property templateProperty = templateConfiguration.get(propertyDef.getName()); if (templateProperty == null) { throw new IllegalArgumentException("The property [" + propertyDef.getName() + "] marked as required in the configuration definition of [" + propertyDef.getConfigurationDefinition().getName() + "] has no attribute 'default'"); } else { pluginConfiguration.put(templateProperty.deepCopy(false)); modified = true; } } }
So it seems there may be difficulty with users upgrading from the existing tomcat plugin.
The solution seems to be to update the existing plugin to not require 'name' to be set:
diff --git a/modules/plugins/tomcat/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/tomcat/src/main/resources/META-INF/rhq-plugin.xml index 653736f..5a93a27 100644 --- a/modules/plugins/tomcat/src/main/resources/META-INF/rhq-plugin.xml +++ b/modules/plugins/tomcat/src/main/resources/META-INF/rhq-plugin.xml @@ -734,16 +734,20 @@ <c:simple-property name="name" type="string" - readOnly="true" /> + readOnly="true" + required="false" /> <c:simple-property name="port" type="string" description="Port on which this connector is configured to listen." - readOnly="true" /> + readOnly="true" + required="false" + /> <c:simple-property name="handler" type="string" description="Connector protocol handler." + required="false" readOnly="true" /> <c:simple-property name="connector"
I did the other properties just to be sure. I don't fully understand this, but it does seem like a bug.
-
2. Re: Upgrading Tomcat plugin, metric names not updated
tsegismont Sep 6, 2013 4:33 AM (in response to genman)Hi Elias,
Nice catch. I created a bug report (Bug 1005095 - Upgrading Tomcat plugin, metric names not updated) and will try to get this fixed ASAP.
Thanks
-
3. Re: Upgrading Tomcat plugin, metric names not updated
jfclere Sep 18, 2013 4:57 AM (in response to tsegismont)In Tomcat there is nothing mandatory... Only the port is need (otherwise it uses 0 and the connector doesn't listen).