Re: [tcljava-user] regarding java objects
Brought to you by:
mdejong
From: Patrick F. <fin...@gm...> - 2007-05-24 08:08:51
|
On 24/05/07, Mrinal Khanvilkar <mr...@gm...> wrote: > > Hi, > I have a web application which runs expect scripts on remote machines > using tclBlend. Now i want to use the same thing to push java objects into > the data base > > this is how i invoke the jtclsh shell from my web application > > Runtime rt = Runtime.getRuntime(); > Process proc = rt.exec("cmd /c > C:\\TclBlend\\bin\\jtclsh.exe C:\\ScriptFiles\\script"+ ""+ID > + ConstantsFile.SCRIPT_FILE_EXTENSION); > > and the contents of the script file that i am using is given below > > #!C:\TclBlend\bin\jtclsh -- > package require java > package require Expect > set session null > spawn telnet afads 23 > set something [java::new chars.rulewizard.GenerateFactObject "mrinal123"] > puts $something Try setting the Tcl Classpath variable inside the tcl script. E.G for MQ. # build tcl classpath append x $drive/IBM/WebSphereMQ/Java/lib/com.ibm.mq.jar\; append x $drive/IBM/WebSphereMQ/Tools/Java/base\; append x $drive/IBM/WebSphereMQ/Java/lib/com.ibm.mqjms.jar\; append x $drive/IBM/WebSphereMQ/Tools/Java/jms\; append x $drive/IBM/WebSphereMQ/Java/lib/com.ibm.mqbind.jar\; set env(TCL_CLASSPATH) $x puts "\nTCL_CLASSPATH = [ array get env TCL_CLASSPATH ]\n" See class loading page of manual. http://tcljava.sourceforge.net/docs/TclJava/ClassLoading.html Also check the system classpath supplied to the script. Something like: set classPath [ split [ lindex [ array get env CLASSPATH ] 1 ] { ; } ] foreach i $classPath { if { $i != {} } { puts $i } } |