tcljava-user Mailing List for Tcl/Java (Page 16)
Brought to you by:
mdejong
You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(23) |
Dec
(9) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(12) |
Feb
(10) |
Mar
(16) |
Apr
(10) |
May
(40) |
Jun
(13) |
Jul
(18) |
Aug
(4) |
Sep
(6) |
Oct
(3) |
Nov
|
Dec
(3) |
2002 |
Jan
(15) |
Feb
(19) |
Mar
(1) |
Apr
(11) |
May
(12) |
Jun
(10) |
Jul
(2) |
Aug
(22) |
Sep
|
Oct
(3) |
Nov
(9) |
Dec
(20) |
2003 |
Jan
(32) |
Feb
(5) |
Mar
(26) |
Apr
(30) |
May
(10) |
Jun
(8) |
Jul
(17) |
Aug
(7) |
Sep
(24) |
Oct
(7) |
Nov
(6) |
Dec
|
2004 |
Jan
(5) |
Feb
|
Mar
|
Apr
(7) |
May
(8) |
Jun
(12) |
Jul
(3) |
Aug
(11) |
Sep
(8) |
Oct
(4) |
Nov
(2) |
Dec
(6) |
2005 |
Jan
(8) |
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
(19) |
Jul
(8) |
Aug
(22) |
Sep
(12) |
Oct
(35) |
Nov
(12) |
Dec
(4) |
2006 |
Jan
(20) |
Feb
(14) |
Mar
(23) |
Apr
(10) |
May
(11) |
Jun
(1) |
Jul
(1) |
Aug
(1) |
Sep
|
Oct
(4) |
Nov
(17) |
Dec
(10) |
2007 |
Jan
(41) |
Feb
(6) |
Mar
(23) |
Apr
(15) |
May
(34) |
Jun
(5) |
Jul
(18) |
Aug
(13) |
Sep
(8) |
Oct
(9) |
Nov
(7) |
Dec
(2) |
2008 |
Jan
|
Feb
(1) |
Mar
(18) |
Apr
(1) |
May
(1) |
Jun
(10) |
Jul
(3) |
Aug
|
Sep
(10) |
Oct
(3) |
Nov
(13) |
Dec
(3) |
2009 |
Jan
(4) |
Feb
(10) |
Mar
(1) |
Apr
(11) |
May
(3) |
Jun
(7) |
Jul
(4) |
Aug
(9) |
Sep
(16) |
Oct
(3) |
Nov
(5) |
Dec
(2) |
2010 |
Jan
(3) |
Feb
|
Mar
|
Apr
(7) |
May
(1) |
Jun
|
Jul
|
Aug
(3) |
Sep
(3) |
Oct
(1) |
Nov
(1) |
Dec
|
2011 |
Jan
(3) |
Feb
|
Mar
(2) |
Apr
(17) |
May
(4) |
Jun
(17) |
Jul
(5) |
Aug
(7) |
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
(12) |
Mar
|
Apr
(1) |
May
(1) |
Jun
(1) |
Jul
|
Aug
(3) |
Sep
(2) |
Oct
(6) |
Nov
|
Dec
(2) |
2013 |
Jan
|
Feb
(1) |
Mar
|
Apr
(1) |
May
(8) |
Jun
(1) |
Jul
|
Aug
(3) |
Sep
|
Oct
(3) |
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
(1) |
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
(1) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
(2) |
Apr
(2) |
May
(1) |
Jun
(3) |
Jul
(3) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
(1) |
Sep
|
Oct
(1) |
Nov
|
Dec
|
2018 |
Jan
|
Feb
(1) |
Mar
|
Apr
(1) |
May
|
Jun
(1) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
(1) |
Sep
(2) |
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2021 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
From: Bill D. <bil...@xi...> - 2007-05-04 20:15:21
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> </head> <body bgcolor="#ffffff" text="#000000"> Mo,<br> <br> <blockquote cite="mid:200...@ma..." type="cite"> <blockquote cite="mid:463...@mo..." type="cite"> <blockquote type="cite"> <pre wrap=""> Should JACL 1.3.3 and 1.4.0 have lsort -unique? -Bill </pre> </blockquote> <pre wrap=""><!----> No, but patches to src/jacl/tcl/lang/LsortCmd.java would be happily accepted. </pre> </blockquote> I looked at tests/tcl/lsort.tcl and it looks like it does use the -unique flag.<br> <br> So lsort -unique is not implemented in any fashion?<br> </blockquote> What version of TCL is jacl 133 and 140 equivalent to? 8.0, 8.1,.. other?<br> <br> -Bill<br> </body> </html> |
From: Bill D. <bil...@xi...> - 2007-05-04 20:11:25
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> <title></title> </head> <body bgcolor="#ffffff" text="#000000"> Mo DeJong wrote: <blockquote cite="mid:463...@mo..." type="cite"> <pre wrap="">Bill Deegan wrote: </pre> <blockquote type="cite"> <pre wrap="">Greetings, Should JACL 1.3.3 and 1.4.0 have lsort -unique? -Bill </pre> </blockquote> <pre wrap=""><!----> No, but patches to src/jacl/tcl/lang/LsortCmd.java would be happily accepted. </pre> </blockquote> I looked at tests/tcl/lsort.tcl and it looks like it does use the -unique flag.<br> <br> So lsort -unique is not implemented in any fashion?<br> <br> Thanks,<br> Bill<br> </body> </html> |
From: Mo D. <mo...@mo...> - 2007-05-04 20:01:04
|
Bill Deegan wrote: > Greetings, > > Should JACL 1.3.3 and 1.4.0 have lsort -unique? > > -Bill > No, but patches to src/jacl/tcl/lang/LsortCmd.java would be happily accepted. Mo |
From: Mo D. <mo...@mo...> - 2007-05-04 19:59:26
|
shrisha karanth wrote: > Hello all, > > I require some example of TclList, > > My Problem is that i want to send arrayList to the TCL from java.so i > wanto to know how to intiliaze tcllist and append values into it. > > Thanks > Naveen > Hello Naveen Here is the most simple example of TclList usage: { TclObject alist = TclList.newInstance(); TclList.append(interp, alist, TclString.newInstance("ONE")); TclList.append(interp, alist, TclString.newInstance("TWO")); TclList.append(interp, alist, TclString.newInstance("THREE")); interp.setResult(alist); } To get values out of a ArrayList, just iterate over the elements and create a TclString or TclInteger object for each element before adding to the TclList. I hope that helps Mo DeJong |
From: Mo D. <mo...@mo...> - 2007-05-04 19:51:41
|
Justin Ryan wrote: > Before using Jacl, I was executing a Tcl binary via Runtime.exec. This > provided me with an easy way of grabbing the input/output from the > Process variable. My requirement is to capture the stdout of a > untrusted Tcl script (and not the result). > > I'd like to see Jacl behave like its in a sandbox, to use in a JSR-233 > fashion. In which it minimizes it's access to the System class > (System.exit, System.out, System.err). Are there any efforts in this > regard? > > justin > > Hi Justin The approach of overwriting puts, gets, and read is not too complex and should work for you. But, it would be a lot easier to modify the tcl.lang.StdChannel class to support setting the STDIN, STDOUT, AND STDERR streams to a user supplied stream. This is likely a 30 minute hack, I am sure you could implement it easily. If you want to do that and post a patch, I can add it to the CVS version for Jacl 1.4. cheers Mo DeJong |
From: Mo D. <mo...@mo...> - 2007-05-04 19:39:15
|
Justin Ryan wrote: > I run Tcl scripts inside of a larger long-running Java system (along > the lines of JSR-223, but using tcl.lang classes directly), and I've > found some behavior which I found a little odd in Jacl. The tcl exit > command calls System.exit(), which makes sense when running a single > script. But it proves to be prohibitive when I'm containing the > Interpreter inside a larger system. I'm looking for an exit command to > kindly exit the evalFile/eval method or throw an exception indicating > that the Interp in now invalid. This might already be taken of when > putting the Interpreter into safe mode, is this true and is there > documentation concerning the state of the Safe Interpreter in > tcljava/jacl? > > My workaround, in case anyone is interested is to overwrite the exit > command. I prep the Interpreter before running any untrusted code: > > interp.eval("rename exit ::tcl::exit"); > interp.createCommand("exit", new SafeExitCommand() ); > > My new exit command looks like this: > > public class SafeExitCommand implements Command { > public void cmdProc(Interp interp, TclObject argv[]) > throws TclException { > int code = 0; > > if (argv.length > 2) > throw new TclNumArgsException(interp, > 1, argv, "?returnCode?"); > > if (argv.length == 2) { > code = TclInteger.get(interp, argv[1]); > } > > throw new TclException(interp, "ExitCommand " > + Integer.toString(code) ); > } > } > > I then look for a TclException with a message (e.getMessage()) with > the word ExitCommand. It's definitely hacky, but it works for me. An > alternative would be to set the ccode of TclException to something > like TCL.EXIT, and then look for that code like TCL.RETURN is looked > for. Is that a valid idea to persue and contribute? > > justin > > Hi Justin The approach you mention may work out for you. My only suggestion is to take a look at the new "interrupted" feature in Jacl 1.4. You can replace the exit command in the safe interp with a command that invokes Interp.setInterrupted(). When this exception is raised, the call stack will be unwound and the interp will be cleaned up in the event processing thread. You could also invoke this method via reflection from a Tcl script if you like. I hope that helps Mo |
From: Bill D. <bil...@xi...> - 2007-05-04 17:23:34
|
Greetings, Should JACL 1.3.3 and 1.4.0 have lsort -unique? -Bill |
From: Justin R. <ju...@ha...> - 2007-05-01 20:24:07
|
I ran your example in jaclsh and tclsh (running pure Tcl on a linux box) and I got the same exact message in both, without line numbers. So I don't believe this is a case of different behavior. I have seen Jacl provide line numbers, but thats in the case of a runtime error. Maybe this error, and the lack of a stack trace, pertains to parsing error? On 4/19/07, Patrick Finnegan <fin...@gm...> wrote: > > Jacl seems to behave differently to Tcl in that it does not produce line > numbers with the error messages. > > With WebSphere: > > WASX7017E: Exception received while running file > "C:\home\patrick\eclipse\WSAdminCVS\WSAdmin\WAS5.1\JACL\installCluster.tcl"; > exception information: com.ibm.bsf.BSFException: error while eval'ing Jacl > expression: extra switch pattern with no body > > Even if I wrap the "switch statement" in a catch I still don't get a line > number. > > > if { [ catch { > > switch xxxxx-exact -- $secondName { > > name { > > set nameList [ list $secondName [ lindex $a 1 ] ] > > } > > description { > > set descriptionList [ list $secondName [ lindex $a 1 ] ] > > } > > enableHA { > > set enableHAList [ list $secondName [ lindex $a 1 ] ] > > } > > preferLocal { > > set preferLocalList [ list $secondName [ lindex $a 1 ] ] > > } > > serverType { > > set serverTypeList [ list $secondName [ lindex $a 1 ] ] > > } > > > } > > } r ] != 0 } { > > return -code error $r > > } > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > tcljava-user mailing list > tcl...@li... > https://lists.sourceforge.net/lists/listinfo/tcljava-user > > |
From: shrisha k. <nav...@gm...> - 2007-04-27 04:24:05
|
Hello all, I require some example of TclList, My Problem is that i want to send arrayList to the TCL from java.so i wanto to know how to intiliaze tcllist and append values into it. Thanks Naveen |
From: Patrick F. <fin...@gm...> - 2007-04-19 10:26:01
|
Jacl seems to behave differently to Tcl in that it does not produce line numbers with the error messages. With WebSphere: WASX7017E: Exception received while running file "C:\home\patrick\eclipse\WSAdminCVS\WSAdmin\WAS5.1\JACL\installCluster.tcl"; exception information: com.ibm.bsf.BSFException: error while eval'ing Jacl expression: extra switch pattern with no body Even if I wrap the "switch statement" in a catch I still don't get a line number. if { [ catch { switch xxxxx-exact -- $secondName { name { set nameList [ list $secondName [ lindex $a 1 ] ] } description { set descriptionList [ list $secondName [ lindex $a 1 ] ] } enableHA { set enableHAList [ list $secondName [ lindex $a 1 ] ] } preferLocal { set preferLocalList [ list $secondName [ lindex $a 1 ] ] } serverType { set serverTypeList [ list $secondName [ lindex $a 1 ] ] } } } r ] != 0 } { return -code error $r } |
From: Justin R. <ju...@ha...> - 2007-04-11 00:31:31
|
Before using Jacl, I was executing a Tcl binary via Runtime.exec. This provided me with an easy way of grabbing the input/output from the Process variable. My requirement is to capture the stdout of a untrusted Tcl script (and not the result). I just happen to put this into a file or pipe it to another Java class for processing. My problem is that now that I've moved to Jacl, I don't have a straight forward getOut/setOut. I went down the path of creating a custom Channel, but realized that all the relevant classes and methods are package private and I couldn't instantiate them. That was enough to stop me from investigating if that route would really work anyways, the Interp might just hardcode that kind of thing. So, caveat lector, I'm too lazy to investigate the writing a customer Channel route. I've seen other solution that redirect System.out. I'm not interesting in grabbing System.out because my code in running a larger system that uses System.out for its own purposes, and I can't have my code spill over into it. (Which bring up the point, Interp.java has lots of System.out and that is very annoying.) My solution was to write "gets" and "puts" since those are the only ways of outputting or inputting (correct me if I'm wrong). I'm describing it here to help other users and to provoke some comments. I based my solution on http://wiki.tcl.tk/8502 to redirect puts. First I have to push a variable into the Interp: String filename = outputFile.getCanonicalPath(); interp.eval("set outputfilename \"" + escape(filename) + "\"", TCL.EVAL_GLOBAL); interp.eval("set outputfile [open \"$outputfilename\" w+]", TCL.EVAL_GLOBAL); I then run this code: set altStdOut $outputfile set altStdErr $outputfile if ![llength [info command ::tcl::puts]] { rename puts ::tcl::puts proc puts args { set la [llength $args] if {$la<1 || $la>3} { error "usage: puts ?-nonewline? ?channel? string" } set nl \n if {[lindex $args 0]=="-nonewline"} { set nl "" set args [lrange $args 1 end] } if {[llength $args]==1} { set args [list stdout [join $args]] ; } foreach {channel s} $args break set cmd ::tcl::puts if {$nl==""} {lappend cmd -nonewline} if {$channel=="stdout"} { global altStdOut set channel $altStdOut } if {$channel=="stderr"} { global altStdErr set channel $altStdErr } lappend cmd $channel $s catch {eval $cmd} flush $channel } } It looks for the channel stdout or a default channel (which maps to stdout) and then I output them to the file, which is the worst part of this solution. I'd love to see a solution the just lets me set the OutputStream, from outside the package. For gets, I used the method from http://wiki.tcl.tk/10794. I'd like to see Jacl behave like its in a sandbox, to use in a JSR-233 fashion. In which it minimizes it's access to the System class (System.exit, System.out, System.err). Are there any efforts in this regard? justin |
From: Justin R. <ju...@ha...> - 2007-04-10 23:47:12
|
I run Tcl scripts inside of a larger long-running Java system (along the lines of JSR-223, but using tcl.lang classes directly), and I've found some behavior which I found a little odd in Jacl. The tcl exit command calls System.exit(), which makes sense when running a single script. But it proves to be prohibitive when I'm containing the Interpreter inside a larger system. I'm looking for an exit command to kindly exit the evalFile/eval method or throw an exception indicating that the Interp in now invalid. This might already be taken of when putting the Interpreter into safe mode, is this true and is there documentation concerning the state of the Safe Interpreter in tcljava/jacl? My workaround, in case anyone is interested is to overwrite the exit command. I prep the Interpreter before running any untrusted code: interp.eval("rename exit ::tcl::exit"); interp.createCommand("exit", new SafeExitCommand() ); My new exit command looks like this: public class SafeExitCommand implements Command { public void cmdProc(Interp interp, TclObject argv[]) throws TclException { int code = 0; if (argv.length > 2) throw new TclNumArgsException(interp, 1, argv, "?returnCode?"); if (argv.length == 2) { code = TclInteger.get(interp, argv[1]); } throw new TclException(interp, "ExitCommand " + Integer.toString(code) ); } } I then look for a TclException with a message (e.getMessage()) with the word ExitCommand. It's definitely hacky, but it works for me. An alternative would be to set the ccode of TclException to something like TCL.EXIT, and then look for that code like TCL.RETURN is looked for. Is that a valid idea to persue and contribute? justin |
From: Mo D. <mo...@mo...> - 2007-04-09 21:31:38
|
Johannes Kleinlercher wrote: > Hi all, > > I look for a way to parse an XML-File in IBMs wsadmin, which uses jacl > 1.3.1 as a scripting language. > > I found a project called sa4was [1] on IBMs developerworks which does > parsing XML with regexp. sa4was works with WebSpher 5.x (which used jacl > 1.2.x) however in WebSphere 6.0 (which uses jacl 1.3.1) it doesn't work > anymore. > > Some code in sa4was does the following: > > ============================================ > while {[regexp {([^=]+)="([^"]*?)"(.*)} $restOfTag dontCare > attributeName attributeValue restOfTag]} { > if {$attributeName == "id"} { > set idValue $attributeValue > break > } > } > ============================================ > > and there I get the error > "couldn't compile regular expression pattern: nested *?+" > > > I found out that regexp changed in jacl 1.3.1 and non-greedy regexp > (with this "*?" expression) doesn't work anymore. Is that right? > > Questions: > a) So are there workarounds for something like that? > b) Or are there some better ways to parse XML in jacl? > Currently, there is no workaround except porting regexp code back to use the older Tcl 8.1 style regexp syntax. Very old versions of Jacl made use or the Oro regexp package, but it was non free and had to be removed from Jacl. But, lets back up a minute. I would not even suggest that you use regexp commands to parse your XML code. Using a series of regexp call like that is going to be SLOW! There is just no way around it, you would be much better off using a XML parsing engine written in Java. There are lots and lot of them available. You could create your XML parser in Java and build up a DOM in memory and then pass a handle to the DOM back to your Tcl scripts. It is actually quite easy to examine and decode a DOM tree with Tcl code once you have your own utility procs that examine subtrees and extract data from nodes. I hope that helps Mo DeJong |
From: Mo D. <mo...@mo...> - 2007-04-09 21:23:10
|
Tanzer, Troy wrote: > I'm not sure if this belongs here or on the developer list, but here is > my problem. We have a library of functions written in Java, and access > the libraries using TclBlend. When those functions return a specific > class of Java object, we can use them in the tcl scripts and call > methods on them and all works fine. However, when those functions > return generics (we are using Java 1.5), the TclBlend shell is confused. > I can access the type of the object, but TclBlend sees it as only > java.lang.Object, and only allows Object methods on it until I cast it. > > So, I can access the class type on the Tcl side, and work around this on > the Tcl side by casting to the correct object type. Is there anything I > could do on the Java side (outside of not using generics) that would > eliminate the need to cast the return to the correct type on the Tcl > side? > Hi troy My understanding of how Java implements generics is that the compiler creates compiled code that does the upcast behind the scenes. It may be possible to implement this type of functionality in TclJava, but it is not implemented now. So, doing the upcast is needed currently. You may be able to work around this issue by creating a util Java method that returns the objects you create already upcasted to the specific type. For example, if a container contained String objects, you could create a method that would have the String return type. This method would get an element out of a container and cast it to String in Java code. You would then invoke this method from Tcl code and your Tcl code would not need to know anything about generics. You might also want to look into a Tcl util method that would examine the contents of a container and do the upcast action via java::cast for you. Another option would be to modify Jacl itself, that might take a bit longer but would be better for everyone in the long run, assuming you were interested in making the changes and donating them to the project. For example, you might want to take a look at the new java::for command that I added to 1.4.0, it supports iteration over objects that support the generics API. cheers Mo DeJong |
From: Tanzer, T. <tro...@am...> - 2007-04-09 19:48:32
|
I'm not sure if this belongs here or on the developer list, but here is my problem. We have a library of functions written in Java, and access the libraries using TclBlend. When those functions return a specific class of Java object, we can use them in the tcl scripts and call methods on them and all works fine. However, when those functions return generics (we are using Java 1.5), the TclBlend shell is confused. I can access the type of the object, but TclBlend sees it as only java.lang.Object, and only allows Object methods on it until I cast it. For example: Case 1) Java method returns an object of Type1 > set oTest [$oFactory getType1] > $oTest getElementValue ToolName Tool42 Case 2) Java method returns a generic (in this case, a Type1 object) > set oTest [$oFactory2 getType1] > $oTest getElementValue ToolName no accessible method "getElementValue" in class java.lang.Object > puts "[$oTest getClass]" Type1 > set oTest2 [java::cast Type1 $oTest] > $oTest2 getElementValue ToolName Tool42 So, I can access the class type on the Tcl side, and work around this on the Tcl side by casting to the correct object type. Is there anything I could do on the Java side (outside of not using generics) that would eliminate the need to cast the return to the correct type on the Tcl side? |
From: Tanzer, T. <tro...@am...> - 2007-04-09 19:30:30
|
=20 I know nothing of of WAS and sa4was, but another option is to avoid using regexp at all to parse XML and use an XML parser. As mentioned, the TclXML package isn't ported yet, but writing a wrapper around the apache xml handlers is relatively simple. I have a simple implementation using the org.xml.sax package. I just extend the DefaultHandler class, and implement the methods I need to send the event contents to a tcl procedure (very much like the tclxml API - I actually reuse the handlers from my tclxml apps). It doesn't look that hard to more or less implement nearly the same API as tclxml has for SAX parsing, but I've never needed anything beyond start/char/end events, and I stopped there. =20 |
From: Patrick F. <pfi...@oz...> - 2007-04-09 16:11:43
|
On Monday 09 April 2007 15:37, Johannes Kleinlercher wrote: > sa4was isn't supported anyway by IBM so I don't think that is the > point. Parts of the underlying JMX implementation have changed in WS6.0. I had to modify some of my WAS 5.1 jacl scripts to cope with this. Since sa4was is a simplification of the WAS 5.1 JMX layer it may not cope with these changes so if you are starting from scratch I would avoid using sa4was with 6. The sarwas author is aware of these issues. See thread on the se4was forum. http://www-128.ibm.com/developerworks/forums/dw_thread.jsp?message=13714004&cat=28&thread=78335&treeDisplayType=threadmode1&forum=443#13714004 > > I am developing my own deployment-scripts so I just wanted to take some > code of sa4was and use it in my scripts. Parsing XML files was some of > it. I didn't find any code to do that and I don't think it is easy > without a good regexp-engine. Non-greedy regexp is one important thing > for parsing XML, I think. Do you have some piece of code which can parse > XML-Files with the regexp-engine in jacl 1.3.1? > I have never had the need to parse XML files in JACL mainly because IBM do not recommend manual modification of the underlying WAS xml config files. I don't know whether jacl 1.4.0 supports non greedy regexp but if it does then you can upgrade the WAS 6.0 jacl environment by simply downloading the jacl 1.4 binary and replacing the jacl.jar and tcljava.jar files in the wasinstall/appserver/lib directory with the 1.4 jars. I have tested 1.4 with WAS 6.0 and have not had a single problem. It's rock solid. You can test the regexp in jacl 1.4 independently. See this link. link:http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=60&t=000208 You can also run wsadmin with Jacl 1.4 as an external tool in eclipse. See this link. http://www-128.ibm.com/developerworks/forums/dw_thread.jsp?message=13714004&cat=28&thread=78335&treeDisplayType=threadmode1&forum=443#13714004 |
From: Johannes K. <joh...@kl...> - 2007-04-09 14:37:33
|
sa4was isn't supported anyway by IBM so I don't think that is the point. I am developing my own deployment-scripts so I just wanted to take some code of sa4was and use it in my scripts. Parsing XML files was some of it. I didn't find any code to do that and I don't think it is easy without a good regexp-engine. Non-greedy regexp is one important thing for parsing XML, I think. Do you have some piece of code which can parse XML-Files with the regexp-engine in jacl 1.3.1? I will look at your homepage the next time and look forward to your jacl libraries. Am Montag, den 09.04.2007, 14:22 +0100 schrieb Patrick Finnegan: > On Monday 09 April 2007 13:32, Johannes Kleinlercher wrote: > > Hi all, > > > > I look for a way to parse an XML-File in IBMs wsadmin, which uses jacl > > 1.3.1 as a scripting language. > > > > I found a project called sa4was [1] on IBMs developerworks which does > > parsing XML with regexp. sa4was works with WebSpher 5.x (which used jacl > > 1.2.x) however in WebSphere 6.0 (which uses jacl 1.3.1) it doesn't work > > anymore. > > > > Some code in sa4was does the following: > > > > ============================================ > > while {[regexp {([^=]+)="([^"]*?)"(.*)} $restOfTag dontCare > > attributeName attributeValue restOfTag]} { > > if {$attributeName == "id"} { > > set idValue $attributeValue > > break > > } > > } > > ============================================ > > > > and there I get the error > > "couldn't compile regular expression pattern: nested *?+" > > > > > > I found out that regexp changed in jacl 1.3.1 and non-greedy regexp > > (with this "*?" expression) doesn't work anymore. Is that right? > > > > Questions: > > a) So are there workarounds for something like that? > > b) Or are there some better ways to parse XML in jacl? > > > > The quick work around for existing sa4was scripts in a WAS 6 environment is to > downgrade JACL from 1.3.1 to 1.2.X by replacing the 1.3.1 jacl.jar and > tcljava.jar jar files in the was/installdirectory/lib directory. > > However I would not recommend using sa4was with 6.0 because it's is not > supported by IBM in 6.x. I have a JACL script library for WAS which I am > posting on the internet this week that covers most of the WAS admin > functions. You should have a look at that. > > The Tcl xml parser TclXml has not been ported to JACL so you need to use > 'regexp' or 'string match' to parse XML. > > If you want to use Tcl packages that have not been ported to JACL in a > scripted WebSphere admin environment then you will need to use TclBlend as a > java client with the WebSphere JMX java library. There are plenty of > articles on Developerworks that describe WAS admin using java clients rather > than Wasadmin clients written in Jython or Jacl. I am re-writing most of my > stuff to use TclBlend because while IBM might drop support for Jacl and > Jython in future releases the JVM layer will always be there. |
From: Patrick F. <pfi...@oz...> - 2007-04-09 13:16:50
|
On Monday 09 April 2007 13:32, Johannes Kleinlercher wrote: > Hi all, > > I look for a way to parse an XML-File in IBMs wsadmin, which uses jacl > 1.3.1 as a scripting language. > > I found a project called sa4was [1] on IBMs developerworks which does > parsing XML with regexp. sa4was works with WebSpher 5.x (which used jacl > 1.2.x) however in WebSphere 6.0 (which uses jacl 1.3.1) it doesn't work > anymore. > > Some code in sa4was does the following: > > ============================================ > while {[regexp {([^=]+)="([^"]*?)"(.*)} $restOfTag dontCare > attributeName attributeValue restOfTag]} { > if {$attributeName == "id"} { > set idValue $attributeValue > break > } > } > ============================================ > > and there I get the error > "couldn't compile regular expression pattern: nested *?+" > > > I found out that regexp changed in jacl 1.3.1 and non-greedy regexp > (with this "*?" expression) doesn't work anymore. Is that right? > > Questions: > a) So are there workarounds for something like that? > b) Or are there some better ways to parse XML in jacl? > The quick work around for existing sa4was scripts in a WAS 6 environment is to downgrade JACL from 1.3.1 to 1.2.X by replacing the 1.3.1 jacl.jar and tcljava.jar jar files in the was/installdirectory/lib directory. However I would not recommend using sa4was with 6.0 because it's is not supported by IBM in 6.x. I have a JACL script library for WAS which I am posting on the internet this week that covers most of the WAS admin functions. You should have a look at that. The Tcl xml parser TclXml has not been ported to JACL so you need to use 'regexp' or 'string match' to parse XML. If you want to use Tcl packages that have not been ported to JACL in a scripted WebSphere admin environment then you will need to use TclBlend as a java client with the WebSphere JMX java library. There are plenty of articles on Developerworks that describe WAS admin using java clients rather than Wasadmin clients written in Jython or Jacl. I am re-writing most of my stuff to use TclBlend because while IBM might drop support for Jacl and Jython in future releases the JVM layer will always be there. |
From: Johannes K. <joh...@kl...> - 2007-04-09 12:32:48
|
Hi all, I look for a way to parse an XML-File in IBMs wsadmin, which uses jacl 1.3.1 as a scripting language. I found a project called sa4was [1] on IBMs developerworks which does parsing XML with regexp. sa4was works with WebSpher 5.x (which used jacl 1.2.x) however in WebSphere 6.0 (which uses jacl 1.3.1) it doesn't work anymore. Some code in sa4was does the following: ============================================ while {[regexp {([^=]+)="([^"]*?)"(.*)} $restOfTag dontCare attributeName attributeValue restOfTag]} { if {$attributeName == "id"} { set idValue $attributeValue break } } ============================================ and there I get the error "couldn't compile regular expression pattern: nested *?+" I found out that regexp changed in jacl 1.3.1 and non-greedy regexp (with this "*?" expression) doesn't work anymore. Is that right? Questions: a) So are there workarounds for something like that? b) Or are there some better ways to parse XML in jacl? Any help would be appreciated!! best regards, Johannes Links: 1: http://www.alphaworks.ibm.com/tech/sa4was |
From: Mo D. <mo...@mo...> - 2007-04-06 19:37:44
|
Richard Shaw wrote: > Hello, > > I am trying to run a tcl script that then runs a tcl script > application. This is normally done by calling main.tcl and the > wish84.exe in the Tcl Interpreter /bin directory via a desktop > shortcut. main.tcl then calls another file which calls several more... > > This is the same file that is called in the shortcut, which has no > problem finding packages. Do I have to modify the evalFile call? The whole > purpose of this exercise is to remove the need for a seperate Tcl > interpreter installation by using the one within Jacl. I can only conclude that you are trying to run your Tcl application that loads the starkit package inside Jacl. That is not going to work since Jacl does not include support for the starkit extension. You will need to use Tcl Blend to load native C extensions inside the JVM. Mo |
From: Patrick F. <pfi...@oz...> - 2007-04-06 13:51:59
|
On Friday 23 March 2007 14:16, Tom Poindexter wrote: You are correct. The garbage collection is causing the problem. Thanks for your help. Patrick. > On Fri, Mar 23, 2007 at 01:38:01PM +0000, Patrick Finnegan wrote: > > Error occurs when variable is used as command. This problem does not > > occur on Komodo 4.0 or RamDebugger. > > > > set ConnectionI [ java::call DriverManager getConnection $url ] > > > > putsLog "transaction isolation level is [ $ConnectionI > > getTransactionIsolation ]" > > > > $ConnectionI resolves to "java0x2" > > > > Error msg. > > > > invalid command name "java0x2" > > while executing > > "$ConnectionI getTransactionIsolation" > > I don't have TDK so I can't confirm, but it appears to > me that the reflected Connection object is being > garbage collected, possibly due to going out of > scope while be run by the debugger. > > Try using: > java::autolock 1 > > or wrap your connection with: > java::lock [ set ConnectionI [ java::call DriverManager getConnection > $url ] ] |
From: Patrick F. <fin...@gm...> - 2007-04-03 09:01:52
|
* *WebSphere Portal 6 - Best Practices for Enterprise Scale Deployment WSadmin is the command line environment equivalent to the administrative console GUI for the system administrator to perform the system management operations. The scripting capability allows using either Jython or Jacl to automate WAS-related configuration tasks and controlling (start and stop). Since the WebSphere Application Server v5.1 release, the WebSphere administration scripting tool (wsadmin) supported both Jacl (Java TCL) and Jython (Java Python) as the scripting languages. When selecting a scripting language, Jython is the strategic direction as the administration scripting language for WebSphere Application Server because *** Jython is more intuitive to object oriented (such as Java) developers ***. Future enhancements of the scripting language are focused on the use of Jython. |
From: <pat...@hs...> - 2007-03-23 15:56:26
|
I will be out of the office starting 23/03/2007 and will not return until 24/02/2010. Patrick Finnegan has finished at HSBC and moved to Norwich Union. ----------------------------------------- SAVE PAPER - THINK BEFORE YOU PRINT! This E-mail is confidential. It may also be legally privileged. If you are not the addressee you may not copy, forward, disclose or use any part of it. If you have received this message in error, please delete it and all copies from your system and notify the sender immediately by return E-mail. Internet communications cannot be guaranteed to be timely secure, error or virus-free. The sender does not accept liability for any errors or omissions. |
From: Imran S. <isa...@gm...> - 2007-03-23 15:46:29
|
hi i from where i got the diffserv and intserv model kindly guide me in this regard thanks On 3/23/07, Tom Poindexter <tpo...@ny...> wrote: > > On Fri, Mar 23, 2007 at 01:38:01PM +0000, Patrick Finnegan wrote: > > > Error occurs when variable is used as command. This problem does not > occur > > on Komodo 4.0 or RamDebugger. > > > > set ConnectionI [ java::call DriverManager getConnection $url ] > > > > putsLog "transaction isolation level is [ $ConnectionI > > getTransactionIsolation ]" > > > > $ConnectionI resolves to "java0x2" > > > > Error msg. > > > > invalid command name "java0x2" > > while executing > > "$ConnectionI getTransactionIsolation" > > > > I don't have TDK so I can't confirm, but it appears to > me that the reflected Connection object is being > garbage collected, possibly due to going out of > scope while be run by the debugger. > > Try using: > java::autolock 1 > > or wrap your connection with: > java::lock [ set ConnectionI [ java::call DriverManager getConnection > $url ] ] > > > -- > Tom Poindexter > tpo...@ny... > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > tcljava-user mailing list > tcl...@li... > https://lists.sourceforge.net/lists/listinfo/tcljava-user > -- With Regards: Imran ------ |