Issue1273

classification
Title: ImportError: No module named os
Type: crash Severity: critical
Components: Core Versions: 2.5b1
Milestone:
process
Status: closed Resolution: invalid
Dependencies: Superseder:
Assigned To: Nosy List: admin, adsharma, alserkli, andv, anonymous, bckfnn, bme, cgroves, fwierzbicki, gbgbgb50, greg_ball, herron, ianzsk, jeffsong, jmacy, mfuzzey, mianko, nickm, njcarriero, nobody, pedronis, satayboy, szegedia, thehaas, tommyli, ype, zenzen, zyasoft
Priority: Keywords:

Created on 2009-03-17.09:22:03 by tommyli, last changed 2009-04-04.02:15:52 by zyasoft.

Messages
msg4302 (view) Author: Tommy Li (tommyli) Date: 2009-03-17.09:22:02
PyServlet not working properly with the following envirnoment
Red Hat Enterprise Linux AS release 3 (Taroon Update 3)
Java SDK 6.0 update 12
Jython 2.5b3
Tomcat 6.0.18

but this is work fine in windows.

-----------------------------------------------------------------------
HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented
it from fulfilling this request.

exception

javax.servlet.ServletException: Traceback (most recent call last):
  File "/home/xxxxxx/XXXXXXXX/tomcat/webapps/xxxxxxxx/xxxxxxxx.py", line
1, in <module>
    import os
ImportError: No module named os

	org.python.util.PyServlet.loadServlet(PyServlet.java:199)
	org.python.util.PyServlet.getServlet(PyServlet.java:159)
	org.python.util.PyServlet.service(PyServlet.java:135)

root cause

Traceback (most recent call last):
  File "/home/xxxxxx/XXXXXXXX/tomcat/webapps/xxxxxxxx/xxxxxxxx.py", line
1, in <module>
    import os
ImportError: No module named os

	org.python.core.PyException.fillInStackTrace(PyException.java:65)
	java.lang.Throwable.<init>(Throwable.java:181)
	java.lang.Exception.<init>(Exception.java:29)
	java.lang.RuntimeException.<init>(RuntimeException.java:32)
	org.python.core.PyException.<init>(PyException.java:46)
	org.python.core.PyException.<init>(PyException.java:43)
	org.python.core.PyException.<init>(PyException.java:56)
	org.python.core.Py.ImportError(Py.java:262)
	org.python.core.imp.import_first(imp.java:616)
	org.python.core.imp.import_name(imp.java:700)
	org.python.core.imp.importName(imp.java:750)
	org.python.core.ImportFunction.__call__(__builtin__.java:1265)
	org.python.core.PyObject.__call__(PyObject.java:337)
	org.python.core.__builtin__.__import__(__builtin__.java:1236)
	org.python.core.__builtin__.__import__(__builtin__.java:1219)
	org.python.core.imp.importOne(imp.java:761)
	org.python.pycode._pyx2.f$0(/home/xxxxxx/XXXXXXXX/tomcat/webapps/xxxxxxxx/xxxxxxxx.py:18)
	org.python.pycode._pyx2.call_function(/home/xxxxxx/XXXXXXXX/tomcat/webapps/xxxxxxxx/xxxxxxxx.py)
	org.python.core.PyTableCode.call(PyTableCode.java:166)
	org.python.core.PyCode.call(PyCode.java:14)
	org.python.core.Py.runCode(Py.java:1206)
	org.python.core.__builtin__.execfile_flags(__builtin__.java:538)
	org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:142)
	org.python.util.PyServlet.loadServlet(PyServlet.java:184)
	org.python.util.PyServlet.getServlet(PyServlet.java:159)
	org.python.util.PyServlet.service(PyServlet.java:135)

note The full stack trace of the root cause is available in the Apache
Tomcat/6.0.18 logs.
Apache Tomcat/6.0.18
msg4303 (view) Author: Tommy Li (tommyli) Date: 2009-03-17.09:29:07
HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented
it from fulfilling this request.

exception

javax.servlet.ServletException: Traceback (most recent call last):
  File "/home/xxxxx/xxxxxxx/tomcat/webapps/xxxxxxxx/related.py", line 1,
in <module>
    import urllib
  File
"/home/xxxxx/xxxxxxx/tomcat/webapps/xxxxxxxx/WEB-INF/lib/Lib/urllib.py",
line 26, in <module>
    import socket
  File
"/home/xxxxx/xxxxxxx/tomcat/webapps/xxxxxxxx/WEB-INF/lib/Lib/socket.py",
line 23, in <module>
    import threading
  File
"/home/xxxxx/xxxxxxx/tomcat/webapps/xxxxxxxx/WEB-INF/lib/Lib/threading.py",
line 6, in <module>
    import traceback
  File
"/home/xxxxx/xxxxxxx/tomcat/webapps/xxxxxxxx/WEB-INF/lib/Lib/traceback.py",
line 3, in <module>
    import linecache
  File
"/home/xxxxx/xxxxxxx/tomcat/webapps/xxxxxxxx/WEB-INF/lib/Lib/linecache.py",
line 9, in <module>
    import os
