this is using the cvs as of 4/26   running tomcat 4.04b2   jdk 1.4  jython 
download this week

At 11:31 PM 4/24/2002 -0700, I wrote:
>I'm getting a jython error
>=============================
>org.apache.cocoon.ProcessingException: Exception in 
>ScriptGenerator.generate(): com.ibm.bsf.BSFException: exception from 
>JPython: Traceback (innermost last):
>File "<string>", line 3, in ?
>NameError: System
>
>================================
>
>clearly I didn't track your changes correctly. Can you follow with
>a description of the changes you made to get it working, step by step?
>
>thanks
>bob phillips
>
>
>At 04:10 PM 4/22/2002 -0400, you wrote:
>
>>Here is how I finally got this working.
>>
>>1. In the generate tag, create a parameter to hold the python.path (not
>>PYTHONPATH, thats for CPython)
>>
>>    <map:match pattern="jython/*">
>>     <map:generate type="script" src="jython/{1}" >
>>       <map:parameter name="python.path" value="c:/java/jython-2.1/Lib"
>>/>
>>     </map:generate>
>>     <map:transform src="stylesheets/test/simple-page2html.xsl"/>
>>     <map:serialize type="html"/>
>>    </map:match>
>>
>>2. In the actual python script, before trying to import any modules
>>
>>params   = bsf.lookupBean( "parameters" )
>># params is a org.apache.avalon.framework.parameters.Parameters
>>props = System.getProperties()
>>import sys  # thats the Jython standard library, includes sys.path
>>pth = params.getParameter("python.path")
>>sys.path.insert(0, pth )
>># now it should search there first for modules
>>===
>>
>>[EMAIL PROTECTED]
>>Author of Soap Programming with Java - Sybex; ISBN: 0782129285
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>Please check that your question has not already been answered in the
>>FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>>
>>To unsubscribe, e-mail: <[EMAIL PROTECTED]>
>>For additional commands, e-mail: <[EMAIL PROTECTED]>
>
>
>
>---------------------------------------------------------------------
>Please check that your question has not already been answered in the
>FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
>To unsubscribe, e-mail: <[EMAIL PROTECTED]>
>For additional commands, e-mail: <[EMAIL PROTECTED]>



---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to