国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

JDK21 WARNING: A Java agent has been loaded dynamically

這篇具有很好參考價(jià)值的文章主要介紹了JDK21 WARNING: A Java agent has been loaded dynamically。希望對大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問。

背景

在做企業(yè)微信消息通知的時(shí)候,運(yùn)行項(xiàng)目,出現(xiàn)該警告。

WARNING: A Java agent has been loaded dynamically (D:\maven-repository\net\bytebuddy\byte-buddy-agent\1.14.9\byte-buddy-agent-1.14.9.jar)
WARNING: If a serviceability tool is in use, please run with -XX:+EnableDynamicAgentLoading to hide this warning
WARNING: If a serviceability tool is not in use, please run with -Djdk.instrument.traceUsage for more information
WARNING: Dynamic loading of agents will be disallowed by default in a future release

warning: a java agent has been loaded dynamically,各種各樣的問題記錄,java,開發(fā)語言

解決

warning: a java agent has been loaded dynamically,各種各樣的問題記錄,java,開發(fā)語言

經(jīng)過

查了一些資料,找到一篇英文的介紹,有想深入的小伙伴可以自己研究下。
這里貼到下面

OpenJDK’s JEP 451: Balancing Serviceability and Integrity in JVM

JEP 451, Prepare to Disallow the Dynamic Loading of Agents( 鏈接), has been completed from Target status for JDK 21. This JEP has evolved from its original intent to disallow the dynamic loading of agents into a running JVM by default to issue warnings when agents are dynamically loaded into a running JVM. The goals of this JEP include: reassessing the balance between serviceability and integrity; and ensuring that a majority of tools, which do not need to load agents dynamically, are unaffected.
(JEP 451,準(zhǔn)備禁止代理的動態(tài)加載,已從 JDK 21 的目標(biāo)狀態(tài)完成。此 JEP 已從其最初的意圖演變而來,即默認(rèn)不允許將代理動態(tài)加載到正在運(yùn)行的 JVM 中,而是在代理動態(tài)加載到正在運(yùn)行的 JVM 時(shí)發(fā)出警告。該 JEP 的目標(biāo)包括:重新評估可維護(hù)性和完整性之間的平衡;并確保大多數(shù)不需要?jiǎng)討B(tài)加載代理的工具不受影響。)

The primary goal of this proposal is to prepare for a future release of the JDK that will, by default, disallow the loading of agents into a running JVM. This change is designed to reassess the balance between serviceability, which involves ad-hoc changes to running code, and integrity, which assumes that running code is not arbitrarily changed. It is important to note that the majority of tools, which do not need to load agents dynamically, will remain unaffected by this change.
(該提案的主要目標(biāo)是為將來的 JDK 版本做準(zhǔn)備,默認(rèn)情況下,該版本將不允許將代理加載到正在運(yùn)行的 JVM 中。此更改旨在重新評估可維護(hù)性(涉及對運(yùn)行代碼的臨時(shí)更改)和完整性(假定運(yùn)行代碼未被任意更改)之間的平衡。需要注意的是,大多數(shù)不需要?jiǎng)討B(tài)加載代理的工具將不受此更改的影響。)

In JDK 21, the dynamic loading of agents is allowed, but the JVM issues a warning when it occurs. For example:
(在 JDK 21 中,允許動態(tài)加載代理,但 JVM 會在發(fā)生時(shí)發(fā)出警告。例如)

WARNING: A Java agent has been loaded dynamically (D:\maven-repository\net\bytebuddy\byte-buddy-agent\1.14.9\byte-buddy-agent-1.14.9.jar)
WARNING: If a serviceability tool is in use, please run with -XX:+EnableDynamicAgentLoading to hide this warning
WARNING: If a serviceability tool is not in use, please run with -Djdk.instrument.traceUsage for more information
WARNING: Dynamic loading of agents will be disallowed by default in a future release

To allow tools to load agents without warnings dynamically, developers must run with the -XX:+EnableDynamicAgentLoading option on the command line.
(要允許工具在沒有警告的情況下動態(tài)加載代理,開發(fā)人員必須在命令行上使用 -XX:+EnableDynamicAgentLoading 選項(xiàng)運(yùn)行。)

