[Java programming language only]

Troubleshooting client connectivity

There are several common problems specific to clients and client connectivity that you can solve as described in the following sections.

Procedure

  • Problem: If you are using the EntityManager API or byte array maps with the COPY_TO_BYTES copy mode, client data access methods result in various serialization-related exceptions or a NullPointerException exception.
    • The following error occurs when you are using the COPY_TO_BYTES copy mode:

      java.lang.NullPointerException
              at com.ibm.ws.objectgrid.map.BaseMap$BaseMapObjectTransformer2.inflateObject(BaseMap.java:5278) 
              at com.ibm.ws.objectgrid.map.BaseMap$BaseMapObjectTransformer.inflateValue(BaseMap.java:5155)
      
    • The following error occurs when you are using the EntityManager API:

      
      java.lang.NullPointerException
      		at com.ibm.ws.objectgrid.em.GraphTraversalHelper.fluffFetchMD(GraphTraversalHelper.java:323)
      		at com.ibm.ws.objectgrid.em.GraphTraversalHelper.fluffFetchMD(GraphTraversalHelper.java:343)
      		at com.ibm.ws.objectgrid.em.GraphTraversalHelper.getObjectGraph(GraphTraversalHelper.java:102)
      		at com.ibm.ws.objectgrid.ServerCoreEventProcessor.getFromMap(ServerCoreEventProcessor.java:709)
      		at com.ibm.ws.objectgrid.ServerCoreEventProcessor.processGetRequest(ServerCoreEventProcessor.java:323)
      
      
    Cause: The EntityManager API and COPY_TO_BYTES copy mode use a metadata repository that is embedded in the data grid. When clients connect, the data grid stores the repository identifiers in the client and caches the identifiers for the duration of the client connection. If you restart the data grid, you lose all metadata and the regenerated identifiers do not match the cached identifiers on the client.

    Solution: If you are using the EntityManager API or the COPY_TO_BYTES copy mode, disconnect and reconnect all of the clients if the ObjectGrid is stopped and restarted. Disconnecting and reconnecting the clients refreshes the metadata identifier cache. You can disconnect clients by using the ObjectGridManager.disconnect method or the ObjectGrid.destroy method.

  • Problem: The client hangs during a getObjectGrid method call.

    A client might seem to hang when calling the getObjectGrid method on the ObjectGridManager or throw an exception: com.ibm.websphere.projector.MetadataException. The EntityMetadata repository is not available and the timeout threshold is reached.

    Cause: The reason is the client is waiting for the entity metadata on the ObjectGrid server to become available.

    Solution: This error can occur when a container server has been started, but placement has not yet started. Take the following actions:
    • Examine the deployment policy for the ObjectGrid and verify that the number of active containers is greater than or equal to both the numInitialContainers and minSyncReplicas attributes in the deployment policy descriptor file.
    • Examine the setting for the placementDeferralInterval property in the container server server properties file to see how much time needs to pass before placement operations occur.
    • If you used the xscmd -c suspendBalancing command to stop the balancing of shards for a specific data grid and map set, use the xscmd -c resumeBalancing to start balancing again.