If we create a ResourceTemplate, using CLI script which is at a application scope, ResourceInstance creation fails with "TIBCO-AMX-CLI-000810: Resource template <Resource_Template_Name>' was not found in scope ''null' null'" Error Message.

If we create a ResourceTemplate, using CLI script which is at a application scope, ResourceInstance creation fails with "TIBCO-AMX-CLI-000810: Resource template <Resource_Template_Name>' was not found in scope ''null' null'" Error Message.

book

Article ID: KB0071031

calendar_today

Updated On:

Products Versions
TIBCO ActiveMatrix Service Grid 3.4.0 and 3.4.1

Description

If you use the samples folder resourcetemplate_build.xml and resourcetemplate_data.xml and create a ResourceTemplate at the Application scope as below then you will not able to create ResourceInstance at Application scope using samples folder resourceinstance_build.xml and resourceinstance_data.xmlIt will fail with the below error trace.

Example of ResourceTemplate at Application scopes:
===========================
User-added image

 

Sample Output of ResourceInstance creation failing with the below error message:
======================================
C:\ProgramData\CONFIGAMXBPM432\tibco\data\admin\amxadmin432\samples>ant -f resourceinstance_build.xml create
Buildfile: C:\ProgramData\CONFIGAMXBPM432\tibco\data\admin\amxadmin432\samples\resourceinstance_build.xml

