You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(6) |
Nov
(8) |
Dec
(51) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(105) |
Feb
(93) |
Mar
(194) |
Apr
(145) |
May
(100) |
Jun
(111) |
Jul
(117) |
Aug
(126) |
Sep
(233) |
Oct
(138) |
Nov
(164) |
Dec
(109) |
2002 |
Jan
(216) |
Feb
(175) |
Mar
(216) |
Apr
(194) |
May
(157) |
Jun
(140) |
Jul
(158) |
Aug
(73) |
Sep
(105) |
Oct
(164) |
Nov
(104) |
Dec
(95) |
2003 |
Jan
(72) |
Feb
(69) |
Mar
(81) |
Apr
(151) |
May
(101) |
Jun
(139) |
Jul
(99) |
Aug
(118) |
Sep
(115) |
Oct
(151) |
Nov
(161) |
Dec
(102) |
2004 |
Jan
(120) |
Feb
(175) |
Mar
(106) |
Apr
(111) |
May
(54) |
Jun
(78) |
Jul
(76) |
Aug
(105) |
Sep
(94) |
Oct
(143) |
Nov
(75) |
Dec
(85) |
2005 |
Jan
(99) |
Feb
(77) |
Mar
(164) |
Apr
(97) |
May
(79) |
Jun
(57) |
Jul
(65) |
Aug
(102) |
Sep
(95) |
Oct
(129) |
Nov
(123) |
Dec
(52) |
2006 |
Jan
(48) |
Feb
(99) |
Mar
(90) |
Apr
(51) |
May
(81) |
Jun
(136) |
Jul
(56) |
Aug
(109) |
Sep
(50) |
Oct
(44) |
Nov
(74) |
Dec
(75) |
2007 |
Jan
(92) |
Feb
(137) |
Mar
(93) |
Apr
(79) |
May
(52) |
Jun
(74) |
Jul
(143) |
Aug
(175) |
Sep
(154) |
Oct
(137) |
Nov
(88) |
Dec
(90) |
2008 |
Jan
(58) |
Feb
(113) |
Mar
(167) |
Apr
(88) |
May
(105) |
Jun
(37) |
Jul
(87) |
Aug
(72) |
Sep
(56) |
Oct
(41) |
Nov
(102) |
Dec
(70) |
2009 |
Jan
(115) |
Feb
(113) |
Mar
(126) |
Apr
(58) |
May
(125) |
Jun
(45) |
Jul
(90) |
Aug
(125) |
Sep
(84) |
Oct
(61) |
Nov
(111) |
Dec
(61) |
2010 |
Jan
(85) |
Feb
(86) |
Mar
(130) |
Apr
(58) |
May
(57) |
Jun
(32) |
Jul
(25) |
Aug
(50) |
Sep
(41) |
Oct
(65) |
Nov
(63) |
Dec
(24) |
2011 |
Jan
(43) |
Feb
(31) |
Mar
(28) |
Apr
(68) |
May
(53) |
Jun
(42) |
Jul
(58) |
Aug
(26) |
Sep
(51) |
Oct
(76) |
Nov
(60) |
Dec
(9) |
2012 |
Jan
(16) |
Feb
(32) |
Mar
(32) |
Apr
(39) |
May
(16) |
Jun
(19) |
Jul
(3) |
Aug
(11) |
Sep
(35) |
Oct
(47) |
Nov
(28) |
Dec
(18) |
2013 |
Jan
(18) |
Feb
(36) |
Mar
(10) |
Apr
(7) |
May
(7) |
Jun
(27) |
Jul
(17) |
Aug
(35) |
Sep
(19) |
Oct
(31) |
Nov
(8) |
Dec
(22) |
2014 |
Jan
(5) |
Feb
(11) |
Mar
(18) |
Apr
(23) |
May
(26) |
Jun
(14) |
Jul
(18) |
Aug
(26) |
Sep
(20) |
Oct
(48) |
Nov
(13) |
Dec
(9) |
2015 |
Jan
(9) |
Feb
(15) |
Mar
(25) |
Apr
(10) |
May
(26) |
Jun
(6) |
Jul
(13) |
Aug
(5) |
Sep
(14) |
Oct
(36) |
Nov
(24) |
Dec
(18) |
2016 |
Jan
(24) |
Feb
(11) |
Mar
(1) |
Apr
(6) |
May
(7) |
Jun
(3) |
Jul
(9) |
Aug
(15) |
Sep
(22) |
Oct
(5) |
Nov
(5) |
Dec
(2) |
2017 |
Jan
(20) |
Feb
(4) |
Mar
(4) |
Apr
(1) |
May
(5) |
Jun
(7) |
Jul
(14) |
Aug
(9) |
Sep
(18) |
Oct
(2) |
Nov
(3) |
Dec
(3) |
2018 |
Jan
(7) |
Feb
(6) |
Mar
(1) |
Apr
(2) |
May
|
Jun
|
Jul
(1) |
Aug
(18) |
Sep
(8) |
Oct
(9) |
Nov
(4) |
Dec
(6) |
2019 |
Jan
(5) |
Feb
|
Mar
(2) |
Apr
(4) |
May
(6) |
Jun
(8) |
Jul
(11) |
Aug
(10) |
Sep
(6) |
Oct
|
Nov
(1) |
Dec
|
2020 |
Jan
(8) |
Feb
(3) |
Mar
(1) |
Apr
(4) |
May
(1) |
Jun
(1) |
Jul
|
Aug
|
Sep
(1) |
Oct
(5) |
Nov
(2) |
Dec
(1) |
2021 |
Jan
|
Feb
|
Mar
(5) |
Apr
(2) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2022 |
Jan
|
Feb
(2) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(7) |
Aug
(1) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
(5) |
Jul
(15) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2024 |
Jan
|
Feb
(1) |
Mar
|
Apr
(2) |
May
|
Jun
(5) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2025 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Glen S. <gl...@en...> - 2001-06-13 16:42:28
|
On Wed, 13 Jun 2001, Andre Burgaud wrote: > Hi Mark, > > This works, but I definitely think there should be something more elegant or > more "Python" ;-) : > webbrowser.py from java.lang import * class webbrowser: def __init__(self, browser_path): self.browser=browser_path def setURL(self,url): self.url = url def open_new(self): p = Runtime.getRuntime().exec("%s %s" % (self.browser, self.url)) p.waitFor() #if you wish to wait until the browser is closed moduleA.py from webbrowser import webbrowser if __name__=="__main__": wb = webbrowser("C:/Program Files/Internet Explorer/iexplore.exe") wb.open_new("http://www.jython.org") > ================================================ > C:\>jython > Jython 2.0 on java1.3.0_01 (JIT: null) > Type "copyright", "credits" or "license" for more information. > >>> from java.lang import Runtime > >>> rt=Runtime.getRuntime() > >>> browser="C:/Program Files/Internet Explorer/iexplore.exe" > >>> url="www.jython.org" > >>> cmd="%s %s" % (browser, url) > >>> rt.exec(cmd) > java.lang.Win32Process@407527 > >>> > ================================================ > > I would prefer "a la Python": > > ================================================ > ActivePython 2.1, build 210 ActiveState) > based on Python 2.1 (#15, Apr 23 2001, 18:00:35) [MSC 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>> import webbrowser > >>> webbrowser.open_new("www.python.com") > ================================================ > > Regards, > > Andre > > > ----- Original Message ----- > From: "Mark Ackerman" <ack...@go...> > To: "Jython Users (E-mail)" <jyt...@li...> > Cc: <ack...@go...> > Sent: Tuesday, June 12, 2001 5:50 PM > Subject: [Jython-users] running IE from within jython > > > > Anyone have experience running IE or netscape from within jython? I just > > need to start it with a url. > > > > Mark > > > > _______________________________________________ > > Jython-users mailing list > > Jyt...@li... > > http://lists.sourceforge.net/lists/listinfo/jython-users > > > > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > http://lists.sourceforge.net/lists/listinfo/jython-users -- Glen Starchman Enabled Ventures/Enabled Technology Group gl...@en... 206.234.7330 |
From: Andre B. <an...@bu...> - 2001-06-13 11:45:58
|
Hi Mark, This works, but I definitely think there should be something more elegant or more "Python" ;-) : ================================================ C:\>jython Jython 2.0 on java1.3.0_01 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> from java.lang import Runtime >>> rt=Runtime.getRuntime() >>> browser="C:/Program Files/Internet Explorer/iexplore.exe" >>> url="www.jython.org" >>> cmd="%s %s" % (browser, url) >>> rt.exec(cmd) java.lang.Win32Process@407527 >>> ================================================ I would prefer "a la Python": ================================================ ActivePython 2.1, build 210 ActiveState) based on Python 2.1 (#15, Apr 23 2001, 18:00:35) [MSC 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import webbrowser >>> webbrowser.open_new("www.python.com") ================================================ Regards, Andre ----- Original Message ----- From: "Mark Ackerman" <ack...@go...> To: "Jython Users (E-mail)" <jyt...@li...> Cc: <ack...@go...> Sent: Tuesday, June 12, 2001 5:50 PM Subject: [Jython-users] running IE from within jython > Anyone have experience running IE or netscape from within jython? I just > need to start it with a url. > > Mark > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > http://lists.sourceforge.net/lists/listinfo/jython-users > |
From: Mark A. <ack...@go...> - 2001-06-12 22:50:24
|
Anyone have experience running IE or netscape from within jython? I just need to start it with a url. Mark |
From: Steven M. C. <sca...@sa...> - 2001-06-12 20:55:51
|
Ok, I don't mean to start a license war here, but I have written a suite of programs (half in java, half in python) that use a pair of jython scripts to convert data between the two, and would like to distribute my software without breaking any laws. Here's a couple of scenarios: 1) Jython scripts -> compiled into classes with jythonc -> compiled into binaries with gcj (assuming that that would work). 2) Jython scripts -> compiled into class files -> distributed (on the same medium!) with jython.jar (or whatever components are necessary) 3) Jython scripts -> distribute scripts only, leave it up to the user to install Jython on their machine. Ideally, I'd like either 1 or 2, but right now I'm sticking with 3, while I figure out the legality of the first two. I'm more than happy to include whatever files/documentation required by the Jython license, but I'm no lawyer, and want to play things safe. Can anyone tell me which of the above three options (or feel free to suggest an alternative) will leave me in the clear? Thanks a lot. -- Steve Castellotti Systems Programmer School of Arts and Sciences, University of Pennsylvania |
From: Lukasz S. <lu...@mb...> - 2001-06-12 17:33:54
|
how do I retrieve traceback/error messages that are normally shown in the console ? I the interpreter seems to be working fine when fed the python script one line at a time by calling exec, the correct results do show up in the stream hooked up through a call to setOut but there is no error messages neither there, nor in the error stream... lukasz |
From: Samuele P. <pe...@in...> - 2001-06-12 16:08:14
|
Hi. > Any recommendations for what I should do? It depens on how much control you have on what the locals contain, could they contain modules too? in that case you need to write a deep-copy function that deals with modules making a shallow copy of them (in any case modules are shared among interps): otherwise any tricks that avoids polluting the locals with 'copy' can do: from import etc. the copy.deepcopy that comes with jython 2.0 can deal with PyStringMap. regards. |
From: Sharon L. <lu...@us...> - 2001-06-12 15:19:54
|
How do I make a deep copy of the PythonInterpreter.locals object? I want to start a new thread with a clone of locals passed to the new thread, but I don't want changes to locals that occur in the new thread to effect the locals from the original thread. In the following example, things like lists do not get deep copied. That is, when I change a value in a list in PythonInterpreter pyi2, it is also getting changed in pyi1, which I didn't want. import org.python.util.PythonInterpreter; import org.python.core.*; public class Embedded2 { public static void main(String []args) throws PyException { PythonInterpreter pyi1 = new PythonInterpreter(); // Set up the initial state of pyi1 pyi1.exec("x = 4"); String eval_value = "list1 = ['machA','machB','machC']"; pyi1.exec(eval_value); // Save the initial state of pyi1 PyObject localsMap = pyi1.getLocals(); PyObject initialState = localsMap.invoke("copy"); // Clone pyi1 to pyi2 PythonInterpreter pyi2 = new PythonInterpreter(); pyi2.setLocals(localsMap); // Change variable x and list1[2] in pyi2 pyi2.exec("x = 10"); pyi2.exec("list1[2] = 'newMach'"); // Restore initial state of pyi1 pyi1.setLocals(initialState.invoke("copy")); // x=4 (good) and list1 = ['machA','machB','newMach'] (bad) pyi1.exec("print x"); pyi1.exec("print list1"); // x=10 and list1 = ['machA','machB','n, pyi2.exec("print x"); pyi2.exec("print list1"); } } So, I tried to do a deep copy of the PythonInterpreters.locals object as seen in the following java code and found that object types like PyModule and PyStringMap cannot be deep copied, so I got the following error: Exception in thread "main" Traceback (innermost last): File "<string>", line 1, in ? File "D:\jython-2.1a1\Lib\copy.py", line 160, in deepcopy File "D:\jython-2.1a1\Lib\copy.py", line 209, in _deepcopy_dict File "D:\jython-2.1a1\Lib\copy.py", line 156, in deepcopyewMach'] Error: un-deep-copyable object of type org.python.core.PyModule import org.python.util.PythonInterpreter; import org.python.core.*; public class Embedded3 { public static void main(String []args) throws PyException { PythonInterpreter pyi1 = new PythonInterpreter(); // Set up the initial state of pyi1 pyi1.exec("x = 4"); String eval_value = "list1 = ['machA','machB','machC']"; pyi1.exec(eval_value); // Save the initial state of pyi1 PyObject localsMap = pyi1.getLocals(); pyi1.exec("import copy"); pyi1.set("localsMap", localsMap); pyi1.exec("initialState = copy.deepcopy(localsMap)"); // Clone pyi1 to pyi2 PythonInterpreter pyi2 = new PythonInterpreter(); pyi2.setLocals(localsMap); // Change variable x and list1[2] in pyi2 pyi2.exec("x = 10"); pyi2.exec("list1[2] = 'newMach'"); // Restore initial state of pyi1 PyObject initialState = pyi1.get("InitialState"); pyi1.setLocals(initialState.invoke("copy")); pyi1.exec("print x"); pyi1.exec("print list1"); pyi2.exec("print x"); pyi2.exec("print list1"); } } Any recommendations for what I should do? |
From: Don C. <don...@em...> - 2001-06-12 14:53:36
|
I use jython to test EJBs. I've found it is really easy to put the jndi info in a jndi.properties files in the classpath. This allows you to say "context = InitialContext()" which is much easier to type in the interpreter. You can also modify the jython.bat and pass the information in with -Dproperty=value. # this code seem to work fine # I'm using weblogic but I think I've used this with JBoss too props = Properties(); props.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContectory"); props.put(Context.PROVIDER_URL,"t3://localhost:7001"); context = InitialContext(props); object = jndiContext.lookup("BeanName") beanHome = PortableRemoteObject.narrow(object, BeanHome.class) bean = beanHome.create() > -----Original Message----- > From: la...@lu... > [mailto:la...@lu...] > Sent: Tuesday, June 12, 2001 10:31 AM > To: Robert Kuzelj > Cc: jyt...@li... > Subject: [Jython-users] Jython / EJB question > > > > Hi all. I'm working on writing a small client to an EJB in > jython, that > I've already implemented in Perl. I'm using JBoss as my ejb > server. I'm > stumped on calling javax.naming.initialContext. > > Here's a snippet of the java code: > > ---- JAVA CODE -------- > Properties env = new Properties(); > env.setProperty("java.naming.factory.initial", > "org.jnp.interfaces.NamingContextFactory"); > env.setProperty("java.naming.provider.url", "localhost:1099"); > env.setProperty("java.naming.factory.url.pkgs", > "org.jboss.naming"); > > InitialContext jndiContext = new InitialContext(env); > Object ref = jndiContext.lookup("interest/Interest"); > ----- END JAVA CODE ----- > > here's what I'm trying in jython: > > ---- JYTHON CODE -------- > env = java.util.Properties() > env.setProperty("java.naming.factory,initial", > "org.jnp.interfaces.NamingContextFactory") > env.setProperty("java.naming.provider.url", "localhost:1099") > env.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming") > > jndiContext = javax.naming.InitialContext() > jndiContext.lookup("interest/Interest"); > ---- END JYTHON CODE ---- > > Here's the error I'm getting w/ the jython code: > > File "interest.py", line 15, in ? > javax.naming.NoInitialContextException: Need to specify class name in > environment or system property, or as an applet parameter, or in an > application resource file: java.naming.factory.initial > > Looking up javax.naming.InitialContext, I see this for its > constructor: > > public InitialContext(java.util.Hashtable environment) throws > NamingException > > What I would guess, being almost totally new to both Jython > and Java, is > that "env" is not being properly passed as a java.util.Hashtable, and > therefore I'm not getting a context to do my name lookup in. > > I notice that NoInitialContext is thrown when JNDI cannot create an > initial context. > > Any pointers would be much appreciated. > > -------------------------------------------------------------- > --------------- > Brian Knox > Just Another Perl Hacker > perl -le '$_="6110>374086;2064208213:90<307;55";tr[0->][ > LEOR!AUBGNSTY];print' > > > > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > http://lists.sourceforge.net/lists/listinfo/jython-users > |
From: <la...@lu...> - 2001-06-12 14:49:19
|
Arg. Actually, having the env in there doesn't help. This is what I get for writing emails before I've had coffee :) The env is in the call in my code I still get the same error jndiContext = javax.naming.InitialContext(env) name = "interest/Interest" jndiContext.lookup(name) Here's the entire exception javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:647) at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247) at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:284) at javax.naming.InitialContext.lookup(InitialContext.java:351) at java.lang.reflect.Method.invoke(Native Method) at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:160) at org.python.core.PyMethod.__call__(PyMethod.java:96) at org.python.core.PyObject.__call__(PyObject.java:274) at org.python.core.PyInstance.invoke(PyInstance.java:263) at org.python.pycode._pyx0.f$0(interest.py:15) at org.python.pycode._pyx0.call_function(interest.py) at org.python.core.PyTableCode.call(PyTableCode.java:198) at org.python.core.PyCode.call(PyCode.java:13) at org.python.core.Py.runCode(Py.java:1075) at org.python.core.__builtin__.execfile(__builtin__.java:298) at org.python.core.__builtin__.execfile(__builtin__.java:302) at org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:155) at org.python.util.jython.main(jython.java:164) javax.naming.NoInitialContextException: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial ----------------------------------------------------------------------------- Brian Knox Just Another Perl Hacker perl -le '$_="6110>374086;2064208213:90<307;55";tr[0->][ LEOR!AUBGNSTY];print' On Tue, 12 Jun 2001, Samuele Pedroni wrote: > Hi. > > > > > Hi all. I'm working on writing a small client to an EJB in jython, that > > I've already implemented in Perl. I'm using JBoss as my ejb server. I'm > > stumped on calling javax.naming.initialContext. > > > > Here's a snippet of the java code: > > > > ---- JAVA CODE -------- > > Properties env = new Properties(); > > env.setProperty("java.naming.factory.initial", > > "org.jnp.interfaces.NamingContextFactory"); > > env.setProperty("java.naming.provider.url", "localhost:1099"); > > env.setProperty("java.naming.factory.url.pkgs", > > "org.jboss.naming"); > > > > InitialContext jndiContext = new InitialContext(env); > > Object ref = jndiContext.lookup("interest/Interest"); > > ----- END JAVA CODE ----- > > > > here's what I'm trying in jython: > > > > ---- JYTHON CODE -------- > > env = java.util.Properties() > > env.setProperty("java.naming.factory,initial", > > "org.jnp.interfaces.NamingContextFactory") > > env.setProperty("java.naming.provider.url", "localhost:1099") > > env.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming") > > > > jndiContext = javax.naming.InitialContext() > > where's the env here, > jndiContext = javax.naming.InitialContext(env) could help ;) > > > jndiContext.lookup("interest/Interest"); > > ---- END JYTHON CODE ---- > > > > Here's the error I'm getting w/ the jython code: > > > > File "interest.py", line 15, in ? > > javax.naming.NoInitialContextException: Need to specify class name in > > environment or system property, or as an applet parameter, or in an > > application resource file: java.naming.factory.initial > > > > Looking up javax.naming.InitialContext, I see this for its constructor: > > > > public InitialContext(java.util.Hashtable environment) throws > > NamingException > > > > What I would guess, being almost totally new to both Jython and Java, is > > that "env" is not being properly passed as a java.util.Hashtable, and > > therefore I'm not getting a context to do my name lookup in. > > > > I notice that NoInitialContext is thrown when JNDI cannot create an > > initial context. > > > > Any pointers would be much appreciated. > > > > ----------------------------------------------------------------------------- > > Brian Knox > > Just Another Perl Hacker > > perl -le '$_="6110>374086;2064208213:90<307;55";tr[0->][ LEOR!AUBGNSTY];print' > > > > > > > > > > _______________________________________________ > > Jython-users mailing list > > Jyt...@li... > > http://lists.sourceforge.net/lists/listinfo/jython-users > |
From: Samuele P. <pe...@in...> - 2001-06-12 14:43:09
|
Hi. > > Hi all. I'm working on writing a small client to an EJB in jython, that > I've already implemented in Perl. I'm using JBoss as my ejb server. I'm > stumped on calling javax.naming.initialContext. > > Here's a snippet of the java code: > > ---- JAVA CODE -------- > Properties env = new Properties(); > env.setProperty("java.naming.factory.initial", > "org.jnp.interfaces.NamingContextFactory"); > env.setProperty("java.naming.provider.url", "localhost:1099"); > env.setProperty("java.naming.factory.url.pkgs", > "org.jboss.naming"); > > InitialContext jndiContext = new InitialContext(env); > Object ref = jndiContext.lookup("interest/Interest"); > ----- END JAVA CODE ----- > > here's what I'm trying in jython: > > ---- JYTHON CODE -------- > env = java.util.Properties() > env.setProperty("java.naming.factory,initial", > "org.jnp.interfaces.NamingContextFactory") > env.setProperty("java.naming.provider.url", "localhost:1099") > env.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming") > > jndiContext = javax.naming.InitialContext() where's the env here, jndiContext = javax.naming.InitialContext(env) could help ;) > jndiContext.lookup("interest/Interest"); > ---- END JYTHON CODE ---- > > Here's the error I'm getting w/ the jython code: > > File "interest.py", line 15, in ? > javax.naming.NoInitialContextException: Need to specify class name in > environment or system property, or as an applet parameter, or in an > application resource file: java.naming.factory.initial > > Looking up javax.naming.InitialContext, I see this for its constructor: > > public InitialContext(java.util.Hashtable environment) throws > NamingException > > What I would guess, being almost totally new to both Jython and Java, is > that "env" is not being properly passed as a java.util.Hashtable, and > therefore I'm not getting a context to do my name lookup in. > > I notice that NoInitialContext is thrown when JNDI cannot create an > initial context. > > Any pointers would be much appreciated. > > ----------------------------------------------------------------------------- > Brian Knox > Just Another Perl Hacker > perl -le '$_="6110>374086;2064208213:90<307;55";tr[0->][ LEOR!AUBGNSTY];print' > > > > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > http://lists.sourceforge.net/lists/listinfo/jython-users |
From: <la...@lu...> - 2001-06-12 14:37:55
|
On Tue, 12 Jun 2001 la...@lu... wrote: > > Hi all. I'm working on writing a small client to an EJB in jython, that > I've already implemented in Perl. I'm using JBoss as my ejb server. I'm > stumped on calling javax.naming.initialContext. Hahaha. Sorry. Was coding perl when I wrote the above. I have not already implemented the ejb client in Perl, I implemented it in Java :) Well, actually, I have implemented it in Perl too, but we won't go into that, because its not relevant, and just an extremely twisted thing to do :) |
From: <la...@lu...> - 2001-06-12 14:31:16
|
Hi all. I'm working on writing a small client to an EJB in jython, that I've already implemented in Perl. I'm using JBoss as my ejb server. I'm stumped on calling javax.naming.initialContext. Here's a snippet of the java code: ---- JAVA CODE -------- Properties env = new Properties(); env.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory"); env.setProperty("java.naming.provider.url", "localhost:1099"); env.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming"); InitialContext jndiContext = new InitialContext(env); Object ref = jndiContext.lookup("interest/Interest"); ----- END JAVA CODE ----- here's what I'm trying in jython: ---- JYTHON CODE -------- env = java.util.Properties() env.setProperty("java.naming.factory,initial", "org.jnp.interfaces.NamingContextFactory") env.setProperty("java.naming.provider.url", "localhost:1099") env.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming") jndiContext = javax.naming.InitialContext() jndiContext.lookup("interest/Interest"); ---- END JYTHON CODE ---- Here's the error I'm getting w/ the jython code: File "interest.py", line 15, in ? javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial Looking up javax.naming.InitialContext, I see this for its constructor: public InitialContext(java.util.Hashtable environment) throws NamingException What I would guess, being almost totally new to both Jython and Java, is that "env" is not being properly passed as a java.util.Hashtable, and therefore I'm not getting a context to do my name lookup in. I notice that NoInitialContext is thrown when JNDI cannot create an initial context. Any pointers would be much appreciated. ----------------------------------------------------------------------------- Brian Knox Just Another Perl Hacker perl -le '$_="6110>374086;2064208213:90<307;55";tr[0->][ LEOR!AUBGNSTY];print' |
From: Robert K. <rob...@ya...> - 2001-06-12 08:37:40
|
hi, just one short question? is there any plan to incorporate the python language srvices modules into jython (exspecially the parser-module)? ciao robertj ps: i know that i could be using the jython parser java classes directly. but this would be incompatible wouldnt it? ===== itemj http://www.itemj.com Robert Kuzelj mobil 0177 5302230 Ramonvillestr.6 tel 06039 930223 61184 Karben fax 06039 2224 __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ |
From: Kieran B. <ki...@br...> - 2001-06-11 18:03:45
|
Can you write a static function in jython? The following code: import java from com.borland.primetime.ide import Browser from com.raelity.jvi import * class jvicom(java.lang.Object): def initOpenTool(majorVersion, minorVersion): "@sig public static void initOpenTool(byte majorVersion, byte minorVersion)" ViManager.addStartupListener(actionPerformed=initStuff) def initStuff(self): ColonCommands.register("com", "command", Browser.ACTION_NavigateBack) Returns the following error under jythonc: 1 .\jpywork\jvicom.java:90: non-static variable this cannot be referenced from a static context PyObject inst = Py.jgetattr(this, "initOpenTool"); ^ Note: .\jpywork\jvicom.java uses or overrides a deprecated API. Note: Recompile with -deprecation for details. 1 error Any info appreciated. |
From: Robert W. B. <rb...@di...> - 2001-06-11 17:27:15
|
Hello all, Forgive the cross-post. The discussion concerning documenting Jython migrated to jython-dev, but I feared someone interested in documentation might be missed there. I'll stick to jython-devel in the future. 1. I've added a wicki page for 'in-development' Jython documentation at: http://www.jython.org/cgi-bin/moin.cgi/JythonDevelDocs 2. Fred Drake peeked into his crystal ball and says XML could be in the Python docs future, but not the immediate future. This gives credence to 'stick to the wiki for now' plan. 3. The outline is paraphrased from what was originally posted on this list. It's been reorganized a bit, and had some notes added. The outline seems due for some fresh eyes. -Robert |
From: Kieran B. <ki...@br...> - 2001-06-11 16:32:53
|
Can you help? I am getting the following stack trace from some jythonc'd jython code. The code works fine in jython, but when I turn it into a jar with command: $ //c/jython-2.1a1/jythonc.bat -C c:/JBuilder4/jdk1.3/bin/javac.exe -core -jar TB2.jar TB2.py I get a stacktrace on my awt actionPerformed: def actionPerformed(self, e): conversation = WebConversation() request = GetMethodWebRequest( self.getURL() ) response = conversation.getResponse( request ) self.setHTML(response.getText()) The external classes I'm using are from httpunit.sourceforge.net. If I just have: def actionPerformed(self, e): self.setHTML("hi") It would appear, just having the line: conversation = WebConversation() causes the stack trace. Can you help? > java -jar TB2.jar Exception occurred during event dispatching: java.lang.NullPointerException at java.lang.Class.isAssignableFrom(Native Method) at org.python.core.PyJavaClass.init__class__(PyJavaClass.java:151) at org.python.core.PyJavaClass.init(PyJavaClass.java:209) at org.python.core.PyJavaClass.initLazy(PyJavaClass.java:85) at org.python.core.PyJavaClass.initialize(PyJavaClass.java:101) at org.python.core.PyJavaClass.initConstructors(PyJavaClass.java:657) at org.python.core.PyJavaClass.__call__(PyJavaClass.java:809) at org.python.core.PyObject.__call__(PyObject.java:262) at TB2$_PyInner.go$6(TB2.java:126) at TB2$_PyInner.call_function(TB2.java:74) at org.python.core.PyTableCode.call(PyTableCode.java:198) at org.python.core.PyTableCode.call(PyTableCode.java:388) at org.python.core.PyTableCode.call(PyTableCode.java:288) at org.python.core.PyFunction.__call__(PyFunction.java:185) at org.python.core.PyMethod.__call__(PyMethod.java:96) at org.python.core.PyCompoundCallable.__call__(PyCompoundCallable.java:2 8) |
From: Carlos Q. <car...@we...> - 2001-06-10 12:08:26
|
Hi all I just developed a JythonInterpreter plugin which integrates the Jython interpreter into jEdit. jEdit is a very powerful edit written in Java including syntax coloring, auto indentation and many other features. It includes this features for Python and so it can be very useful for Python and Jython developers alike. It can be found at http://www.jedit.org. You can further customize jEdit by plugins. The plugin I just wrote is based on a slightly modified Console plugin, which gives access to shell commands. A Console.jar is included but it will be removed for the Console's next release 2.6. The Interpreter is a normal Jython interpreter and it can be used for any normal jython interpreter task and jEdit customization. A default buffer variable is auto included. This makes very easy to execute the current file by execfile(buffer.getPath()). This makes jEdit a sort of basic IDE for Jython The plugin can be found at http://koti.welho.com/cquiroz/jedit/ It is just developed and not widely tested, so I want to know if it is useful for Jython and Python developers, suggestions and bug fixes. Regards |
From: Samuele P. <pe...@in...> - 2001-06-10 00:25:16
|
Hi. [Daniel Lord] > ... > I cannot then simply add a package qualifier to foo.java (say package > bar;): the following code fails with "ImportError: No module named bar" > even though it resembles the standard javax.swing package type calls. > What am I doing wrong? How are java packages you build yourself unlike > standard packages or does jreload not handle packages at all? The header > comment in jreload.py implies only loading inner classes or * imports > fails, but doesn't seem to mention all packages failing. According to > the comment in the LoadSet class, contained packages should work. Of > course Samuele states the module is experimental. Or am I just doing > this wrong? > <example-snip> Yes contained packages should work, and your example (slightly changed and attached) works for me - I know that's not very useful - my jrl.py launched from a directory containing foobar.jar (which contains bar/foo.class and bar/foo.java) does its job. I just don't understand what is going wrong in your case, I will suggest you to try my example stuff. regards, Samuele Pedroni. |
From: Daniel L. <da...@br...> - 2001-06-09 21:44:21
|
On Thursday, June 7, 2001, at 12:04 PM, jython-users- re...@li... wrote: > > I'm likely misunderstanding you on this, but to me creating a java > packages consist of: > > - changing my CLASSPATH envvar by adding root directory. > - create a new package dir (let's call it "foo") in the root dir that > was added to CLASSPATH. > - create my java source files inside the foo directory and add a > "package foo;" to the top of all the source files. > > This is all due to the way java is designed. > > regards, > finn I have "." in my class path, but of course that will not load jars by default. To avoid having to set my environment each time I launch Jython and since there is no command line equivalent to "-jar" in Jython, I have been trying to use jreload with litmited success. One thing that I find confusing is that while I can create a java.class (say foo) with no package enveloping it, jar it with a manifest (say in foo.jar), and read it into a Jython program without having to change my shell environment (e.g. setenv CLASSPATH "foo.jar:${CLASSPATH}" before execution with the following code (foo,.java, jartest.py), // foo.java // public class foo { public foo() { System.out.println ("foo::ctor()"); } } //// ## jartest.py ## import sys import os import jreload def xp(name): return os.path.join(sys.prefix,'./'+name) SomeJar = jreload.makeLoadSet('SomeJar',[xp('.'),xp('foo.jar')]) from SomeJar import foo foo() #### I cannot then simply add a package qualifier to foo.java (say package bar;): the following code fails with "ImportError: No module named bar" even though it resembles the standard javax.swing package type calls. What am I doing wrong? How are java packages you build yourself unlike standard packages or does jreload not handle packages at all? The header comment in jreload.py implies only loading inner classes or * imports fails, but doesn't seem to mention all packages failing. According to the comment in the LoadSet class, contained packages should work. Of course Samuele states the module is experimental. Or am I just doing this wrong? // bar/foo.java // package bar; public class foo { public foo() { System.out.println("foobar::ctor()"); } } //// ## jartest-2.py ## import sys import os import jreload def xp(name): return os.path.join(sys.prefix,'./'+name) X = jreload.makeLoadSet('X',[xp('.'),xp('foobar.jar')]) from X.bar import foo X.bar.foo() #### |
From: Neil R. <ne...@bl...> - 2001-06-08 23:30:50
|
I'm trying to setup a security profile for my Jython application, but the Py.java class, when it tries to create the class loader, apparently ignores any security exceptions that are thrown, and then proceeds to try to use the class loader (which failed to load). This results in a NullPointerException without any hint of what the security exception was that caused the class loader not to load. I basically had to touch the code to dump a stack trace when it caught the SecurityException in order to find out what it was. Here's the NullPointerException stack trace: Exception in thread "main" java.lang.ExceptionInInitializerError: java.lang.NullPointerException at org.python.core.Py.findClassEx(Py.java:607) at org.python.core.imp.loadBuiltin(imp.java:198) at org.python.core.imp.load(imp.java:354) at org.python.core.imp.load(imp.java:376) at org.python.core.Py.initClassExceptions(Py.java:470) at org.python.core.PySystemState.initialize(PySystemState.java:335) at org.python.core.PySystemState.initialize(PySystemState.java:294) at org.python.core.PySystemState.initialize(PySystemState.java:287) at org.python.util.PythonInterpreter.<init>(PythonInterpreter.java:61) at org.python.util.PythonInterpreter.<init>(PythonInterpreter.java:45) Thanks, Neil Computer Science is no more about computers than astronomy is about telescopes. -- E. W. Dijkstra |
From: <bc...@wo...> - 2001-06-08 17:18:22
|
[Mike Barton] >Jython code, compiled with jythonc into Java is accessible from >Java but not from another Jython script. [finn] >Correct. Workarounds are available, but they are ugly. [Mike Barton] >Where are the workarounds done? In the jython script. If "foo.py" is a module that have been compiled with jythonc: import java class foo(java.lang.Object): def toString(self): return "foo.toString" def bar(self, arg): """@sig int bar(int arg)""" return arg + 1 then this jythonc compiled module can be used from a jython script by importing it like this: #import foo import foo as fooClass import new foo = new.module("foo") fooClass.moduleDictInit(foo.__dict__) f = foo.foo() print f.toString() print f.bar(43) The thing to notice is that a bare "import foo" will not import foo as a module but it will import the java class. The 4 lines at the beginning will wrap this java class in a module called "foo". If you use this, keep in mind that it is a hack. You may be forced to remove the hack when you upgrade to a later version of jython. regards, finn |
From: <bc...@wo...> - 2001-06-07 16:28:08
|
[Mike Barton] >... >Since the rules engine wants to control processing, I am trying to make >Jython classes, compiled as Java, available to handle i/o and instance >creation. >I would really like to be able to use Jython and Java classes >interchangeably, depending on where I am in development/prototyping. > >My assumptions/observations at this time, which may or may not be correct >are: > >Java code, which will be accessed from Jython MUST be compiled as part of a >package. Not really, but it is a good idea to put such java code into packages. >Jython code, compiled with jythonc into Java is accessible from >Java but not from another Jython script. Correct. Workarounds are available, but they are ugly. >While an instance of a class can be created, the methods are not >accessible. > AttributeError: abstract method getHello not implemented Wrong, but your observation of this is perhaps a consequence of the previous item. >Any corrections or rules-of-thumb would be appreciated. > >Also if there is any reference material available that describes a simple >technique for creating and using Java packages by hand, that would help. >It seems more tedious than it needs to be. I'm likely misunderstanding you on this, but to me creating a java packages consist of: - changing my CLASSPATH envvar by adding root directory. - create a new package dir (let's call it "foo") in the root dir that was added to CLASSPATH. - create my java source files inside the foo directory and add a "package foo;" to the top of all the source files. This is all due to the way java is designed. regards, finn |
From: <bc...@wo...> - 2001-06-07 16:26:48
|
[Craig Turner] >Can I serialise data-structures in python/jython using cPickle? And if so, >would I be able to pass an object serialised python server to a jython >applet provided it inherited from an object available at both ends? (call >me crazy :) ) That should work for most common cases. There are situation where the cPickle output isn't compatible: - the Jython-CPython versions have to match. Eg. both must be 2.0. - Beware of >8bit strings. Jython strings with character values > 0xFF will be pickled as a unicode string. That may come as a surprise to the python server. - Java objects and subclasses of java classes isn't supported at all. regards, finn |
From: Craig T. <cr...@ah...> - 2001-06-07 08:21:19
|
Can I serialise data-structures in python/jython using cPickle? And if so, would I be able to pass an object serialised python server to a jython applet provided it inherited from an object available at both ends? (call me crazy :) ) I've looked into xml-rpc, but am having a last ditch attempt at working around it ;) Am I right to? My concerns are that if I start using a lot of libraries, the applet will take ages to download and run, and I'd like to keep it as small as possible. -- Craig Turner - cr...@ah... Ahdore Emerging Media - www.ahdore.com Bom Bom Bom-Bom Bom! - Puddle Lane |
From: Tessa L. <tl...@cs...> - 2001-06-06 17:50:28
|
If you're only interested in a few of the window listener events, you could instead do this: from javax.swing import * def foo(e): print 'foo', e f = JFrame(windowActivated=foo, windowIconified=foo) (depending on what you want to listen for on your windows) --Tessa |