当前位置: 首页 > 知识库问答 >
问题:

更新NewRelic版本并在运行时抛出AbstractMethodError

须旭
2023-03-14
java -server -javaagent:/Users/amit.upadhyay/abcproject/abcproject-app/newrelic-stage/newrelic.jar -jar abcproject-app/target/abcproject-app-*.*.*-SNAPSHOT.jar /Users/amit.upadhyay/Downloads/abcproject.yml
ERROR StatusLogger Caught java.lang.AbstractMethodError setting feature http://xml.org/sax/features/external-general-entities to false on DocumentBuilderFactory org.apache.xerces.jaxp.DocumentBuilderFactoryImpl@e320068: java.lang.AbstractMethodError: javax.xml.parsers.DocumentBuilderFactory.setFeature(Ljava/lang/String;Z)V java.lang.AbstractMethodError: javax.xml.parsers.DocumentBuilderFactory.setFeature(Ljava/lang/String;Z)V   at com.newrelic.agent.deps.org.apache.logging.log4j.core.config.xml.XmlConfiguration.setFeature(XmlConfiguration.java:212)  at com.newrelic.agent.deps.org.apache.logging.log4j.core.config.xml.XmlConfiguration.disableDtdProcessing(XmlConfiguration.java:205)    at com.newrelic.agent.deps.org.apache.logging.log4j.core.config.xml.XmlConfiguration.newDocumentBuilder(XmlConfiguration.java:194)  at com.newrelic.agent.deps.org.apache.logging.log4j.core.config.xml.XmlConfiguration.<init>(XmlConfiguration.java:92)   at com.newrelic.agent.deps.org.apache.logging.log4j.core.config.xml.XmlConfigurationFactory.getConfiguration(XmlConfigurationFactory.java:46)   at com.newrelic.agent.deps.org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.getConfiguration(ConfigurationFactory.java:420)    at com.newrelic.agent.deps.org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.getConfiguration(ConfigurationFactory.java:347)    at com.newrelic.agent.deps.org.apache.logging.log4j.core.config.ConfigurationFactory.getConfiguration(ConfigurationFactory.java:261)    at com.newrelic.agent.deps.org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:616)  at com.newrelic.agent.deps.org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:637)  at com.newrelic.agent.deps.org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:231)    at com.newrelic.agent.deps.org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:243)  at com.newrelic.agent.deps.org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:45)   at com.newrelic.agent.deps.org.apache.logging.log4j.LogManager.getContext(LogManager.java:174)  at com.newrelic.agent.deps.org.apache.logging.log4j.LogManager.getLogger(LogManager.java:648)   at com.newrelic.agent.logging.Log4jLogger.<init>(Log4jLogger.java:68)   at com.newrelic.agent.logging.Log4jLogger.create(Log4jLogger.java:415)  at com.newrelic.agent.logging.Log4jLogManager.createRootLogger(Log4jLogManager.java:38)     at com.newrelic.agent.logging.Log4jLogManager.initializeRootLogger(Log4jLogManager.java:98)     at com.newrelic.agent.logging.Log4jLogManager.<init>(Log4jLogManager.java:34)   at com.newrelic.agent.logging.Log4jLogManager.create(Log4jLogManager.java:254)  at com.newrelic.agent.logging.AgentLogManager.createAgentLogManager(AgentLogManager.java:19)    at com.newrelic.agent.logging.AgentLogManager.<clinit>(AgentLogManager.java:9)  at com.newrelic.agent.Agent.<clinit>(Agent.java:59)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)    at java.lang.reflect.Method.invoke(Method.java:498)     at com.newrelic.bootstrap.BootstrapAgent.startAgent(BootstrapAgent.java:179)    at com.newrelic.bootstrap.BootstrapAgent.premain(BootstrapAgent.java:81)    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)    at java.lang.reflect.Method.invoke(Method.java:498)     at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386)  at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:401) ERROR StatusLogger Caught java.lang.AbstractMethodError setting feature http://xml.org/sax/features/external-parameter-entities to false on DocumentBuilderFactory org.apache.xerces.jaxp.DocumentBuilderFactoryImpl@e320068: java.lang.AbstractMethodError: javax.xml.parsers.DocumentBuilderFactory.setFeature(Ljava/lang/String;Z)V java.lang.AbstractMethodError: javax.xml.parsers.DocumentBuilderFactory.setFeature(Ljava/lang/String;Z)V     at com.newrelic.agent.deps.org.apache.logging.log4j.core.config.xml.XmlConfiguration.setFeature(XmlConfiguration.java:212)  at com.newrelic.agent.deps.org.apache.logging.log4j.core.config.xml.XmlConfiguration.disableDtdProcessing(XmlConfiguration.java:206)    at com.newrelic.agent.deps.org.apache.logging.log4j.core.config.xml.XmlConfiguration.newDocumentBuilder(XmlConfiguration.java:194)  at com.newrelic.agent.deps.org.apache.logging.log4j.core.config.xml.XmlConfiguration.<init>(XmlConfiguration.java:92)   at com.newrelic.agent.deps.org.apache.logging.log4j.core.config.xml.XmlConfigurationFactory.getConfiguration(XmlConfigurationFactory.java:46)   at com.newrelic.agent.deps.org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.getConfiguration(ConfigurationFactory.java:420)    at com.newrelic.agent.deps.org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.getConfiguration(ConfigurationFactory.java:347)    at com.newrelic.agent.deps.org.apache.logging.log4j.core.config.ConfigurationFactory.getConfiguration(ConfigurationFactory.java:261)    at com.newrelic.agent.deps.org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:616)  at com.newrelic.agent.deps.org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:637)  at com.newrelic.agent.deps.org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:231)    at com.newrelic.agent.deps.org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:243)  at com.newrelic.agent.deps.org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:45)   at com.newrelic.agent.deps.org.apache.logging.log4j.LogManager.getContext(LogManager.java:174)  at com.newrelic.agent.deps.org.apache.logging.log4j.LogManager.getLogger(LogManager.java:648)   at com.newrelic.agent.logging.Log4jLogger.<init>(Log4jLogger.java:68)   at com.newrelic.agent.logging.Log4jLogger.create(Log4jLogger.java:415)  at com.newrelic.agent.logging.Log4jLogManager.createRootLogger(Log4jLogManager.java:38)     at com.newrelic.agent.logging.Log4jLogManager.initializeRootLogger(Log4jLogManager.java:98)     at com.newrelic.agent.logging.Log4jLogManager.<init>(Log4jLogManager.java:34)   at com.newrelic.agent.logging.Log4jLogManager.create(Log4jLogManager.java:254)  at com.newrelic.agent.logging.AgentLogManager.createAgentLogManager(AgentLogManager.java:19)    at com.newrelic.agent.logging.AgentLogManager.<clinit>(AgentLogManager.java:9)  at com.newrelic.agent.Agent.<clinit>(Agent.java:59)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)    at java.lang.reflect.Method.invoke(Method.java:498)     at com.newrelic.bootstrap.BootstrapAgent.startAgent(BootstrapAgent.java:179)    at com.newrelic.bootstrap.BootstrapAgent.premain(BootstrapAgent.java:81)    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)    at java.lang.reflect.Method.invoke(Method.java:498)     at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386)  at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:401) ERROR StatusLogger Caught java.lang.AbstractMethodError setting feature http://apache.org/xml/features/nonvalidating/load-external-dtd to false on DocumentBuilderFactory org.apache.xerces.jaxp.DocumentBuilderFactoryImpl@e320068: java.lang.AbstractMethodError: javax.xml.parsers.DocumentBuilderFactory.setFeature(Ljava/lang/String;Z)V java.lang.AbstractMethodError: javax.xml.parsers.DocumentBuilderFactory.setFeature(Ljava/lang/String;Z)V  at com.newrelic.agent.deps.org.apache.logging.log4j.core.config.xml.XmlConfiguration.setFeature(XmlConfiguration.java:212)  at com.newrelic.agent.deps.org.apache.logging.log4j.core.config.xml.XmlConfiguration.disableDtdProcessing(XmlConfiguration.java:207)    at com.newrelic.agent.deps.org.apache.logging.log4j.core.config.xml.XmlConfiguration.newDocumentBuilder(XmlConfiguration.java:194)  at com.newrelic.agent.deps.org.apache.logging.log4j.core.config.xml.XmlConfiguration.<init>(XmlConfiguration.java:92)   at com.newrelic.agent.deps.org.apache.logging.log4j.core.config.xml.XmlConfigurationFactory.getConfiguration(XmlConfigurationFactory.java:46)   at com.newrelic.agent.deps.org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.getConfiguration(ConfigurationFactory.java:420)    at com.newrelic.agent.deps.org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.getConfiguration(ConfigurationFactory.java:347)    at com.newrelic.agent.deps.org.apache.logging.log4j.core.config.ConfigurationFactory.getConfiguration(ConfigurationFactory.java:261)    at com.newrelic.agent.deps.org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:616)  at com.newrelic.agent.deps.org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:637)  at com.newrelic.agent.deps.org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:231)    at com.newrelic.agent.deps.org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:243)  at com.newrelic.agent.deps.org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:45)   at com.newrelic.agent.deps.org.apache.logging.log4j.LogManager.getContext(LogManager.java:174)  at com.newrelic.agent.deps.org.apache.logging.log4j.LogManager.getLogger(LogManager.java:648)   at com.newrelic.agent.logging.Log4jLogger.<init>(Log4jLogger.java:68)   at com.newrelic.agent.logging.Log4jLogger.create(Log4jLogger.java:415)  at com.newrelic.agent.logging.Log4jLogManager.createRootLogger(Log4jLogManager.java:38)     at com.newrelic.agent.logging.Log4jLogManager.initializeRootLogger(Log4jLogManager.java:98)     at com.newrelic.agent.logging.Log4jLogManager.<init>(Log4jLogManager.java:34)   at com.newrelic.agent.logging.Log4jLogManager.create(Log4jLogManager.java:254)  at com.newrelic.agent.logging.AgentLogManager.createAgentLogManager(AgentLogManager.java:19)    at com.newrelic.agent.logging.AgentLogManager.<clinit>(AgentLogManager.java:9)  at com.newrelic.agent.Agent.<clinit>(Agent.java:59)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)    at java.lang.reflect.Method.invoke(Method.java:498)     at com.newrelic.bootstrap.BootstrapAgent.startAgent(BootstrapAgent.java:179)    at com.newrelic.bootstrap.BootstrapAgent.premain(BootstrapAgent.java:81)    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)    at java.lang.reflect.Method.invoke(Method.java:498)     at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386)  at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:401) Mar 16, 2020 01:40:38 +0530 [8698 1] com.newrelic INFO: Configuration file not found. The agent will attempt to read required values from environment variables. Mar 16, 2020 01:40:38 +0530 [8698 1] com.newrelic INFO: Using default collector host: collector.newrelic.com Mar 16, 2020 01:40:38 +0530 [8698 1] com.newrelic ERROR: Unable to start the New Relic Agent. Your application will continue to run but it will not be monitored. com.newrelic.agent.config.ConfigurationException: The agent requires an application name. Check the app_name setting in newrelic.yml    at com.newrelic.agent.config.ConfigServiceFactory.validateConfig(ConfigServiceFactory.java:64)  at com.newrelic.agent.config.ConfigServiceFactory.createConfigService(ConfigServiceFactory.java:27)

