Forum Discussion
chutchison
8 years agoNew Contributor
Sure! Here’s a repository full of examples: GitHub - chutch1122/snap-date-issue
Specifically, with Joda’s DateTime object: snap-date-issue/JodaDateTimeSnap.java at master · chutch1122/snap-date-issue · GitHub
Map<String, Object> row = new LinkedHashMap<>();
row.put("firstName", "Bobby");
row.put("lastName", "Tables");
row.put("dateOfBirth", new DateTime(1990, 12, 25, 1, 30));
row.put("email", "bobby@tables.com");
row.put("yearsExperience", 5);
Document document = documentUtility.newDocument(row);
outputViews.write(document);
This is what happens when I run a pipeline with that snap.
Note that none of the properties after dateOfBirth are present (email, yearsExperience) and SnapLogic doesn’t let me format the date.
tstack
8 years agoFormer Employee
It looks like a class-loading issue, the class used in your pack is loaded separately from the one in the platform, so the platform doesn’t know how to deal with it. When I unzip the build of the pack I see the joda jar in there, so that is probably why it’s being loaded in and used. You can try adding joda to the pom in the ‘provided’ scope.