Agents in the Java platform are components that can alter the code of an application while it is running. They were introduced by the Java Platform Profiling Architecture in JDK 5 as a way for tools, notably profilers, to instrument classes. This means altering the code in a class so that it emits events to be consumed by a tool outside the application without otherwise changing the code’s behaviour.
(Java 平臺中的代理是可以在應(yīng)用程序運(yùn)行時(shí)更改其代碼的組件。它們是由 JDK 5 中的 Java 平臺分析體系結(jié)構(gòu)引入的,作為工具(尤其是分析器)檢測類的一種方式。這意味著更改類中的代碼,以便它發(fā)出事件以供應(yīng)用程序外部的工具使用,而無需更改代碼的行為。)

However, over time, advanced developers found use cases such as Aspect-Oriented Programming that change application behaviour in arbitrary ways. There is also nothing to stop an agent from altering code outside the application, such as code in the JDK itself. To ensure that the owner of an application approved the use of agents, JDK 5 required agents to be specified on the command line with the -javaagent or -agentlib options and loaded the agents immediately at startup. This represented an explicit grant of privileges by the application owner.
(然而,隨著時(shí)間的流逝,高級開發(fā)人員發(fā)現(xiàn)了諸如面向方面的編程之類的用例,這些用例會以任意方式改變應(yīng)用程序行為。也沒有什么可以阻止代理更改應(yīng)用程序外部的代碼,例如 JDK 本身中的代碼。為了確保應(yīng)用程序的所有者批準(zhǔn)使用代理,JDK 5 要求在命令行上使用 -javaagent 或 -agentlib 選項(xiàng)指定代理,并在啟動時(shí)立即加載代理。這表示應(yīng)用程序所有者顯式授予特權(quán)。)

Serviceability is the ability of a system operator to monitor, observe, debug, and troubleshoot an application while it runs. The Java Platform’s excellent serviceability has long been a source of pride. To support serviceability tools, JDK 6 introduced the Attach API which is not part of the Java Platform but, rather, a JDK API supported for external use. It allows a tool launched with appropriate operating-system privileges to connect to a running JVM, either local or remote, and communicate with that JVM to observe and control its operation.
(可維護(hù)性是指系統(tǒng)操作員在應(yīng)用程序運(yùn)行時(shí)對其進(jìn)行監(jiān)視、觀察、調(diào)試和故障排除的能力。長期以來,Java 平臺出色的可維護(hù)性一直是我們引以為豪的源泉。為了支持可維護(hù)性工具,JDK 6 引入了 Attach API,它不是 Java 平臺的一部分,而是支持外部使用的 JDK API。它允許以適當(dāng)?shù)牟僮飨到y(tǒng)權(quán)限啟動的工具連接到正在運(yùn)行的 JVM(本地或遠(yuǎn)程),并與該 JVM 通信以觀察和控制其操作。)

However, despite a conceptual separation of concerns between libraries and tools, some libraries provide functionality that relies upon the code-altering superpower afforded to agents. For example, a mocking library might redefine application classes to bypass business-logic invariants, while a white-box testing library might redefine JDK classes so that reflection over private fields is always permitted.
(然而,盡管庫和工具之間的關(guān)注點(diǎn)在概念上是分開的,但一些庫提供的功能依賴于為代理提供的代碼更改超級能力。例如,模擬庫可能會重新定義應(yīng)用程序類以繞過業(yè)務(wù)邏輯不變量,而白盒測試庫可能會重新定義 JDK 類,以便始終允許對私有字段進(jìn)行反射。)

Unfortunately, some libraries misuse dynamically loaded agents, leading to a loss of integrity. They use the Attach API to silently connect to the JVMs in which they run and load agents dynamically, in effect masquerading as serviceability tools. This misuse of dynamically loaded agents by libraries has led to the need for stronger measures to prevent such actions and maintain the integrity of the JVM.
(遺憾的是,某些庫濫用了動態(tài)加載的代理,導(dǎo)致完整性喪失。它們使用 Attach API 以靜默方式連接到運(yùn)行它們的 JVM,并動態(tài)加載代理程序,實(shí)際上偽裝成可維護(hù)性工具。庫對動態(tài)加載代理的這種濫用導(dǎo)致需要采取更有力的措施來防止此類行為并維護(hù) JVM 的完整性。)