错误日志表明,我的项目中使用的Xerces版本与更新的newrelic JavaAgent中的版本之间存在冲突。在谷歌上,我发现了这两个SO链接,第一个和第二个类似的问题。根据给出的答案,我补充道

        <dependency>
            <groupId>xerces</groupId>
            <artifactId>xercesImpl</artifactId>
            <version>2.11.0</version>
        </dependency>

        <dependency>
            <groupId>xml-apis</groupId>
            <artifactId>xml-apis</artifactId>
            <version>1.4.01</version>
        </dependency>

然后这个abstractmethoderror错误就消失了。

但在再次运行时,我开始出现以下异常:com.newrelic.agent.config.ConfigurationException

Mar 16, 2020 02:37:18 +0530 [9598 1] com.newrelic INFO: Configuration file not found. The agent will attempt to read required values from environment variables.
Mar 16, 2020 02:37:18 +0530 [9598 1] com.newrelic INFO: Using default collector host: collector.newrelic.com
Mar 16, 2020 02:37:18 +0530 [9598 1] com.newrelic ERROR: Unable to start the New Relic Agent. Your application will continue to run but it will not be monitored.
com.newrelic.agent.config.ConfigurationException: The agent requires an application name. Check the app_name setting in newrelic.yml
    at com.newrelic.agent.config.ConfigServiceFactory.validateConfig(ConfigServiceFactory.java:64) ~
    at com.newrelic.agent.config.ConfigServiceFactory.createConfigService(ConfigServiceFactory.java:27) ~
    at com.newrelic.agent.service.ServiceManagerImpl.<init>(ServiceManagerImpl.java:126) ~
    at com.newrelic.agent.Agent.premain(Agent.java:279) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_222]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_222]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_222]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_222]
    at com.newrelic.bootstrap.BootstrapAgent.startAgent(BootstrapAgent.java:179) 
    at com.newrelic.bootstrap.BootstrapAgent.premain(BootstrapAgent.java:81) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_222]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_222]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_222]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_222]
    at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386) [?:1.8.0_222]
    at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:401) [?:1.8.0_222]

