|
From: Brian Z. <bri...@ya...> - 2001-02-23 00:42:30
|
Hi jython developers:
The following jython servlet runs fine on WinNT/2000, but gives me error
message (at the end of this message) when on Mandrake 7.2 Linux. Of
course no big deal, I can just use out.println("ABC") instead. Just
curious why.
import java, javax
class test(javax.servlet.http.HttpServlet):
def doGet(self, request, response):
out = response.getOutputStream()
response.setContentType("text/plain")
print >>out, "ABC"
return
#---
FYI:
$
/usr/java/jdk1.3/jre/bin/java -Dpython.home=/usr/local/jython-2.0 -class
path "context/WEB-INF/lib/jython.jar" org.python.util.jython
Jython 2.1pre-a1 on java1.3.0 (JIT: null)
Type "copyright", "credits" or "license" for more information.
>>> import sys
>>> print >>sys.stdout, "ABC"
ABC
>>>
$ uname -a
Linux hostname 2.2.17-21mdk #1 Thu Oct 5 13:16:08 CEST 2000 i686 unknown
$ java -version
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0)
Java HotSpot(TM) Client VM (build 1.3.0, mixed mode)
/Brian
# -- ERROR MESSAGE ---
TypeError: can't set arbitrary attribute in java instance: softspace
at org.python.core.Py.TypeError(Py.java:120)
at org.python.core.PyJavaInstance.noField(PyJavaInstance.java:65)
at org.python.core.PyInstance.__setattr__(PyInstance.java:318)
at org.python.core.StdoutWrapper.print(StdoutWrapper.java:127)
at org.python.core.StdoutWrapper.println(StdoutWrapper.java:149)
at org.python.core.Py.println(Py.java:1168)
at
org.python.pycode._pyx1.doGet$3(/home/bzhou/devel/jywikiContext/test.py)
at
org.python.pycode._pyx1.call_function(/home/bzhou/devel/jywikiContext/te
st.py)
at org.python.core.PyTableCode.call(PyTableCode.java:155)
at org.python.core.PyTableCode.call(PyTableCode.java:353)
at org.python.core.PyTableCode.call(PyTableCode.java:258)
at org.python.core.PyFunction.__call__(PyFunction.java:110)
at org.python.core.PyMethod.__call__(PyMethod.java:83)
at org.python.core.PyObject.__call__(PyObject.java:250)
at org.python.core.PyObject._jcallexc(PyObject.java:2022)
at org.python.proxies.main$test$1.doGet(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at org.python.proxies.main$test$1.service(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.python.util.PyServlet.service(PyServlet.java:123)
|