From: Jiang, M. <mar...@ba...> - 2005-03-23 16:15:17
|
Please unsubscribe me from your list. Thanks. --Marie -----Original Message----- From: jyt...@li... [mailto:jyt...@li...]On Behalf Of jyt...@li... Sent: Tuesday, March 22, 2005 7:12 PM To: jyt...@li... Subject: Jython-users digest, Vol 1 #1352 - 13 msgs Send Jython-users mailing list submissions to jyt...@li... To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/jython-users or, via email, send a message with subject or body 'help' to jyt...@li... You can reach the person managing the list at jyt...@li... When replying, please edit your Subject line so it is more specific than "Re: Contents of Jython-users digest..." Today's Topics: 1. Re: web service client (Todd Moyer) 2. web service client (Chai Ang) 3. jython 'object' type --> NameError (Aaron Steele) 4. Re: jython 'object' type --> NameError (Sean Blakey) 5. Re: web service client (Diez B. Roggisch) 6. Re: Jython and axis : LogFactory (Diez B. Roggisch) 7. Re: web service client (Des Oates) 8. RE: embedding questions.. (Updike, Clark) 9. JythonC - generating multiple classes from single .py (Edward Povazan) 10. Re: web service client (Olivier Dameron) 11. Re: web service client (Martin Duffy) 12. Re: Jython and axis : LogFactory (Olivier Dameron) 13. Re: Jython and axis : LogFactory (Olivier Dameron) --__--__-- Message: 1 Date: Mon, 21 Mar 2005 23:36:36 -0500 From: Todd Moyer <tm...@in...> To: Olivier Dameron <da...@sm...> CC: jyt...@li... Subject: Re: [Jython-users] web service client I was using Jython to write Java Server Pages a while back. It worked pretty well. Not clear if that will meet your needs. I sent a post with some sample code that I'll forward again following this msg. Cheers, Todd Moyer Olivier Dameron wrote: > Hello, > Do you have suggestion for writting/reusing a very crude web service > client with jython ? > > Thank you, > Olivier > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users --__--__-- Message: 2 Date: Tue, 22 Mar 2005 15:51:27 +1100 From: Chai Ang <de...@py...> To: jyt...@li... Subject: [Jython-users] web service client > 1. web service client (Olivier Dameron) > > Hello, > Do you have suggestion for writting/reusing a very crude web service > client with jython ? It's quite easy with Python... There is a choice of PySoap or ZSI to choose from. Looks something like the following. eg. (cannibalised from the examples in the ditro) #----- from SOAPpy import * endpoint = "http://localhost:12027" ns = '' sa = '' s = SOAPProxy( endpoint, namespace = ns, soapaction = sa ) try : param1 = "32" resp = s.celciusToFarenheit( celcius ) print "Received'", resp except ZeroDivisionError: print 'eek' #---- Jython? Probably u could use axis.. Will have to dig up an example somewhere but am busy right this moment... Regards, Chai ----------------- Utiba Pty Ltd This message has been scanned for viruses and dangerous content by Utiba mail server and is believed to be clean. --__--__-- Message: 3 Date: Mon, 21 Mar 2005 21:43:00 -0800 From: Aaron Steele <as...@be...> To: jyt...@li... Subject: [Jython-users] jython 'object' type --> NameError dear readers, in jython 2.1 (on red hat linux 3.2.3-49), when i create a new style class that inherits from the 'object' type, i get a 'NameError': !----------------------------------------------------------------------! Jython 2.1 on java1.4.2_06 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> class test(object): ... def __init__(self): pass ... def echo(self,message): ... print message ... Traceback (innermost last): File "<console>", line 1, in ? NameError: object >>> !----------------------------------------------------------------------! here is the same interaction with python (2.4.1c1): !----------------------------------------------------------------------! Python 2.4.1c1 (#1, Mar 14 2005, 10:28:18) [GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-49)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> class test(object): ... def __init__(self): pass ... def echo(self,message): ... print message ... >>> t = test() >>> t.echo('testing') testing >>> !----------------------------------------------------------------------! any thoughts? thanks, aaron --__--__-- Message: 4 Date: Mon, 21 Mar 2005 22:35:50 -0800 From: Sean Blakey <pyt...@gm...> Reply-To: Sean Blakey <pyt...@gm...> To: Aaron Steele <as...@be...> Subject: Re: [Jython-users] jython 'object' type --> NameError Cc: jyt...@li... On Mon, 21 Mar 2005 21:43:00 -0800, Aaron Steele <as...@be...> wrote: > dear readers, > > in jython 2.1 (on red hat linux 3.2.3-49), when i create a new style > class that inherits from the 'object' type, i get a 'NameError': > !----------------------------------------------------------------------! > Jython 2.1 on java1.4.2_06 (JIT: null) > Type "copyright", "credits" or "license" for more information. > >>> class test(object): > ... def __init__(self): pass > ... def echo(self,message): > ... print message > ... > Traceback (innermost last): > File "<console>", line 1, in ? > NameError: object > >>> > !----------------------------------------------------------------------! > > here is the same interaction with python (2.4.1c1): > !----------------------------------------------------------------------! > Python 2.4.1c1 (#1, Mar 14 2005, 10:28:18) > [GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-49)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> class test(object): > ... def __init__(self): pass > ... def echo(self,message): > ... print message > ... > >>> t = test() > >>> t.echo('testing') > testing > >>> > !----------------------------------------------------------------------! > > any thoughts? > > thanks, > aaron > New-style classes were introduced with python 2.2. Since the current release of Jython is python 2.1, new-style classes are not currently supported in Jython. There is currently a major development effort to add new-style classes to Jython. -- Sean Blakey Saint of Mild Amusement, Evil Genius, Big Geek Python/Java/C++/C(Unix/Windows/Palm/Web) developer quine = ['print "quine =",quine,"; exec(quine[0])"'] ; exec(quine[0]) --__--__-- Message: 5 From: "Diez B. Roggisch" <de...@we...> To: jyt...@li... Subject: Re: [Jython-users] web service client Date: Tue, 22 Mar 2005 10:18:10 +0100 Am Tuesday, 22. March 2005 05:17 schrieb Olivier Dameron: > Hello, > Do you have suggestion for writting/reusing a very crude web service > client with jython ? I use apache axis - the python webservice tools aren't mature enough yet (which might be of course stem from SOAP itself being immature and crappy, but I'll spare you that rant for now...) Then the generated axis classes I use from jython - a very powerful combo. Diez --__--__-- Message: 6 From: "Diez B. Roggisch" <de...@we...> To: jyt...@li... Subject: Re: [Jython-users] Jython and axis : LogFactory Date: Tue, 22 Mar 2005 10:20:48 +0100 > However, as soon as I try to create an instance of > org.apache.axis.client.Service, I have a: > "No implementation defined for org.apache.commons.logging.LogFactory" > error message. > > I also tried to use (before instantiating Service): > from java.lang import System > System.setProperty("org.apache.commons.logging.LogFactory", > > :org.apache.commons.logging.impl.Log4jFactory") > > but it didn't help. I never ran into these problems - are you sure you have all necessary jars included? These are mine: -rwxr-xr-x 1 deets 1573104 2005-03-11 18:35 axis.jar* -rwxr-xr-x 1 deets 74527 2005-03-11 18:35 commons-discovery.jar* -rw-r--r-- 1 deets 31605 2003-09-17 15:53 commons-logging.jar drwxr-xr-x 2 deets 4096 2005-03-11 18:35 CVS/ -rwxr-xr-x 1 deets 32071 2005-03-11 18:35 jaxrpc.jar* -rwxr-xr-x 1 deets 19427 2005-03-11 18:35 saaj.jar* -rwxr-xr-x 1 deets 161701 2005-03-11 18:35 wsdl4j.jar* Regards, Diez --__--__-- Message: 7 Date: Tue, 22 Mar 2005 11:15:20 +0000 From: Des Oates <do...@ad...> Subject: Re: [Jython-users] web service client To: Olivier Dameron <da...@sm...> Cc: jyt...@li... I'm involved in a project that does this. We do it this way: We have a client framework library written in Java that interacts with the web server directly. This client framework exposes a public API and we are using Axis. This hides the axis implementation and soap message marshalling code from the scripting environment, so we have a nice clean scripting API . E.g. In the client framework.jar you could have: class org.myapp.User { public static User getUser(String userID) { // implement your Axis calls to the server // to get your User object or its constituent parts. return myUser; } ... private String firstName, secondName; public String getFirstName() {return firstName;} public String getSecondName() {return secondName;} } Then in your Jython script you would have something like this: # start of jython script from org.myapp import User myUser = User.getUser("brubble") print myUser.getFirstName() + " " + myUser.getSecondname() # end of jython script Obviously this script would print something like "Barney Rubble" to System.out. The point being you're using a web service to fetch the data from the app server, but not polluting the scripting environment by exposing all the Axis/SOAP/WS machinery you need to implement the service. On 22 Mar 2005, at 04:17, Olivier Dameron wrote: > Hello, > Do you have suggestion for writting/reusing a very crude web > service > client with jython ? > > Thank you, > Olivier > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real > users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users > --__--__-- Message: 8 Subject: RE: [Jython-users] embedding questions.. Date: Tue, 22 Mar 2005 10:30:07 -0500 From: "Updike, Clark" <Cla...@jh...> To: =?iso-8859-1?Q?G=E1bor_Farkas?= <ga...@ne...>, <jyt...@li...> This post may be helpful: <http://sourceforge.net/mailarchive/forum.php?forum_id=3D5586&max_rows=3D= 25&style=3Dflat&viewmonth=3D200310&viewday=3D18> -Clark > -----Original Message----- > From: jyt...@li...=20 > [mailto:jyt...@li...] On Behalf=20 > Of G=E1bor Farkas > Sent: Monday, March 21, 2005 7:12 AM > To: jyt...@li... > Subject: Re: [Jython-users] embedding questions.. >=20 >=20 > Diez B. Roggisch wrote: > >>is there a way to control the running-time of a jython program? for=20 > >>example..what if a jython program contains an endless loop?=20 > i'd like=20 > >>to specify for example that a jython program can only run for=20 > >>10seconds, or that it can only execute let's say 1000bytecode=20 > >>instructions.. is there a way for that? > >=20 > >=20 > > Not directly, see next answer. > >=20 > >=20 > >>2. > >>somehow implement step-by-step execution..means the jython=20 > interpreter=20 > >>would stop after every instruction, and i could analyze it's=20 > >>state..any ideas on this? > >=20 > >=20 > > Use sys.settrace(). Read the docs on it how to use it. And you can=20 > > also use it > > to accomplish your above mentioned goal. >=20 > thanks.. >=20 > i'm trying it, but with little success.. > the following script: >=20 > =3D=3D=3D=3D=3D=3D > import sys >=20 > def foo(frame,event,arg): > print 'tracing...' >=20 >=20 > sys.settrace(foo) >=20 > print 1 > print 2 > print 3 > =3D=3D=3D=3D=3D=3D >=20 > produces: >=20 > 1 > 2 > 3 >=20 > imho it should >=20 > 1 > tracing > 2 > tracing > 3 > tracing.. >=20 > or something like that.. >=20 > any ideas what am i doing wrong? >=20 > gabor >=20 >=20 > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from=20 > real users. Discover which products truly live up to the=20 > hype. Start reading now.=20 > http://ads.osdn.com/?ad_id=3D6595&alloc_id=3D14396> &op=3Dclick >=20 > _______________________________________________ >=20 > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users >=20 --__--__-- Message: 9 Date: Tue, 22 Mar 2005 08:57:51 -0800 From: Edward Povazan <epo...@te...> To: jython-users <jyt...@li...> Subject: [Jython-users] JythonC - generating multiple classes from single .py Hello, After a long break from Jython, I am back. I decided to write all my Swing custom widgets and all Swing code in Jython. However since the code will be used from Java (I have a large core in Java), I want to use JythonC to convert the .py code. If I have a file: shutter.py Containing class Shutter, class ShutterPanel, class ShutterItem etc. is there a way to use jythonc to create a new package with files shutter/Shutter shutter/ShutterPanel shutter/ShutterItem ? I have seen that if I create a Shutter.py with class Shutter, I get the generated code I need. However now I have the weird import (I think it is weird :) import Shutter.Shutter Am I missing something? Thank you -Edward BTW - I have an old 2.1 jython - does the current download deal with java's "assert" statement, as well as live well with JVM 1.5 code? --__--__-- Message: 10 Date: Tue, 22 Mar 2005 14:53:29 -0800 From: Olivier Dameron <da...@sm...> To: jyt...@li... Subject: Re: [Jython-users] web service client On Tue, 22 Mar 2005 15:51:27 +1100, Chai Ang <de...@py...> wrote: > > 1. web service client (Olivier Dameron) > > > > Hello, > > Do you have suggestion for writting/reusing a very crude web > > service > > client with jython ? > > It's quite easy with Python... > There is a choice of PySoap or ZSI to choose from. Thanks for the quick response. I indeed tried this but never managed to get neither PySoap ZSI to compile with jython-2.1 Do you have a hint on how to do this ? Thank you, Olivier --__--__-- Message: 11 Date: Tue, 22 Mar 2005 15:24:01 -0800 From: Martin Duffy <md...@st...> Reply-To: md...@st... Organization: StarSoft, Inc. To: jyt...@li... Subject: Re: [Jython-users] web service client _Building an Application Web Service based on Jython Scripts <http://www.extreme.indiana.edu/%7Egannon/Building-web-services-for-jython.html>_ http://www.extreme.indiana.edu/~gannon/Building-web-services-for-jython.html Olivier Dameron wrote: >Hello, > Do you have suggestion for writting/reusing a very crude web service >client with jython ? > >Thank you, >Olivier > > >------------------------------------------------------- >SF email is sponsored by - The IT Product Guide >Read honest & candid reviews on hundreds of IT Products from real users. >Discover which products truly live up to the hype. Start reading now. >http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click >_______________________________________________ >Jython-users mailing list >Jyt...@li... >https://lists.sourceforge.net/lists/listinfo/jython-users > > --__--__-- Message: 12 Date: Tue, 22 Mar 2005 16:00:57 -0800 From: Olivier Dameron <da...@sm...> To: jyt...@li... Subject: Re: [Jython-users] Jython and axis : LogFactory Hello Diez, On Tue, 22 Mar 2005 10:20:48 +0100, "Diez B. Roggisch" <de...@we...> wrote: > > However, as soon as I try to create an instance of > > org.apache.axis.client.Service, I have a: > > "No implementation defined for > > org.apache.commons.logging.LogFactory" error message. > > > > I also tried to use (before instantiating Service): > > from java.lang import System > > System.setProperty("org.apache.commons.logging.LogFactory", > > > > :org.apache.commons.logging.impl.Log4jFactory") > > > > but it didn't help. > > I never ran into these problems - are you sure you have all necessary > jars included? > > These are mine: > > -rwxr-xr-x 1 deets 1573104 2005-03-11 18:35 axis.jar* > -rwxr-xr-x 1 deets 74527 2005-03-11 18:35 commons-discovery.jar* > -rw-r--r-- 1 deets 31605 2003-09-17 15:53 commons-logging.jar > drwxr-xr-x 2 deets 4096 2005-03-11 18:35 CVS/ > -rwxr-xr-x 1 deets 32071 2005-03-11 18:35 jaxrpc.jar* > -rwxr-xr-x 1 deets 19427 2005-03-11 18:35 saaj.jar* > -rwxr-xr-x 1 deets 161701 2005-03-11 18:35 wsdl4j.jar* Hum I have indeed the same ones. - do you have any "commons-loggin.properties" or "log4j.properties" somewhere in your classpath ? - which version of jython are you using ? - what is the value of sys.path ? --__--__-- Message: 13 Date: Tue, 22 Mar 2005 17:11:38 -0800 From: Olivier Dameron <da...@sm...> To: jyt...@li... Subject: Re: [Jython-users] Jython and axis : LogFactory [Sorry, I hit the 'send' button by mistake] Hello Diez, On Tue, 22 Mar 2005 10:20:48 +0100, "Diez B. Roggisch" <de...@we...> wrote: > > However, as soon as I try to create an instance of > > org.apache.axis.client.Service, I have a: > > "No implementation defined for > > org.apache.commons.logging.LogFactory" error message. > > > > I also tried to use (before instantiating Service): > > from java.lang import System > > System.setProperty("org.apache.commons.logging.LogFactory", > > > > :org.apache.commons.logging.impl.Log4jFactory") > > > > but it didn't help. > > I never ran into these problems - are you sure you have all necessary > jars included? > > These are mine: > > -rwxr-xr-x 1 deets 1573104 2005-03-11 18:35 axis.jar* > -rwxr-xr-x 1 deets 74527 2005-03-11 18:35 commons-discovery.jar* > -rw-r--r-- 1 deets 31605 2003-09-17 15:53 commons-logging.jar > drwxr-xr-x 2 deets 4096 2005-03-11 18:35 CVS/ > -rwxr-xr-x 1 deets 32071 2005-03-11 18:35 jaxrpc.jar* > -rwxr-xr-x 1 deets 19427 2005-03-11 18:35 saaj.jar* > -rwxr-xr-x 1 deets 161701 2005-03-11 18:35 wsdl4j.jar* Hum I have indeed the same ones (cf infra) Please note that the error message is not a class not found exception, but rather looks like a configuration problem - do you have any "commons-loggin.properties" or "log4j.properties" somewhere in your classpath ? - which version of jython are you using ? - what is the value of sys.path ? - also, I deleted some of the files in my axis installation to match yours, but using one or the other of the two following directories triggered exactly the same error message. olivier@gryffindor /usr/local/axis-1_2RC3/libOD> ll total 1862 -rw-r--r-- 1 root root 1573104 2005-03-22 16:46 axis.jar -rw-r--r-- 1 root root 74527 2005-03-22 16:46 commons-discovery.jar -rw-r--r-- 1 root root 31605 2005-03-22 16:46 commons-logging.jar -rw-r--r-- 1 root root 32071 2005-03-22 16:46 jaxrpc.jar -rw-r--r-- 1 root root 19427 2005-03-22 16:46 saaj.jar -rw-r--r-- 1 root root 161701 2005-03-22 16:46 wsdl4j.jar olivier@gryffindor /usr/local/axis-1_2RC3/lib> ll total 2250 -rw-r--r-- 1 root root 32489 2005-02-28 19:39 axis-ant.jar -rw-r--r-- 1 root root 1573104 2005-02-28 19:39 axis.jar -rw-r--r-- 1 root root 74527 2005-02-28 19:39 commons-discovery.jar -rw-r--r-- 1 root root 31605 2005-02-28 19:39 commons-logging.jar -rwxr-xr-x 1 root root 158 2005-03-22 13:52 commons-logging.properties -rw-r--r-- 1 root root 32071 2005-02-28 19:39 jaxrpc.jar -rw-r--r-- 1 root root 352668 2005-02-28 19:39 log4j-1.2.8.jar -rwxr-xr-x 1 root root 941 2005-03-22 13:45 log4j.properties -rw-r--r-- 1 root root 19427 2005-02-28 19:39 saaj.jar -rw-r--r-- 1 root root 161701 2005-02-28 19:39 wsdl4j.jar --__--__-- _______________________________________________ Jython-users mailing list Jyt...@li... https://lists.sourceforge.net/lists/listinfo/jython-users End of Jython-users Digest |