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: DanglingPointer <dan...@gm...> - 2016-08-23 12:12:37
|
Thanks for the heads up! On 23/08/16 21:20, Stefan Richthofer wrote: > You might want to watch https://github.com/jython/jython3 > > Cheers > > Stefan > > >> Gesendet: Dienstag, 23. August 2016 um 13:08 Uhr >> Von: "Adam Burke" <ada...@gm...> >> An: DanglingPointer <dan...@gm...> >> Cc: jyt...@li... >> Betreff: Re: [Jython-users] CPython 3.x >> >> 3.x has been the main focus of development since 2.7 was released. Haven't seen advertised dates for a beta but commits have been going in. >> >> Cheers >> Adam >> >>> 在 23 Aug 2016,6:42 PM,DanglingPointer <dan...@gm...> 写道: >>> >>> Was wondering if CPyhton 3.x is in Jython's roadmap at all? >>> >>> >>> ------------------------------------------------------------------------------ >>> _______________________________________________ >>> Jython-users mailing list >>> Jyt...@li... >>> https://lists.sourceforge.net/lists/listinfo/jython-users >> ------------------------------------------------------------------------------ >> _______________________________________________ >> Jython-users mailing list >> Jyt...@li... >> https://lists.sourceforge.net/lists/listinfo/jython-users >> |
From: Stefan R. <Ste...@gm...> - 2016-08-23 11:21:13
|
You might want to watch https://github.com/jython/jython3 Cheers Stefan > Gesendet: Dienstag, 23. August 2016 um 13:08 Uhr > Von: "Adam Burke" <ada...@gm...> > An: DanglingPointer <dan...@gm...> > Cc: jyt...@li... > Betreff: Re: [Jython-users] CPython 3.x > > 3.x has been the main focus of development since 2.7 was released. Haven't seen advertised dates for a beta but commits have been going in. > > Cheers > Adam > > > 在 23 Aug 2016,6:42 PM,DanglingPointer <dan...@gm...> 写道: > > > > Was wondering if CPyhton 3.x is in Jython's roadmap at all? > > > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > > Jython-users mailing list > > Jyt...@li... > > https://lists.sourceforge.net/lists/listinfo/jython-users > > ------------------------------------------------------------------------------ > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users > |
From: Adam B. <ada...@gm...> - 2016-08-23 11:08:29
|
3.x has been the main focus of development since 2.7 was released. Haven't seen advertised dates for a beta but commits have been going in. Cheers Adam > 在 23 Aug 2016,6:42 PM,DanglingPointer <dan...@gm...> 写道: > > Was wondering if CPyhton 3.x is in Jython's roadmap at all? > > > ------------------------------------------------------------------------------ > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users |
From: DanglingPointer <dan...@gm...> - 2016-08-23 10:42:20
|
Was wondering if CPyhton 3.x is in Jython's roadmap at all? |
From: Adam B. <ada...@gm...> - 2016-08-23 10:22:09
|
Hi, it's active just low volume. Cheers Adam > 在 23 Aug 2016,5:00 PM,Fernando Casado <dan...@gm...> 写道: > > Is this mailing list active? I haven't received anything since joining. Does anyone use this? > ------------------------------------------------------------------------------ > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users |
From: Fernando C. <dan...@gm...> - 2016-08-23 09:00:54
|
Is this mailing list active? I haven't received anything since joining. Does anyone use this? |
From: Fabio Z. <fa...@gm...> - 2016-08-18 12:58:15
|
Release Highlights: ------------------------------- * **Important** PyDev now requires Java 8 and Eclipse 4.5 onwards. * PyDev 4.5.5 is the last release supporting Java 7 and Eclipse 3.8. * See: `update sites page`_ for the update site of older versions of PyDev. * See: the **PyDev does not appear after install** section on `the download page`_ for help on using a Java 8 vm in Eclipse. * Inital support for code-completion using **PEP 484 static type declarations**. * **Debugger** * Fixed racing condition where the variables view would not be properly shown in the debugger -- which made an additional select of the stack required in order to show the variables (#PyDev-672). * Reusing the existing stack from the thread in the debugger (so that the expanded state of the variables is properly kept on step over). * Fixed issue changing attribute of local variable in the variables view (#PyDev.Debugger-56). * Fixed issue on attach to process: it required the pydevd_tracing to be at the top-level and it was moved to _pydevd_bundle (restored it to be a public API). * **Indentation** * The default indent mode now changed to better follow PEP 8 guidelines: * Indenting directly after {, [, ( will add one indent level. * Indenting after another token in a line with a {, [, ( will indent to the {, [, ( level. * It's possible to restore previous indent modes (which either always indented to the parenthesis level or always indented a single level) in the preferences > PyDev > Editor > Typing. * **Interactive console** * IPython 5 now supported in interactive console (#PyDev-710). * Fixed issue executing single line with multiple statements in console. * Fixed issue executing a multiple line statement in Jython. * **Others** * The (fast) parser which detects the outline of a Python module now handles mixed indentation (and additional fixes which could result in log entries such as "Did not expect to find item below node: Assign..."). * Support for unpacking generalizations (PEP 448) which could still result in a syntax error for the Python 3 grammar (#PyDev-701). * Fixed error in code analysis when the code is connected to an RTC source control (#PyDev-184, patch by Wesley Barroso Lopes) What is PyDev? --------------------------- PyDev is an open-source Python IDE on top of Eclipse for Python, Jython and IronPython development. It comes with goodies such as code completion, syntax highlighting, syntax analysis, code analysis, refactor, debug, interactive console, etc. Details on PyDev: http://pydev.org Details on its development: http://pydev.blogspot.com What is LiClipse? --------------------------- LiClipse is a PyDev standalone with goodies such as support for Multiple cursors, theming, TextMate bundles and a number of other languages such as Django Templates, Jinja2, Kivy Language, Mako Templates, Html, Javascript, etc. It's also a commercial counterpart which helps supporting the development of PyDev. Details on LiClipse: http://www.liclipse.com/ Cheers, -- Fabio Zadrozny ------------------------------------------------------ Software Developer LiClipse http://www.liclipse.com PyDev - Python Development Environment for Eclipse http://pydev.org http://pydev.blogspot.com PyVmMonitor - Python Profiler http://www.pyvmmonitor.com/ |
From: Jeff A. <ja...@fa...> - 2016-08-18 06:37:58
|
Syntax errors are mostly reported directly from code generated by the ANTLR parser-generator, so will reflect its conventions: "no viable alternative" is one of those. A move to ANTLR 4 (suggested but not straightforward) could change them somewhat, but they are quite stylised. Our guidance for other error messages is to be as like the ones from CPython as is sensible -- nothing more formal is consistently followed. The code that formats exceptions for output (may help with your ideas) is here: https://hg.python.org/jython/file/tip/src/org/python/core/Py.java#l1173 It may also be worth looking at sys.excepthook as an alternative to catching the exception, but catching sounds like a natural Java approach. Jeff Allen On 16/08/2016 20:15, James Ervin wrote: > I was wondering if someone could point me to either the jython class > or a document where the format of error messages is defined. > > I am working on embedding a jython engine inside an Eclipse RCP > application. I would really love to be able to extract line numbers > (if not exact character offsets) from errors generated by bad python code. > > For example I get: > SyntaxError: ("no viable alternative at input 'crap'", ('<string>', 5, > 11, ' crappy crap crap\n')) > > I am trying to figure out how to successfully extract the 5 and 11 there. > > Another example: > Traceback (most recent call last):File "<string>", line 1, in > <module>AttributeError: 'NoneType' object has no attribute 'getName' > > Obviously the line followed by the number should be sufficient. > > Also is there a better way to get these errors than catch exceptions > from PythonInterpreter.exec()? > > Thanks, > James E. Ervin, IV > > "Noli nothis permittere te terere." > "Romanes eunt domus." > Blog: http://iacobus.blogspot.com > > > ------------------------------------------------------------------------------ > > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users |
From: James E. <je...@gm...> - 2016-08-16 19:15:48
|
I was wondering if someone could point me to either the jython class or a document where the format of error messages is defined. I am working on embedding a jython engine inside an Eclipse RCP application. I would really love to be able to extract line numbers (if not exact character offsets) from errors generated by bad python code. For example I get: SyntaxError: ("no viable alternative at input 'crap'", ('<string>', 5, 11, ' crappy crap crap\n')) I am trying to figure out how to successfully extract the 5 and 11 there. Another example: Traceback (most recent call last):File "<string>", line 1, in <module>AttributeError: 'NoneType' object has no attribute 'getName' Obviously the line followed by the number should be sufficient. Also is there a better way to get these errors than catch exceptions from PythonInterpreter.exec()? Thanks, James E. Ervin, IV "Noli nothis permittere te terere." "Romanes eunt domus." Blog: http://iacobus.blogspot.com |
From: Spence A. <sp...@gm...> - 2016-07-21 18:51:53
|
Hi and thanks for reading: I have a Jython class: class MyClass(SomeInterface): def op(self): a = some_fun() return a In a separate java class I have: class Task extends MultiThreadedTask { SomeResult _a; @Override public void callPerThread() { SomeInterface si = (SomeInterface) JythonObjectFactory.get("MyClass") _a = si.op() } } Here's my jython program that I'd like to single step with breakpoints inside of the "op" call for MyClass: m = MyClass() t = Task().do() I'm debugging from within IntelliJ and I get breakpoints for all of the single-threaded code, but as soon as execution steps into the `callperThread` method, all of my breakpoints are seemingly ignored. Thanks! Spencer |
From: Häyrinen, A. <ari...@jy...> - 2016-07-20 12:01:42
|
>> hmm — are you sure you're not trying to instantiate a interface? I guess that's what I was trying to do... GroupServiceImpl.java: * Service implementation for the Group object. * This class is responsible for all business logic calls for the Group object and is autowired by spring. * This class should never be accessed directly. Maybe I'm trying to use wrong approach here. I'll check from DSpace folks what are correct methods for making this kind of task in Java and then I try again with Jython. Thanks for your time. |
From: Häyrinen, A. <ari...@jy...> - 2016-07-20 08:20:56
|
Thanks for reply! I tried to instantiate it but I got "No visible constructors for class (org.dspace.eperson.service.GroupService) " So it is private? Is setting respectJacaAccessibility to false only option? python.security.respectJavaAccessibility = false Sorry about newbie questions, my java knowledge is very poor. ________________________________ Lähettäjä: Stefan Eletzhofer [ste...@ne...] Lähetetty: 20. heinäkuuta 2016 10:58 Vastaanottaja: Häyrinen, Ari; jyt...@li... Aihe: Re: [Jython-users] What extra argument is needed for java method call? Hi, to me it looks like the GroupService wasn't instantiated. The findByName() is not a class method. The error message hints that way — self is an implicit 1st argument. Mit freundlichen Grüßen // With best regards // Med vennlig hilsen Stefan Eletzhofer nexiles GmbH Birkenweg 12/3 88250 Weingarten tel: +49 (751) 270 856-50 fax: +49 (751) 270 856-51 mobile: +49 (151) 58 5 58 096 e-mail: se...@ne... internet: www.nexiles.com Rechtsform / Legal form: Gesellschaft mit beschränkter Haftung / Limited Liability Company Registergericht / Registration Court: Amtsgericht Ulm Registernummer / Commercial Register No.: HRB 725682 Umsatzsteuernummer / VAT No.: DE 273776037 Geschäftsführer / Managing Directors: Stephan Eletzhofer, Günter Häußner, Michael Schilling, Jörg Szillat Der Inhalt dieser E-Mail und ihrer Anhänge ist vertraulich. Die E-Mail ist ausschließlich für den Adressaten bestimmt. Jeglicher Zugriff darauf durch andere Personen als den Adressaten ist untersagt. Sollten Sie nicht der für die E-Mail bestimmte Adressat sein, ist Ihnen jede Vervielfältigung, Weitergabe oder Veröffentlichung wie auch das Ergreifen oder Unterlassen von Maßnahmen im Vertrauen auf erlangte Information untersagt. This email and any attachment is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorized.If you are not the intended recipient, any copying, distribution, disclosure or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. Von: "Häyrinen, Ari" <ari...@jy...<mailto:ari...@jy...>> Datum: Mittwoch, 20. Juli 2016 um 09:20 An: "jyt...@li...<mailto:jyt...@li...>" <jyt...@li...<mailto:jyt...@li...>> Betreff: [Jython-users] What extra argument is needed for java method call? Hi, there is a Java class called "GroupServiceImpl": public class GroupServiceImpl extends DSpaceObjectServiceImpl<Group> implements GroupService This class has mehod called "findByName": @Override public Group findByName(Context context, String name) throws SQLException { So there are 2 arguments for that method. I try to use this method like this (this is DSpace curator task): class ConvertOldEmbargo(ScriptedTask): def init(self, curator, taskName): self.c = curator def performDso(self, dso): anonymous = GroupService.findByName(self.c.curationContext(), "Anonymous"); Jython complains: TypeError: findByName(): expected 3 args; got 2 What is the third argument and how should I deliver it? Did I misunderstood something? Any help much appreciated. |
From: Adam B. <ada...@gm...> - 2016-07-20 08:12:18
|
Hi Ari It looks like it is a normal object-level method, but you are invoking it statically. You could just get hold of a GroupService object, instead of the class, and call findByName() on that the normal way. You are actually allows to invoke statically in Python, but the method still needs an object to act on, so you have to pass that as the first parameter. It is then received as the parameter self. class A: def a(self): print "a" aobj = A() A.a(aobj) a.a() # same as previous Cheers Adam > 在 20 Jul 2016,3:20 PM,Häyrinen, Ari <ari...@jy...> 写道: > > > Hi, > there is a Java class called "GroupServiceImpl": > > public class GroupServiceImpl extends DSpaceObjectServiceImpl<Group> implements GroupService > > This class has mehod called "findByName": > > @Override > public Group findByName(Context context, String name) throws SQLException { > > > So there are 2 arguments for that method. > > I try to use this method like this (this is DSpace curator task): > > class ConvertOldEmbargo(ScriptedTask): > def init(self, curator, taskName): > self.c = curator > > def performDso(self, dso): > anonymous = GroupService.findByName(self.c.curationContext(), "Anonymous"); > > Jython complains: > TypeError: findByName(): expected 3 args; got 2 > > What is the third argument and how should I deliver it? Did I misunderstood something? > > Any help much appreciated. > > > ------------------------------------------------------------------------------ > What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic > patterns at an interface-level. Reveals which users, apps, and protocols are > consuming the most bandwidth. Provides multi-vendor support for NetFlow, > J-Flow, sFlow and other flows. Make informed decisions using capacity planning > reports.http://sdm.link/zohodev2dev > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users |
From: Häyrinen, A. <ari...@jy...> - 2016-07-20 07:21:07
|
Hi, there is a Java class called "GroupServiceImpl": public class GroupServiceImpl extends DSpaceObjectServiceImpl<Group> implements GroupService This class has mehod called "findByName": @Override public Group findByName(Context context, String name) throws SQLException { So there are 2 arguments for that method. I try to use this method like this (this is DSpace curator task): class ConvertOldEmbargo(ScriptedTask): def init(self, curator, taskName): self.c = curator def performDso(self, dso): anonymous = GroupService.findByName(self.c.curationContext(), "Anonymous"); Jython complains: TypeError: findByName(): expected 3 args; got 2 What is the third argument and how should I deliver it? Did I misunderstood something? Any help much appreciated. |
From: Adam B. <ada...@gm...> - 2016-07-19 22:44:06
|
Hi Vincent First things to check (and share) would be 1/ PYTHONPATH and CLASSPATH 2/ Is it failing on the first invocation of jython or a specific bit of Python code? It looks like it is failing on an import. It would be good to clarify if simple scripts without imports work, just for troubleshooting. Adam > On 20 Jul 2016, at 12:14 AM, Vincent Privat <vp...@au...> wrote: > > Hi, > We’re using Jython 2.7.0 in a Maven/J2EE application and face the following error: > > java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError: Could not initialize class org.python.antlr.ast.Name > at org.python.core.Py.JavaError(Py.java:546) > at org.python.core.ParserFacade.fixParseError(ParserFacade.java:107) > at org.python.core.ParserFacade.parse(ParserFacade.java:190) > at org.python.core.imp.compileSource(imp.java:366) > at org.python.core.imp.compileSource(imp.java:355) > at org.python.core.util.importer.getModuleCode(importer.java:211) > at org.python.core.util.importer.importer_load_module(importer.java:95) > at org.python.modules.zipimport.zipimporter.zipimporter_load_module(zipimporter.java:163) > at org.python.modules.zipimport.zipimporter$zipimporter_load_module_exposer.__call__(Unknown Source) > at org.python.core.PyBuiltinMethodNarrow.__call__(PyBuiltinMethodNarrow.java:46) > at org.python.core.imp.loadFromLoader(imp.java:587) > at org.python.core.imp.find_module(imp.java:537) > at org.python.core.imp.import_next(imp.java:840) > at org.python.core.imp.import_first(imp.java:861) > at org.python.core.imp.load(imp.java:716) > at org.python.core.Py.importSiteIfSelected(Py.java:1558) > at org.python.util.PythonInterpreter.<init>(PythonInterpreter.java:116) > at org.python.util.PythonInterpreter.<init>(PythonInterpreter.java:94) > at com.mycompany.myapplication > Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.python.antlr.ast.Name > at org.python.antlr.GrammarActions.makeDottedName(GrammarActions.java:91) > at org.python.antlr.PythonParser.dotted_name(PythonParser.java:5682) > at org.python.antlr.PythonParser.dotted_as_name(PythonParser.java:5447) > at org.python.antlr.PythonParser.dotted_as_names(PythonParser.java:5539) > at org.python.antlr.PythonParser.import_name(PythonParser.java:4860) > at org.python.antlr.PythonParser.import_stmt(PythonParser.java:4782) > at org.python.antlr.PythonParser.small_stmt(PythonParser.java:2731) > at org.python.antlr.PythonParser.simple_stmt(PythonParser.java:2524) > at org.python.antlr.PythonParser.stmt(PythonParser.java:2438) > at org.python.antlr.PythonParser.file_input(PythonParser.java:618) > at org.python.antlr.BaseParser.parseModule(BaseParser.java:78) > at org.python.core.CompileMode$3.dispatch(CompileMode.java:22) > at org.python.core.ParserFacade.parse(ParserFacade.java:158) > at org.python.core.ParserFacade.parse(ParserFacade.java:188) > ... 54 more > I was unable to find this stacktrace in the bug database, is it a known bug, or maybe a configuration problem? > > Thanks, > Vincent > ------------------------------------------------------------------------------ > What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic > patterns at an interface-level. Reveals which users, apps, and protocols are > consuming the most bandwidth. Provides multi-vendor support for NetFlow, > J-Flow, sFlow and other flows. Make informed decisions using capacity planning > reports.http://sdm.link/zohodev2dev > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users |
From: Vincent P. <vp...@au...> - 2016-07-19 16:27:09
|
Hi, We're using Jython 2.7.0 in a Maven/J2EE application and face the following error: java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError: Could not initialize class org.python.antlr.ast.Name at org.python.core.Py.JavaError(Py.java:546) at org.python.core.ParserFacade.fixParseError(ParserFacade.java:107) at org.python.core.ParserFacade.parse(ParserFacade.java:190) at org.python.core.imp.compileSource(imp.java:366) at org.python.core.imp.compileSource(imp.java:355) at org.python.core.util.importer.getModuleCode(importer.java:211) at org.python.core.util.importer.importer_load_module(importer.java:95) at org.python.modules.zipimport.zipimporter.zipimporter_load_module(zipimporter .java:163) at org.python.modules.zipimport.zipimporter$zipimporter_load_module_exposer.__c all__(Unknown Source) at org.python.core.PyBuiltinMethodNarrow.__call__(PyBuiltinMethodNarrow.java:46 ) at org.python.core.imp.loadFromLoader(imp.java:587) at org.python.core.imp.find_module(imp.java:537) at org.python.core.imp.import_next(imp.java:840) at org.python.core.imp.import_first(imp.java:861) at org.python.core.imp.load(imp.java:716) at org.python.core.Py.importSiteIfSelected(Py.java:1558) at org.python.util.PythonInterpreter.<init>(PythonInterpreter.java:116) at org.python.util.PythonInterpreter.<init>(PythonInterpreter.java:94) at com.mycompany.myapplication Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.python.antlr.ast.Name at org.python.antlr.GrammarActions.makeDottedName(GrammarActions.java:91) at org.python.antlr.PythonParser.dotted_name(PythonParser.java:5682) at org.python.antlr.PythonParser.dotted_as_name(PythonParser.java:5447) at org.python.antlr.PythonParser.dotted_as_names(PythonParser.java:5539) at org.python.antlr.PythonParser.import_name(PythonParser.java:4860) at org.python.antlr.PythonParser.import_stmt(PythonParser.java:4782) at org.python.antlr.PythonParser.small_stmt(PythonParser.java:2731) at org.python.antlr.PythonParser.simple_stmt(PythonParser.java:2524) at org.python.antlr.PythonParser.stmt(PythonParser.java:2438) at org.python.antlr.PythonParser.file_input(PythonParser.java:618) at org.python.antlr.BaseParser.parseModule(BaseParser.java:78) at org.python.core.CompileMode$3.dispatch(CompileMode.java:22) at org.python.core.ParserFacade.parse(ParserFacade.java:158) at org.python.core.ParserFacade.parse(ParserFacade.java:188) ... 54 more I was unable to find this stacktrace in the bug database, is it a known bug, or maybe a configuration problem? Thanks, Vincent |
From: Michael C. <chi...@mi...> - 2016-07-07 23:28:07
|
On 7/7/2016 6:08 PM, Stefan Richthofer wrote: > This looks like you placed a jar-file inside a jar-file. > I never tried this, but I doubt that Jython (actually Java?) can handle such > nesting of jars (maybe this feature was added and I am overlooking it, sorry in > that case). It's possible; spring-boot does it [1]. I guess with the ability to write custom classloaders, the sky's the limit :) According to > http://www.jython.org/jythonbook/en/1.0/SimpleWebApps.html?highlight=explode#distributing-via-standalone-jar > (which is somewhat dated though) you should "explode" jython-standalone, add > your code-files and then jar it again. I suppose you would have to do this with > your other dependencies too or distribute them as separate files. > (Maybe you better try this with a toy-example first, before re-packing all the > jars). That's sometimes referred to as a "shaded" jar. [1] mentions that approach too. > Looking at this, the need for some kind of deployment-tool that would automate > such a process comes to my mind. You should maybe check, whether such a thing > already exists (maybe for Java-apps in general). I know Maven has a plugin for it [2]. Other build tools might too. I don't know if this is helpful for Ranga's actual problem, but from the quoted email, I thought it would be of interest. Andy 1. http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#executable-jar 2. http://maven.apache.org/plugins/maven-shade-plugin/ |
From: Stefan R. <Ste...@gm...> - 2016-07-07 22:08:28
|
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div style="font-family: Verdana;font-size: 12.0px;"> <div> <div>This looks like you placed a jar-file inside a jar-file.</div> <div>I never tried this, but I doubt that Jython (actually Java?) can handle such nesting of jars (maybe this feature was added and I am overlooking it, sorry in that case). According to <a href="http://www.jython.org/jythonbook/en/1.0/SimpleWebApps.html?highlight=explode#distributing-via-standalone-jar" target="_blank">http://www.jython.org/jythonbook/en/1.0/SimpleWebApps.html?highlight=explode#distributing-via-standalone-jar</a> (which is somewhat dated though) you should "explode" jython-standalone, add your code-files and then jar it again. I suppose you would have to do this with your other dependencies too or distribute them as separate files.</div> <div>(Maybe you better try this with a toy-example first, before re-packing all the jars).</div> <div>Looking at this, the need for some kind of deployment-tool that would automate such a process comes to my mind. You should maybe check, whether such a thing already exists (maybe for Java-apps in general).</div> <div> </div> <div>Best</div> <div> </div> <div>Stefan</div> <div> </div> <div> <div style="margin: 10.0px 5.0px 5.0px 10.0px;padding: 10.0px 0 10.0px 10.0px;border-left: 2.0px solid rgb(195,217,229);"> <div style="margin: 0 0 10.0px 0;"><b>Gesendet:</b> Dienstag, 05. Juli 2016 um 16:21 Uhr<br/> <b>Von:</b> "Ranga Babu Mandada" <Ran...@ip...><br/> <b>An:</b> "Stefan Richthofer" <Ste...@gm...><br/> <b>Cc:</b> "jyt...@li..." <jyt...@li...><br/> <b>Betreff:</b> Re: [Jython-users] ImportError: No module named re</div> <div> <div style="font-size: 12.0pt;color: rgb(0,0,0);background-color: rgb(255,255,255);font-family: Calibri , Arial , Helvetica , sans-serif;"> <p>Hello Stefan,</p> <p> </p> <p>I am packaging my application as a runnable jar ex: application.jar.</p> <p> </p> <p>It's contents are like below:</p> <p> </p> <p>when I run my application via IDE(Intellij IDEA) it's working properly.</p> <p>sys.path : </p> <p><span style="color: rgb(0,111,201);">['/home/rmandada/.m2/repository/org/python/jython-standalone/2.5.2/Lib', '/home/rmandada/.m2/repository/org/python/jython-standalone/2.5.2/jython-standalone-2.5.2.jar/Lib', '__classpath__', '__pyclasspath__/']</span></p> <p> </p> <p>But when I run the application from command line using <span style="color: rgb(0,111,201);"> java -jar application.jar</span> I am getting the above error.</p> <p>now sys.path is :</p> <p> </p> <p><span style="color: rgb(0,111,201);">['/home/rmandada/amelia-web.jar!/lib/Lib', '__classpath__', '__pyclasspath__/']​</span></p> <p> </p> <p>I tried to add the path like below code.</p> <p> </p> <div><span style="color: rgb(0,111,201);">PySystemState systemState = new PySystemState();</span></div> <div><span style="color: rgb(0,111,201);">systemState.path.append(Py.newString("lib/jython-standalone-2.5.2.jar/Lib"));</span></div> <div><span style="color: rgb(0,111,201);">Py.setSystemState(systemState);</span></div> <div><span style="color: rgb(0,111,201);">return new ScriptEngineManager().getEngineByName("python");</span></div> <div> </div> <div><span style="color: rgb(0,111,201);"><span style="color: rgb(0,0,0);">​But it's not working . Please tell me how to add the path of jython-standalone-2.5.2.jar​ which lies in lib folder of application.jar.</span></span></div> <p> </p> <p> </p> <p> </p> <div id="Signature"> <div style="font-family: Calibri , Arial , Helvetica , sans-serif;margin: 0;">Regards,<br/> Ranga Babu<br/> </div> </div> <div style="color: rgb(33,33,33);"> <hr style="display: inline-block;width: 98.0%;"/> <div id="divRplyFwdMsg"><font color="#000000" face="Calibri, sans-serif" style="font-size: 11.0pt;"><b>From:</b> Stefan Richthofer <Ste...@gm...><br/> <b>Sent:</b> Friday, June 24, 2016 4:58 PM<br/> <b>To:</b> Ranga Babu Mandada<br/> <b>Cc:</b> jyt...@li...<br/> <b>Subject:</b> Re: [Jython-users] ImportError: No module named re</font> <div> </div> </div> <div> <div style="font-family: Verdana;font-size: 12.0px;"> <div> <div>Hello Ranga,</div> <div> </div> <div>this looks like in your command-line Jython-launch cannot find its lib-folder/doesn't have Jython-path configured properly.</div> <div>You should first identify the location of Jython's lib-folder (the folder containing the .py-files making up the major</div> <div>part of the standard lib). Then</div> <div>- you can check via import sys; print sys.path whether that folder is on the path.</div> <div>- you can verify if the problem is cured by manually adding that path via sys.path.append</div> <div>- you can fix you Jython-path configuration by providing the environment variable JYTHONPATH to the jvm (see jython --help)</div> <div>- I guess things get easier or issue might be self-soved if you call Jython via its launcher rather than manually via java-command.</div> <div>- finally you can consider how to solve this for distribution, e.g. by distributing jython-standalone</div> <div>(which contains the lib folder) or by providing an installer or launcher that makes sure the path is configured correctly for the user</div> <div> </div> <div>Hope this somewhat helps.</div> <div>Best</div> <div> </div> <div>Stefan</div> <div> </div> <div> </div> <div> <div style="margin: 10.0px 5.0px 5.0px 10.0px;padding: 10.0px 0 10.0px 10.0px;border-left: 2.0px solid rgb(195,217,229);"> <div style="margin: 0 0 10.0px 0;"><b>Gesendet:</b> Freitag, 24. Juni 2016 um 12:17 Uhr<br/> <b>Von:</b> "Ranga Babu Mandada" <Ran...@ip...><br/> <b>An:</b> "jyt...@li..." <jyt...@li...><br/> <b>Betreff:</b> [Jython-users] ImportError: No module named re</div> <div> <div style="font-size: 12.0pt;color: rgb(0,0,0);background-color: rgb(255,255,255);font-family: Calibri , Arial , Helvetica , sans-serif;"> <p> </p> <div style="font-size: 12.0pt;color: rgb(0,0,0);background-color: rgb(255,255,255);font-family: Calibri , Arial , Helvetica , sans-serif;"><span style="font-size: 12.0pt;">Hello, </span> <div> <p> </p> <p>I am using Jython in java application to run python scripts. I am using <span style="font-size: 12.0pt;">j</span><span style="font-size: 12.0pt;">ython-standalone-2.5.2 as a dependency in pom.xml in maven project.</span></p> <p><span style="font-size: 12.0pt;">when I run the application in IDE the script is running without problems.</span></p> <p>But when I run the application from command line using<span style="color: rgb(255,0,0);"> java -jar application.jar <span style="color: rgb(0,0,0);">I get the following error</span></span></p> <p><span style="color: rgb(255,0,0);"><span style="color: rgb(0,0,0);">ImportError: No module named re​.</span></span></p> <p> </p> <p><span style="color: rgb(255,0,0);"><span style="color: rgb(0,0,0);">Please help me in fixing the issue.</span></span></p> <p> </p> <div id="Signature"> <div style="font-family: Calibri , Arial , Helvetica , sans-serif;margin: 0;">Regards,<br/> Ranga Babu<br/> </div> </div> </div> </div> ------------------------------------------------------------------------------ Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San Francisco, CA to explore cutting-edge tech and listen to tech luminaries present their vision of the future. This family event has something for everyone, including kids. Get more information and register today. <a href="http://sdm.link/attshape_______________________________________________" target="_blank"> http://sdm.link/attshape_______________________________________________</a> Jython-users mailing list Jyt...@li... <a href="https://lists.sourceforge.net/lists/listinfo/jython-users" target="_blank"> https://lists.sourceforge.net/lists/listinfo/jython-users</a></div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div></div></body></html> |
From: Fabio Z. <fa...@gm...> - 2016-06-24 16:43:03
|
Release Highlights: ------------------------------- * **Important** PyDev now requires Java 8 and Eclipse 4.5 onwards. * PyDev 4.5.5 is the last release supporting Java 7 and Eclipse 3.8. * See: http://www.pydev.org/update_sites/index.html for the update site of older versions of PyDev. * See: the **PyDev does not appear after install** section on http://www.pydev.org/download.html for help on using a Java 8 vm in Eclipse. * The pytest integration was redone and should now work properly with the latest pytest. * Properly showing output of tests in PyUnit view. * Improved dealing with items filtered through Ctrl+F9. * Better support for xdist (no longer reporting that the session finished when only a slave finished). * Reporting skipped items as "skip" and not "ok". * Properly showing running tests on PyUnit view. * Not using tokenize.open() in Python 3.2 for the execfile custom implementation. * Expand and collapse keybindings changed to use the Numpad entries (so that they don't override the add/subtract used for zooming). #PyDev 695. * The hover in PyDev has an implementation which is now more flexible and easier to extend in plugins (patch by Mark A. Leone). What is PyDev? --------------------------- PyDev is an open-source Python IDE on top of Eclipse for Python, Jython and IronPython development. It comes with goodies such as code completion, syntax highlighting, syntax analysis, code analysis, refactor, debug, interactive console, etc. Details on PyDev: http://pydev.org Details on its development: http://pydev.blogspot.com What is LiClipse? --------------------------- LiClipse is a PyDev standalone with goodies such as support for Multiple cursors, theming, TextMate bundles and a number of other languages such as Django Templates, Jinja2, Kivy Language, Mako Templates, Html, Javascript, etc. It's also a commercial counterpart which helps supporting the development of PyDev. Details on LiClipse: http://www.liclipse.com/ Cheers, -- Fabio Zadrozny ------------------------------------------------------ Software Developer LiClipse http://www.liclipse.com PyDev - Python Development Environment for Eclipse http://pydev.org http://pydev.blogspot.com PyVmMonitor - Python Profiler http://www.pyvmmonitor.com/ |
From: Stefan R. <Ste...@gm...> - 2016-06-24 11:28:32
|
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div> <div>Hello Ranga,</div> <div> </div> <div>this looks like in your command-line Jython-launch cannot find its lib-folder/doesn't have Jython-path configured properly.</div> <div>You should first identify the location of Jython's lib-folder (the folder containing the .py-files making up the major</div> <div>part of the standard lib). Then</div> <div>- you can check via import sys; print sys.path whether that folder is on the path.</div> <div>- you can verify if the problem is cured by manually adding that path via sys.path.append</div> <div>- you can fix you Jython-path configuration by providing the environment variable JYTHONPATH to the jvm (see jython --help)</div> <div>- I guess things get easier or issue might be self-soved if you call Jython via its launcher rather than manually via java-command.</div> <div>- finally you can consider how to solve this for distribution, e.g. by distributing jython-standalone</div> <div>(which contains the lib folder) or by providing an installer or launcher that makes sure the path is configured correctly for the user</div> <div> </div> <div>Hope this somewhat helps.</div> <div>Best</div> <div> </div> <div>Stefan</div> <div> </div> <div> </div> <div> <div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"> <div style="margin:0 0 10px 0;"><b>Gesendet:</b> Freitag, 24. Juni 2016 um 12:17 Uhr<br/> <b>Von:</b> "Ranga Babu Mandada" <Ran...@ip...><br/> <b>An:</b> "jyt...@li..." <jyt...@li...><br/> <b>Betreff:</b> [Jython-users] ImportError: No module named re</div> <div name="quoted-content"><!--p { margin-top: 0.0px; margin-bottom: 0.0px; } --> <div style="font-size: 12.0pt;color: rgb(0,0,0);background-color: rgb(255,255,255);font-family: Calibri , Arial , Helvetica , sans-serif;"> <p> </p> <div style="font-size: 12.0pt;color: rgb(0,0,0);background-color: rgb(255,255,255);font-family: Calibri , Arial , Helvetica , sans-serif;"><span style="font-size: 12.0pt;">Hello, </span> <div> <p> </p> <p>I am using Jython in java application to run python scripts. I am using <span style="font-size: 12.0pt;">j</span><span style="font-size: 12.0pt;">ython-standalone-2.5.2 as a dependency in pom.xml in maven project.</span></p> <p><span style="font-size: 12.0pt;">when I run the application in IDE the script is running without problems.</span></p> <p>But when I run the application from command line using<span style="color: rgb(255,0,0);"> java -jar application.jar <span style="color: rgb(0,0,0);">I get the following error</span></span></p> <p><span style="color: rgb(255,0,0);"><span style="color: rgb(0,0,0);">ImportError: No module named re​.</span></span></p> <p> </p> <p><span style="color: rgb(255,0,0);"><span style="color: rgb(0,0,0);">Please help me in fixing the issue.</span></span></p> <p> </p> <div id="Signature"> <div style="font-family: Calibri , Arial , Helvetica , sans-serif;margin: 0;">Regards,<br/> Ranga Babu<br/> </div> </div> </div> </div> ------------------------------------------------------------------------------ Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San Francisco, CA to explore cutting-edge tech and listen to tech luminaries present their vision of the future. This family event has something for everyone, including kids. Get more information and register today. <a href="http://sdm.link/attshape_______________________________________________" target="_blank">http://sdm.link/attshape_______________________________________________</a> Jython-users mailing list Jyt...@li... <a href="https://lists.sourceforge.net/lists/listinfo/jython-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/jython-users</a></div> </div> </div> </div> </div></div></body></html> |
From: Ranga B. M. <Ran...@ip...> - 2016-06-24 10:17:23
|
Hello, I am using Jython in java application to run python scripts. I am using jython-standalone-2.5.2 as a dependency in pom.xml in maven project. when I run the application in IDE the script is running without problems. But when I run the application from command line using java -jar application.jar I get the following error ImportError: No module named re?. Please help me in fixing the issue. Regards, Ranga Babu |
From: Jimmy M. <jim...@gm...> - 2016-05-22 17:09:54
|
After further investigation of my code, I've discovered that the issue appears to be on the interpreter and how it is importing the class entity. Thanks to your advice, I did a direct comparison on what the interpreter imported from the script and the class entity I passed directly as a constructor argument. I.E: made the following edits on the following two files: com.dirty.plugin.simple_jython_plugin.App //line 34 PyObject pyInstance = pyClass.__call__(Py.javas2pys("SampleTestInput", PyInterface.class); PyInterfaceImpl.py def __init__(self, yourInput, classComparison): print PyInterface == classComparison Upon first creation, the evaluation returns true. However, on subsequent creations, this always returns false. The observation I'm seeing is that the interpreter is not pulling the classloader's version and pulling another version entirely. The import statement in the App.class is pulling the version I wish to work with, but the interpreter is pulling the wrong version. I don't understand why this is occurring despite during the interpreter initialization, I'm providing a system state with the specified classloader to use. With that in mind, I resolved a workaround by instead creating the interpreter via PythonInterpreter.threadLocalStateInterpreter() and passing in a map with the class simple name as a key and all the relevant classes as values. This allowed me to now properly do casting in Java. This solution though appears tedious as if the jar has a dependency on libraries it packages with itself, I must ensure that I build their namespace as well. For small subapps, this isn't a lot of work, but this can be a relatively large undertaking if the libraries they import are massive. Is it possible to get the interpreter to respect the classloader's classes provided inside the attached PyStstemState and resolve with this one first before attempting to retrieve from parent classloaders? On Fri, May 20, 2016 at 11:23 AM, John Hubbard <jhu...@no...> wrote: > On 05/19/2016 05:22 PM, Jimmy Mauri wrote: > > For context, see sample project in: > https://github.com/ElCubanoPoderoso/jython-classloader-issue > > I have a use-case where I must support dynamically loaded .jar files as > hot-deployable subapplications. I was having trouble in instances where if > the .jar file was redeployed (say I made a code change and need to update > the environment), Jython starts to break down with class casting. Upon the > first deployment, the application is able to properly load the .jar file, > instantiate the main class which creates the interpreter with the packaged > URLClassLoader into the PySystemState object, interprets the script and > creates the class object with the appropriate java interface cast to it. > > However, the second invocation of said project causes the casting to fail > on subsequent executions, converting the object to a PySingleton and > rejecting the cast. I'm having trouble understanding what I need to do to > resolve my issue. Not being able to properly coerce the object to the > expected java interface is causing forced workarounds to add wrapper > objects to utilize them in Java code. > > Note: This is only observed when trying to cast to interfaces that reside > inside the .jar file and not in the system classloader. > > The sample GitHub project linked was simplified to generate a > proof-of-concept that can be invoked via JUnit to reproduce the error. > > My question is: what is wrong with my current implementation that is > causing this issue? As part of the requirement, I must be able to redeploy > without shutting down the JVM. Any help in this matter would be > appreciated. > > > I'm not sure if this is your issue but remember that in Java two > instantiations of the same class from two different class loaders are for > all intents and purposes not the same class. Given an object of class C > loaded by class loader A and another object of class C loaded by class > loader B you cannot cast from the first to the second. Jython's duck > typing protects you from some of this (e.g. within the Jythin interpreter > you can call all methods on either instantiation of C), however if you try > to pass a C instantiated by CL A to a any class loaded in CL B that will > fail. > > If this sounds like your issue let me know and I can tell you more about > how we deal with this in our application (which uses multiple instances of > a custom classloader to isolate different components). Its been a while > since I've seen it but I seem to recall that the hint that I'd run into > this from within our application was getting a ClassCastException with a > message something like: 'cannot cast a foo.bar to foo.bar'. > > > > -- > -john > > To be or not to be, that is the question > 2b || !2b > (0b10)*(0b1100010) || !(0b10)*(0b1100010) > 0b11000100 || !0b11000100 > 0b11000100 || 0b00111011 > 0b11111111 > 255, that is the answer. > > > > > ------------------------------------------------------------------------------ > Mobile security can be enabling, not merely restricting. Employees who > bring their own devices (BYOD) to work are irked by the imposition of MDM > restrictions. Mobile Device Manager Plus allows you to control only the > apps on BYO-devices by containerizing them, leaving personal data > untouched! > https://ad.doubleclick.net/ddm/clk/304595813;131938128;j > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users > > |
From: John H. <jhu...@no...> - 2016-05-20 15:44:09
|
On 05/19/2016 05:22 PM, Jimmy Mauri wrote: > For context, see sample project in: > https://github.com/ElCubanoPoderoso/jython-classloader-issue > > I have a use-case where I must support dynamically loaded .jar files > as hot-deployable subapplications. I was having trouble in instances > where if the .jar file was redeployed (say I made a code change and > need to update the environment), Jython starts to break down with > class casting. Upon the first deployment, the application is able to > properly load the .jar file, instantiate the main class which creates > the interpreter with the packaged URLClassLoader into the > PySystemState object, interprets the script and creates the class > object with the appropriate java interface cast to it. > > However, the second invocation of said project causes the casting to > fail on subsequent executions, converting the object to a PySingleton > and rejecting the cast. I'm having trouble understanding what I need > to do to resolve my issue. Not being able to properly coerce the > object to the expected java interface is causing forced workarounds to > add wrapper objects to utilize them in Java code. > > Note: This is only observed when trying to cast to interfaces that > reside inside the .jar file and not in the system classloader. > > The sample GitHub project linked was simplified to generate a > proof-of-concept that can be invoked via JUnit to reproduce the error. > > My question is: what is wrong with my current implementation that is > causing this issue? As part of the requirement, I must be able to > redeploy without shutting down the JVM. Any help in this matter would > be appreciated. I'm not sure if this is your issue but remember that in Java two instantiations of the same class from two different class loaders are for all intents and purposes not the same class. Given an object of class C loaded by class loader A and another object of class C loaded by class loader B you cannot cast from the first to the second. Jython's duck typing protects you from some of this (e.g. within the Jythin interpreter you can call all methods on either instantiation of C), however if you try to pass a C instantiated by CL A to a any class loaded in CL B that will fail. If this sounds like your issue let me know and I can tell you more about how we deal with this in our application (which uses multiple instances of a custom classloader to isolate different components). Its been a while since I've seen it but I seem to recall that the hint that I'd run into this from within our application was getting a ClassCastException with a message something like: 'cannot cast a foo.bar to foo.bar'. -- -john To be or not to be, that is the question 2b || !2b (0b10)*(0b1100010) || !(0b10)*(0b1100010) 0b11000100 || !0b11000100 0b11000100 || 0b00111011 0b11111111 255, that is the answer. |
From: Jimmy M. <jim...@gm...> - 2016-05-20 00:22:07
|
For context, see sample project in: https://github.com/ElCubanoPoderoso/jython-classloader-issue I have a use-case where I must support dynamically loaded .jar files as hot-deployable subapplications. I was having trouble in instances where if the .jar file was redeployed (say I made a code change and need to update the environment), Jython starts to break down with class casting. Upon the first deployment, the application is able to properly load the .jar file, instantiate the main class which creates the interpreter with the packaged URLClassLoader into the PySystemState object, interprets the script and creates the class object with the appropriate java interface cast to it. However, the second invocation of said project causes the casting to fail on subsequent executions, converting the object to a PySingleton and rejecting the cast. I'm having trouble understanding what I need to do to resolve my issue. Not being able to properly coerce the object to the expected java interface is causing forced workarounds to add wrapper objects to utilize them in Java code. Note: This is only observed when trying to cast to interfaces that reside inside the .jar file and not in the system classloader. The sample GitHub project linked was simplified to generate a proof-of-concept that can be invoked via JUnit to reproduce the error. My question is: what is wrong with my current implementation that is causing this issue? As part of the requirement, I must be able to redeploy without shutting down the JVM. Any help in this matter would be appreciated. Thanks, ~Jimmy M. |
From: Sébastien B. <seb...@te...> - 2016-05-14 09:16:43
|
Hi all, Replying to my own question, it seems that I was kinda tired yesterday afternoon, because this morning I could easily find some ressources explaining the phenomenon, indeed. So far, I've found a thread from 2008 http://python.6.x6.nabble.com/Problem-importing-Java-packages-td1773276.html and as long as I import classes instead of packages, everythong is fine (using the standalone mode). I have also found some information in the Jython Book[1] which led me to use 'jython' (not the standalone version), with the '-Djava.ext.dirs="/dir/with/my/jar(s)/inside/" I guess this is sufficient for me starting to use jython. I have also seen that it is possible to repack the .jar to provide the necessary classes inside a single jar, for distribution [2], so I keep that under the pillow. In any case, if I forgot an obvious solution with the standalone jython in particular, I'd be glad to here from it; especially because it is simpler to use. And I say something wrong, I'd be grateful that someone points them --I'm just starting to use jython. Best regards, __ Sébastien. [1] http://www.jython.org/jythonbook/en/1.0/ModulesPackages.html#how-jython-finds-the-jars-and-classes-to-scan [2] https://wiki.python.org/jython/LearningJython#id62 On Fri, 13 May 2016 17:59:23 +0200 Sébastien Bigaret <seb...@te...> wrote: > Hi all, > > I have currently a problem with imports I do not understand. > This is what happens (Jython 2.7.0, java 1.8.0u66, on debian 8): > > ----8< ---- 8< ---- > ./jython.sh > Jython 2.7.0 (default:9987c746f838, Apr 29 2015, 02:25:11) > [Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)] on java1.8.0_66 > Type "help", "copyright", "credits" or "license" for more information. > >>> import sys; sys.path > ['', '/path/to/XMCDA-java.jar', '/home/bigaret/lang/python/Lib', '/home/bigaret/lang/python/jython-standalone-2.7.0.jar/Lib', '__classpath__', '__pyclasspath__/'] > >>> import org.xmcda.parsers.xml # this one fails here.... > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > ImportError: No module named xmcda > >>> from org.xmcda.parsers.xml.xmcda_3_0 import XMCDAParser > >>> import org.xmcda.parsers.xml # ...but now it succeeds > >>> org.xmcda.parsers.xml > <java package org.xmcda.parsers.xml 0x2> > >>> sys.path > ['', '/path/to/XMCDA-java.jar', '/home/bigaret/lang/python/Lib', '/home/bigaret/lang/python/jython-standalone-2.7.0.jar/Lib', '__classpath__', '__pyclasspath__/'] > ----8< ---- 8< ---- > > > Note that the first import fails, while the last (which is the same statement) succeeds --and sys.path was untouched, there is just an import between the two identical imports) > > Does someone has any hint why I get such a strange behaviour, or can point me to the right documentation to read? I could unfortunately not find any hint on such peculiarities when searching in jython's doc or on the web in general. > > Thanks in advance, > > __ Sébastien. > > > NB: The jython.sh is a simple bash script: > > ----8< ---- 8< ---- > #! /bin/bash > JAVA=/usr/local/java8/bin/java > JYTHON_STANDALONE_JAR=/home/bigaret/lang/python/jython-standalone-2.7.0.jar > XMCDA_LIB="/path/to/XMCDA-java.jar" > > export JYTHONPATH="${XMCDA_LIB}" > > "${JAVA}" -cp "${JYTHON_STANDALONE_JAR}" org.python.util.jython > ----8< ---- 8< ---- > > (and I have the same behaviour when adding XMCDA_LIB to the java '-cp' argument. > |