ImportError: No module named os

	org.python.util.PyServlet.loadServlet(PyServlet.java:199)
	org.python.util.PyServlet.getServlet(PyServlet.java:159)
	org.python.util.PyServlet.service(PyServlet.java:135)

root cause

Traceback (most recent call last):
  File "/home/xxxxx/xxxxxxx/tomcat/webapps/xxxxxxxx/related.py", line 1,
in <module>
    import urllib
  File
"/home/xxxxx/xxxxxxx/tomcat/webapps/xxxxxxxx/WEB-INF/lib/Lib/urllib.py",
line 26, in <module>
    import socket
  File
"/home/xxxxx/xxxxxxx/tomcat/webapps/xxxxxxxx/WEB-INF/lib/Lib/socket.py",
line 23, in <module>
    import threading
  File
"/home/xxxxx/xxxxxxx/tomcat/webapps/xxxxxxxx/WEB-INF/lib/Lib/threading.py",
line 6, in <module>
    import traceback
  File
"/home/xxxxx/xxxxxxx/tomcat/webapps/xxxxxxxx/WEB-INF/lib/Lib/traceback.py",
line 3, in <module>
    import linecache
  File
"/home/xxxxx/xxxxxxx/tomcat/webapps/xxxxxxxx/WEB-INF/lib/Lib/linecache.py",
line 9, in <module>
    import os
