java.lang.IllegalStateException:在呈现响应后非法尝试设置ViewHandler - Weblogic 12c中的Jsf1.2

时间:2014-03-14 21:28:13

标签: richfaces facelets jsf-1.2 weblogic12c

我目前的应用程序在weblogic 11g上正常运行并使用jsf1.2,richfaces 3.3.1,facelets 1.1.14在Weblogic 12c中运行时会出错。

Richfaces,jsf和facelets的依赖关系:

            <dependency>
            <groupId>org.richfaces.framework</groupId>
            <artifactId>richfaces-api</artifactId>
            <version>3.3.1.GA</version>
        </dependency>
        <dependency>
            <groupId>org.richfaces.framework</groupId>
            <artifactId>richfaces-impl</artifactId>
            <version>3.3.1.GA</version>
    </dependency>
    <dependency>
        <groupId>org.richfaces.ui</groupId>
        <artifactId>richfaces-ui</artifactId>
        <version>3.3.1.GA</version>
    </dependency>   
    <dependency>
        <groupId>javax.faces</groupId>
        <artifactId>jsf-api</artifactId>
        <version>1.2_13</version>
    </dependency>
    <dependency>
        <groupId>javax.faces</groupId>
        <artifactId>jsf-impl</artifactId>
        <version>1.2_13</version>
    </dependency>
    <dependency>
        <groupId>com.sun.facelets</groupId>
         <artifactId>jsf-facelets</artifactId>
        <version>1.1.14</version>
    </dependency>

web.xml中的条目:

<?xml version="1.0" encoding="UTF-8"?>
<web-app
  version="2.5"
  xmlns="http://java.sun.com/xml/ns/javaee"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

<context-param>
    <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
    <param-value>.xhtml</param-value>
</context-param>
    <listener>
    <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
<filter>
    <display-name>Ajax4jsf Filter</display-name>
    <filter-name>ajax4jsf</filter-name>
    <filter-class>org.ajax4jsf.Filter</filter-class>
    <init-param>
        <param-name>forceparser</param-name>
        <param-value>false</param-value>
    </init-param>
    <init-param>
        <param-name>enable-cache</param-name>
        <param-value>true</param-value>
    </init-param>
</filter>
<filter-mapping>
    <filter-name>ajax4jsf</filter-name>
    <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>INCLUDE</dispatcher>
</filter-mapping>
<filter-mapping>
    <filter-name>ajax4jsf</filter-name>
    <servlet-name>Faces Servlet</servlet-name>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>INCLUDE</dispatcher>
</filter-mapping>
<servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.jsf</url-pattern>
</servlet-mapping>

当我在Weblogic 12c中部署应用程序时,出现以下错误,并且页面未呈现。

我得到的错误是:

 <Error> <GWS> <BEA-000000> <ERROR 2014-03-14 13:07:06,977 | [ACTIVE]
 ExecuteThread:'5' for queue: 'weblogic.kernel.Default (self-tuning)' | 
BaseXMLFilter:doXmlFilter |LineNumber(199) | Exception in the filter chain
javax.servlet.ServletException: Illegal attempt to set ViewHandler after a response has been rendered.
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:606)
        at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:280)
        at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:254)
        at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:136)
        at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:341)
        Truncated. see log file for complete stacktrace
   Caused By: java.lang.IllegalStateException: Illegal attempt to set ViewHandler after a response has been rendered.
        at com.sun.faces.application.ApplicationImpl.setViewHandler(ApplicationImpl.java:563)
        at org.ajax4jsf.event.InitPhaseListener.beforePhase(InitPhaseListener.java:92)
        at com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:228)
        at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:99)
       at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116)
        Truncated. see log file for complete stacktrace
>

<Mar 14, 2014 1:07:06 PM PDT> <Error> <HTTP> <BEA-101017>
<[ServletContext@3586515[app:gwsexternal-ear-2.5.14 module:/ path:null 
spec-version:3.0], request: weblogic.servlet.internal.ServletRequestImpl@457e6d8e[
GET / HTTP/1.1
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
DNT: 1
Connection: keep-alive

]] Root cause of ServletException.
java.lang.IllegalStateException: Illegal attempt to set ViewHandler after a response has been rendered.
    at com.sun.faces.application.ApplicationImpl.setViewHandler(ApplicationImpl.java:563)
    at org.ajax4jsf.event.InitPhaseListener.beforePhase(InitPhaseListener.java:92)
    at com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:228)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:99)
    at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116)
    Truncated. see log file for complete stacktrace
>

我已将JSF1.2和JSTL 1.2部署为weblogic 12c中的共享库。但是当我尝试将浏览器提供给页面时,我的应用程序仍然会出错。

如何为jsf 1.2修复此错误?

0 个答案:

没有答案