我正在尝试将 django 应用程序部署到 Weblogic,但它找不到 modjy。我查看了生成的war文件中包含的jython.jar,modjy servlet确实在那里。以下是服务器在部署应用程序时遇到的错误。

<Feb 18, 2010 11:18:49 AM EST> <Error> <HTTP> <BEA-101216> <Servlet: "modjy" failed to preload on startup in Web application: "myApp.war".
Traceback (innermost last):
File "<string>", line 1, in ?
ImportError: no module named modjy

    at org.python.core.Py.ImportError(Unknown Source)
    at org.python.core.imp.import_first(Unknown Source)
    at org.python.core.imp.import_name(Unknown Source)
    at org.python.core.imp.importName(Unknown Source)
    at org.python.core.ImportFunction.load(Unknown Source)
    Truncated. see log file for complete stacktrace
>
<Feb 18, 2010 11:18:49 AM EST> <Error> <Deployer> <BEA-149231> <Unable to set the     activation state to true for the application 'myApp'.
weblogic.application.ModuleException: [HTTP:101216]Servlet: "modjy" failed to preload     on startup in Web application: "myApp.war".
Traceback (innermost last):
  File "<string>", line 1, in ?
ImportError: no module named modjy

    at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1399)
    at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:460)
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:83)
    at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
    Truncated. see log file for complete stacktrace

Caused By: Traceback (innermost last):
  File "<string>", line 1, in ?
ImportError: no module named modjy

    at org.python.core.Py.ImportError(Unknown Source)
    at org.python.core.imp.import_first(Unknown Source)
    at org.python.core.imp.import_name(Unknown Source)
    at org.python.core.imp.importName(Unknown Source)
    at org.python.core.ImportFunction.load(Unknown Source)
    Truncated. see log file for complete stacktrace
>

最佳答案

很抱歉这么晚才讨论这个问题:我刚刚在我的引用日志中发现了这个 URL。

这里的问题是 modjy 无法导入位于 jython Lib/modjy 目录中的“modjy.py”模块。

我创建了一个“Modjy 故障排除”页面,并在上面描述了这个问题。

http://opensource.xhaus.com/projects/modjy/wiki/ModjyTroubleShooting

如果这不能解决问题,那么请向 jython-users 列表发送电子邮件。

10-06 02:27