ImportError: No module named os

	org.python.core.PyException.fillInStackTrace(PyException.java:65)
	java.lang.Throwable.<init>(Throwable.java:181)
	java.lang.Exception.<init>(Exception.java:29)
	java.lang.RuntimeException.<init>(RuntimeException.java:32)
	org.python.core.PyException.<init>(PyException.java:46)
	org.python.core.PyException.<init>(PyException.java:43)
	org.python.core.PyException.<init>(PyException.java:56)
	org.python.core.Py.ImportError(Py.java:262)
	org.python.core.imp.import_first(imp.java:616)
	org.python.core.imp.import_name(imp.java:700)
	org.python.core.imp.importName(imp.java:750)
	org.python.core.ImportFunction.__call__(__builtin__.java:1265)
	org.python.core.PyObject.__call__(PyObject.java:337)
	org.python.core.__builtin__.__import__(__builtin__.java:1236)
	org.python.core.__builtin__.__import__(__builtin__.java:1219)
	org.python.core.imp.importOne(imp.java:761)
	linecache$py.f$0(/home/xxxxx/xxxxxxx/tomcat/webapps/xxxxxxxx/WEB-INF/lib/Lib/linecache.py:59)
	linecache$py.call_function(/home/xxxxx/xxxxxxx/tomcat/webapps/xxxxxxxx/WEB-INF/lib/Lib/linecache.py)
	org.python.core.PyTableCode.call(PyTableCode.java:166)
	org.python.core.PyCode.call(PyCode.java:14)
	org.python.core.imp.createFromCode(imp.java:296)
	org.python.core.imp.createFromPyClass(imp.java:124)
	org.python.core.imp.loadFromSource(imp.java:468)
	org.python.core.imp.find_module(imp.java:381)
	org.python.core.imp.import_next(imp.java:579)
	org.python.core.imp.import_name(imp.java:690)
	org.python.core.imp.importName(imp.java:750)
	org.python.core.ImportFunction.__call__(__builtin__.java:1265)
	org.python.core.PyObject.__call__(PyObject.java:337)
	org.python.core.__builtin__.__import__(__builtin__.java:1236)
	org.python.core.__builtin__.__import__(__builtin__.java:1219)
	org.python.core.imp.importOne(imp.java:761)
	traceback$py.f$0(/home/xxxxx/xxxxxxx/tomcat/webapps/xxxxxxxx/WEB-INF/lib/Lib/traceback.py:279)
	traceback$py.call_function(/home/xxxxx/xxxxxxx/tomcat/webapps/xxxxxxxx/WEB-INF/lib/Lib/traceback.py)
	org.python.core.PyTableCode.call(PyTableCode.java:166)
	org.python.core.PyCode.call(PyCode.java:14)
	org.python.core.imp.createFromCode(imp.java:296)
	org.python.core.imp.createFromPyClass(imp.java:124)
	org.python.core.imp.loadFromSource(imp.java:468)
	org.python.core.imp.find_module(imp.java:381)
	org.python.core.imp.import_next(imp.java:579)
	org.python.core.imp.import_name(imp.java:690)
	org.python.core.imp.importName(imp.java:750)
	org.python.core.ImportFunction.__call__(__builtin__.java:1265)
	org.python.core.PyObject.__call__(PyObject.java:337)
	org.python.core.__builtin__.__import__(__builtin__.java:1236)
	org.python.core.__builtin__.__import__(__builtin__.java:1219)
	org.python.core.imp.importOne(imp.java:761)
	threading$py.f$0(/home/xxxxx/xxxxxxx/tomcat/webapps/xxxxxxxx/WEB-INF/lib/Lib/threading.py:698)
	threading$py.call_function(/home/xxxxx/xxxxxxx/tomcat/webapps/xxxxxxxx/WEB-INF/lib/Lib/threading.py)
	org.python.core.PyTableCode.call(PyTableCode.java:166)
	org.python.core.PyCode.call(PyCode.java:14)
	org.python.core.imp.createFromCode(imp.java:296)
	org.python.core.imp.createFromPyClass(imp.java:124)
	org.python.core.imp.loadFromSource(imp.java:468)
	org.python.core.imp.find_module(imp.java:381)
	org.python.core.imp.import_next(imp.java:579)
	org.python.core.imp.import_name(imp.java:690)
	org.python.core.imp.importName(imp.java:750)
	org.python.core.ImportFunction.__call__(__builtin__.java:1265)
	org.python.core.PyObject.__call__(PyObject.java:337)
	org.python.core.__builtin__.__import__(__builtin__.java:1236)
	org.python.core.__builtin__.__import__(__builtin__.java:1219)
	org.python.core.imp.importOne(imp.java:761)
	socket$py.f$0(/home/xxxxx/xxxxxxx/tomcat/webapps/xxxxxxxx/WEB-INF/lib/Lib/socket.py:902)
	socket$py.call_function(/home/xxxxx/xxxxxxx/tomcat/webapps/xxxxxxxx/WEB-INF/lib/Lib/socket.py)
	org.python.core.PyTableCode.call(PyTableCode.java:166)
	org.python.core.PyCode.call(PyCode.java:14)
	org.python.core.imp.createFromCode(imp.java:296)
	org.python.core.imp.createFromPyClass(imp.java:124)
	org.python.core.imp.loadFromSource(imp.java:468)
	org.python.core.imp.find_module(imp.java:381)
	org.python.core.imp.import_next(imp.java:579)
	org.python.core.imp.import_name(imp.java:690)
	org.python.core.imp.importName(imp.java:750)
	org.python.core.ImportFunction.__call__(__builtin__.java:1265)
	org.python.core.PyObject.__call__(PyObject.java:337)
	org.python.core.__builtin__.__import__(__builtin__.java:1236)
	org.python.core.__builtin__.__import__(__builtin__.java:1219)
	org.python.core.imp.importOne(imp.java:761)
	urllib$py.f$0(/home/xxxxx/xxxxxxx/tomcat/webapps/xxxxxxxx/WEB-INF/lib/Lib/urllib.py:1465)
	urllib$py.call_function(/home/xxxxx/xxxxxxx/tomcat/webapps/xxxxxxxx/WEB-INF/lib/Lib/urllib.py)
	org.python.core.PyTableCode.call(PyTableCode.java:166)
	org.python.core.PyCode.call(PyCode.java:14)
	org.python.core.imp.createFromCode(imp.java:296)
	org.python.core.imp.createFromPyClass(imp.java:124)
	org.python.core.imp.loadFromSource(imp.java:468)
	org.python.core.imp.find_module(imp.java:381)
	org.python.core.imp.import_next(imp.java:579)
	org.python.core.imp.import_name(imp.java:690)
	org.python.core.imp.importName(imp.java:750)
	org.python.core.ImportFunction.__call__(__builtin__.java:1265)
	org.python.core.PyObject.__call__(PyObject.java:337)
	org.python.core.__builtin__.__import__(__builtin__.java:1236)
	org.python.core.__builtin__.__import__(__builtin__.java:1219)
	org.python.core.imp.importOne(imp.java:761)
	org.python.pycode._pyx3.f$0(/home/xxxxx/xxxxxxx/tomcat/webapps/xxxxxxxx/related.py:17)
	org.python.pycode._pyx3.call_function(/home/xxxxx/xxxxxxx/tomcat/webapps/xxxxxxxx/related.py)
	org.python.core.PyTableCode.call(PyTableCode.java:166)
	org.python.core.PyCode.call(PyCode.java:14)
	org.python.core.Py.runCode(Py.java:1206)
	org.python.core.__builtin__.execfile_flags(__builtin__.java:538)
	org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:142)
	org.python.util.PyServlet.loadServlet(PyServlet.java:184)
	org.python.util.PyServlet.getServlet(PyServlet.java:159)
	org.python.util.PyServlet.service(PyServlet.java:135)

note The full stack trace of the root cause is available in the Apache
Tomcat/6.0.18 logs.
Apache Tomcat/6.0.18
msg4304 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2009-03-17.14:54:56
How did the nosy list get so long - was it auto-populated?  With names
like "nobody" I wonder if there was a problem with the recent tracker
upgrade...
msg4425 (view) Author: Jim Baker (zyasoft) Date: 2009-04-04.02:15:52
This looks like a path issue. Consider using a standalone jar or setting
python.path/JYTHONPATH, etc.
History
Date User Action Args
2009-04-04 02:15:52zyasoftsetstatus: open -> closed
resolution: invalid
messages: + msg4425
nosy: + zyasoft
2009-03-17 14:54:57fwierzbickisetnosy: + fwierzbicki
messages: + msg4304
2009-03-17 09:29:07tommylisetmessages: + msg4303
2009-03-17 09:22:03tommylicreate