Message12846

Author jeff.allen
Recipients gbach, jeff.allen
Date 2019-12-15.21:38:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1576445907.67.0.808704936007.issue2844@roundup.psfhosted.org>
In-reply-to
Content
With just jython.jar, copied from an installation, it produces the effect reported. If I turn on logging for the jythondemo application (via WEB-INF/classes/logging.properties), the reasons are apparent:


Dec 15, 2019 9:19:54 PM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet [PyServletTest] in web application [/jythondemo] threw load() exception
ImportError: Cannot import site module and its dependencies: No module named site
Determine if the following attributes are correct:
  * sys.path: [D:\web\base\webapps\jythondemo\WEB-INF\lib\Lib, __classpath__, __pyclasspath__/]
    This attribute might be including the wrong directories, such as from CPython
  * sys.prefix: D:\web\base\webapps\jythondemo\WEB-INF\lib
    This attribute is set by the system property python.home, although it can
    be often automatically determined by the location of the Jython jar file

You can use the -S option or python.import.site=false to not import the site module


(I am using the (potentially) multi-instance configuration with CATALINA_BASE=D:\web\base.) It is only necessary to provide the standard library at WEB-INF\lib\Lib and it all seems to work ok. I don't think any of this is different in 2.7.2 from 2.7.1, so I'm puzzled you experience this as a new failure, all other things being equal.

I find I can also get the tutorial example working if I use the jython-standalone JAR (in the WEB-INF/lib of my application). (That JAR includes the the Lib directory.)

I currently lean towards marking this issue invalid. (However, I learned some new things, so that's ok.)
History
Date User Action Args
2019-12-15 21:38:27jeff.allensetmessageid: <1576445907.67.0.808704936007.issue2844@roundup.psfhosted.org>
2019-12-15 21:38:27jeff.allensetrecipients: + jeff.allen, gbach
2019-12-15 21:38:27jeff.allenlinkissue2844 messages
2019-12-15 21:38:27jeff.allencreate