# Issue in Connecting Java Agent

**URL:** https://discuss.elastic.co/t/issue-in-connecting-java-agent/165839
**Category:** APM
**Created:** [January 26, 2019, 6:49am UTC](https://discuss.elastic.co/t/issue-in-connecting-java-agent/165839 "2019-01-26T06:49:18Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![jyoti\_singh](https://avatars.discourse-cdn.com/v4/letter/j/4491bb/32.png) [@jyoti\_singh](https://discuss.elastic.co/u/jyoti_singh)
#### Post date: [January 26, 2019, 6:49am UTC](https://discuss.elastic.co/t/issue-in-connecting-java-agent/165839/1 "2019-01-26T06:49:18Z")

</div>

Hello Team

I am using elasticsearch, kibana and APM server provided by elastic cloud but when i am trying to configure java agent I am getting errors.

2019-01-26 11:43:05.988 [apm-server-healthcheck] INFO co.elastic.apm.agent.report.ApmServerHealthChecker - Elastic APM server is available:  
2019-01-26 11:43:44.806 [apm-reporter] INFO co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Backing off for 0 seconds (±10%)  
2019-01-26 11:43:44.814 [apm-reporter] ERROR co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Error sending data to APM server: cannot retry due to server authentication, in streaming mode, response code is 401  
2019-01-26 11:43:44.817 [apm-reporter] WARN co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - null  
26-Jan-2019 11:44:01.311 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.  
log4j:WARN No appenders could be found for logger (com.logicaldoc.util.config.XMLBean).  
log4j:WARN Please initialize the log4j system properly.  
log4j:WARN See [http://logging.apache.org/log4j/1.2/faq.html#noconfig](http://logging.apache.org/log4j/1.2/faq.html#noconfig) for more info.  
Instantiate concrete PluginRegistry: com.logicaldoc.util.plugin.DefaultPluginRegistry  
Searching for plugins in C:\LogicalDOC-Community\tomcat\webapps\ROOT\WEB-INF\lib  
Found plugin file: logicaldoc-cmis-8.1.0-plugin.jar  
Found plugin file: logicaldoc-core-8.1.0-plugin.jar  
Found plugin file: logicaldoc-dropbox-8.1.0-plugin.jar  
Found plugin file: logicaldoc-gui-8.1.0-plugin.jar  
Found plugin file: logicaldoc-webdav-8.1.0-plugin.jar  
Found plugin file: logicaldoc-webservice-8.1.0-plugin.jar  
Succesfully registered 6 plugins  
Intialising plugins  
manifestURL: jar:file:C:\LogicalDOC-Community\tomcat\webapps\ROOT\WEB-INF\lib\logicaldoc-dropbox-8.1.0-plugin.jar!/plugin.xml  
plugin located: logicaldoc-dropbox @ jar:file:C:\LogicalDOC-Community\tomcat\webapps\ROOT\WEB-INF\lib\logicaldoc-dropbox-8.1.0-plugin.jar!/plugin.xml  
Intialising plugin: {PluginDescriptor: uid=logicaldoc-dropbox@8.1.0}  
plugin located: jar:file:C:\LogicalDOC-Community\tomcat\webapps\ROOT\WEB-INF\lib\logicaldoc-dropbox-8.1.0-plugin.jar!/plugin.xml  
Activated plugin logicaldoc-dropbox  
manifestURL: jar:file:C:\LogicalDOC-Community\tomcat\webapps\ROOT\WEB-INF\lib\logicaldoc-webservice-8.1.0-plugin.jar!/plugin.xml  
plugin located: logicaldoc-webservice @ jar:file:C:\LogicalDOC-Community\tomcat\webapps\ROOT\WEB-INF\lib\logicaldoc-webservice-8.1.0-plugin.jar!/plugin.xml  
Intialising plugin: {PluginDescriptor: uid=logicaldoc-webservice@8.1.0}  
plugin located: jar:file:C:\LogicalDOC-Community\tomcat\webapps\ROOT\WEB-INF\lib\logicaldoc-webservice-8.1.0-plugin.jar!/plugin.xml  
Activated plugin logicaldoc-webservice  
manifestURL: jar:file:C:\LogicalDOC-Community\tomcat\webapps\ROOT\WEB-INF\lib\logicaldoc-gui-8.1.0-plugin.jar!/plugin.xml  
plugin located: logicaldoc-gui @ jar:file:C:\LogicalDOC-Community\tomcat\webapps\ROOT\WEB-INF\lib\logicaldoc-gui-8.1.0-plugin.jar!/plugin.xml  
Intialising plugin: {PluginDescriptor: uid=logicaldoc-gui@8.1.0}  
plugin located: jar:file:C:\LogicalDOC-Community\tomcat\webapps\ROOT\WEB-INF\lib\logicaldoc-gui-8.1.0-plugin.jar!/plugin.xml  
Activated plugin logicaldoc-gui  
manifestURL: jar:file:C:\LogicalDOC-Community\tomcat\webapps\ROOT\WEB-INF\lib\logicaldoc-webdav-8.1.0-plugin.jar!/plugin.xml  
plugin located: logicaldoc-webdav @ jar:file:C:\LogicalDOC-Community\tomcat\webapps\ROOT\WEB-INF\lib\logicaldoc-webdav-8.1.0-plugin.jar!/plugin.xml  
Intialising plugin: {PluginDescriptor: uid=logicaldoc-webdav@8.1.0}  
plugin located: jar:file:C:\LogicalDOC-Community\tomcat\webapps\ROOT\WEB-INF\lib\logicaldoc-webdav-8.1.0-plugin.jar!/plugin.xml  
Activated plugin logicaldoc-webdav  
manifestURL: jar:file:C:\LogicalDOC-Community\tomcat\webapps\ROOT\WEB-INF\lib\logicaldoc-core-8.1.0-plugin.jar!/plugin.xml  
plugin located: logicaldoc-core @ jar:file:C:\LogicalDOC-Community\tomcat\webapps\ROOT\WEB-INF\lib\logicaldoc-core-8.1.0-plugin.jar!/plugin.xml  
Intialising plugin: {PluginDescriptor: uid=logicaldoc-core@8.1.0}  
plugin located: jar:file:C:\LogicalDOC-Community\tomcat\webapps\ROOT\WEB-INF\lib\logicaldoc-core-8.1.0-plugin.jar!/plugin.xml  
Activated plugin logicaldoc-core  
manifestURL: jar:file:C:\LogicalDOC-Community\tomcat\webapps\ROOT\WEB-INF\lib\logicaldoc-cmis-8.1.0-plugin.jar!/plugin.xml  
plugin located: logicaldoc-cmis @ jar:file:C:\LogicalDOC-Community\tomcat\webapps\ROOT\WEB-INF\lib\logicaldoc-cmis-8.1.0-plugin.jar!/plugin.xml  
Intialising plugin: {PluginDescriptor: uid=logicaldoc-cmis@8.1.0}  
plugin located: jar:file:C:\LogicalDOC-Community\tomcat\webapps\ROOT\WEB-INF\lib\logicaldoc-cmis-8.1.0-plugin.jar!/plugin.xml  
Activated plugin logicaldoc-cmis  
2019-01-26 11:44:14.902 [apm-reporter] INFO co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Backing off for 1 seconds (±10%)  
26-Jan-2019 11:45:21.133 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\LogicalDOC-Community\tomcat\webapps\ROOT] has finished in [135,208] ms  
26-Jan-2019 11:45:34.774 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]  
26-Jan-2019 11:45:34.811 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["https-jsse-nio-8443"]  
26-Jan-2019 11:45:34.823 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 148963 ms  
2019-01-26 11:45:35.859 [apm-reporter] ERROR co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Error sending data to APM server: cannot retry due to server authentication, in streaming mode, response code is 401  
2019-01-26 11:45:35.861 [apm-reporter] WARN co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - null  
2019-01-26 11:45:46.857 [apm-reporter] INFO co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Backing off for 4 seconds (±10%)  
2019-01-26 11:45:51.091 [apm-reporter] ERROR co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Error sending data to APM server: cannot retry due to server authentication, in streaming mode, response code is 401

