Accessing java class from DataStage

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
techiexavier
Participant
Posts: 39
Joined: Tue Feb 28, 2012 12:59 pm
Location: Chennai

Accessing java class from DataStage

Post by techiexavier »

Hi All,

I am working with Java client stage to invoke a java class file. I am just calling simple class file to print a message. My design is

Java client stage -> seq_file

I am not returning anything out of my java class. In the link to seq_file I am just having one filed but I am not passing through any data in it. Once this class invoked and I am able to print the string I will proceed to return data from the file and will load to seq file.

But I am getting below error and my job is getting aborted.

Java_Transformer_9,0: Error: java.lang.ClassCastException: Print_ds incompatible with com.ascentialsoftware.jds.InternalStage

Print_ds is my class name. I am not able to get proper input from sites. Please help he.

TIA.
techiexavier
Participant
Posts: 39
Joined: Tue Feb 28, 2012 12:59 pm
Location: Chennai

Post by techiexavier »

My Java code is:

Public class Print_ds
{
Public static void main(Stringp[] args)
{
System.out.println("Success");
}
}
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post by jwiles »

Your class is not defined correctly. More specifically, it does not extend the Stage class, as described in documentation for the Java Pack.

Have you read the documentation regarding the Java Pack and Java Client Stages? It describes how to properly create your Java class and programs for use with DataStage and provides examples for source and target Client stages. Here's the link for IS 8.7: http://publib.boulder.ibm.com/infocente ... apack.html

Regards,
- james wiles


All generalizations are false, including this one - Mark Twain.
lstsaur
Participant
Posts: 1139
Joined: Thu Oct 21, 2004 9:59 pm

Post by lstsaur »

Your class wouldn't even get compiled with "Stringp[]".
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post by jwiles »

Good catch! I missed that little typo...might need some new glasses :(

Regards,
- james wiles


All generalizations are false, including this one - Mark Twain.
techiexavier
Participant
Posts: 39
Joined: Tue Feb 28, 2012 12:59 pm
Location: Chennai

Post by techiexavier »

Thanks for the inputs.

Stringp is typo error.. Will check the docs and will update the result.
Post Reply