The proposal aims to require the dynamic loading of agents to be approved by the application owner, moving the Java Platform closer to the long-term vision of integrity by default. In practical terms, the application owner will have to choose to allow the dynamic loading of agents via a command-line option.
(該提案旨在要求代理的動態(tài)加載必須得到應(yīng)用程序所有者的批準(zhǔn),從而使 Java 平臺更接近默認(rèn)完整性的長期愿景。實(shí)際上,應(yīng)用程序所有者必須選擇允許通過命令行選項(xiàng)動態(tài)加載代理。)

The impact of this change will be mitigated by the fact that most modern server applications are designed with redundancy, so individual nodes can be restarted with the command-line option as needed. Special cases, such as a JVM that must never be stopped for maintenance, can typically be identified in advance so that the dynamic loading of agents can be enabled from the start.
(由于大多數(shù)現(xiàn)代服務(wù)器應(yīng)用程序都設(shè)計(jì)有冗余,因此可以根據(jù)需要使用命令行選項(xiàng)重新啟動單個(gè)節(jié)點(diǎn),因此可以減輕此更改的影響。特殊情況,例如永遠(yuǎn)不能停止維護(hù)的 JVM,通??梢蕴崆白R別,以便從一開始就啟用代理的動態(tài)加載。)

This change will allow the Java ecosystem to attain the vision of integrity by default without substantially constraining serviceability. It is a significant step towards ensuring the security and reliability of applications running on the JVM. The proposal is a clear indication of OpenJDK’s commitment to enhancing the integrity of the JVM and ensuring the secure operation of Java applications.
(這一變化將允許 Java 生態(tài)系統(tǒng)在默認(rèn)情況下實(shí)現(xiàn)完整性的愿景,而不會嚴(yán)重限制可維護(hù)性。這是朝著確保在 JVM 上運(yùn)行的應(yīng)用程序的安全性和可靠性邁出的重要一步。該提案清楚地表明了 OpenJDK 致力于增強(qiáng) JVM 的完整性并確保 Java 應(yīng)用程序的安全運(yùn)行。)文章來源地址http://www.zghlxwxcb.cn/news/detail-766755.html

參考文章

  • https://www.infoq.com/news/2023/07/jep-451-balancing-serviceability/#:~:text=To%20allow%20tools%20to%20load%20agents%20without%20warnings,code%20of%20an%20application%20while%20it%20is%20running.

