Skip to content

Commit f83b16b

Browse files
committed
Fix exception on missing class name in custom object
1 parent 0d12c98 commit f83b16b

File tree

2 files changed

+23
-19
lines changed

2 files changed

+23
-19
lines changed

README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ Example:
210210
##### Download
211211

212212
```bash
213-
docker pull commercetools/commercetools-project-sync:5.4.5
213+
docker pull commercetools/commercetools-project-sync:5.4.6
214214
```
215215
##### Run
216216

@@ -222,14 +222,14 @@ docker run \
222222
-e TARGET_PROJECT_KEY=xxxx \
223223
-e TARGET_CLIENT_ID=xxxx \
224224
-e TARGET_CLIENT_SECRET=xxxx \
225-
commercetools/commercetools-project-sync:5.4.5 -s all
225+
commercetools/commercetools-project-sync:5.4.6 -s all
226226
```
227227

228228

229229
### Examples
230230
- To run the all sync modules from a source project to a target project
231231
```bash
232-
docker run commercetools/commercetools-project-sync:5.4.5 -s all
232+
docker run commercetools/commercetools-project-sync:5.4.6 -s all
233233
```
234234
This will run the following sync modules in the given order:
235235
1. `Type` Sync and `ProductType` Sync and `States` Sync and `TaxCategory` Sync and `CustomObject` Sync in parallel.
@@ -239,70 +239,70 @@ commercetools/commercetools-project-sync:5.4.5 -s all
239239

240240
- To run the type sync
241241
```bash
242-
docker run commercetools/commercetools-project-sync:5.4.5 -s types
242+
docker run commercetools/commercetools-project-sync:5.4.6 -s types
243243
```
244244

245245
- To run the productType sync
246246
```bash
247-
docker run commercetools/commercetools-project-sync:5.4.5 -s productTypes
247+
docker run commercetools/commercetools-project-sync:5.4.6 -s productTypes
248248
```
249249

250250
- To run the states sync
251251
```bash
252-
docker run commercetools/commercetools-project-sync:5.4.5 -s states
252+
docker run commercetools/commercetools-project-sync:5.4.6 -s states
253253
```
254254
- To run the taxCategory sync
255255
```bash
256-
docker run commercetools/commercetools-project-sync:5.4.5 -s taxCategories
256+
docker run commercetools/commercetools-project-sync:5.4.6 -s taxCategories
257257
```
258258

259259
- To run the category sync
260260
```bash
261-
docker run commercetools/commercetools-project-sync:5.4.5 -s categories
261+
docker run commercetools/commercetools-project-sync:5.4.6 -s categories
262262
```
263263

264264
- To run the product sync
265265
```bash
266-
docker run commercetools/commercetools-project-sync:5.4.5 -s products
266+
docker run commercetools/commercetools-project-sync:5.4.6 -s products
267267
```
268268

269269
- To run the cartDiscount sync
270270
```bash
271-
docker run commercetools/commercetools-project-sync:5.4.5 -s cartDiscounts
271+
docker run commercetools/commercetools-project-sync:5.4.6 -s cartDiscounts
272272
```
273273

274274
- To run the inventoryEntry sync
275275
```bash
276-
docker run commercetools/commercetools-project-sync:5.4.5 -s inventoryEntries
276+
docker run commercetools/commercetools-project-sync:5.4.6 -s inventoryEntries
277277
```
278278

279279
- To run the customObject sync
280280
```bash
281-
docker run commercetools/commercetools-project-sync:5.4.5 -s customObjects
281+
docker run commercetools/commercetools-project-sync:5.4.6 -s customObjects
282282
```
283283

284284
- To run the customer sync
285285
```bash
286-
docker run commercetools/commercetools-project-sync:5.4.5 -s customers
286+
docker run commercetools/commercetools-project-sync:5.4.6 -s customers
287287
```
288288

289289
- To run the shoppingList sync
290290
```bash
291-
docker run commercetools/commercetools-project-sync:5.4.5 -s shoppingLists
291+
docker run commercetools/commercetools-project-sync:5.4.6 -s shoppingLists
292292
```
293293
- To run both products and shoppingList sync
294294
```bash
295-
docker run commercetools/commercetools-project-sync:5.4.5 -s products shoppingLists
295+
docker run commercetools/commercetools-project-sync:5.4.6 -s products shoppingLists
296296
```
297297

298298
- To run type, productType and shoppingList sync
299299
```bash
300-
docker run commercetools/commercetools-project-sync:5.4.5 -s types productTypes shoppingLists
300+
docker run commercetools/commercetools-project-sync:5.4.6 -s types productTypes shoppingLists
301301
```
302302

303303
- To run all sync modules using a runner name
304304
```bash
305-
docker run commercetools/commercetools-project-sync:5.4.5 -s all -r myRunnerName
305+
docker run commercetools/commercetools-project-sync:5.4.6 -s all -r myRunnerName
306306
```
307307

308308
## Scopes

src/main/java/com/commercetools/project/sync/BaseSyncStatisticsDeserializer.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,12 @@ public BaseSyncStatistics deserialize(JsonParser jsonParser, DeserializationCont
2525
final ObjectMapper mapper = (ObjectMapper) jsonParser.getCodec();
2626
final JsonNode syncStatisticsNode = mapper.readTree(jsonParser);
2727
try {
28-
final String syncStatisticsClassName =
29-
syncStatisticsNode.get("syncStatisticsClassName").asText();
28+
final JsonNode syncStatisticsClassNameJsonNode =
29+
syncStatisticsNode.get("syncStatisticsClassName");
30+
if (syncStatisticsClassNameJsonNode == null) {
31+
throw new ClassNotFoundException();
32+
}
33+
final String syncStatisticsClassName = syncStatisticsClassNameJsonNode.asText();
3034
final Class<? extends BaseSyncStatistics> c =
3135
Class.forName(syncStatisticsClassName).asSubclass(BaseSyncStatistics.class);
3236
return mapper.treeToValue(syncStatisticsNode, c);

0 commit comments

Comments
 (0)