Hello
I try to use the reformat component but I have an error "java.lang.ArrayIndexOutOfBoundsException".
My Graph :
I had 1 DELIMITED_DATA_READER_NIO connected to a reformat component.
This component is followed by a DELIMITED_DATA_WRITER_NIO
the XML Code
<?xml version="1.0" encoding="UTF-8"?>
<Graph name="acopMarquages00">
<Global>
<Metadata fileURL="Metadata/Marquages.fmt" id="Metadata0"/>
</Global>
<Phase number="0">
<Node enabled="enabled" fileURL="D:/marquages/Data/DataOut/DELTA_CO_MARQUAGES_20060409.dat" guiHeight="0" guiName="INPUT_DELTA" guiWidth="0" guiX="54" guiY="78" id="INPUT" passThroughOutputPort="0" type="DELIMITED_DATA_READER_NIO"/>
<Node append="false" enabled="enabled" fileURL="D:/marquages/Data/DataOut/W1_DELTA_CO_MARQUAGES_20060409.dat" guiHeight="0" guiName="OUTPUT_W1_DELTA_CO_MARQUAGES" guiWidth="0" guiX="443" guiY="82" id="OUTPUT" passThroughInputPort="0" type="DELIMITED_DATA_WRITER_NIO"/>
<Node enabled="enabled" guiHeight="0" guiName="REFORMAT_DATE" guiWidth="0" guiX="238" guiY="81" id="REFORMAT" type="REFORMAT">
import org.jetel.component.DataRecordTransform;
import org.jetel.metadata.DataRecordMetadata;
import org.jetel.data.*;
public class reformatDate extends DataRecordTransform{
public boolean transform(DataRecord[] source, DataRecord[] target){
target[0].getField(0).setValue(source[0].getField(0).getValue());
target[0].getField(1).setValue(source[0].getField(1).getValue());
target[0].getField(2).setValue(source[0].getField(2).getValue());
target[0].getField(3).setValue(source[0].getField(3).getValue());
target[0].getField(4).setValue(source[0].getField(4).getValue());
target[0].getField(5).setValue(source[0].getField(5).getValue());
return false;
}
}
</Node>
<Edge fromNode="INPUT:0" guiBendpoints="" id="Edge0" inPort="0 (REFORMAT_DATE)" metadata="Metadata0" outPort="0 (INPUT_DELTA)" toNode="REFORMAT:0"/>
<Edge fromNode="REFORMAT:0" guiBendpoints="" id="Edge1" inPort="0 (OUTPUT_W1_DELTA_CO_MARQUAGES)" metadata="Metadata0" outPort="0 (REFORMAT_DATE)" toNode="OUTPUT:0"/>
</Phase>
</Graph>
And I get this exceoption
INFO [WatchDog] - [Clover] phase: 0 initialized successfully.
INFO [WatchDog] - Starting up all nodes in phase [0]
DEBUG [WatchDog] - INPUT ... started
DEBUG [WatchDog] - REFORMAT ... started
DEBUG [WatchDog] - OUTPUT ... started
INFO [WatchDog] - Sucessfully started all nodes in phase!
FATAL [WatchDog] - !!! Fatal Error !!! - graph execution is aborting
ERROR [WatchDog] - Node REFORMAT finished with fatal error: java.lang.ArrayIndexOutOfBoundsException : 1
WARN [WatchDog] - Interrupted node: INPUT
WARN [WatchDog] - Interrupted node: REFORMAT
WARN [WatchDog] - Interrupted node: OUTPUT
Does any one know why? Has anyone faced the same problem?
Any help is appreciated.
Thanks in advance.
Alex
I try to use the reformat component but I have an error "java.lang.ArrayIndexOutOfBoundsException".
My Graph :
I had 1 DELIMITED_DATA_READER_NIO connected to a reformat component.
This component is followed by a DELIMITED_DATA_WRITER_NIO
the XML Code
<?xml version="1.0" encoding="UTF-8"?>
<Graph name="acopMarquages00">
<Global>
<Metadata fileURL="Metadata/Marquages.fmt" id="Metadata0"/>
</Global>
<Phase number="0">
<Node enabled="enabled" fileURL="D:/marquages/Data/DataOut/DELTA_CO_MARQUAGES_20060409.dat" guiHeight="0" guiName="INPUT_DELTA" guiWidth="0" guiX="54" guiY="78" id="INPUT" passThroughOutputPort="0" type="DELIMITED_DATA_READER_NIO"/>
<Node append="false" enabled="enabled" fileURL="D:/marquages/Data/DataOut/W1_DELTA_CO_MARQUAGES_20060409.dat" guiHeight="0" guiName="OUTPUT_W1_DELTA_CO_MARQUAGES" guiWidth="0" guiX="443" guiY="82" id="OUTPUT" passThroughInputPort="0" type="DELIMITED_DATA_WRITER_NIO"/>
<Node enabled="enabled" guiHeight="0" guiName="REFORMAT_DATE" guiWidth="0" guiX="238" guiY="81" id="REFORMAT" type="REFORMAT">
import org.jetel.component.DataRecordTransform;
import org.jetel.metadata.DataRecordMetadata;
import org.jetel.data.*;
public class reformatDate extends DataRecordTransform{
public boolean transform(DataRecord[] source, DataRecord[] target){
target[0].getField(0).setValue(source[0].getField(0).getValue());
target[0].getField(1).setValue(source[0].getField(1).getValue());
target[0].getField(2).setValue(source[0].getField(2).getValue());
target[0].getField(3).setValue(source[0].getField(3).getValue());
target[0].getField(4).setValue(source[0].getField(4).getValue());
target[0].getField(5).setValue(source[0].getField(5).getValue());
return false;
}
}
</Node>
<Edge fromNode="INPUT:0" guiBendpoints="" id="Edge0" inPort="0 (REFORMAT_DATE)" metadata="Metadata0" outPort="0 (INPUT_DELTA)" toNode="REFORMAT:0"/>
<Edge fromNode="REFORMAT:0" guiBendpoints="" id="Edge1" inPort="0 (OUTPUT_W1_DELTA_CO_MARQUAGES)" metadata="Metadata0" outPort="0 (REFORMAT_DATE)" toNode="OUTPUT:0"/>
</Phase>
</Graph>
And I get this exceoption
INFO [WatchDog] - [Clover] phase: 0 initialized successfully.
INFO [WatchDog] - Starting up all nodes in phase [0]
DEBUG [WatchDog] - INPUT ... started
DEBUG [WatchDog] - REFORMAT ... started
DEBUG [WatchDog] - OUTPUT ... started
INFO [WatchDog] - Sucessfully started all nodes in phase!
FATAL [WatchDog] - !!! Fatal Error !!! - graph execution is aborting
ERROR [WatchDog] - Node REFORMAT finished with fatal error: java.lang.ArrayIndexOutOfBoundsException : 1
WARN [WatchDog] - Interrupted node: INPUT
WARN [WatchDog] - Interrupted node: REFORMAT
WARN [WatchDog] - Interrupted node: OUTPUT
Does any one know why? Has anyone faced the same problem?
Any help is appreciated.
Thanks in advance.
Alex
-
Could you please also send the metadata - to david.pavlis <at> centrum.cz
This looks like you are addressing field with non-existing index. But might be also something totally different.
Please sign in to leave a comment.
Comments 1