Hi ,
I am not able to run the query when I am having the instance id
constraint , record type constraint with in a same template. when I am
running the following query file ,
<?xml version="1.0" encoding="UTF-8"?>
<query xmlns="http://cmdbf.org/schema/1-0-0/datamodel">
<itemTemplate id="template2">
<instanceIdConstraint>
<instanceId>
<mdrId>CCMDBMDR</mdrId>
<localId>Server1</localId>
</instanceId>
</instanceIdConstraint>
<recordConstraint>
<recordType localName="OS" namespace=""/>
</recordConstraint>
</itemTemplate>
</query>
I am getting the following exception.
"
Exception in thread "main" java.lang.NullPointerException
at
com.ibm.cmdbf.query.CMDBfQueryOperation.applyItemConstraints(CMDBfQueryOperation.java:485)
at
com.ibm.cmdbf.query.CMDBfQueryOperation.processItemTemplates(CMDBfQueryOperation.java:216)
at
com.ibm.cmdbf.query.CMDBfQueryOperation.execute(CMDBfQueryOperation.java:139)
at
com.ibm.cmdbf.query.CMDBfQueryOperation.execute(CMDBfQueryOperation.java:126)
at com.ibm.cmdbf.query.QueryLauncher.getResponse(QueryLauncher.java:93)
at com.ibm.cmdbf.query.QueryLauncher.main(QueryLauncher.java:64)
"
I am getting the error on the applyItemConstraints method ,
Logically it is wrong to have the instance id constraint record
constraint with in the same template , but the api is just throwing the
null pointer exception.
Is this not possible to have the instance id constraint and record
constraint with in the same template ?
if this is not possible the API should inform the user by throwing
the custom exception something like "it is not possible to have the
instance id constraint and record constraint with in the same template"
Regards
Arunachalam.