title: Error while sending multivalued customdata
body: <p>I am facing the following error while sending set of custom objects.</p>
  <blockquote>
  <p>Oct 21, 2015 7:28:38 PM
  com.amazonaws.services.dynamodbv2.datamodeling.marshallers.ObjectSetToStringSetMarshaller
  marshall WARNING: Marshaling a set of non-String objects to a DynamoDB
  StringSet. You won't be able to read these objects back out of
  DynamoDB unless you REALLY know what you're doing: it's probably a
  bug. If you DO know what you're doing feelfree to ignore this warning,
  but consider using a custom marshaler for this instead.</p>
  <p>com.amazonaws.AmazonServiceException: One or more parameter values
  were invalid: An string set  may not be empty (Service:
  AmazonDynamoDBv2; Status Code: 400; Error Code: ValidationException;
  Request ID: S61P89234SI8PE61M8I9QTG8RNVV4KQNSO5AEMVJF66Q9ASUAAJG)     at
  com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:1181)
  at
  com.amazonaws.http.AmazonHttpClient.executeOneRequest(AmazonHttpClient.java:766)
  at
  com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:485)
  at
  com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:306)
  at
  com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient.invoke(AmazonDynamoDBClient.java:1799)
  at
  com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient.updateItem(AmazonDynamoDBClient.java:1614)
  at
  com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper$SaveObjectHandler.doUpdateItem(DynamoDBMapper.java:1241)
  at
  com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper$2.executeLowLevelRequest(DynamoDBMapper.java:937)
  at
  com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper$SaveObjectHandler.execute(DynamoDBMapper.java:1120)
  at
  com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper.save(DynamoDBMapper.java:966)
  at
  com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper.save(DynamoDBMapper.java:758)
  at .dao.impl.DeviceDaoImpl.addDevice(DeviceDaoImpl.java:57)     at
  .admin.device.service.impl.DeviceServiceImpl.addDevice(DeviceServiceImpl.java:38)</p>
  </blockquote>
  <p>This is the code snippet from where this is happening</p>
  <pre><code>    @DynamoDBTable(tableName=&quot;Device&quot;)
  public class Device extends BaseEntity implements Serializable{
  private Set&lt;AsscoiatedReviewer&gt; asscoiatedReviewers ;
  // getters setter
  
      public Device addDevice(Device device) {
          device.setDeviceId(generateId());
          device.setCreatedTime(getCurrentTime());
          if (!StringUtils.isNullOrEmpty(device.getPincode())) {
              // get lat and long - do this for review team as well
              //TODO : move it to common place that can be accessed for review team too
              setLatLong(device);
              // calculate the distances between this organization and reviewers
              calculateAsscoiatedReviewersDistances(device);
          }
          mapper.save(device);
          Device device1 = mapper.load(Device.class, device.getDeviceId());
  
  
          return device1;
      }
  
      private void calculateAsscoiatedReviewersDistances(Device device)  {
          if(StringUtils.isNullOrEmpty(device.getPincode())) return;
          try {
              List&lt;ReviewTeam&gt; ReviewTeam = reviewTeamDao.getAllReviewTeams();
              Set&lt;AsscoiatedReviewer&gt; asscoiatedReviewers = new HashSet&lt;AsscoiatedReviewer&gt;();
              /*for (ReviewTeam reviewTeam2 : ReviewTeam) {
                  if(StringUtils.isNullOrEmpty(reviewTeam2.getPincode())) continue;
                  AsscoiatedReviewer asscoiatedReviewer = new AsscoiatedReviewer();
                  asscoiatedReviewer.setReviewTeamId(reviewTeam2.getReviewTeamId());
                  double distance = distance(new Double(device.getLat()), new Double(device.getLongt()),
                          new Double(reviewTeam2.getLat()), new Double(reviewTeam2.getLongt()));
                  asscoiatedReviewer.setDistance(new Double(distance).toString());
                  asscoiatedReviewers.add(asscoiatedReviewer);
              }*/
              device.setAsscoiatedReviewers(asscoiatedReviewers);
  
          } catch (Exception e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
  
      }
      public class AsscoiatedReviewer implements Serializable,Comparable {
  
      /**
       *
       */
      private static final long serialVersionUID = -1906388056843006046L;
  
      private String distance;
      private String reviewTeamId;
  // getters setters 
  }
  </code></pre>
  <p>it seems the error is happening from the following line
  device.setAsscoiatedReviewers(asscoiatedReviewers);</p>
  <p>Should this be marshalled / demarshalled and send to amazon ? Any help would be greatly appreciated .</p>
  <p>UPDATE :
  i am getting the following exception when the data is populated in asscoiatedReviewers</p>
  <blockquote>
  <p>WARNING: Marshaling a set of non-String objects to a DynamoDB
  StringSet. You won't be able to read these objects back out of
  DynamoDB unless you REALLY know what you're doing: it's probably a
  bug. If you DO know what you're doing feelfree to ignore this warning,
  but consider using a custom marshaler for this instead.
  com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMappingException:
  Cannot unmarshall to type class
  in.forus.foruscare.entity.AsscoiatedReviewer without a custom
  marshaler or @DynamoDBDocument annotation.    at
  com.amazonaws.services.dynamodbv2.datamodeling.ConversionSchemas$StandardItemConverter.getObjectUnmarshaller(ConversionSchemas.java:590)
  at
  com.amazonaws.services.dynamodbv2.datamodeling.ConversionSchemas$StandardItemConverter.augment(ConversionSchemas.java:497)
  at
  com.amazonaws.services.dynamodbv2.datamodeling.ConversionSchemas$StandardItemConverter.getMemberUnmarshaller(ConversionSchemas.java:466)
  at
  com.amazonaws.services.dynamodbv2.datamodeling.ConversionSchemas$StandardItemConverter.getObjectSetUnmarshaller(ConversionSchemas.java:520)</p>
  </blockquote>
  <p>does this mean i needed to write custom marshaller or annoate with DynamoDBDocument annotation . If yes, this is set of custom objects, can you send me the pointer to simple example of marshaller. i happened to look at other marshllers, they didnt seem to explain what i need</p>