Announcement Announcement Module
Collapse
No announcement yet.
Bridge server: failed accepting client connection - client: Could not create a queue Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Bridge server: failed accepting client connection - client: Could not create a queue

    I've got a Spring configured cache-server running on a single host and a client-cache trying to connect. Communication occurs, but so does a failure.

    When the client connects, it logs:
    Code:
    [info 2012/06/13 23:05:03.659 PDT <poolTimer-locgf-pool-3> tid=0x12] Communication with locator localhost/127.0.0.1:40404 failed with java.net.SocketException: Connection reset.
    java.net.SocketException: Connection reset
    	at java.net.SocketInputStream.read(SocketInputStream.java:168)
    	at java.net.SocketInputStream.read(SocketInputStream.java:182)
    	at java.io.DataInputStream.readByte(DataInputStream.java:248)
    	at com.gemstone.gemfire.internal.InternalDataSerializer.basicReadObject(InternalDataSerializer.java:2622)
    	at com.gemstone.gemfire.DataSerializer.readObject(DataSerializer.java:3217)
    	at com.gemstone.org.jgroups.stack.tcpserver.TcpClient.requestToServer(TcpClient.java:84)
    	at com.gemstone.gemfire.cache.client.internal.AutoConnectionSourceImpl.queryOneLocator(AutoConnectionSourceImpl.java:183)
    The server is logging:
    Code:
    [warning 2012/06/13 23:05:13.644 PDT LOC GF CacheServer <Handshaker /127.0.0.1:40404 Thread 0> tid=0x2f] Bridge server: failed accepting client connection  java.io.IOException: Acceptor received unknown communication mode: 0
    The cacheserver Spring config is:
    Code:
        <!-- GemFire cache bean -->
        <gfe:cache properties-ref="props" />
        <util:properties id="props" location="cache.properties"/>
        
        <gfe:cache-server id="locgf-cacheserver" auto-startup="true"
            bind-address="${server.host}" port="${gfe.port}" host-name-for-clients="${server.host}"
            load-poll-interval="2000" max-connections="22" max-threads="16"
            max-message-count="1000" max-time-between-pings="30000"
            groups="locgf-servers">
            <gfe:subscription-config eviction-type="ENTRY" capacity="1000" disk-store="file://${java.io.tmpdir}"/>
        </gfe:cache-server>
        <context:property-placeholder location="classpath:app-context.properties" />
        
        <gfe:partitioned-region id="consumer-partition" copies="2" total-buckets="4" persistent="true">
            <gfe:disk-store queue-size="50" auto-compact="true" max-oplog-size="10" synchronous-write="false" time-interval="9999">
                <gfe:disk-dir location="${disk.dir.1}" max-size="999"/>
                <gfe:disk-dir location="${disk.dir.2}" max-size="999"/>
            </gfe:disk-store>
            <gfe:eviction type="MEMORY_SIZE" threshold="512" action="OVERFLOW_TO_DISK"/>
            <!--
            <gfe:cache-loader ref="c-loader"/>
            <gfe:cache-writer ref="c-writer"/>
            -->
        </gfe:partitioned-region>
    the client-cache Spring config is:
    Code:
        <gfe:client-cache pool-name="locgf-pool" properties-ref="props"/>
        <util:properties id="props" location="classpath:/cache.properties"/>
        
        <gfe:pool id="locgf-pool" subscription-enabled="true" server-group="locgf-servers">
            <gfe:locator host="${client.host}" port="${gfe.port}"/>
        </gfe:pool>
        
        <gfe:client-region id="consumer-region" pool-name="locgf-pool">
            <gfe:cache-listener ref="consumerListener"/>
        </gfe:client-region>
    I'm referencing Spring 3.1.1.RELEASE and Spring Data GemFire 1.2.0.M1.

    Any help would be appreciated! I'd be happy to post more info if I have missed something.

  • #2
    I've learned that the problem here is I don't have a locator running for the cache-server. Also, clarifying my approach, I'm trying to use only Spring "pure Java" to run both the cache-server and cache-client, ie., I was hoping I wouldn't have to run gemfire commands, like "gemfire start-locator ...".

    Anyhow, I *think* I've got a locator running now, on the cache-server, by just adding the gemfire cache properties:
    mcast-port=0
    start-locator=127.0.0.1[50505]

    On startup, the server now logs:
    [info 2012/06/19 21:10:24.250 PDT LOC GF CacheServer <main> tid=0x1] Starting Distribution Locator on /127.0.0.1[50505]

    Now, when my client-cache web app starts up, the server logs:
    [info 2012/06/19 21:18:31.555 PDT LOC GF CacheServer <ServerConnection on port 40404 Thread 1> tid=0x3d] ClientHealthMonitor: Registering client with member id identity(172.16.179.1(5656:loner):59498:f8f21c08:L OC GF Cache Client,connection=1

    I might be missing more (properties, other config), but the basics of this mystery seem solved... The errors above were caused by my original client-cache locator config, which was trying to find a locator on the actual server port (40404), not a locator port.

    At the time of this issue, the Spring Data GemFire documentation doesn't say a whole lot about the GemFire cache properties or the powerful effect changing them has, eg. defining a locator for the server. Being a GemFire noob, here, that was painful.
    Last edited by mavenj; Jun 20th, 2012, 01:18 AM. Reason: clarifying cause of errors

    Comment


    • #3
      The locator is not required but recommended for production configuration. Without a locator you can do:
      Code:
       <gfe:pool id="locgf-pool" subscription-enabled="true" server-group="locgf-servers">
            <gfe:server host="${client.host}" port="${gfe.port}"/>
      </gfe:pool>

      Comment


      • #4
        Hi there. Thanks for the reply! But, isn't that the client config for finding a running locator? Seems a client/server topology requires a locator running that manages server information and provides access for clients, as in this documentation diagram

        Thanks, again.

        Comment

        Working...
        X