create:
[AMXAdminTask] 03 Oct 2023 22:39:05  INFO - Initializing JSSE's crypto provider class com.sun.net.ssl.internal.ssl.Provider in default mode
[AMXAdminTask] 03 Oct 2023 22:39:05  INFO - Connecting to AMX Admin server at 'http://na1devspehin01:8124' as user 'root'.
[AMXAdminTask] 03 Oct 2023 22:39:06  INFO - Executing action 'add' for 1 objects from data file 'C:\ProgramData\CONFIGAMXBPM432\tibco\data\admin\amxadmin432\samples\resourceinstance_data.xml'
[AMXAdminTask] 03 Oct 2023 22:39:08  INFO - TIBCO-AMX-CLI-000962: Getting entrprise information before executing action 'add'
[AMXAdminTask] 03 Oct 2023 22:39:08  INFO - ---------------------------------------------------------------------------------
[AMXAdminTask] 03 Oct 2023 22:39:09  INFO - Admin Info:
[AMXAdminTask] 03 Oct 2023 22:39:09  INFO -     Time for which Admin is up: 1 days, 4 hours, 2 minutes, 13 seconds
[AMXAdminTask] 03 Oct 2023 22:39:09  INFO -     Time taken for Admin to start up: 05 minutes, 51 seconds
[AMXAdminTask] 03 Oct 2023 22:39:09  INFO -     Time taken to ping the Database: 0.001 seconds
[AMXAdminTask] 03 Oct 2023 22:39:09  INFO -     Time taken to ping Qin Notification Server: 47ms
[AMXAdminTask] 03 Oct 2023 22:39:09  INFO -     Admin suspend state: Unsuspended
[AMXAdminTask] 03 Oct 2023 22:39:09  INFO -     Admin readOnly state: Write
[AMXAdminTask] 03 Oct 2023 22:39:09  INFO -     Admin suspend/readOnly description:
[AMXAdminTask] 03 Oct 2023 22:39:09  INFO -     Is this Admin Qin Notification Group leader: N/A
[AMXAdminTask] 03 Oct 2023 22:39:09  INFO -     Number of Notifications processed by Admin: 1727
[AMXAdminTask] 03 Oct 2023 22:39:09  INFO -     Number of Runtime Artifacts in Admin Staging Area: 1 (RDA files: 0, ZIP files: 1)
[AMXAdminTask] 03 Oct 2023 22:39:09  INFO -     Admin Entities:
[AMXAdminTask] 03 Oct 2023 22:39:09  INFO -                Entities          Total    Last Modified/Deployed On
[AMXAdminTask] 03 Oct 2023 22:39:09  INFO -                  Environments        3     05 Mar 2023 08:38:54,045
[AMXAdminTask] 03 Oct 2023 22:39:09  INFO -                         Hosts        2     05 Mar 2023 08:31:43,412
[AMXAdminTask] 03 Oct 2023 22:39:09  INFO -                         Nodes        4     26 Sep 2023 07:32:44,333
[AMXAdminTask] 03 Oct 2023 22:39:09  INFO -                  Applications       18     26 Sep 2023 07:32:44,510
[AMXAdminTask] 03 Oct 2023 22:39:09  INFO -            Resource Templates       51     03 Oct 2023 22:31:20,144
[AMXAdminTask] 03 Oct 2023 22:39:09  INFO -            Resource Instances      112                          N/A
[AMXAdminTask] 03 Oct 2023 22:39:09  INFO -         Application Templates        6     29 Aug 2023 05:27:21,406
[AMXAdminTask] 03 Oct 2023 22:39:09  INFO -
[AMXAdminTask] 03 Oct 2023 22:39:09  INFO - Enterprise [amxadmin432] summary :
[AMXAdminTask] 03 Oct 2023 22:39:09  INFO -     Number of Nodes: 4 [4 Running, 0 Not Running]
[AMXAdminTask] 03 Oct 2023 22:39:09  INFO -     Number of Hosts: 2 [2 Running, 0 Not Running]
[AMXAdminTask] 03 Oct 2023 22:39:09  INFO -     Number of Applications: 18 [10 Running, 8 Not Running, 0 Not Deployed]
[AMXAdminTask] 03 Oct 2023 22:39:09  INFO -     Number of ActiveMatrix Environments: 3
[AMXAdminTask] 03 Oct 2023 22:39:09  INFO -     Most amount of applications deployed on Node [BPMNode] ( managed by [ BPMHost]): 11
[AMXAdminTask] 03 Oct 2023 22:39:09  INFO -     Most amount of applications deployed in Environment [BPMEnvironment]: 12
[AMXAdminTask] 03 Oct 2023 22:39:09  INFO -     Most amount of Nodes managed by Host [SystemHost]: 2
[AMXAdminTask] 03 Oct 2023 22:39:09  INFO -     Most amount of Host running on Machine [na1devspehin01.dev.tibco.com]: 2
[AMXAdminTask] 03 Oct 2023 22:39:09  INFO -     Most amount of Node running on Machine [na1devspehin01.dev.tibco.com]: 4
[AMXAdminTask] 03 Oct 2023 22:39:09  INFO -     Most amount of applications deployed on Machines [na1devspehin01.dev.tibco.com]: 18
[AMXAdminTask] 03 Oct 2023 22:39:09  INFO -     CPU and Memory are not collected.
[AMXAdminTask] 03 Oct 2023 22:39:09  INFO -
[AMXAdminTask] 03 Oct 2023 22:39:09  INFO - ---------------------------------------------------------------------------------
[AMXAdminTask] 03 Oct 2023 22:39:09  INFO - Adding Resource Instances...
[AMXAdminTask] 03 Oct 2023 22:39:09 ERROR - TIBCO-AMX-CLI-000810: Resource template 'KB_Test' was not found in scope ''null' null', so cannot create Resource Instance 'KB_Test'.
[AMXAdminTask] 03 Oct 2023 22:39:09 ERROR - Adding Resource Instances...
[AMXAdminTask] 03 Oct 2023 22:39:09 ERROR - com.tibco.amf.admin.api.core.exception.AdminException
[AMXAdminTask] summary = Adding Resource Instances...
[AMXAdminTask]
[AMXAdminTask]  at com.tibco.amf.admin.cmdline.resinstance.AddOnNodeAction.invoke(AddOnNodeAction.java:105)
[AMXAdminTask]  at com.tibco.amf.admin.cmdline.Processor.invokeIndividualAction(Processor.java:970)
[AMXAdminTask]  at com.tibco.amf.admin.cmdline.Processor.invokeGenericAdd(Processor.java:772)
[AMXAdminTask]  at com.tibco.amf.admin.cmdline.Processor.invokeAction(Processor.java:599)
[AMXAdminTask]  at com.tibco.amf.admin.cmdline.Processor.processChild(Processor.java:495)
[AMXAdminTask]  at com.tibco.amf.admin.cmdline.Processor.process(Processor.java:344)
[AMXAdminTask]  at com.tibco.amf.admin.cmdline.Processor.processChildren(Processor.java:237)
[AMXAdminTask]  at com.tibco.amf.admin.cmdline.Processor.processChild(Processor.java:537)
[AMXAdminTask]  at com.tibco.amf.admin.cmdline.Processor.process(Processor.java:344)
[AMXAdminTask]  at com.tibco.amf.admin.cmdline.Processor.processChildren(Processor.java:237)
[AMXAdminTask]  at com.tibco.amf.admin.cmdline.Processor.processChild(Processor.java:537)
[AMXAdminTask]  at com.tibco.amf.admin.cmdline.Processor.process(Processor.java:344)
[AMXAdminTask]  at com.tibco.amf.admin.cmdline.Processor.processChildren(Processor.java:237)
[AMXAdminTask]  at com.tibco.amf.admin.cmdline.ant.AMXAdminTask.process(AMXAdminTask.java:580)
[AMXAdminTask]  at com.tibco.amf.admin.cmdline.ant.AMXAdminTask.execute(AMXAdminTask.java:325)
[AMXAdminTask]  at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
[AMXAdminTask]  at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
[AMXAdminTask]  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[AMXAdminTask]  at java.lang.reflect.Method.invoke(Method.java:498)
[AMXAdminTask]  at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
[AMXAdminTask]  at org.apache.tools.ant.Task.perform(Task.java:350)
[AMXAdminTask]  at org.apache.tools.ant.Target.execute(Target.java:449)
[AMXAdminTask]  at org.apache.tools.ant.Target.performTasks(Target.java:470)
[AMXAdminTask]  at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1391)
[AMXAdminTask]  at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
[AMXAdminTask]  at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[AMXAdminTask]  at org.apache.tools.ant.Project.executeTargets(Project.java:1254)
[AMXAdminTask]  at org.apache.tools.ant.Main.runBuild(Main.java:830)
[AMXAdminTask]  at org.apache.tools.ant.Main.startAnt(Main.java:223)
[AMXAdminTask]  at org.apache.tools.ant.launch.Launcher.run(Launcher.java:284)
[AMXAdminTask]  at org.apache.tools.ant.launch.Launcher.main(Launcher.java:101)
[AMXAdminTask]
[AMXAdminTask] 03 Oct 2023 22:39:09 ERROR - TIBCO-AMX-CLI-000019: Error invoking action add on ResourceInstance: Adding Resource Instances...