到了這里,關(guān)于JDK21 WARNING: A Java agent has been loaded dynamically的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • Unity尋路報(bào)錯(cuò)“SetDestination“ can only be called on an active agent that has been placed on a NavMesh.

    Unity尋路報(bào)錯(cuò)“SetDestination“ can only be called on an active agent that has been placed on a NavMesh.

    這個(gè)報(bào)錯(cuò)表示NavMeshAgent所在節(jié)點(diǎn)未放置在尋路網(wǎng)格上。出現(xiàn)這個(gè)錯(cuò)誤一般伴有 \\\"Failed to create agent because it is not close enough to the NavMesh\\\"類似警告。 表明尋路代理創(chuàng)建失敗,后續(xù)設(shè)置目的地肯定就會導(dǎo)致失敗。 出現(xiàn)此類問題需要檢查: 在調(diào)用SetDestination的時(shí)候,NavMeshAgent是否啟用

    2023年04月08日
    瀏覽(32)
  • QMimeDatabase: Error loading internal MIME data An error has been encountered at line 1 of <internal

    QMimeDatabase: Error loading internal MIME data An error has been encountered at line 1 of : Premature end of document.: Traceback (most recent call last): File “D:anacondalibsite-packageslibscanvas.py”, line 530, in paintEvent p.drawLine(self.prev_point.x(), 0, self.prev_point.x(), self.pixmap.height()) TypeError: arguments did not match any overlo

    2024年02月06日
    瀏覽(122)
  • has been compiled by a more recent version of the Java Runtime

    has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0 在導(dǎo)入gradle項(xiàng)目時(shí),需要將jdk調(diào)整到對應(yīng)的版本,參考下面的對應(yīng)關(guān)系:

    2024年01月18日
    瀏覽(24)
  • java.lang.IllegalStateException: Illegal access: this web application instance has been stopped

    java.lang.IllegalStateException: Illegal access: this web application instance has been stopped

    java.lang.IllegalStateException: Illegal access: this web application instance has been stopped already.? Could not load [org.apache.logging.log4j.core.impl.Log4jLogEvent$Builder]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access. 部署web項(xiàng)目出現(xiàn)在這個(gè)問題,其

    2024年02月16日
    瀏覽(17)
  • JDK21:Java21的新特性

    JDK21:Java21的新特性

    定于9月推出的Java21計(jì)劃現(xiàn)在包括一個(gè)關(guān)鍵封裝機(jī)制API和32位Windows端口的棄用。 Java開發(fā)工具包(JDK)21將于9月作為Oracle標(biāo)準(zhǔn)Java實(shí)現(xiàn)的下一個(gè)長期支持版本,現(xiàn)在有13個(gè)功能被正式提出,最近幾天又增加了兩個(gè)功能。 最新的提議包括密鑰封裝機(jī)制(KEM)API和32位x86 Windows端口的

    2024年02月07日
    瀏覽(24)
  • 解決java.lang.IllegalStateException: Cannot call sendError() after the response has been committed異常

    解決java.lang.IllegalStateException: Cannot call sendError() after the response has been committed異常

    相信大家自己在用spring boot寫restful風(fēng)格的接口時(shí)特別是寫文件下載或文件導(dǎo)出時(shí)會碰到j(luò)ava.lang.IllegalStateException: Cannot call sendError() after the response has been committed這樣的bug,很多人可能一臉困惑,就好奇為什么我文件都已經(jīng)可以正常導(dǎo)出了,為什么在日志中還是會出現(xiàn)這樣的報(bào)錯(cuò)

    2024年02月16日
    瀏覽(46)
  • java JDK(21)安裝

    java JDK(21)安裝

    地址:https://www.oracle.com/ 打開后往下滑找到: 傻瓜式向下執(zhí)行安裝即可 注意:cmd跳轉(zhuǎn)到j(luò)ava安裝路徑運(yùn)行以下指令安裝jre 4 測試是否安裝成功 cmd內(nèi)運(yùn)行

    2024年02月22日
    瀏覽(15)
  • warning: ignoring JAVA_HOME=D:\JDK; using bundled JDK報(bào)錯(cuò)解決

    warning: ignoring JAVA_HOME=D:\JDK; using bundled JDK報(bào)錯(cuò)解決

    warning: ignoring JAVA_HOME=D:JDK; using bundled JDK報(bào)錯(cuò)原因是因?yàn)槟鉐DK版本太低或者你的ElasticSearch版本太高降低版本即可、 我的是JDK1.8我下載的是 elasticsearch-8.7.0 改成 elasticsearch-7.6.1 就可以了 elasticsearch-7.6.1 地址:彈性搜索 7.6.1 |彈性的 (elastic.co) 歷史版本:Past Releases of Elastic Stack

    2024年02月11日
    瀏覽(26)
  • 報(bào)錯(cuò)——warning: ignoring JAVA_HOME=/home/jdk/jdk1.8.0_281; using bundled JDK

    報(bào)錯(cuò)——warning: ignoring JAVA_HOME=/home/jdk/jdk1.8.0_281; using bundled JDK

    我使用了es的8.3.0版本,但es從7.17版本以后不再支持jdk1.8了,需要進(jìn)行JDK的版本升級,或者降低es的版本。 es和jdk對比版本

    2024年02月07日
    瀏覽(19)
  • 【java】JDK21 要來了

    【java】JDK21 要來了

    不過多久,JDK 21 馬上就出來了,看來 Java 這幾年真的是長進(jìn)了。 目前 Java 的最新穩(wěn)定版是 JDK 20,但這是個(gè)過渡版,JDK21就是 LTS 版的了,也快要發(fā)布了,在今年9月份(也就是2023年9月)就要正式發(fā)布了。 但是,猜都不用猜,你肯定還在用 Java 8 吧! 如果說之前的 JDK17你還覺

    2024年02月10日
    瀏覽(21)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包