bufferUnderFlow Exception

hello

i implement my SPLITRECORD component which split record in two record. with one input ans two output. but i get buffer underflow exception in it.

when i run my graph output is as

*** CloverETL framework/transformation graph runner ver1.7, (c) 2002-05 D.Pavlis, released under GNU Lesser General Public License ***

Graph definition file: E:/CloverETL/Examples/testSplit.txt
phase No. 0
phase No. 0
phase No. 0
phase No. 0
Initializing DB connection: jdbc:postgresql://192.168.0.3/vtech0506 … OK
Initializing DB connection: jdbc:postgresql://192.168.0.3/olap … OK
[Clover] starting WatchDog thread …
[WatchDog] Thread started.
[WatchDog] Running on 1 CPU(s) max available memory for JVM 1570 KB
[Clover] Initializing phase: 0
initializing edges: all edges initialized successfully…
initializing nodes:
INPUT …OK
SPLIT …OK
OUTSALES …OK
OUTDATE …OK
[Clover] phase: 0 initialized successfully.
[WatchDog] Starting up all nodes in phase [0]
[WatchDog] INPUT … started
[WatchDog] SPLIT … started
[WatchDog] OUTSALES … started
[WatchDog] OUTDATE … started
[WatchDog] Sucessfully started all nodes in phase!
Nov 19, 2005 12:22:28 PM org.jetel.database.SQLUtil getFieldTypes
WARNING: No metadata obtained for table: “sales”, using workaround …
Nov 19, 2005 12:22:28 PM org.jetel.database.SQLUtil getFieldTypes
WARNING: No metadata obtained for table: “mydate”, using workaround …
java.nio.BufferUnderflowException
at java.nio.Buffer.nextGetIndex(Unknown Source)
at java.nio.DirectByteBuffer.getChar(Unknown Source)
at org.jetel.data.StringDataField.deserialize(StringDataField.java:342)
at org.jetel.data.DataRecord.deserialize(DataRecord.java:170)
at org.jetel.graph.DirectEdge.readRecord(DirectEdge.java:125)
at org.jetel.graph.Edge.readRecord(Edge.java:238)
at org.jetel.graph.Node.readRecord(Node.java:536)
at org.jetel.component.DBOutputTable.runInNormalMode(DBOutputTable.java:405)
at org.jetel.component.DBOutputTable.run(DBOutputTable.java:360)
[WatchDog] Execution of phase [0] successfully finished - elapsed time(sec): 1
---------------------** Start of tracking Log for phase [0] **-------------------
Time: 19/11/05 12:22:29
Node Status Port #Records
---------------------------------------------------------------------------------
INPUT OK
Out:0 3
SPLIT OK
In:0 3
Out:0 3
Out:1 3
OUTSALES FATAL_ERROR
In:0 3
OUTDATE OK
In:0 3
---------------------------------** End of Log **--------------------------------
[WatchDog] Forcing garbage collection …
-----------------------** Summary of Phases execution **---------------------
Phase# Finished Status RunTime(sec) MemoryAllocation(KB)
0 0 1 181
------------------------------** End of Summary **---------------------------
[Clover] WatchDog thread finished - total execution time: 1 (sec)
[Clover] Graph execution finished successfully
Execution of graph finished !

hello martin

this is my SplitRecord componenet

