Thread: [tcljava-user] (no subject)
Brought to you by:
mdejong
From: Pak L. <pak...@di...> - 2003-01-23 16:02:57
|
Hi, I would like my Java program to run a tcl script which requires a package called Service. How can I tell the jacl Interpter to find the "Service" package? As I got the following exception: C:\CSLU\Toolkit\2.0\src\examples\baldiControl>java baldiControl tcl.lang.TclException: can't find package Service at tcl.lang.PackageCmd.pkgRequire(PackageCmd.java) at tcl.lang.PackageCmd.cmdProc(PackageCmd.java) at tcl.lang.Parser.evalObjv(Parser.java) at tcl.lang.Parser.eval2(Parser.java) at tcl.lang.Interp.eval(Interp.java) at tcl.lang.Interp.evalFile(Interp.java) at baldiControl.baldiSpeak(baldiControl.java:25) at baldiControl.main(baldiControl.java:52) Thanks and Regards Pak -- This message has been scanned for viruses by the DIT Computer Centre MailScanner Service, and is believed to be clean. |
From: harish <har...@wi...> - 2003-04-16 11:45:35
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <HTML> <HEAD> <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; = charset=3Diso-8859-1"> <META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version = 6.0.6249.1"> <TITLE></TITLE> </HEAD> <BODY> <!-- Converted from text/rtf format --> <P><FONT SIZE=3D2 FACE=3D"Arial">Hi,</FONT> </P> <P><FONT SIZE=3D2 FACE=3D"Arial">I have downloaded the tclblend binaries = for windows from scriptics.com site.Now, How can i know whether tclblend = is installed or not?.Do I need to install Tcl/Tk seperately or it will = come with tcl blend?. Could you tell me the detailed steps involved in = using Tcl Blend.</FONT></P> <P><FONT SIZE=3D2 FACE=3D"Arial">Rgds,</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">Hari</FONT> </P> </BODY> </HTML> |
From: Mo D. <md...@un...> - 2003-04-19 00:32:39
|
On Wed, 16 Apr 2003 17:14:57 +0530 "harish" <har...@wi...> wrote: > Hi, > > I have downloaded the tclblend binaries for windows from scriptics.com site. > Now, How can i know whether tclblend is installed or not?.Do I need to > install Tcl/Tk seperately or it will come with tcl blend?. Could you tell > me the detailed steps involved in using Tcl Blend. You need to Tcl 8.3 download, here is the link from the Tcl Blend download page: http://tcl.activestate.com/download/tcl/tcl8_3/tcl831.exe Then just unzip the Tcl Blend binary in the installed Tcl dir, it will unpack the files into the lib. You then start the Tcl shell and run "package require java" and it should just work. Just and FYI, but there is a new Tcl Blend 1.3.0 release, but it is still "for developers only". cheers Mo |
From: Dan D. <dda...@ya...> - 2008-09-24 15:01:49
|
Hi, I am wondering why I need to "preserve" a TclList that I don't return to TCL, nor need/use after the function returns. I am trying to return just one sub-list from a list of sub-lists. If I have just a list of normal TclObjects I can return one item without a problem. What is wrong with this: public void cmdProc(Interp interp, TclObject argv[]) throws TclException { TclObject list = TclList.newInstance(); //Create the first sublist TclObject list1 = TclList.newInstance(); TclList.append(interp, list1, TclString.newInstance("1.1")); TclList.append(interp, list1, TclString.newInstance("1.2")); //Create the second sublist TclObject list2 = TclList.newInstance(); TclList.append(interp, list2, TclString.newInstance("2.1")); TclList.append(interp, list2, TclString.newInstance("2.2")); //Add to main list TclList.append(interp, list, list1); TclList.append(interp, list1, list2); //list.preserve(); //return just the second sublist list interp.setResult(TclList.index(interp, list, 0)); } When I run it (without the preserve()), I get this: % ls_test alloc: invalid block: 009B3DF0: f8 0 0 This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. D:\ When I run a similar situation in my production code I get the error from JRE side, SIGSEGV on Linux and ACCESS_VIOLATION on Windows: # # An unexpected error has been detected by HotSpot Virtual Machine: # # SIGSEGV (0xb) at pc=0x4008eb78, pid=4098, tid=1074768448 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_06-b05 mixed mode, sharing) # Problematic frame: # C [libtcl8.4.so+0x77b78] # # An error report file with more information is saved as hs_err_pid4098.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # Aborted (core dumped) Thanks, Dan |
From: Mo D. <mo...@mo...> - 2008-09-24 19:30:37
|
Dan Diolosa wrote: > > Hi, > > > I am wondering why I need to "preserve" a TclList that I don't return > to TCL, nor need/use after the function returns. > > I am trying to return just one sub-list from a list of sub-lists. If > I have just a list of normal TclObjects I can return one item without > a problem. What is wrong with this: > Hi Dan It is kind of odd, and the way you are using the list object is kind of odd too. I am sure there is some reason for it in your code, but in this example you should be able to just set the interp result to list1 without having to create another container list. I don't see why your code would need to preserve() the "list" variable, but it would need to release it after the interp.setResult() call in order to avoid leaking memory. When a TclObject is created it should have a ref count of 0, if you then release() it is should then be deallocated. The safest thing to do is to preserve() the container list, and then release() it (which will release any contained objects) after the interp.setResult() call. The release should be in a finally block, in case an exception is thrown. I hope that helps Mo DeJong |
From: Martin L. <mar...@gm...> - 2008-09-25 09:08:39
Attachments:
smime.p7s
|
Hi Dan, the reason is, that you return an element from the just built list by pushing it into the interpreter. If the method is ending the list object is released and all its elements will be released, too. So the result list element won't be present anymore. In my eyes even a "list.preserve" call wouldn't solve the problem because it raises the question, when the list would be release again? I would say ... never! So I would duplicate the object I want to return! In C(++) I would do: *Tcl_Obj** pList = *Tcl_NewObj*(); // building the list *Tcl_Obj** pElement = NULL; *Tcl_ListObjIndex*(pInterp, pList, nIndex, &pElement); *Tcl_SetObjResult*(pInterp, *Tcl_DuplicateObj*(pElement)); By the way ... why do you build a tcl list to extract one element and to forget it? Why not using Java container objects, if container objects are really needed? Ok - I hope my suggestion helps. Best regards, Martin Lemburg Dan Diolosa wrote: > > Hi, > > > I am wondering why I need to "preserve" a TclList that I don't return > to TCL, nor need/use after the function returns. > > I am trying to return just one sub-list from a list of sub-lists. If > I have just a list of normal TclObjects I can return one item without > a problem. What is wrong with this: > > > > public void cmdProc(Interp interp, TclObject argv[]) throws TclException > > { > > TclObject list = TclList.newInstance(); > > > > //Create the first sublist > > TclObject list1 = TclList.newInstance(); > > TclList.append(interp, list1, TclString.newInstance("1.1")); > > TclList.append(interp, list1, TclString.newInstance("1.2")); > > > > //Create the second sublist > > TclObject list2 = TclList.newInstance(); > > TclList.append(interp, list2, TclString.newInstance("2.1")); > > TclList.append(interp, list2, TclString.newInstance("2.2")); > > > > //Add to main list > > TclList.append(interp, list, list1); > > TclList.append(interp, list1, list2); > > > > //list.preserve(); > > > > //return just the second sublist list > > interp.setResult(TclList.index(interp, list, 0)); > > } > > > > When I run it (without the preserve()), I get this: > > % ls_test > > alloc: invalid block: 009B3DF0: f8 0 0 > > > > This application has requested the Runtime to terminate it in an > unusual way. > > Please contact the application's support team for more information. > > D:\ > > > > > > When I run a similar situation in my production code I get the error > from JRE side, SIGSEGV on Linux and ACCESS_VIOLATION on Windows: > > > > # > > # An unexpected error has been detected by HotSpot Virtual Machine: > > # > > # SIGSEGV (0xb) at pc=0x4008eb78, pid=4098, tid=1074768448 > > # > > # Java VM: Java HotSpot(TM) Client VM (1.5.0_06-b05 mixed mode, sharing) > > # Problematic frame: > > # C [libtcl8.4.so+0x77b78] > > # > > # An error report file with more information is saved as > hs_err_pid4098.log > > # > > # If you would like to submit a bug report, please visit: > > # http://java.sun.com/webapps/bugreport/crash.jsp > > # > > Aborted (core dumped) > > > Thanks, > > Dan > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > ------------------------------------------------------------------------ > > _______________________________________________ > tcljava-user mailing list > tcl...@li... > https://lists.sourceforge.net/lists/listinfo/tcljava-user > -- ------------------------------------------------------------------------ Martin Lemburg Emdener Strasse 19A D-10551 Berlin Private: Phone: +49 30 39 03 72 05 Mobile: +49 179 395 40 95 Fax: +49 1805 40 02-26 86 05 Email: mar...@gm... <mailto:mar...@gm...> Office: Phone: +49 30 46 77 75-22 Fax: +49 30 46 77 75-11 Email: mar...@si... <mailto:mar...@si...> ------------------------------------------------------------------------ "We are all individualists!" "No, Im the only non-individualist!" (Monty Pythons "Life of Brian") ------------------------------------------------------------------------ |
From: Omar E. J. V. <oma...@gm...> - 2011-03-06 12:57:40
|
From: Shibu C. <shi...@ya...> - 2012-06-29 17:16:26
|
http://meljin.co.za/pagnrk.html |
From: Shibu C. <shi...@ya...> - 2012-08-31 12:11:02
|
http://www.mexicollectables.com/pmngbl.php?ctbb=ctbb |
From: Shibu C. <shi...@ya...> - 2012-08-31 18:30:23
|
http://www.programul-prima-casa.ro/wp-content/plugins/zwuweawjvmc/ikhkjskl.php?syzj=syzj |
From: Shibu C. <shi...@ya...> - 2012-09-01 00:25:43
|
http://translator.6te.net/atmlse.php?hwux=hwux |
From: Mo D. <md...@un...> - 2003-01-23 21:00:59
|
On Thu, 23 Jan 2003 16:08:56 +0000 Pak Leung <pak...@di...> wrote: > Hi, > > I would like my Java program to run a tcl script which requires a > package called Service. > > How can I tell the jacl Interpter to find the "Service" package? The "package require XXX" command works just like it does in Tcl, in that it looks at the directories in the "auto_path" global variable and tries to load any packages found in those directories. Each dir on the auto_path is checked to see if it has a pkgIndex.tcl file or a subdir that contains a pkgIndex.tcl file. This pkgIndex.tcl file is then source'd, which runs the package provide command in the file. You can set the auto_path however you like, you might also want to try out the -DTCLLIBPATH=/somedir argument to the java executable. That will add the /somedir argument to the auto_path from the command line. cheers Mo |