Thread: [tcljava-user] tclblend execution problem on linux
Brought to you by:
mdejong
From: Will Z. <wa...@gm...> - 2006-01-25 19:07:57
|
Mo, I am having problems getting tclblend working on linux. I have installed tclblend and everything looks ok, but when I attempt to run my tcl script I get the following error: -bash-2.05b$ cdv.tcl "XpUtils::iload -d /opt/tclBlend1.3.2 tclblend" failed: java.lang.UnsatisfiedLinkError: no tclblend in java.library.path While instantiating Interp object in Tclblend_Init The Tcl Blend shared lib was loaded by Tcl, but the JVM could not access JNI symbols. while executing "error "\"XpUtils::iload -d $dir tclblend\" failed:\n $errMsg"" (procedure "loadtclblend" line 168) invoked from within "loadtclblend /opt/tclBlend1.3.2" ("package ifneeded" script) invoked from within "package require java" (file "./cdv.tcl" line 6) I check my env and it looks fine. From jtclsh I did the following: -bash-2.05b$ jtclsh % env HOSTNAME=3Dautomation01 JAVA_LIB_RUNTIME_PATH=3D/usr/java/jdk1.5.0_06/jre/lib/i386:/usr/java/jdk1.5= .0_06/jre/lib/i386/client:/usr/java/jdk1.5.0_06/jre/lib/i386/native_threads= :/usr/local/lib/tcljava1.3.2 TERM=3Dvt100 SHELL=3D/bin/bash LD_BIND_NOW=3D HISTSIZE=3D1000 LD_PRELOAD=3D USER=3Dtester2 LS_COLORS=3Dno=3D00:fi=3D00:di=3D01;34:ln=3D01;36:pi=3D40;33:so=3D01;35:bd= =3D40;33;01:cd=3D40;33;01:or=3D01;05;37;41:mi=3D01;05;37;41:ex=3D01;32:*.cm= d=3D01;32:*.exe=3D01;32:*.com=3D01;32:*.btm=3D01;32:*.bat=3D01;32:*.sh=3D01= ;32:*.csh=3D01;32:*.tar=3D01;31:*.tgz=3D01;31:*.arj=3D01;31:*.taz=3D01;31:*= .lzh=3D01;31:*.zip=3D01;31:*.z=3D01;31:*.Z=3D01;31:*.gz=3D01;31:*.bz2=3D01;= 31:*.bz=3D01;31:*.tz=3D01;31:*.rpm=3D01;31:*.cpio=3D01;31:*.jpg=3D01;35:*.g= if=3D01;35:*.bmp=3D01;35:*.xbm=3D01;35:*.xpm=3D01;35:*.png=3D01;35:*.tif=3D= 01;35: LD_LIBRARY_PATH=3D/usr/java/jdk1.5.0_06/jre/lib/i386:/usr/java/jdk1.5.0_06/= jre/lib/i386/client:/usr/java/jdk1.5.0_06/jre/lib/i386/native_threads:/usr/= local/lib/tcljava1.3.2:/opt/tclBlend1.3.2/unix:/usr/java/jdk1.5.0_06/jre/li= b/i386/native_threads KAFFELIBRARYPATH=3D/usr/java/jdk1.5.0_06/jre/lib/i386:/usr/java/jdk1.5.0_06= /jre/lib/i386/client:/usr/java/jdk1.5.0_06/jre/lib/i386/native_threads:/usr= /local/lib/tcljava1.3.2:/usr/java/jdk1.5.0_06/jre/lib/i386:/usr/java/jdk1.5= .0_06/jre/lib/i386/client:/usr/java/jdk1.5.0_06/jre/lib/i386/native_threads= :/usr/local/lib/tcljava1.3.2:/opt/tclBlend1.3.2/unix:/usr/java/jdk1.5.0_06/= jre/lib/i386/native_threads PATH=3D/usr/kerberos/bin::::/usr/java/jdk1.5.0_06/bin://home/tester2:/usr/l= ocal/bin:/usr/sbin:/sbin:/usr/bin:/bin:/usr/X11R6/bin MAIL=3D/var/spool/mail/tester2 LOGIN=3Dtester2 PWD=3D/home/tester2/run INPUTRC=3D/etc/inputrc TCLLIBPATH=3D/usr/local/lib LANG=3Den_US.UTF-8 KRB5CCNAME=3DFILE:/tmp/krb5cc_p566 SSH_ASKPASS=3D/usr/libexec/openssh/gnome-ssh-askpass HOME=3D/home/tester2 SHLVL=3D1 LOGNAME=3Dtester2 CLASSPATH=3D/usr/java/jdk1.5.0_06/jre/lib/rt.jar LESSOPEN=3D|/usr/bin/lesspipe.sh %s G_BROKEN_FILENAMES=3D1 Your help would greatly be appreciated. P.S. I have expect code in my tcl script. Here is what I am working on: #!/usr/bin/expect -- source /home/server/module/startup.tcl lappend auto_path /opt/tclBlend1.3.2 /usr/local/lib/xputils /usr/local/lib/tcljava1.3.2 package require java ########## start here ########### set procname cdv.tcl; set dbg 1; printFilesOpen {cdv} equipFileRead equipment.txt; # read in the data file arrArrayDump eqArr $dbg; if {1} {####### login to all devices ####### ##### go through all alphabetically foreach key [lsort -dictionary [array names eqArr {*ip*}]] { # only need one so use "ip" which needs to exist for all device s regsub {\{ip\}} $key "" name; # strip off "{ip}" ### Do the stuff here if {$dbg} {print "Debug - $procname Debug - dut =3D $name"}= ; ### open session to device set spawn_id [equipSessionOpen $name]; ### close session close $spawn_id; } } if {1} { ####### SNMP set ver 1; set retries 1 set timeout 2; set optSet "-c \$comm -m all -v $ver -O vQ -r $retries -t $timeout"= ; set optGet "-c \$comm -m all -v $ver -O vQ -r $retries -t $timeout"= ; ##### go through all alphabetically foreach key [lsort -dictionary [array names eqArr {*ip*}]] { # only need one so use "ip" which needs to exist for all device s regsub {\{ip\}} $key "" name; # strip off "{ip}"; set ip $eqArr($name{ip}); set roComm $eqArr($name{snmpRO}) set rwComm $eqArr($name{snmpRW}) if {$dbg} {print "Debug - $procname Debug - dut =3D $name = =3D> ip =3D $ip, roComm =3D $roComm, rwComm =3D $rwComm"}; ### try to read the sysDescr using local RO string set act [snmpGet $ip " sysDescr.0" $roComm $optGet 1]; set strng "get sysDescr from local using local RO" set exp "VENDOR"; chkRegexp $strng $act $exp ### try to read the sysDescr using local RW string set act [snmpGet $ip "sysDescr.0" $rwComm $optGet 1]; set strng "get sysDescr from local using local RW" set exp "VENDOR"; chkRegexp $strng $act $exp ### try to write the sysContact using local RW string set act [snmpSet $ip sysContact.0 s "Local-RW" $rwComm $optSet 1]; set strng "set sysContact from local using local RW" set exp "OK"; chkString $strng $act $exp } } ##### End of File ##### Regards, Will |
From: Mo D. <md...@un...> - 2006-01-26 04:03:35
|
On Wed, 25 Jan 2006 14:07:49 -0500 Will Zapar <wa...@gm...> wrote: > Mo, > > I am having problems getting tclblend working on linux. I have installed > tclblend and everything looks ok, but when I attempt to run my tcl script I > get the following error: > > -bash-2.05b$ cdv.tcl > "XpUtils::iload -d /opt/tclBlend1.3.2 tclblend" failed: > java.lang.UnsatisfiedLinkError: no tclblend in java.library.path That is a strange one. I think the only way this error can show up is if the tclblend.so is loaded, but the JVM can't read the symbols for some reason. First off, did you pass a --prefix=/somedir/whereit/should/go type of directory name to the configure script? I have seen some problems that may be the result of trying to use the default --prefix. Also, this might be a silly question but you did compiled with gcc and not g++ right, if you used a c++ compiler it might mangle the symbols in some funky way. If you did pass a --prefix to configure, then what happens if you run "make test" from the build dir where you built Tcl Blend? Do the test cases pass when run in the build directory? If you can't get Tcl Blend running in the build directory then it is likely that one of the shared libraries it needs does not appear on the runtime path. This tends to be caused by changes to the JDK layout which seem to show up with every new release. The configure script may not know how to find a runtime library that is needed. You could try running "make shell" from the Tcl Blend build dir and then run "ldd tclblend.so" to see if it prints any missing shared library deps. Running "make shell" like that will set the LD_LIBRARY_PATH to the runtime paths defined in the Makefile. If you are able to identify a shared lib dir that needs to be added to the runtime path or a shared library that needs to be linked to, then the way to fix it is in the configure script. If that seems to scary just post a diff of the Makefile before and after your changes and I will fixup the configure script. There are some other things you could try if none of this works, but that should at least give you something to try next. Also, see the recent posts on this list about gcc 4 not compiling Tcl Blend correctly. I hope that helps Mo DeJong |