cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

This product reached the end of support date on March 31, 2021.

Java Agent injection into run-nifi batch command for Apache NiFi

miteglia
Participant

Hi Everyone,

We are trying to inject a Java agent into the start file of Apache Nifi (run-nifi.bat). Based from the Application Environment Configuration for a Java Application, below configuration string must be added to all JVMs -

-agentpath:"C:\Dynatrace 6.5\agent\lib64\dtagent.dll"=name=JavaApplication_Test,server=michele:9998

- which in this case we assume is the batch command file.

However when it is added in the run-nifi.bat batch command file, we get the following prompt:

The input line is too long

Attached is the actual file. run-nifi.txt

I'll research this prompt in the web, seems a limitation of Windows batch command. However I would also like to know if anyone else has experienced this and able to find a workaround?

Thanks in advance.

4 REPLIES 4

chase_hulderman
Inactive


Michele,


Could it be related to ordering?


SET JAVA_PARAMS=-cp %CONF_DIR%;%LIB_DIR%\* -Xms12m -Xmx24m %JAVA_ARGS% org.apache.nifi.bootstrap.RunNiFi
set BOOTSTRAP_ACTION=run
cmd.exe /K "%JAVA_EXE%" %JAVA_PARAMS% %DYNA_ARGS% %BOOTSTRAP_ACTION%

It looks like you're applying the dynatrace arguments in the wrong order.

Maybe try this:

SET JAVA_PARAMS=-cp %CONF_DIR%;%LIB_DIR%\* -Xms12m -Xmx24m %JAVA_ARGS% %DYNA_ARGS% org.apache.nifi.bootstrap.RunNiFi
set BOOTSTRAP_ACTION=run
cmd.exe /K "%JAVA_EXE%" %JAVA_PARAMS% %BOOTSTRAP_ACTION%

miteglia
Participant

Thanks, @Chase. I tried your suggestion, but still get the same output. 😞

miteglia
Participant

I even tried running the bat file in PowerShell but the same error exists. 😞

dave_mauney
Dynatrace Champion
Dynatrace Champion

I worked with a customer that added the agentpath into the bootstrap.conf file and that seems to work well.