Before I answer, please use proper formatting when posting anything.
Code block should be added in code blocks like this using “```”
This is code
Now to your question:
Instead using Map<String, Object> you should use a Map<String, MeasurementValue>
Also you can just use “set”. Here is an example:
HashMap<String, MeasurementValue> mvMap = new HashMap<>();
MeasurementValue mvx = new MeasurementValue();
mvx.setValue(xValue);
mvx.setUnit("g");
mvMap.put(sensorTypeX, mvx);
MeasurementValue mvy = new MeasurementValue();
mvy.setValue(yValue);
mvy.setUnit("g");
mvMap.put(sensorTypeY, mvy);
MeasurementValue mvz = new MeasurementValue();
mvz.setValue(zValue);
mvz.setUnit("g");
MeasurementRepresentation measurementRepresentation = new MeasurementRepresentation();
measurementRepresentation.set(mvMap, name);
measurementRepresentation.setType(type);
measurementRepresentation.setSource(mor);
measurementRepresentation.setDateTime(dateTime);
measurementApi.create(measurementRepresentation);
Also make sure that your Timestamp is a UTC formatted joda.DateTime and most possible not in the future (this is often the reason measurements are not visible in the UI but can be retrieved via API). Just check the MeasurementAPI if the measurement has been created, with the ID returned from the MeasurementAPI in java.