简体   繁体   English

javax.servlet.UnavailableException:使用jsp的已部署应用程序的持有人中没有类

[英]javax.servlet.UnavailableException: No class in holder on deployed application with jsp

I'm having some issues in achieving the following: 我在实现以下目标时遇到了一些问题:

I want my backend to return my index.html page on some defined paths, since it is an angular application. 我希望后端在某些定义的路径上返回index.html页面,因为它是一个有角度的应用程序。

Inside my web.xml I've written: 在我的web.xml中,我写了:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
         version="3.1">

  <!--my servlets-->

  <!--HTML5-->
    <servlet>
        <servlet-name>html5Servlet</servlet-name>
        <jsp-file>/index.html</jsp-file>
    </servlet>
    <servlet-mapping>
        <servlet-name>html5Servlet</servlet-name>
        <url-pattern>/</url-pattern>
        <url-pattern>/home</url-pattern>
        <url-pattern>/wp-users</url-pattern>
        <url-pattern>/wp-groups</url-pattern>
    </servlet-mapping>
    <!--HTML5-->

    <security-constraint>
        <web-resource-collection>
            <web-resource-name>all</web-resource-name>
            <url-pattern>/*</url-pattern>
        </web-resource-collection>
        <user-data-constraint>
            <transport-guarantee>CONFIDENTIAL</transport-guarantee>
        </user-data-constraint>
    </security-constraint>

</web-app>

The application works fine in local, however I get the following error on the deployed application while calling my servlets: 该应用程序在本地运行良好,但是在调用我的servlet时,在已部署的应用程序上出现以下错误:

javax.servlet.ServletContext log: unavailable
javax.servlet.UnavailableException: No class in holder html5Servlet@830ae0fb==null,jsp=/index.html,order=-1,inst=false
    at org.eclipse.jetty.servlet.BaseHolder.doStart(BaseHolder.java:88)
    at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:363)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:891)
    at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:349)
    at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1406)
    at com.google.apphosting.runtime.jetty9.AppEngineWebAppContext.startWebapp(AppEngineWebAppContext.java:159)
    at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1368)
    at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:778)
    at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:262)
    at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:522)
    at com.google.apphosting.runtime.jetty9.AppEngineWebAppContext.doStart(AppEngineWebAppContext.java:116)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at com.google.apphosting.runtime.jetty9.AppVersionHandlerMap.createHandler(AppVersionHandlerMap.java:244)
    at com.google.apphosting.runtime.jetty9.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:182)
    at com.google.apphosting.runtime.jetty9.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:109)
    at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.dispatchServletRequest(JavaRuntime.java:693)
    at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.dispatchRequest(JavaRuntime.java:655)
    at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:625)
    at com.google.apphosting.runtime.JavaRuntime$NullSandboxRequestRunnable.run(JavaRuntime.java:819)
    at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:274)
    at java.lang.Thread.run(Thread.java:745)

I don't understand while it's missing the class. 错过课程时,我不明白。 I've also tried with a jsp file instead of the html one, but it doesn't work. 我也尝试过使用jsp文件而不是html文件,但是它不起作用。 Anyone got any clue ? 有人知道吗?

*.html is not a recognized servlet <url-pattern> for JSP. *.html不是JSP公认的servlet <url-pattern>

Switch to index.jsp and the JettyJspServlet should start to recognize it as a JSP file. 切换到index.jspJettyJspServlet应该开始将其识别为JSP文件。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 谷歌应用引擎 .jsp 加载错误 [javax.servlet.UnavailableException] - google app engine .jsp error loading [javax.servlet.UnavailableException] 升级到 WAS 7 后的 javax.servlet.UnavailableException - javax.servlet.UnavailableException after an upgrade to WAS 7 javax.servlet.UnavailableException:SRVE0201E:Servlet [my_ws]:不是Servlet类 - javax.servlet.UnavailableException: SRVE0201E: Servlet [my_ws]: not a servlet class 为什么我有javax.servlet.UnavailableException:我的Filter的CrawlServlet? - Why do i have javax.servlet.UnavailableException: CrawlServlet for my Filter? javax.servlet.UnavailableException:缺少路径/WEB-INF/struts-config.xml的配置资源 - javax.servlet.UnavailableException: Missing configuration resource for path /WEB-INF/struts-config.xml javax.servlet.UnavailableException:EDU / oswego / cs / dl / util / concurrent / ConcurrentHashMap-在Jetty 9.2.2上运行Struts 1.3.5 - javax.servlet.UnavailableException: EDU/oswego/cs/dl/util/concurrent/ConcurrentHashMap - running Struts 1.3.5 on Jetty 9.2.2 控制器spring bean共享属性和引用bean导致javax.servlet.UnavailableException - Controller spring bean share property and reference bean causes javax.servlet.UnavailableException 更新到Spring 2.5.5会导致javax.servlet.UnavailableException:org.springframework.web.struts.DelegatingTilesRequestProcessor - Updating to Spring 2.5.5 causes a javax.servlet.UnavailableException: org.springframework.web.struts.DelegatingTilesRequestProcessor 找不到javax.servlet.jsp.jstl.core.Config类 - javax.servlet.jsp.jstl.core.Config class not found Servlet类com.foobar.jaxrs.application.MyApplication不是javax.servlet.Servlet - Servlet class com.foobar.jaxrs.application.MyApplication is not a javax.servlet.Servlet
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM