Uploaded image for project: 'Spring Data GemFire'
  1. Spring Data GemFire
  2. SGF-433

Fix improper resolution of Spring property placeholders in 'locators' and 'servers' attributes on the '<gfe:pool>' element(s) in Spring XML config.

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    XMLWordPrintable

Details

    Description

      Currently, the resolution of Spring property placeholders in the <gfe:pool>, "locators" and "servers" attributes does not function properly since the logic to parse the value of a particular property placeholder is misplaced. The logic parsing the attribute values is inappropriately placed in the PoolParser.

      Specifically, the following lines of code initiate the parsing of the "locators" and "servers" attributes, respectively. This leads to the following calls for locators and servers, respectively.

      However, by the time the Thread of execution reaches the code to parse a connection, the value of the 'hostPort' combo is actually the Spring property placeholder and not the value of the property placeholder.

      This leads to the following Exception at runtime when the client attempts to connect to the server using the configured GemFire Pool...

      com.gemstone.gemfire.cache.client.NoAvailableLocatorsException: Unable to connect to any locators in the list [localhost[11235]:10334]
      	at com.gemstone.gemfire.cache.client.internal.AutoConnectionSourceImpl.findServer(AutoConnectionSourceImpl.java:136)
      	at com.gemstone.gemfire.cache.client.internal.ConnectionFactoryImpl.createClientToServerConnection(ConnectionFactoryImpl.java:206)
      	at com.gemstone.gemfire.cache.client.internal.pooling.ConnectionManagerImpl.borrowConnection(ConnectionManagerImpl.java:214)
      	at com.gemstone.gemfire.cache.client.internal.OpExecutorImpl.execute(OpExecutorImpl.java:134)
      	at com.gemstone.gemfire.cache.client.internal.OpExecutorImpl.execute(OpExecutorImpl.java:113)
      	at com.gemstone.gemfire.cache.client.internal.PoolImpl.execute(PoolImpl.java:702)
      	at com.gemstone.gemfire.cache.client.internal.GetOp.execute(GetOp.java:94)
      	at com.gemstone.gemfire.cache.client.internal.ServerRegionProxy.get(ServerRegionProxy.java:133)
      	at com.gemstone.gemfire.internal.cache.LocalRegion.findObjectInSystem(LocalRegion.java:2739)
      	at com.gemstone.gemfire.internal.cache.LocalRegion.nonTxnFindObject(LocalRegion.java:1464)
      	at com.gemstone.gemfire.internal.cache.LocalRegionDataView.findObject(LocalRegionDataView.java:133)
      	at com.gemstone.gemfire.internal.cache.LocalRegion.get(LocalRegion.java:1348)
      	at com.gemstone.gemfire.internal.cache.LocalRegion.get(LocalRegion.java:1311)
      	at com.gemstone.gemfire.internal.cache.LocalRegion.get(LocalRegion.java:1298)
      	at com.gemstone.gemfire.internal.cache.AbstractRegion.get(AbstractRegion.java:321)
              ...
      

      And more specifically...

      java.net.ConnectException: Connection refused
      	at java.net.PlainSocketImpl.socketConnect(Native Method)
      	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
      	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
      	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
      	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
      	at java.net.Socket.connect(Socket.java:579)
      	at com.gemstone.gemfire.internal.SocketUtils.connect(SocketUtils.java:88)
      	at com.gemstone.gemfire.internal.SocketUtils.connect(SocketUtils.java:60)
      	at com.gemstone.gemfire.internal.SocketCreator.connect(SocketCreator.java:1011)
      	at com.gemstone.gemfire.internal.SocketCreator.connect(SocketCreator.java:946)
      	at com.gemstone.gemfire.internal.SocketCreator.connect(SocketCreator.java:936)
      	at com.gemstone.org.jgroups.stack.tcpserver.TcpClient.getServerVersion(TcpClient.java:163)
      	at com.gemstone.org.jgroups.stack.tcpserver.TcpClient.requestToServer(TcpClient.java:90)
      	at com.gemstone.org.jgroups.stack.tcpserver.TcpClient.requestToServer(TcpClient.java:78)
      	at com.gemstone.gemfire.cache.client.internal.AutoConnectionSourceImpl.queryOneLocator(AutoConnectionSourceImpl.java:188)
      	at com.gemstone.gemfire.cache.client.internal.AutoConnectionSourceImpl.queryLocators(AutoConnectionSourceImpl.java:220)
      	at com.gemstone.gemfire.cache.client.internal.AutoConnectionSourceImpl.findServer(AutoConnectionSourceImpl.java:132)
      	at com.gemstone.gemfire.cache.client.internal.ConnectionFactoryImpl.createClientToServerConnection(ConnectionFactoryImpl.java:206)
      	at com.gemstone.gemfire.cache.client.internal.pooling.ConnectionManagerImpl.prefillConnection(ConnectionManagerImpl.java:794)
      	at com.gemstone.gemfire.cache.client.internal.pooling.ConnectionManagerImpl.prefill(ConnectionManagerImpl.java:737)
      	at com.gemstone.gemfire.cache.client.internal.pooling.ConnectionManagerImpl$PrefillConnectionsTask.run2(ConnectionManagerImpl.java:888)
      	at com.gemstone.gemfire.cache.client.internal.PoolImpl$PoolTask.run(PoolImpl.java:1249)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at java.lang.Thread.run(Thread.java:745)
      

      Attachments

        Activity

          People

            jblum John Blum
            jblum John Blum
            Archiver:
            tmarshall Trevor Marshall
            Trevor Marshall Trevor Marshall

            Dates

              Created:
              Updated:
              Resolved:
              Archived:

              Time Tracking

                Estimated:
                Original Estimate - 1d
                1d
                Remaining:
                Remaining Estimate - 1d
                1d
                Logged:
                Time Spent - Not Specified
                Not Specified