cancel
Showing results for 
Search instead for 
Did you mean: 

Parse Exception : java.text.ParseException: Unparseable date

Former Member
0 Kudos

I have inherited a UDF in some mapping that on the whole, works okay...

but it throws an error after mapping a few dates:

Parse Exception : java.text.ParseException: Unparseable date: "2010-03-18T00:00:00.000Z"

Parse Exception : java.text.ParseException: Unparseable date: "2010-03-23T23:59:00.000Z"

Parse Exception : java.text.ParseException: Unparseable date: "2010-03-18T00:00:00.000Z"

Parse Exception : java.text.ParseException: Unparseable date: "2010-03-23T23:59:00.000Z"

Parse Exception : java.text.ParseException: Unparseable date: "2010-03-18T00:00:00.000Z"

Parse Exception : java.text.ParseException: Unparseable date: "2010-03-23T23:59:00.000Z"

the first few map okay... then i get the exception.

the UDF is as follows:


public String convertDateTimeToUTC(String strDate, Container container) throws StreamTransformationException{
AbstractTrace trace = container.getTrace();
Date date=null;
SimpleDateFormat sdfSource = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
try{ 
String dt = strDate; 
date = sdfSource.parse(dt);
trace.addInfo("Local Date:"+date);
SimpleDateFormat sdfDestination = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
strDate = sdfDestination.format(date);
}
catch(ParseException pe){ 
trace.addInfo("Parse Exception : " + pe);
}
return strDate;

can anyone see why this fails after successfully mapping a few fields???

Accepted Solutions (1)

Accepted Solutions (1)

Shabarish_Nair
Active Contributor
0 Kudos

000Z and ssZ

could that be the reason?

What are the examples of successful dates being parsed?

Former Member
0 Kudos

the first mapping works correctly...

then we reuse the same fields to map to the additional segments.

the context is correct as it is trying to pull the same fields in... it just throw the error with the same data in the same UDF/Function Library but for different segments! :o(

http://img199.imageshack.us/img199/3104/dateconversion.jpg

as you can see from the screenshot above, the mapping works in the first instance, then fails on subsequent nodes.

Answers (1)

Answers (1)

Former Member
0 Kudos

ahhhhhhhh!

i see what is happening now...

i get the "Information message" for the successfully mapped fields....

it is not an error.....

i just need to work out why it is not mapping to all the segments......