0

I'm looking to run a jython/modjy (modjy is kinda analogous to mod_wsgi except it bridges java web servers and applications) on my IBM WAS 8.5 Liberty Profile.

However when I convert the jython-modjy sample app into a .WAR file and put it in the dropins directory, the WebSphere server really struggles to find the path of the demo_app.py (WSGI handler). Here's a snippet of my web.xml file:

<init-param>
  <param-name>python.home</param-name>
  <param-value>C:/jython2.5.3</param-value>
</init-param>
<init-param>
  <param-name>app_filename</param-name>
  <param-value>demo_app.py</param-value>
</init-param>

The only other app related parameters are app_directory and app_callable_name which default to the current directory and handler respectfully:

I get the following error when I try to run the app:

modjy.modjy_exceptions.ApplicationNotFound: Application filename not found: None/demo_app.py

The only way I've gotten it to work is by specifying an absolute path, which really isn't too portable

Any help would be greatly appreciated

Thanks, David

4

1 回答 1

0

我自己做了一个快速测试,我和 bkail 提出了同样的担忧。此问题很可能是 Liberty 未膨胀已部署的 Web 应用程序行为的结果。因此,所有依赖的应用程序getRealPath()都会失败。

有两种可能的选项/解决方法:

  1. 在开发环境中,您可以将 Eclipse 与 WebSphere Application Server Liberty Profile Tools 一起使用,以将您的动态 Web 模块项目添加到您的 Liberty 服务器实例。这将在 Liberty 和您的工作区中的项目文件之间创建一个链接。Servlet 上下文的getRealPath()方法将在此设置中工作。

  2. 将 Liberty 服务器dropins目录中的 WAR 文件扩展为一个目录,该目录与 WAR 文件类似,包括文件扩展名.war. 同样的方法应该适用于在server.xml.

于 2014-01-17T16:17:44.810 回答