title: zabbix server can't connect to java gateway
body: <p>I have installed zabbix server and java gateway in same linux server and started zabbix-server and zabbix-java-gateway service. the OS is CentOS 6.5, java is JDK1.6.0_45, IP is 192.98.12.240, zabbix server and zabbix java gateway version is 2.2.9. I have stop iptables service.</p>
  
  <p>Then in zabbix web console, I added a host that enabled jmx interface. My host IP is 192.98.12.198 and JMX post is 9999. In Jconsole, I can connect to this JMX enabled java application. But in zabbix web console, it show error:</p>
  
  <p><img src="https://i.stack.imgur.com/driNy.png" alt="enter image description here"></p>
  
  <p>below are my zabbix_server.conf</p>
  
  <pre><code>LogFile=/var/log/zabbix/zabbix_server.log
  LogFileSize=0
  DebugLevel=4
  PidFile=/var/run/zabbix/zabbix_server.pid
  DBHost=localhost
  DBName=zabbix
  DBUser=zabbix
  DBPassword=zabbix
  DBSocket=/var/lib/mysql/mysql.sock
  JavaGateway=192.98.12.240
  JavaGatewayPort=10052
  StartJavaPollers=5
  SNMPTrapperFile=/var/log/snmptt/snmptt.log
  AlertScriptsPath=/usr/lib/zabbix/alertscripts
  ExternalScripts=/usr/lib/zabbix/externalscripts
  </code></pre>
  
  <p>below are my zabbix_java_gateway.conf</p>
  
  <pre><code>LISTEN_IP=192.98.12.240
  LISTEN_PORT=10052
  PID_FILE="/var/run/zabbix/zabbix_java.pid"
  START_POLLERS=5
  </code></pre>
  
  <p>below are some snippes of zabbix_server.log</p>
  
  <pre><code>13573:20150321:100114.503 In substitute_key_macros() data:'jmx[java.lang:type=Memory,HeapMemoryUsage.used]'
  13573:20150321:100114.503 End of substitute_key_macros():SUCCEED data:'jmx[java.lang:type=Memory,HeapMemoryUsage.used]'
  13573:20150321:100114.503 In substitute_simple_macros() data:'9999'
  13573:20150321:100114.503 In substitute_simple_macros() data:EMPTY
  13573:20150321:100114.503 In substitute_simple_macros() data:EMPTY
  13573:20150321:100114.503 In get_values_java() host:'myhost' addr:'192.98.12.198' num:1
  13573:20150321:100114.503 getting Java values failed: cannot connect to [[192.98.12.240]:10052]: [13] Permission denied
  13573:20150321:100114.503 End of get_values_java()
  13573:20150321:100114.503 In deactivate_host() hostid:10106 itemid:23899 type:16
  13573:20150321:100114.503 query [txnlev:1] [begin;]
  13573:20150321:100114.503 query [txnlev:1] [update hosts set jmx_disable_until=1426903334,jmx_error='cannot connect to [[192.98.12.240]:10052]: [13] Permission denied' where hostid=10106]
  13573:20150321:100114.504 query [txnlev:1] [commit;]
  13573:20150321:100114.526 deactivate_host() errors_from:1426901309 available:2
  13573:20150321:100114.526 End of deactivate_host()
  13573:20150321:100114.526 End of get_values():1
  </code></pre>
  
  <p>below are my zabbix_java_gateway.log</p>
  
  <pre><code>2015-03-21 10:54:29.078 [main] INFO  com.zabbix.gateway.JavaGateway - Zabbix Java Gateway 2.2.9 (revision 52686) has started
  2015-03-21 10:54:29.086 [main] DEBUG c.z.gateway.ConfigurationManager - starting to parse configuration parameters
  2015-03-21 10:54:29.086 [main] DEBUG c.z.gateway.ConfigurationManager - found pidFile configuration parameter with value '/var/run/zabbix/zabbix_java.pid'
  2015-03-21 10:54:29.087 [main] DEBUG c.z.gateway.ConfigurationManager - received pidFile configuration parameter, daemonizing
  2015-03-21 10:54:29.088 [main] DEBUG c.z.gateway.ConfigurationManager - found listenIP configuration parameter with value '192.98.12.240'
  2015-03-21 10:54:29.089 [main] DEBUG c.z.gateway.ConfigurationManager - found listenPort configuration parameter with value '10052'
  2015-03-21 10:54:29.089 [main] DEBUG c.z.gateway.ConfigurationManager - found startPollers configuration parameter with value '5'
  2015-03-21 10:54:29.089 [main] DEBUG c.z.gateway.ConfigurationManager - finished parsing configuration parameters
  2015-03-21 10:54:29.092 [main] INFO  com.zabbix.gateway.JavaGateway - listening on /192.98.12.240:10052
  2015-03-21 10:54:29.097 [main] DEBUG com.zabbix.gateway.JavaGateway - created a thread pool of 5 pollers
  </code></pre>
  
  <p>Please Help and Thanks.</p>
  
  <p>ps: I had changed JavaGateway in zabbix_server.conf to localhost or 127.0.0.1, I didn't work too.</p>