Hi,
I am new to Java client stage. I am trying to run java program through datastage. My job looks like
Java stage-----> Sequential File stage
I have an employee.java program. It has details of employee like employee ID, name, designation, place.
I am trying to run .java class through datastage but getting error as javaclassnot found.exception
Please advise where should be .class file placed and also what should be the user's classpath in java client stage?
also any dsenv need to be set before runnning the job.
I am using Dstage 8.5
Thanks
Use of java client/ transformer stage
Moderators: chulett, rschirm, roy
My .class file is Employee only (mistake in case for E) and i gave it correctly.
Also i have not included the .class extension for transformer Class Name.
And at user classpath I have given this path where i have placed my .class file
C:\Users\dsouza
Getting error as "java.lang.ClassNotFoundException: Employee"
Also i have not included the .class extension for transformer Class Name.
And at user classpath I have given this path where i have placed my .class file
C:\Users\dsouza
Getting error as "java.lang.ClassNotFoundException: Employee"
There is a lot more to this than just the classpath....
First, have you coded your Employee.java along with the JavaPack API? DataStage works very closely with the java code that you write, invoking various pre-defined methods that you include in your code. In those methods you place your own logic along with the various API calls that allow you to interact with the DataStage engine.
Assuming you have done that, and included your local jars and also the JavaPack API jars and it has all compiled appropriately, then you can move to the next step which is trying to run it inside of your Job.
At that point, the classpath is typically dependent upon some of the specifics that are inside of your class, such as the Package. Java standards vary --- you will often find some very detailed Package names, and those Package names will often establish a real sub-directory hierarchy. For simple testing purposes I tend to have a single name package, such as "myStuff". Under those circumstances my Classpath goes as deep as "one level higher" than the subdirectory that matches my Package name.
...so that means on disk, myClass.class sits in a subdirectory called
c:\myBusiness\myStuff
...and then I include c:\myBusiness in my Classpath.
If you are not familiar with the details I noted above about the pre-defined classes and the API, you need to spend a lot of time with the documentation and the many examples that are identified in the forum and elsewhere.
Ernie
First, have you coded your Employee.java along with the JavaPack API? DataStage works very closely with the java code that you write, invoking various pre-defined methods that you include in your code. In those methods you place your own logic along with the various API calls that allow you to interact with the DataStage engine.
Assuming you have done that, and included your local jars and also the JavaPack API jars and it has all compiled appropriately, then you can move to the next step which is trying to run it inside of your Job.
At that point, the classpath is typically dependent upon some of the specifics that are inside of your class, such as the Package. Java standards vary --- you will often find some very detailed Package names, and those Package names will often establish a real sub-directory hierarchy. For simple testing purposes I tend to have a single name package, such as "myStuff". Under those circumstances my Classpath goes as deep as "one level higher" than the subdirectory that matches my Package name.
...so that means on disk, myClass.class sits in a subdirectory called
c:\myBusiness\myStuff
...and then I include c:\myBusiness in my Classpath.
If you are not familiar with the details I noted above about the pre-defined classes and the API, you need to spend a lot of time with the documentation and the many examples that are identified in the forum and elsewhere.
Ernie
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>