Java Compilation error

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
srinivas.nettalam
Participant
Posts: 134
Joined: Tue Jun 15, 2010 2:10 am
Location: Bangalore

Java Compilation error

Post by srinivas.nettalam »

Hi,
We are trying to invoke java function in datastage job. We tried to compile the code and we are getting same error like this post as seen below:

Code: Select all

generateUUID.java:1: package com.ascentialsoftware.jds does not exist
import com.ascentialsoftware.jds.Stage;
                                ^
generateUUID.java:2: package com.ascentialsoftware.jds does not exist
import com.ascentialsoftware.jds.Row;
                                ^
generateUUID.java:4: cannot find symbol
symbol: class Stage
public class generateUUID extends Stage
                                  ^
generateUUID.java:10: cannot find symbol
symbol  : method trace()
location: class generateUUID
trace();
^
generateUUID.java:13: incompatible types
found   : java.util.UUID
required: java.lang.String
   String newguid = UUID.randomUUID();
                                   ^
generateUUID.java:14: cannot find symbol
symbol  : class Row
location: class generateUUID
   Row outputRow=createOutputRow();
   ^
generateUUID.java:14: cannot find symbol
symbol  : method createOutputRow()
location: class generateUUID
   Row outputRow=createOutputRow();
                 ^
generateUUID.java:16: cannot find symbol
symbol  : variable OUTPUT_STATUS_READY
location: class generateUUID
   return OUTPUT_STATUS_READY
Please let me know what all the steps we need to follow to execute a java functon successfully in datastage job.Do we need to install the packages com.ascential.* and also from which path we need to compile the code??
N.Srinivas
India.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

<split to your own post>
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Start with the first error. Resolve the "package not found" error message.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

it's all about your classpath(s) at development and compile time, the manner in which the import statements are set up...where you have jar files and other resources......all in all...java development things. Make sure you have a java resource available for the work. Most will have a java IDE already set up, or will know how to set one up, and will have their own personal and site preferences as to where to put libraries and jar files and how to name them at your site, etc. etc.

google it also. There are hundreds of resources and forums for java, many of which are as rich as our own dsXchange. Many of those such forums are great places for issues regarding the initial compilation of your code.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
srinivas.nettalam
Participant
Posts: 134
Joined: Tue Jun 15, 2010 2:10 am
Location: Bangalore

Post by srinivas.nettalam »

Code: Select all

dsadm@ait-etl01dev:/home/dsadm $ env
_=/usr/bin/env
LANG=en_ZA.8859-15
LOGIN=dsadm
SSH_TTY=/dev/pts/0
CLCMD_PASSTHRU=1
PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/local/bin:/var/ifor:/usr/vac/bin:/usr/java5/jre/bin:/app/oracle/product/11.2.0/client_1/bin:/home/db2inst1/sqllib/java/jdk64/bin
LC__FASTMSG=true
CLASSPATH=/opt/IBM/InformationServer/Server/DSEngine/java/lib
LOGNAME=dsadm
MAIL=/usr/spool/mail/dsadm
ORACLE_SID=dwhdev:plnuat
LOCPATH=/usr/lib/nls/loc
PS1=$LOGNAME@ait-etl01dev:$PWD $
USER=dsadm
AUTHSTATE=compat
SHELL=/usr/bin/ksh
DSHOME=/opt/IBM/InformationServer/Server/DSEngine
ODMDIR=/etc/objrepos
HOME=/home/dsadm
FCEDIT=vi
SSH_CONNECTION=10.38.9.44 59693 10.36.157.190 22
SSH_CLIENT=10.38.9.44 59693 22
TERM=xterm
MAILMSG=[YOU HAVE NEW MAIL]
ORACLE_HOME=/app/oracle/product/11.2.0/client_1
PWD=/home/dsadm
TZ=Africa/Johannesburg
ENV=/etc/.kshrc
A__z=! LOGNAME
NLSPATH=/usr/lib/nls/msg/%L/%N:/usr/lib/nls/msg/en_US.8859-15/%N:/usr/lib/nls/msg/%L/%N.cat:/usr/lib/nls/msg/en_US.8859-15/%N.cat
Hi,Do we ned to include any Environment Variables in .profile for JAva Pack specifically other than the CLASSPATH and PATH?
N.Srinivas
India.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Maybe. Where are your other classes (jar files) located?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chetan.c
Participant
Posts: 112
Joined: Tue Jan 17, 2012 2:09 am
Location: Bangalore

Post by chetan.c »

This link tells you about the compilation of your code.

http://www-01.ibm.com/support/docview.w ... wg21607302

Thanks,
Chetan.C
srinivas.nettalam
Participant
Posts: 134
Joined: Tue Jun 15, 2010 2:10 am
Location: Bangalore

Post by srinivas.nettalam »

Hi All,
The code got compiled successfully and we added DATASTAGE_JVM and DATASTAGE_JRE environmental vairables on the AIX server and the java function executed successfully using the java client stage on the job
N.Srinivas
India.
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Great work! Once you do all the environment work the first time, you probably will never have to look at it again....now you can do some creative things to extend your DS app. Congrats.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
srinivas.nettalam
Participant
Posts: 134
Joined: Tue Jun 15, 2010 2:10 am
Location: Bangalore

Post by srinivas.nettalam »

Thank You!! :)
N.Srinivas
India.
Post Reply