Kindly help regarding this.

---

<div class="post-metadata">

### Author: ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)
#### Post date: [January 26, 2019, 8:59am UTC](https://discuss.elastic.co/t/issue-in-connecting-java-agent/165839/2 "2019-01-26T08:59:51Z")

</div>

Hi 🙂

Do you have a Proxy Server with basic authentication in between or are you trying to authenticate with the apm server via a secret token?

Best,  
Felix

---

<div class="post-metadata">

### Author: ![jyoti\_singh](https://avatars.discourse-cdn.com/v4/letter/j/4491bb/32.png) [@jyoti\_singh](https://discuss.elastic.co/u/jyoti_singh)
#### Post date: [January 26, 2019, 9:55am UTC](https://discuss.elastic.co/t/issue-in-connecting-java-agent/165839/3 "2019-01-26T09:55:36Z")

</div>

Hi Felix

As I mentioned above that I have launched APM from elastic cloud like elastic search and Kibana. After that I have received APM Url and Secret Token. I have used APM Server URL wherever it required but I think, I have not used the secret token properly. Can you please guide regarding that.

And I have a doubt regarding APM Server i.e. If I am launching APM from elastic clound :-- Do i need to make any manual configuration to run APM server properly.

Thanks in Advance.  
Jyoti Singh

---

<div class="post-metadata">

### Author: ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)
#### Post date: [January 26, 2019, 10:31am UTC](https://discuss.elastic.co/t/issue-in-connecting-java-agent/165839/4 "2019-01-26T10:31:33Z")

</div>

Ah, got it. This is the configuration for the secret token: [https://www.elastic.co/guide/en/apm/agent/java/current/config-reporter.html#config-secret-token](https://www.elastic.co/guide/en/apm/agent/java/current/config-reporter.html#config-secret-token)

You can find your secret token in the APM tab of your cloud deployment.

---

<div class="post-metadata">

### Author: ![jyoti\_singh](https://avatars.discourse-cdn.com/v4/letter/j/4491bb/32.png) [@jyoti\_singh](https://discuss.elastic.co/u/jyoti_singh)
#### Post date: [January 26, 2019, 12:20pm UTC](https://discuss.elastic.co/t/issue-in-connecting-java-agent/165839/5 "2019-01-26T12:20:49Z")

</div>

Hi Felix

Thanks for your support. Now everything is working fine and I am able to monitor my process.

Regards  
Jyoti Singh

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [February 16, 2019, 8:20am UTC](https://discuss.elastic.co/t/issue-in-connecting-java-agent/165839/6 "2019-02-16T08:20:49Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
