2016-11-10 1 views
0

Après avoir lancé ma jetée avec applicationinsights-agent-1.0.6.jar en tant qu'agent (voir https://github.com/Azure/azure-content/blob/master/articles/application-insights/app-insights-java-agent.md), j'obtiens la trace de pile suivante. Supprimer l'agent supprime la trace de la pile.[Azure] [agent Application Insights pour Java] java.lang.NoClassDefFoundError: http/RequestLine

Je ne comprends pas pourquoi il dérange avec « java.lang.NoClassDefFoundError: http/RequestLine », je trouve cette classe nulle part ...

est quelqu'un a le même problème?

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) 

Ligne de commande

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 & 

Répondre

1

Selon l'exception java.lang.NoClassDefFoundError, cela signifie que certaines bibliothèques dépendantes comme httpclient ont été manqués dans la ligne de commande.

Comme pour le résoudre, vous devez télécharger le zip file de Insights application SDK pour Java à partir du page, et les ajouter avec le séparateur : à la queue de l'option -cp.

Toute préoccupation, s'il vous plaît n'hésitez pas à me le faire savoir.

+0

Oui, je comprends que NoClassDefFoundError signifie que la classe n'est pas disponible. Mais qu'est ce que la classe "http/RequestLine"? D'où vient-il? Sans l'agent, le programme est correct, avec l'agent il se plaint de la classe manquante ... –

+0

Il vient de 'org.apache.httpcomponents/httpcore', s'il vous plaît voir les liens [1] (https://hc.apache.org/ httpcomponents-core-ga/httpcore/apidocs/org/apache/http/RequestLine.html) & [2] (http://snacktrace.com/artifacts/org.apache.httpcomponents/httpcore/4.2.1/org.apache .http.RequestLine). –

+0

Oui j'ai trouvé "org.apache.http.RequestLine" mais l'erreur concerne "http.RequestLine" –