on 05-06-2010 1:38 PM
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???
000Z and ssZ
could that be the reason?
What are the examples of successful dates being parsed?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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......
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.