Hi All,
I picked this effort up again and wanted to see if anyone else has had
success with a scenario like this. I had tried a while back but Jython
and modjy was still maturing and ran into some platform issues.
First off, here are the components I'm using:
* Windows XP SP3
* Tomcat 6.0.29
* Sun JDK 1.6.0_21
* Jython 2.5.2 rc2
Everything seems to be configured correctly from a modjy standpoint.
When I hit the defined uri localhost:8080/web2py it automatically
redirects me to localhost:8080/welcome/default/index controller. I
believe this is due to the default route setup for web2py. However
since the controller actually exists in localhost:8080/web2py/welcome
I get a 404 naturally.
When I specifically define the welcome controller @ localhost:8080/
web2py/welcome/default/index I get "invalid request". I've looked at
the gluon.main code to see which of the conditions I might be meeting
to trigger the invalid request error and am not able to pin it down.
I'm not sure how to debug this from the servlet container. I've also
tried putting the welcome directory within the WEB-INF structure but
still get the same error.
My tomcat log only gives this riddle:
Jan 4, 2011 10:33:33 AM org.apache.catalina.core.ApplicationContext
log
INFO: debug: Attempting to import application callable
'gluon.main.wsgibase'
Jan 4, 2011 10:33:33 AM org.apache.catalina.core.ApplicationContext
log
INFO: debug: Application is <function wsgibase at 0x3>
Jan 4, 2011 10:33:33 AM org.apache.catalina.core.ApplicationContext
log
INFO: debug: Processing app return type: <type 'list'>
Any direction or ideas on what I might be doing wrong is greatly
appreciated. The pursuit for this on jython is due to wanting to use
web2py as a utility framework in a Java only environment. Getting
python installed in this environment is not an option unfortunately.
My Tomcat directory structure is laid out like so:
<Tomcat_HOME>
|__webapps
|__web2py
|
|__WEB-INF
| |__web.xml
| |___lib
| | |__jython.jar
| |___lib-python(contents of Lib from jython
install and gluon module)
|
|__welcome
| |__(web2py welcome example app)
|
|__application.py
My web2py web.xml / modjy servlet config looks like this:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>modjy demo application</display-name>
<description>
modjy WSGI demo application
</description>
<servlet>
<servlet-name>modjy</servlet-name>
<servlet-class>com.xhaus.modjy.ModjyJServlet</servlet-class>
<init-param>
<param-name>python.home</param-name>
<param-value>E:/jython2.5.2</param-value>
</init-param>
<init-param>
<param-name>app_import_name</param-name>
<param-value>gluon.main.wsgibase</param-value>
</init-param>
<init-param>
<param-name>cache_callables</param-name>
<param-value>1</param-value>
</init-param>
<init-param>
<param-name>reload_on_mod</param-name>
<param-value>1</param-value>
</init-param>
<init-param>
<param-name>load_site_packages</param-name>
<param-value>1</param-value>
</init-param>
<init-param>
<param-name>log_level</param-name>
<param-value>debug</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>modjy</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
TIA,
Andrew