我想知道这里出了什么问题/缺少了什么?

共有1个答案

戈嘉慕
2023-03-14

我能够在我的项目中更新到最新的newrelic版本。似乎他们已经更新了其java代理中的Xerces版本,其中版本大于5.0.0。在更新Xerces版本的修复程序的同时,我需要将newrelic配置文件显式地作为系统属性传递,以解析ConfigurationException

总体摘要:-将这些库更新为

        <dependency>
            <groupId>xerces</groupId>
            <artifactId>xercesImpl</artifactId>
            <version>2.11.0</version>
        </dependency>

        <dependency>
            <groupId>xml-apis</groupId>
            <artifactId>xml-apis</artifactId>
            <version>1.4.01</version>
        </dependency>

并将newrelic配置文件作为系统属性传递:

-Dnewrelic.config.file=./${NEW_RELIC_DIR_NAME}/newrelic.yml
 类似资料:
  • 我只是试图让我的节点应用程序上的新遗迹跟踪工作(http://newrelic.com/nodejs),但是我得到以下错误: 根据newrelic,节点正在登录到同一目录。然而,在我看来,这似乎是试图登录到根目录?! 在服务器根目录中手动创建文件可以正常工作。然而,这不是我喜欢做的。这是虫子吗? 如何设置日志路径?

  • 今天,我更新到bumblebee android版本,创建了一个新项目,并导入了一些库,包括dagger hilt。内置。gradle(模块)i插入: 而且是内置的。gradle(项目)我插入: 但android studio构建失败: 生成文件'H:\AndroidProject\WMTworkManagerToList\Build。格拉德尔线:7 插件[id:'dagger.hilt.andr

  • 当我运行junit测试时,控制台打印此异常: 基本测试对象如下 而 JUnit 方法就像这样: 我的项目是JavaEE项目,使用maven管理lib,使用spring-manage-beans。 我的开发环境是: Mac OS X Yosetime 10.10.4 EclipseJavaEE IDE for Web Developers(版本:Mars Release(4.5.0)) Maven插

  • null 现在我只想在我的目录中测试命令: 我得到了这个: 失败:生成失败,出现异常。*错误:Java.lang.unsupportedClassVersionError:org/javamodularity/modulePlugin/moduleSystemPlugin是由最新版本的Java运行时(类文件版本55.0)编译的,此版本的Java运行时只识别类文件版本高达52.0 我使用SDKMAN

  • 问题内容: 我正在运行Travis构建,构建mysql:5.7.27 docker映像时失败。Dockerfile运行,然后出现错误。 使用curl我可以看到它正在重定向,但是重定向到URL的结果为404。有人看到这种行为并且有补救措施吗?在debian进行更改之前,它基本上是不可修复的吗? 问题答案: 这是由于事实 由于Wheezy和Jessie最近已集成到archive.debian.org结

  • v2.0.9[2020-4-12] 修复(Fixed): 修复 MySQL 8.0 生成实体主键位置错误 e437d36 更新(Update): 连接池关闭连接, 如果连接已经断开, 异常将会被忽略 7aac80da 增强(Enhancement): v2.0.8[2020-1-18] 修复(Fixed): 修复 ws server 的 message response.finish 兼容 swo