Noise exception generated when deploying a composite using properties
---------------------------------------------------------------------
Key: TUSCANY-3268
URL: https://issues.apache.org/jira/browse/TUSCANY-3268
Project: Tuscany
Issue Type: Bug
Components: Java SCA Assembly Model
Affects Versions: Java-SCA-1.5
Environment: All
Reporter: Hasan Muhammad
Priority: Minor
When we have a composite with properties and try to build it, it generates a
harmless noise exception which can be avoided. The following is the exception
java.lang.NullPointerException
at
org.apache.tuscany.sca.assembly.builder.impl.PropertyConfigurationUtil.evaluate(PropertyConfigurationUtil.java:73)
at
org.apache.tuscany.sca.assembly.builder.impl.PropertyConfigurationUtil.sourceComponentProperties(PropertyConfigurationUtil.java:146)
at
org.apache.tuscany.sca.assembly.builder.impl.BaseConfigurationBuilderImpl.configureSourcedProperties(BaseConfigurationBuilderImpl.java:828)
at
org.apache.tuscany.sca.assembly.builder.impl.BaseConfigurationBuilderImpl.configureComponents(BaseConfigurationBuilderImpl.java:100)
at
org.apache.tuscany.sca.assembly.builder.impl.ComponentConfigurationBuilderImpl.build(ComponentConfigurationBuilderImpl.java:65)
The reason is the following block of code not checking for null
PropertyConfigurationUtil.evaluate()
Document document = documentBuilderFactory.newDocumentBuilder().newDocument();
the documentBuilderFactory is null in this case, and we can simply check for it
and if it is null, return null. We do check for the returned value is null or
not in the method sourceComponentProperties, so no worries if we change this.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.