title: Tomcat Error. ajp_service::jk_ajp_common.c ajp_send_request::jk_ajp_common.c
body: <p>I have a small tomcat 9 error. But I can't find it. Can someone make a small review of the following lines?</p>
  <p><strong>This is: Error</strong></p>
  <pre><code>[Fri Jun 26 13:22:39.019 2020] [783:140640154666752] [info] ajp_connect_to_endpoint::jk_ajp_common.c (1065): (local_worker_1) Failed opening socket to (::1:8009) (errno=111)
  [Fri Jun 26 13:22:39.019 2020] [783:140640154666752] [error] ajp_send_request::jk_ajp_common.c (1725): (local_worker_1) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=111)
  [Fri Jun 26 13:22:39.019 2020] [783:140640154666752] [info] ajp_service::jk_ajp_common.c (2775): (local_worker_1) sending request to tomcat failed (recoverable), because of error during request sending (attempt=2)
  [Fri Jun 26 13:22:39.019 2020] [783:140640154666752] [error] ajp_service::jk_ajp_common.c (2796): (local_worker_1) connecting to tomcat failed (rc=-3, errors=3, client_errors=0).
  [Fri Jun 26 13:22:39.019 2020] [783:140640154666752] [info] jk_handler::mod_jk.c (2991): Service error=-3 for worker=local_worker_1
  </code></pre>
  <p><strong>This is: mod_jd.log</strong></p>
  <pre><code>[Sat Jun 27 05:09:48.423 2020] [8540:139826577745664] [info] ajp_connect_to_endpoint::jk_ajp_common.c (1065): (local_worker_1) Failed opening socket to (::1:8009) (errno=111)
  [Sat Jun 27 05:09:48.423 2020] [8540:139826577745664] [error] ajp_send_request::jk_ajp_common.c (1725): (local_worker_1) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=111)
  [Sat Jun 27 05:09:48.423 2020] [8540:139826577745664] [info] ajp_service::jk_ajp_common.c (2775): (local_worker_1) sending request to tomcat failed (recoverable), because of error during request sending (attempt=2)
  [Sat Jun 27 05:09:48.423 2020] [8540:139826577745664] [error] ajp_service::jk_ajp_common.c (2796): (local_worker_1) connecting to tomcat failed (rc=-3, errors=4, client_errors=0).
  [Sat Jun 27 05:09:48.423 2020] [8540:139826577745664] [info] jk_handler::mod_jk.c (2991): Service error=-3 for worker=local_worker_1
  </code></pre>
  <p><strong>This is: catalina.out</strong></p>
  <pre><code>[2020-06-27 05:12:40] [crit] Failed to start component [Connector[AJP/1.3-8009]]
  [2020-06-27 05:12:40] [crit] org.apache.catalina.LifecycleException: Protocol handler start failed
  [2020-06-27 05:12:40] [crit]     at org.apache.catalina.connector.Connector.startInternal(Connector.java:1038)
  [2020-06-27 05:12:40] [crit]     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
  [2020-06-27 05:12:40] [crit]     at org.apache.catalina.core.StandardService.startInternal(StandardService.java:438)
  [2020-06-27 05:12:40] [crit]     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
  [2020-06-27 05:12:40] [crit]     at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930)
  [2020-06-27 05:12:40] [crit]     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
  [2020-06-27 05:12:40] [crit]     at org.apache.catalina.startup.Catalina.start(Catalina.java:633)
  [2020-06-27 05:12:40] [crit]     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  [2020-06-27 05:12:40] [crit]     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  [2020-06-27 05:12:40] [crit]     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  [2020-06-27 05:12:40] [crit]     at java.base/java.lang.reflect.Method.invoke(Method.java:566)
  [2020-06-27 05:12:40] [crit]     at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:343)
  [2020-06-27 05:12:40] [crit]     at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:478)
  [2020-06-27 05:12:40] [crit] Caused by: java.lang.IllegalArgumentException: The AJP Connector is configured with secretRequired=&quot;true&quot; but the secret attribute is either null or &quot;&quot;. This combination is not valid.
  [2020-06-27 05:12:40] [crit]     at org.apache.coyote.ajp.AbstractAjpProtocol.start(AbstractAjpProtocol.java:264)
  [2020-06-27 05:12:40] [crit]     at org.apache.catalina.connector.Connector.startInternal(Connector.java:1035)
  </code></pre>
  <p><strong>This is: /etc/tomcat9/tomcat-users.xml</strong></p>
  <pre><code>&lt;?xml version='1.0' encoding='UTF-8'?&gt;
  &lt;tomcat-users&gt;
  &lt;role rolename=&quot;manager&quot;/&gt;
  &lt;role rolename=&quot;tomcat&quot;/&gt;
  &lt;role rolename=&quot;admin&quot;/&gt;
  &lt;role rolename=&quot;role1&quot;/&gt;
  &lt;role rolename=&quot;admin-gui&quot;/&gt;
  &lt;role rolename=&quot;manager-gui&quot;/&gt;
  &lt;role rolename=&quot;manager-script&quot;/&gt;
  &lt;user username=&quot;xxx&quot; password=&quot;xxx&quot; roles=&quot;admin-gui,manager-gui,manager-script&quot;/&gt;
  &lt;/tomcat-users&gt;
  </code></pre>
  <p><strong>This is: /etc/tomcat9/server.xml</strong></p>
  <pre><code>&lt;Connector port=&quot;8009&quot; protocol=&quot;AJP/1.3&quot; redirectPort=&quot;8443&quot;
  maxThreads=&quot;3000&quot; minSpareThreads=&quot;50&quot;
  connectionTimeout=&quot;45000&quot; /&gt;
  </code></pre>
  <p><strong>This is: /etc/libapache2-mod-jk/workers.properties</strong></p>
  <pre><code>workers.tomcat_home=/usr/share/tomcat9
  workers.java_home=/usr/lib/jvm/java-11-openjdk-amd64
  ps=/
  worker.list=local_worker_1,jkstatus
  worker.loadbalancer.type=lb
  worker.loadbalancer.balance_workers=local_worker_1
  worker.local_worker_1.port=8009
  worker.local_worker_1.host=localhost
  worker.local_worker_1.type=ajp13
  worker.local_worker_1.lbfactor=1
  worker.jkstatus.type=status
  </code></pre>
  <p><strong>This is: Java version</strong></p>
  <pre><code>root@main:/var/log/apache2# cd /usr/lib/jvm/
  root@main:/usr/lib/jvm# ll
  total 16K
  drwxr-xr-x 46 root root 4.0K Jun 26 09:47 ..
  drwxr-xr-x  3 root root 4.0K Jun 26 09:47 .
  drwxr-xr-x  7 root root 4.0K Jun 26 09:47 java-11-openjdk-amd64
  -rw-r--r--  1 root root 2.0K Apr 20 00:13 .java-1.11.0-openjdk-amd64.jinfo
  lrwxrwxrwx  1 root root   21 Apr 20 00:13 java-1.11.0-openjdk-amd64 -&gt; java-11-openjdk-amd64
  lrwxrwxrwx  1 root root   25 Dec 30  2018 default-java -&gt; java-1.11.0-openjdk-amd64
  </code></pre>
  <p><em><strong>Update</strong></em>
  After adding <code>secretRequired=&quot;false&quot;</code> to server.xml the mod_jk.log was:</p>
  <pre><code>[Sat Jun 27 05:31:30.947 2020] [8539:139826619709184] [info] jk_open_socket::jk_connect.c (816): connect to ::1:8009 failed (errno=111)
  [Sat Jun 27 05:31:30.947 2020] [8539:139826619709184] [info] ajp_connect_to_endpoint::jk_ajp_common.c (1065): (local_worker_1) Failed opening socket to (::1:8009) (errno=111)
  [Sat Jun 27 05:31:30.947 2020] [8539:139826619709184] [error] ajp_send_request::jk_ajp_common.c (1725): (local_worker_1) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=111)
  [Sat Jun 27 05:31:30.947 2020] [8539:139826619709184] [info] ajp_service::jk_ajp_common.c (2775): (local_worker_1) sending request to tomcat failed (recoverable), because of error during request sending (attempt=1)
  [Sat Jun 27 05:31:31.047 2020] [8539:139826619709184] [info] jk_open_socket::jk_connect.c (816): connect to ::1:8009 failed (errno=111)
  [Sat Jun 27 05:31:31.047 2020] [8539:139826619709184] [info] ajp_connect_to_endpoint::jk_ajp_common.c (1065): (local_worker_1) Failed opening socket to (::1:8009) (errno=111)
  [Sat Jun 27 05:31:31.047 2020] [8539:139826619709184] [error] ajp_send_request::jk_ajp_common.c (1725): (local_worker_1) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=111)
  [Sat Jun 27 05:31:31.047 2020] [8539:139826619709184] [info] ajp_service::jk_ajp_common.c (2775): (local_worker_1) sending request to tomcat failed (recoverable), because of error during request sending (attempt=2)
  [Sat Jun 27 05:31:31.047 2020] [8539:139826619709184] [error] ajp_service::jk_ajp_common.c (2796): (local_worker_1) connecting to tomcat failed (rc=-3, errors=10, client_errors=0).
  [Sat Jun 27 05:31:31.047 2020] [8539:139826619709184] [info] jk_handler::mod_jk.c (2991): Service error=-3 for worker=local_worker_1
  </code></pre>
  <p>I changed server.xml and worker.properties port to 8007
  <strong>Ports:</strong></p>
  <pre><code>root@ub:/var/log/apache2# netstat -tulpen
  Active Internet connections (only servers)
  Proto Recv-Q Send-Q Local Address           Foreign Address         State       User       Inode      PID/Program name
  tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      0          13199      556/sshd
  tcp6       0      0 :::22                   :::*                    LISTEN      0          13201      556/sshd
  tcp6       0      0 :::443                  :::*                    LISTEN      0          68920      9527/apache2
  tcp6       0      0 :::80                   :::*                    LISTEN      0          68916      9527/apache2
  udp        0      0 0.0.0.0:68              0.0.0.0:*                           0          11862      353/dhclient
  udp        0      0 127.0.0.1:323           0.0.0.0:*                           0          12232      433/chronyd
  udp6       0      0 ::1:323                 :::*                                0          12233      433/chronyd
  </code></pre>
  <p><strong>Telnet</strong></p>
  <pre><code>root@ub:/var/log/apache2# telnet 127.0.0.1 8007
  Trying 127.0.0.1...
  Connected to 127.0.0.1.
  Escape character is '^]'.
  </code></pre>
  <p><strong>server.xml</strong>
  <a href="https://pastebin.com/YrEx1Qk6" rel="nofollow noreferrer">https://pastebin.com/YrEx1Qk6</a></p>