/*
* Created on Nov 10, 2005
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
package org.jetel.component;

/**
* @author Deepak
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
import java.io.IOException;

import org.jetel.data.DataRecord;
import org.jetel.exception.ComponentNotReadyException;
import org.jetel.graph.InputPort;
import org.jetel.graph.Node;
import org.jetel.graph.OutputPort;
import org.jetel.util.ComponentXMLAttributes;
import org.w3c.dom.Element;

/**
* @author Deepak
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
public class SplitRecord extends Node{

public static final String COMPONENT_TYPE=“SPLIT_RECORD”;

public SplitRecord(String id)
{
super(id);
}

public String getType() {
return COMPONENT_TYPE;
}

public void init() throws ComponentNotReadyException {
// test that we have at least one input port and one output
if (inPorts.size()<1){
throw new ComponentNotReadyException("At least one input port has to be defined for node " + id);
}else if (outPorts.size()<1){
throw new ComponentNotReadyException("At least one output port has to be defined for node " + id);
}
}

public void run()
{
boolean isDriverDifferent;

// get all ports involved
InputPort inPort = getInputPort(0);
DataRecord driverRecordread = new DataRecord(inPort.getMetadata());
driverRecordread.init();

int index=0;

// get array of all ports defined/connected - use collection Collection - getInPorts();
OutputPort outPorts;
outPorts = (OutputPort) getOutPorts().toArray(new OutputPort[0]);

// create array holding incoming records
DataRecord outputRecords;
outputRecords = new DataRecord[outPorts.length];

// initialize array of data records (for each input port one)
System.out.println("the no. of out put pin in split is " + outPorts.length);

// numActive=inPorts.length;
int cou = new int[5];
Integer timeid=new Integer (1);

while (runIt)
{
try
{
driverRecordread = inPort.readRecord(driverRecordread);
if(driverRecordread != null)
{
DataRecord record0 = new DataRecord(outPorts[0].getMetadata());
record0.init();
record0.getField(0).setValue(driverRecordread.getField(1).getValue());

DataRecord record1=new DataRecord(outPorts[1].getMetadata());
record1.init();
record1.getField(1).setValue(new Integer(1));
record1.getField(2).setValue(driverRecordread.getField(0).getValue()); //customer_id
record1.getField(3).setValue(timeid );
record1.getField(4).setValue(driverRecordread.getField(2).getValue()); //doc_no
record1.getField(5).setValue(driverRecordread.getField(3).getValue());//version
record1.getField(6).setValue(driverRecordread.getField(4).getValue());//sales_representative
record1.getField(7).setValue(driverRecordread.getField(5).getValue());//item_id
record1.getField(8).setValue(“KG”);
record1.getField(9).setValue(driverRecordread.getField(6).getValue());//qty
record1.getField(10).setValue(driverRecordread.getField(7).getValue());//price
record1.getField(11).setValue(driverRecordread.getField(8).getValue());//discount1
record1.getField(12).setValue(driverRecordread.getField(9).getValue());//discount2
record1.getField(13).setValue(new Integer(5));

outPorts[0].writeRecord(record0 );
outPorts[1].writeRecord(record1);

}else
{
break;
}
} catch (IOException ex)
{
resultMsg = ex.getMessage();
resultCode = Node.RESULT_ERROR;
closeAllOutputPorts();
System.out.println(“IO error in split:” + ex.getMessage());
ex.printStackTrace();
return;
} catch (Exception ex)
{
resultMsg = ex.getMessage();
resultCode = Node.RESULT_FATAL_ERROR;
System.out.println(“error in split:” + ex.getMessage());
ex.printStackTrace();
return;
}
}

broadcastEOF();

if (runIt) {
resultMsg = “OK”;
} else
{
resultMsg = “STOPPED”;
}
resultCode = Node.RESULT_OK;
}

public boolean checkConfig() {
return true;
}
public void toXML(Element xmlElement) {
super.toXML(xmlElement);
}

public static Node fromXML(org.w3c.dom.Node nodeXML) {
ComponentXMLAttributes xattribs = new ComponentXMLAttributes(nodeXML);

try {
return new SimpleCopy(xattribs.getString(Node.XML_ID_ATTRIBUTE));
} catch (Exception ex) {
System.err.println(ex.getMessage());
return null;
}
}
}

here is my graph

<?xml version="1.0" encoding="UTF-8"?> 0 and sv.current\_version and sv.sales\_representativ=em.id and em.person\_master\_id=pm.id and sd.sv\_id=sv.id"/>

[sales.txt]

<?xml version="1.0" encoding="UTF-8"?>

[salesOutMeta.txt]

<?xml version="1.0" encoding="UTF-8" ?>

[date.txt]

<?xml version="1.0" encoding="UTF-8"?>

hello Martin

after modifying fromXML my Split record work.

but its can not copy bigint type data instead its return null.

now i implement grneral component. then i send it to you in your mail.

please explain me whats going wrong with bigint data

I think that you mail me this data (zatopek.martin@seznam.cz). Post like this make this forum little bit messy.

I dont understand your fromXML() method. This method is used by engine for creating your component. You must return instance of SplitRecord node. Your code is never use because you make only SimpleCopy Node.

Martin

Hello,
hard to say what’s wrong. Sorry i really dont know, but you can try post me graph, your component and data and i find some time to debug your code. It’s maximum what can i do.
Martin