HotswapAgent | Java unlimited redefinition of classes at runtime | Continuous Deployment library
kandi X-RAY | HotswapAgent Summary
kandi X-RAY | HotswapAgent Summary
Java unlimited runtime class and resource redefinition. Originally, the main purpose of this project was to avoid the infamous change code→restart and wait…→check development lifecycle. Lately, this schema evolved into a new paradigm in the Java world, based on the development of software in running application, that approach can be used even in a closed environment like Docker.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Equals between two objects .
- Execute the method instruction at the given index .
- Overrides the visitor to look for cast to an array type .
- handles opcodes in the opcode
- Generate the class file .
- Adds a multi - dimensional array to the stack .
- Attempt to match the given pattern
- Insert a gap into the code .
- Intersection of two lists
- Processes a branch of a given branch .
HotswapAgent Key Features
HotswapAgent Examples and Code Snippets
Community Discussions
Trending Discussions on HotswapAgent
QUESTION
TravaOpenJDK introduced a new JVM option -XX:HotswapAgent in version 11.0.9.
There are three modes to enable HotswapAgent, fatjar
, core
and external
.
What is the difference between fatjar
and core
?
ANSWER
Answered 2021-Jan-02 at 14:47Because this answer is hidden in a closed issue as @papaya said, i leave it here as reference
HotswapAgent core has no plugin except core JVM plugins. Then it is faster since less scanning tasks are necessary to be done, less class copying to target classloaders, there is no need to disable plugins. You choose only what you want.
Loaded plugins are visible in the log, "HOTSWAP AGENT: 15:43:42.059 INFO (org.hotswap.agent.config.PluginRegistry) - Discovered plugins:"
For core
: Hotswapper, WatchResources, AnonymousClassPatch, ClassInitPlugin, JdkPlugin
For fatjar
: dkPlugin, Hotswapper, WatchResources, ClassInitPlugin, AnonymousClassPatch, Hibernate, Hibernate3JPA, Hibernate3, Spring, Jersey1, Jersey2, Jetty, Tomcat, ZK, Logback, Log4j2, MyFaces, Mojarra, Omnifaces, ELResolver, WildFlyELResolver, OsgiEquinox, Owb, Proxy, WebObjects, Weld, JBossModules, ResteasyRegistry, Deltaspike, GlassFish, Vaadin, Wicket, CxfJAXRS, FreeMarker, Undertow, MyBatis
QUESTION
I am building a desktop application. I am using ProGuard with the following config:
...ANSWER
Answered 2020-Aug-13 at 16:35You have the line ${java.home}/lib/rt.jar
in your configuration for proguard. This is no longer valid in JDK11 as it was removed in that version of Java.
QUESTION
I am using Hot Code Replace feature when Tomcat is running from eclipse and it works great.
But, how can I do this manually when Tomcat is running outside eclipse?
After some searching, I have found that I need to use an agent like HotswapAgent. But, they are using this agent with modified JDK called DCEVM. I don't want to use modified JDK. I want to achieve the same thing with OpenJDK.
I know that modification will be limited to method body only but, that's not a problem for me. How can I achieve the exact same thing eclipse is doing for Hot Code Replace for an externally running Tomcat without using IDE?
Edit : Eclipse example is just to clarify what I want to achieve. I do not want to use eclipse at all. I just want to do Hot Code Replace in an application running in Tomcat.
...ANSWER
Answered 2020-Apr-05 at 22:19Yes, it's possible to perform Hot Code Replace in a running JVM. This involves several steps.
- Prepare (compile) the new version of classes you want to replace. Let's say, you want to replace
org.pkg.MyClass
, and the new version of this class is located at/new/path/org/pkg/MyClass.class
Create a Java Agent that uses Instrumentation API to redefine the given class. Here is how the simplest agent may look like:
QUESTION
I am trying to have a java program that is built with maven to run on a docker-compose scenario and hot reload as I make changes. I added trava-jdk libvm on top of the original libvm and added the hotswapagent lib on the proper place. It gives me what I want when I run java -version
...ANSWER
Answered 2020-Feb-04 at 12:57I don't have an experience of working with this concrete hotswap agent, but in general to answer your question:
- When you build the docker image, you are supposed to run your own application after all (via maven, with java -jar or in any other way) So, When you start the application process, you're supposed to make the application ready for remote debugging:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install HotswapAgent
download [latest release of DCEVM Java patch](https://github.com/dcevm/dcevm/releases) and launch the installer (e.g. java -jar installer-light.jar). Currently, you need to select the correct installer for Java major version (7/8).
select java installation directory on your disc and press "Install DCEVM as altjvm" button. Java 1.7+ versions are supported.
download [latest release of Hotswap agent jar](https://github.com/HotswapProjects/HotswapAgent/releases), unpack hotswap-agent.jar and put it anywhere on your disc. For example: C:\java\hotswap-agent.jar
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page