BUILD SUCCESSFUL
Total time: 7 seconds

======================================

Hence, follow the below resolution steps that will help us to overcome this error and allow us to create ResourceInstance using CLI script at a different scope.

Issue/Introduction

If we create a ResourceTemplate using CLI script, which is at application scope ResourceInstance creation, fails with "TIBCO-AMX-CLI-000810: Resource template ' was not found in scope ''null' null'" Error Message. Hence, The scope of this article is to help you to overcome this error.

Environment

All Supported Environments.

Resolution

In order to overcome this error message we need to add scopeType and applicationName in resourceinstance_data.xml to make it work.

General Format :
==============
<ResourceInstance xsi:type="amxdata:ResourceInstance"
   name="<Resource_Instance_Name>"
   resourceTemplateName="<Already_created_Resource_Template_Name>" 
   scopeType="<Scope_You_want_to_use>"
   applicationName="<Name_of_application>"/>
==============

Example Snippet from "resourceinstance_data.xml" file :
==============
<ResourceInstance xsi:type="amxdata:ResourceInstance"
   name="KB_Test"
   resourceTemplateName="KB_Test" 
   scopeType="Application"
   applicationName="amx.bpm.app"/>
==============

Once the above changes are done you can run the "resourceinstance_build.xml" script by using the ant command with the required task/action. This time it will not fail with the earlier error message and we will able to create a ResourceInstance at application scope.

Sample Command :
ant -f resourceinstance_build.xml create

Sample Output of ResourceInstance creation without any errors :
==================================
C:\ProgramData\CONFIGAMXBPM432\tibco\data\admin\amxadmin432\samples>ant -f resourceinstance_build.xml create
Buildfile: C:\ProgramData\CONFIGAMXBPM432\tibco\data\admin\amxadmin432\samples\resourceinstance_build.xml

