Java transformer Error msg

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
skrispriya
Participant
Posts: 6
Joined: Thu Jan 20, 2011 11:09 pm

Java transformer Error msg

Post by skrispriya »

Hi all,

I used Java transformer in my job.
The job actually read data from DB and by applying some business rules writes into file.Please find error logs.

APT_CombinedOperatorController,0: JVMDUMP006I Processing Dump Event "gpf", detail "" - Please Wait.
APT_CombinedOperatorController,0: JVMDUMP007I JVM Requesting System Dump using '/projects/TDWM_DEV/core.20110121.091209.28786.dmp'
APT_CombinedOperatorController,0: JVMDUMP010I System Dump written to /projects/TDWM_DEV/core.20110121.091209.28786.dmp
APT_CombinedOperatorController,0: JVMDUMP007I JVM Requesting Java Dump using '/projects/TDWM_DEV/javacore.20110121.091209.28786.txt'
APT_CombinedOperatorController,0: JVMDUMP010I Java Dump written to /projects/TDWM_DEV/javacore.20110121.091209.28786.txt
APT_CombinedOperatorController,0: JVMDUMP013I Processed Dump Event "gpf", detail ""
APT_CombinedOperatorController,0: Operator terminated abnormally: received signal SIGSEGV
main_program: Step execution finished with status = FAILED.

Please suggest

Thanks in advance

Regards
Priya
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Do you have a simple java class working in the java transformer? What does the class do? did it ever work? how much memory does it need.....etc. etc. Lots of things to look for, but first ensure that you can get even a simple java class with the JavaPack API to function properly.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
skrispriya
Participant
Posts: 6
Joined: Thu Jan 20, 2011 11:09 pm

Post by skrispriya »

Hi Ernie,

Thanks for your reply.
I am new in using java stages in datastage.
Please advice how to check whether java class will work and memory utilisation of that class.

Please find my java class.

package SampleJavaPlugIns;

import com.ascentialsoftware.jds.Row;
import com.ascentialsoftware.jds.Stage;
import com.ascentialsoftware.jds.Column;
/* import com.ascentialsoftware.tr4j.*;

/**
* @author eostic
*
* DataStage PlugIn Development
*
* Ernie Ostic
* Ascential Software
*
* This class is based on one of the samples in the javadocs written by ASCL engineering.
*
* It has then been customized to test additional calls supported by the java plugin API,
* and illustrate how the plugin can "discover" how it is being used in the job. It certainly does NOT
* exercise every possible call, nor explore all the things, such as reference links, etc.
* that can be performed with javaPack. However, it is helpful in validating that the plugins
* are working and provides another baseline example.
*
* NO WARRANTIES OR VALIDATED TECHNIQUES IMPLIED BY THIS CODE. USE THIS AT YOUR OWN RISK AND FOR
* EDUCATIONAL AND LEARNING PURPOSES ONLY.
*
*/
public class ExamineRows extends Stage {

public void initialize()
{

//*------------------------------------------------------------------------------------*
// What kind of Links do I have (am I being invoked with)...ie what type of Stage
//
// a JavaTransformer Stage would typically have Input -and- Output links...
//*------------------------------------------------------------------------------------*

/* trace("initialization analysis");
if (hasInputLink()) {warn("Input Link Found"); }
if (hasOutputLink()) {warn("Output Link Found"); }
if (hasReferenceLink()) {warn("Reference Link Found"); }
if (hasRejectLink()) {warn("Reject Link Found"); } */

//Ultimately, determining link types should trigger branching to different parts of the code,
//depending on what type of operation we're expected to be coding for...source/target/transform.
//This way a java developer could (in theory, but less likely in reality) write a very "generic" class
//that would work in many situations, perhaps having it's "function" passed in as a property

//*------------------------------------------------------------------------------------*
// Obtain user properties from the generic "box" property of the plugin GUI
//*------------------------------------------------------------------------------------*

String UserProperties=getUserProperties();

//*------------------------------------------------------------------------------------*
//write values of the user properties to the DS log as info message
//*------------------------------------------------------------------------------------*
//* info (UserProperties);
trace("For the first row list the column names and their SQL data types.");

if (isTraceOn()) {
trace("Trace is on");
}
//*------------------------------------------------------------------------------------*
// Trace works, but only if the user, in the Director, selects the third radio button
// for "Subroutine Calls" ...IN COMBINATION with any additional radio button of the 4.
//*------------------------------------------------------------------------------------*

trace("Tracing has been turned on"); //only appears if tracing is on from Director
}



int rowNumber;
int outColNumber;

public int process()
{
// Read a row, convert all its columns to upper case,
// and write the result. If any column of the input row
// contains the character '*', the row is rejected.


Row inputRow = readRow();

trace("Java class just received a row...");

rowNumber = rowNumber + 1;

if (inputRow == null) {
return OUTPUT_STATUS_END_OF_DATA;
}

boolean reject = false;
int columnCount = inputRow.getColumnCount();
Row outputRow = createOutputRow();


for (int columnNumber = 0; columnNumber < columnCount; columnNumber++) {
String value = inputRow.getValueAsString(columnNumber);


if (rowNumber == 1)
{

Column MetaDataForMyColumn = inputRow.getColumn(columnNumber);
String colName = MetaDataForMyColumn.getName();
int colSQLType=MetaDataForMyColumn.getSQLType();
String colSQLTypeName=Column.getSQLTypeName(colSQLType);


trace(colName);
trace(colSQLTypeName);


}
//*--------------------------------------------------------------------------------------------------------------
// "reject" any rows that have asterisks [these will go down a link that the DS developer marks as "reject" link
//*--------------------------------------------------------------------------------------------------------------

outColNumber=columnNumber;

if (value.indexOf("*") >=0) {
reject = true;
// warn("Value found with Asterisk. Reject the row");
outputRow.setValueAsString(outColNumber, value);
} else {
outputRow.setValueAsString(outColNumber, value.toUpperCase());
}
}

if (reject) {
rejectRow(outputRow);
} else {
writeRow(outputRow);
}
return OUTPUT_STATUS_READY;
}

}


