小编use*_*488的帖子

文件扩展名为".jsf"但为".xhtml"时的JSF ServletException

一旦我尝试通过"http://localhost:8080/beginner/faces/index.jsf"打开我的index.xhtml,我将得到以下异常:

javax.servlet.ServletException
javax.faces.webapp.FacesServlet.service(FacesServlet.java:606)
    org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62)

java.lang.NullPointerException
com.sun.faces.renderkit.RenderKitImpl.createResponseWriter(RenderKitImpl.java:228)
com.sun.faces.application.view.JspViewHandlingStrategy.renderView(JspViewHandlingStrategy.java:214)
com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:125)
    javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288)
    com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)
    com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
    javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
    org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62)


note The full stack trace of the root cause is available in the JBoss Web/7.0.13.Final logs.
Run Code Online (Sandbox Code Playgroud)

在eclipse中,我通过"新Maven项目向导"创建了一个Maven项目并选择了Group Id:"org.jboss.spec.archetypes",Artifact Id"jboss-javaee6-webapp-blank-archetype"version:7.13我正在使用JBoss 7.1.1.FINAL并尝试了JDK 6和JDK7

index.xthml看起来像这样:

<?xml version="1.0" encoding= "UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html">
    <h:head>
        <title>First JSF</title>
    </h:head>
        <h:body>
            <h1>Hello there</h1>
        </h:body>
</html>
Run Code Online (Sandbox Code Playgroud)

我找了几个小时是有原因的,但是找不到任何解决方案,尽管我做了这个研讨会书告诉我要做的每一步.

jsf facelets servletexception

2
推荐指数
1
解决办法
1742
查看次数

标签 统计

facelets ×1

jsf ×1

servletexception ×1