create:
[AMXAdminTask] 04 Oct 2023 00:07:21  INFO - Initializing JSSE's crypto provider class com.sun.net.ssl.internal.ssl.Provider in default mode
[AMXAdminTask] 04 Oct 2023 00:07:21  INFO - Connecting to AMX Admin server at 'http://na1devspehin01:8124' as user 'root'.
[AMXAdminTask] 04 Oct 2023 00:07:21  INFO - Executing action 'add' for 1 objects from data file 'C:\ProgramData\CONFIGAMXBPM432\tibco\data\admin\amxadmin432\samples\resourceinstance_data.xml'
[AMXAdminTask] 04 Oct 2023 00:07:23  INFO - TIBCO-AMX-CLI-000962: Getting entrprise information before executing action 'add'
[AMXAdminTask] 04 Oct 2023 00:07:23  INFO - ---------------------------------------------------------------------------------
[AMXAdminTask] 04 Oct 2023 00:07:24  INFO - Admin Info:
[AMXAdminTask] 04 Oct 2023 00:07:24  INFO -     Time for which Admin is up: 1 days, 5 hours, 30 minutes, 28 seconds
[AMXAdminTask] 04 Oct 2023 00:07:24  INFO -     Time taken for Admin to start up: 05 minutes, 51 seconds
[AMXAdminTask] 04 Oct 2023 00:07:24  INFO -     Time taken to ping the Database: 0.001 seconds
[AMXAdminTask] 04 Oct 2023 00:07:24  INFO -     Time taken to ping Qin Notification Server: 31ms
[AMXAdminTask] 04 Oct 2023 00:07:24  INFO -     Admin suspend state: Unsuspended
[AMXAdminTask] 04 Oct 2023 00:07:24  INFO -     Admin readOnly state: Write
[AMXAdminTask] 04 Oct 2023 00:07:24  INFO -     Admin suspend/readOnly description:
[AMXAdminTask] 04 Oct 2023 00:07:24  INFO -     Is this Admin Qin Notification Group leader: N/A
[AMXAdminTask] 04 Oct 2023 00:07:24  INFO -     Number of Notifications processed by Admin: 1727
[AMXAdminTask] 04 Oct 2023 00:07:24  INFO -     Number of Runtime Artifacts in Admin Staging Area: 1 (RDA files: 0, ZIP files: 1)
[AMXAdminTask] 04 Oct 2023 00:07:24  INFO -     Admin Entities:
[AMXAdminTask] 04 Oct 2023 00:07:24  INFO -                Entities          Total    Last Modified/Deployed On
[AMXAdminTask] 04 Oct 2023 00:07:24  INFO -                  Environments        3     05 Mar 2023 08:38:54,045
[AMXAdminTask] 04 Oct 2023 00:07:24  INFO -                         Hosts        2     05 Mar 2023 08:31:43,412
[AMXAdminTask] 04 Oct 2023 00:07:24  INFO -                         Nodes        4     26 Sep 2023 07:32:44,333
[AMXAdminTask] 04 Oct 2023 00:07:24  INFO -                  Applications       18     26 Sep 2023 07:32:44,510
[AMXAdminTask] 04 Oct 2023 00:07:24  INFO -            Resource Templates       51     03 Oct 2023 22:31:20,144
[AMXAdminTask] 04 Oct 2023 00:07:24  INFO -            Resource Instances      112                          N/A
[AMXAdminTask] 04 Oct 2023 00:07:24  INFO -         Application Templates        6     29 Aug 2023 05:27:21,406
[AMXAdminTask] 04 Oct 2023 00:07:24  INFO -
[AMXAdminTask] 04 Oct 2023 00:07:24  INFO - Enterprise [amxadmin432] summary :
[AMXAdminTask] 04 Oct 2023 00:07:24  INFO -     Number of Nodes: 4 [4 Running, 0 Not Running]
[AMXAdminTask] 04 Oct 2023 00:07:24  INFO -     Number of Hosts: 2 [2 Running, 0 Not Running]
[AMXAdminTask] 04 Oct 2023 00:07:24  INFO -     Number of Applications: 18 [10 Running, 8 Not Running, 0 Not Deployed]
[AMXAdminTask] 04 Oct 2023 00:07:24  INFO -     Number of ActiveMatrix Environments: 3
[AMXAdminTask] 04 Oct 2023 00:07:24  INFO -     Most amount of applications deployed on Node [BPMNode] ( managed by [ BPMHost]): 11
[AMXAdminTask] 04 Oct 2023 00:07:24  INFO -     Most amount of applications deployed in Environment [BPMEnvironment]: 12
[AMXAdminTask] 04 Oct 2023 00:07:24  INFO -     Most amount of Nodes managed by Host [SystemHost]: 2
[AMXAdminTask] 04 Oct 2023 00:07:24  INFO -     Most amount of Host running on Machine [na1devspehin01.dev.tibco.com]: 2
[AMXAdminTask] 04 Oct 2023 00:07:24  INFO -     Most amount of Node running on Machine [na1devspehin01.dev.tibco.com]: 4
[AMXAdminTask] 04 Oct 2023 00:07:24  INFO -     Most amount of applications deployed on Machines [na1devspehin01.dev.tibco.com]: 18
[AMXAdminTask] 04 Oct 2023 00:07:24  INFO -     CPU and Memory are not collected.
[AMXAdminTask] 04 Oct 2023 00:07:24  INFO -
[AMXAdminTask] 04 Oct 2023 00:07:24  INFO - ---------------------------------------------------------------------------------
[AMXAdminTask] 04 Oct 2023 00:07:24  INFO - Adding Resource Instances...
[AMXAdminTask] 04 Oct 2023 00:07:24  INFO - TIBCO-AMX-ADMIN-030052: Resource Instance KB_Test created on Node BPMNode.
[AMXAdminTask] 04 Oct 2023 00:07:24  INFO - Action finished at 10/4/23 12:07 AM in 1.094 seconds

BUILD SUCCESSFUL
Total time: 7 seconds

==================================

Sample Admin UI screenshot for the same :
=================================
User-added image

 

 

Additional Information

support case 02211838