Domain Hawkagent is throwing 'java.io.FileNotFoundException: null/hawkagent.cfg (No such file or directory)' exception.

Domain Hawkagent is throwing 'java.io.FileNotFoundException: null/hawkagent.cfg (No such file or directory)' exception.

book

Article ID: KB0077957

calendar_today

Updated On:

Products Versions
TIBCO Runtime Agent (TRA) 5.11, 5.10, 5.9. 5.8, 5.7

Description

Domain Hawkagent is throwing 'java.io.FileNotFoundException: null/hawkagent.cfg (No such file or directory)' exception in nohup.out or the console where hawkagent is started.

Here is the error from nohup.out or the console where hawkagent is started:
-----------------------------------------------------------------
java.io.FileNotFoundException: null/hawkagent.cfg (No such file or directory)
        at java.io.FileInputStream.open0(Native Method)
        at java.io.FileInputStream.open(FileInputStream.java:195)
        at java.io.FileInputStream.<init>(FileInputStream.java:138)
        at java.io.FileInputStream.<init>(FileInputStream.java:93)
        at com.tibco.tra.tsm.TSM.updateHawkagentCfg(TSM.java:1782)
        at com.tibco.tra.tsm.TSM.initializeMicroAgent(TSM.java:1729)
        at COM.TIBCO.hawk.agent.macollection.MicroAgentContainerServer.addMicroAgent(MicroAgentContainerServer.java:452)
-----------------------------------------------------------------

And below is the error in Hawk.log:
-----------------------------------------------------------------
2019 Jun 15 12:15:21:033 GMT -07:00 HawkAgent.test Error [Application] HWKAGT-060102 An error while loading microagent from com.tibco.tra.tsm.TSM: java.lang.NullPointerException
2019 Jun 15 12:15:21:035 GMT -07:00 HawkAgent.testError [Application] HWKAGT-060102 java.lang.NullPointerException
        at com.tibco.tra.tsm.TSM.initializeMicroAgent(TSM.java:1746)
        at COM.TIBCO.hawk.agent.macollection.MicroAgentContainerServer.addMicroAgent(MicroAgentContainerServer.java:452)
        at COM.TIBCO.hawk.agent.maloader.MALoader.loadMicroAgent(MALoader.java:65)
-----------------------------------------------------------------

Cause:

In general, the above exception can be seen when a 'custom' microagent is added after the TSM microagent.  For Example:
-----------------------------------------------------------------
-M com.tibco.tra.tsm.TSM

-M CustomMicroAgent

-hawk_domain test
-rvd_session 7474 ; tcp:7474
-ami_rvd_session 7475 ; tcp:7474
​​​​​​​-----------------------------------------------------------------

The properties including hawk_domain, rvd_session and ami_rvd_session belong to "-M com.tibco.tra.tsm.TSM", However, Hawkagent will treat these properties belong to "-M CustomMicroAgent" if add Custom microagnet after TSM microagent. Hawkagent will throw NPE when TSM microagnet is not able to get these properties and values.

Issue/Introduction

Domain Hawkagent is throwing 'java.io.FileNotFoundException: null/hawkagent.cfg (No such file or directory)' exception.

Environment

All platform

Resolution

Add the 'Custom' microagent before 'TSM' microagent then restart domain hawkagent.

Example:

----------------------------------------------------------------
-M CustomMicroAgent

-M com.tibco.tra.tsm.TSM
-hawk_domain test
-rvd_session 7474 ; tcp:7474
-ami_rvd_session 7475 ; tcp:7474
----------------------------------------------------------------
Refer to KB Article: 000015483  for more details on adding 'Custom' & 'Logfile' microAgents.