如何使用Tomee / Openejb设置预编译的jsps?

时间:2013-01-30 00:26:18

标签: openejb apache-tomee

我遇到了这个错误:

Caused by: org.apache.tomee.catalina.TomEERuntimeException: org.apache.openejb.OpenEJBException: Unable to load servlet class: org.apache.jsp.versionMessage_jsp: org.apache.jsp.versionMessage_jsp
    at org.apache.openejb.config.AnnotationDeployer$ProcessAnnotatedBeans.deploy(AnnotationDeployer.java:1924)
    at org.apache.openejb.config.AnnotationDeployer$ProcessAnnotatedBeans.deploy(AnnotationDeployer.java:1691)
    at org.apache.openejb.config.AnnotationDeployer.deploy(AnnotationDeployer.java:336)
    at org.apache.openejb.config.ConfigurationFactory$Chain.deploy(ConfigurationFactory.java:363)
    at org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:850)
    at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:881)
    ... 17 more
Caused by: java.lang.ClassNotFoundException: org.apache.jsp.versionMessage_jsp
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:264)
    at org.apache.openejb.core.TempClassLoader.loadClass(TempClassLoader.java:94)
    at org.apache.openejb.core.TempClassLoader.loadClass(TempClassLoader.java:67)

这个设置:
1. versionMessage.jsp是通过org.apache.jasper.JspC预编译的 2. web.xml的声明如下:

  <servlet>
        <servlet-name>org.apache.jsp.versionMessage_jsp</servlet-name>
        <servlet-class>org.apache.jsp.versionMessage_jsp</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>org.apache.jsp.versionMessage_jsp</servlet-name>
        <url-pattern>/versionMessage.jsp</url-pattern>
    </servlet-mapping>
  1. 如果我不进行预编译,只需将原始jsp包含在战争中,就没有问题。
  2. 我能错过什么?

1 个答案:

答案 0 :(得分:0)

我在openejb用户论坛here

中得到了答案