Modifying the Application Execution Command
The Application-Plugin pattern utilizes an encrypted JAR file; therefore, the `sjt-agent.jar` must be used to decrypt the encrypted content before the application starts running. This approach intercepts and modifies Java bytecode before and after class loading, enabling non-intrusive enhancement of business logic code. To implement this, you can add the `-javaagent` parameter during program startup and specify the path to `sjt-agent.jar` after the colon (`:`). This instructs the JVM to load `sjt-agent.jar` as a proxy bundle at startup, thereby completing the initialization process.
Edit the Startup Script
Modify the application startup script to include handling for sjt-agent.jar.
Original:
"$JAVA_CMD" \ -Dfile.encoding=UTF-8 \ -Djava.io.tmpdir="$TMP_DIR" \ -Dloader.path=lib/ \ -jar sdktest-2.7-Generic.jar
Modify (add a dependency for sjt_agent.jar):
"$JAVA_CMD" \ -Dfile.encoding=UTF-8 \ -Djava.io.tmpdir="$TMP_DIR" \ -javaagent:"./lib/sjt_agent.jar" \ -Dloader.path=lib/ \ -jar sdktest-2.7-Generic.jar
The modified results are shown in Figure 1.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot
