TravaOpenJDK / trava-jdk-11-dcevm

dcevm-11 built on Travis
Apache License 2.0
407 stars 56 forks source link

How to disable certain plugins? #34

Closed dermoritz closed 2 years ago

dermoritz commented 4 years ago

I ran into that issue: https://github.com/HotswapProjects/HotswapAgent/issues/339 or https://github.com/HotswapProjects/HotswapAgent/issues/373

Hotswap agen throws errors on start and on swap regarding Hibernate plugin. I am using the Trava JDK to run my stuff. How can i disable the Hibernate plugin (normally disabled "-javaagent: .... hotswap-agent.jar=disablePlugin=Hibernate") but running with Trava the agent is set implicitly?

Is there another fix or workaround for this issue?

skybber commented 4 years ago

Fast fix is to use -XX:HotswapAgent=external and supply your agent

skybber commented 4 years ago

Another option (more tricky) is to modify hotswap-agent.properties in hotswap-agent.jar and set:

disabledPlugins=${disabled.plugins}

${disabled.plugins} is replaced by value passed via -D option, hence you can use -Ddisabled.plugins=Hibernate

or you can set disabledPlugins=Hibernate directly in hotswap-agent.properties, but it is not so flexible. We have to consider passing system properties as default values in hotswap-agent.properties for the next release.

MuizMahdi commented 3 years ago

+1 for passing system properties

kjerinsky commented 3 years ago

Another option (more tricky) is to modify hotswap-agent.properties in hotswap-agent.jar and set:

Depending on which version you are using, instead of modifying the jar you can add your own hotswap-agent.properties inside your resources directory:

(optional) create a file named “hotswap-agent.properties” inside your resources directory, see available properties and default values: https://github.com/HotswapProjects/HotswapAgent/blob/master/hotswap-agent-core/src/main/resources/hotswap-agent.properties

http://hotswapagent.org/mydoc_quickstart-jdk11.html

skybber commented 2 years ago

I'm closing it. Solution is to use hotswap-agent.properties in application resources or use modular hotswap agent