Seven Stars

KARAF_OPTS in wrapper

I was running my ESB based REST webservices directly using "start/ trun".


I recently setup the "wrapper" so that I can run the it as an OS service. I had set certain KARAF_OPTS in setenv.bat earlier. However, the KARAF_OPTS no longer take into effect since I moved to the wrapper.

How does one set "KARAF_OPTS" while running the ESB service as a wrapper?


I have tried the following in container\etc\myservice.conf:

set.KARAF_OPTS="-Dcontrast.appname=<MyAPP> -Dcontrast.classpath.libs=true -Dcontrast.server=<MyServer> -javaagent:E:/contrast.jar"<MyAPP> -Dcontrast.classpath.libs=true -Dcontrast.server=<MyServer> -javaagent:E:/contrast.jar

None of these worked. Any help is appreciated.


Re: KARAF_OPTS in wrapper

The correct way to set system properties to Talend Runtime when installing it as an OS service (using the "wrapper") is the following (in container\etc\myservice.conf config file):<MyApp> -Dcontrast.classpath.libs=true -Dcontrast.server=<MyServer> -javaagent:D:/MyAgent.jar

For my tests I've used a different java agent. With the above configuration my agent was picked up at Talend Runtime start and also the other properties were correctly added.


You can inspect the system properties using:



Seven Stars

Re: KARAF_OPTS in wrapper

@ ipop-talend : I have no clue why the java agent I am using is not triggered. I did validate that the agent works perfectly when doing a "trun" executable.
Anything else I can try/ check?

Re: KARAF_OPTS in wrapper

You can use jconsole to inspect the VM arguments and Class path in the VM Summary tab. There you should identify if your agent and parameters are set properly.


If you still have the default configuration of Karaf, you can use the following service URL for the JMXConnectorServer 



Username/password: karaf/karaf