gpt4 book ai didi

java - [Azure][适用于 Java 的 Application Insights 代理]java.lang.NoClassDefFoundError : http/RequestLine

转载 作者:行者123 更新时间:2023-12-01 09:16:16 24 4
gpt4 key购买 nike

使用 applicationinsights-agent-1.0.6.jar 作为代理启动 Jetty 后(请参阅 https://github.com/Azure/azure-content/blob/master/articles/application-insights/app-insights-java-agent.md ),我得到以下堆栈跟踪。删除代理并删除堆栈跟踪。

我不明白为什么它会遇到“java.lang.NoClassDefFoundError: http/RequestLine”,我找不到这个类......

有人有同样的问题吗?

    java.lang.NoClassDefFoundError: http/RequestLine
at org.apache.http.impl.client.HttpClientBuilder.build(HttpClientBuilder.java:1231)
at com.microsoft.applicationinsights.internal.channel.common.ApacheSender43.<init>(ApacheSender43.java:52)
at com.microsoft.applicationinsights.internal.channel.common.ApacheSenderFactory.create(ApacheSenderFactory.java:40)
at com.microsoft.applicationinsights.internal.channel.common.TransmissionNetworkOutput.<init>(TransmissionNetworkOutput.java:95)
at com.microsoft.applicationinsights.internal.channel.common.TransmissionNetworkOutput.create(TransmissionNetworkOutput.java:85)
at com.microsoft.applicationinsights.channel.concrete.inprocess.InProcessTelemetryChannelFactory.create(InProcessTelemetryChannelFactory.java:41)
at com.microsoft.applicationinsights.channel.concrete.inprocess.InProcessTelemetryChannel.initialize(InProcessTelemetryChannel.java:263)
at com.microsoft.applicationinsights.channel.concrete.inprocess.InProcessTelemetryChannel.<init>(InProcessTelemetryChannel.java:147)
at com.microsoft.applicationinsights.internal.config.TelemetryConfigurationFactory.setChannel(TelemetryConfigurationFactory.java:396)
at com.microsoft.applicationinsights.internal.config.TelemetryConfigurationFactory.initialize(TelemetryConfigurationFactory.java:102)
at com.microsoft.applicationinsights.TelemetryConfiguration.getActive(TelemetryConfiguration.java:74)
at com.microsoft.applicationinsights.TelemetryClient.<init>(TelemetryClient.java:75)
at com.microsoft.applicationinsights.internal.common.LogTelemetryClientProxy.<init>(LogTelemetryClientProxy.java:72)
at com.microsoft.applicationinsights.log4j.v1_2.ApplicationInsightsAppender.activateOptions(ApplicationInsightsAppender.java:103)
at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:307)
at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:295)
at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:176)
at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:191)
at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:523)
at org.apache.log4j.xml.DOMConfigurator.parseRoot(DOMConfigurator.java:492)
at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:1006)
at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:872)
at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:755)
at org.apache.log4j.xml.XMLWatchdog.doOnChange(DOMConfigurator.java:1125)
at org.apache.log4j.helpers.FileWatchdog.checkAndConfigure(FileWatchdog.java:89)
at org.apache.log4j.helpers.FileWatchdog.<init>(FileWatchdog.java:58)
at org.apache.log4j.xml.XMLWatchdog.<init>(DOMConfigurator.java:1117)
at org.apache.log4j.xml.DOMConfigurator.configureAndWatch(DOMConfigurator.java:735)
at org.apache.log4j.xml.DOMConfigurator.configureAndWatch(DOMConfigurator.java:718)

命令行

    java -Djetty.home=/opt/servers/jetty -Djetty.base=/opt/servers/jetty-base  -Djava.awt.headless=true -Dfile.encoding=UTF-8  -javaagent:/opt/servers/jetty-base/lib/ext/applicationinsights-agent-1.0.6.jar -Djava.net.preferIPv4Stack=true -cp /opt/servers/jetty/start.jar org.eclipse.jetty.start.Main &

最佳答案

根据异常java.lang.NoClassDefFoundError ,这意味着命令行中缺少一些依赖库,例如 httpclient

要解决这个问题,您需要下载zip file来自 page 的 Application Insights SDK for Java ,并将它们与 : 分隔符附加到选项 -cp 的尾部。

如有任何疑问,请随时告诉我。

关于java - [Azure][适用于 Java 的 Application Insights 代理]java.lang.NoClassDefFoundError : http/RequestLine,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40524108/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com