Please suggest to proceed further.
If possible provide some sample code.

Regards
Priya
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Ok...you are using a very basic sample...that's a good thing for getting started.

I've seen a lot of strange errors, but not the ones that you have below. Usually when getting started people run into classpath problems or, in early 8.x, jvm initialization errors.

Anyone else who plays with JavaPack a lot seen these when in EE?

I'd suggest you also try this from a Server Job --- it sometimes offers slightly different errors that may be more informative.

Also --- exactly what release are you running of 8.x ?

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
skrispriya
Participant
Posts: 6
Joined: Thu Jan 20, 2011 11:09 pm

Post by skrispriya »

Hi Ernie,

I am using datastage 8.0.1.

I made the following
transformer class name:tr4j.jar
path :/opt/IBM/InformationServer/Server/DSEngine/java/lib/
copied java file content and pasted in User Properties box.

Please direct me if I am in wrong track.
Actually my requirement reading data from tsv file and writing data to target via jar file.
Is it possible?If so how to pass arg for jar file.
Please discuss in detail as much as possile.

Regards
Priya
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

...."copied java file content and pasted..."

What "Java File content" are you referring to? The code above?

How familiar are you with Java? Have you coded in java? Do you know how to compile a class. Forgive me if you do that all the time --- it's hard to tell from the questions you are asking.

The JavaPack in DataStage works like this: ....you take a java class that you have (or code something from scratch), and you code the "JavaPack API" into it ---- you can be very creative. At its most basic, however, the JavaPack API gives your code the opportunity to read or write (or both) to the links in a DataStage Job. There are pre-determined methods in your java class that the JavaPack is going to invoke at run time. This is all documented.

Then you compile your class with the appropriate libraries for JavaPack, and run your Job.

If you are not familiar with how to set up your java environment, manage classpaths, and compile java classes, you need to find a resource who has done these things or first spend considerable time learning about those concepts, independent of DataStage. JavaPack doesn't let you just "call" any class and exchange information. You have to do some coding/compiling/configuring to fully exploit the potential integration.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
skrispriya
Participant
Posts: 6
Joined: Thu Jan 20, 2011 11:09 pm

Post by skrispriya »

Hi Ernie,

Thanks for the infomation.
Can you tel me where should I compile my code.

Regards
Priya
ppgoml
Participant
Posts: 58
Joined: Mon Aug 20, 2007 11:00 pm

Post by ppgoml »

I don't have any idea on your error messages, however, I remember that there are something wrong with java pack's debug methods, and you'd better avoid to use them. And another important point is that you need to compile your java code using the jdk with same version as that datastage uses.
Post Reply