English 中文(简体)
java.lang.IllegalStateException: 非法试图在答复后提出观点
原标题:java.lang.IllegalStateException: Illegal attempt to set ViewHandler after a response has been rendered

我的Java EE网络应用正在与玻璃鱼2.1做精细工作。 现在我想向玻璃鱼3.1.1迁移,但在成功部署战争档案之后,它造成以下错误:

WARNING: ApplicationDispatcher[/Myapp] PWC1231: Servlet.service() for servlet Faces Servlet threw exception
java.lang.IllegalStateException: Illegal attempt to set ViewHandler after a response has been rendered.

My application uses following frameworks.

  • Spring Framework 3.0.2
  • JSF 2.0
  • RichFaces 3.3.3 Final

该表与JDK1.6合编。

这一问题是如何造成的,我如何解决这一问题?

http://www.ohchr.org。

我遵循了所提供的修改:

丰富多彩的我的属性如下:

   <dependency>
        <groupId>org.richfaces.framework</groupId>
        <artifactId>richfaces-api</artifactId>
        <version>3.3.3.Final</version>
    </dependency>
    <dependency>
        <groupId>org.richfaces.framework</groupId>
        <artifactId>richfaces-impl-jsf2</artifactId>
        <version>3.3.3.Final</version>
    </dependency>
    <dependency>
        <groupId>org.richfaces.ui</groupId>
        <artifactId>richfaces-ui</artifactId>
        <version>3.3.3.Final</version>
    </dependency>

我的脆弱之处在于:

        <dependency>
            <groupId>com.sun.faces</groupId> 
            <artifactId>jsf-api</artifactId> 
            <version>2.0.2</version> 
        </dependency>
        <dependency>
            <groupId>com.sun.faces</groupId> 
            <artifactId>jsf-impl</artifactId> 
            <version>2.0.2</version> 
        </dependency>

添加以下内容:

<context-param>
    <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
    <param-value>com.sun.facelets.FaceletViewHandler</param-value>
</context-param>
<context-param>
    <param-name>javax.faces.DISABLE_FACELET_JSF_VIEWHANDLER</param-name>
    <param-value>true</param-value>
</context-param>

修改了我的申请说明,修改了2.5版。

<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/j2ee" 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">

我在座席上的发言如下:

 <application>
        <navigation-handler >
            org.navigation.CustomNavigationHandler
        </navigation-handler>

        <view-handler>
            org.ajax4jsf.application.AjaxViewHandler
        </view-handler>
<!--        <view-handler>
            com.sun.facelets.FaceletViewHandler
        </view-handler>-->
        <variable-resolver>org.springframework.web.jsf.DelegatingVariableResolver</variable-resolver>
        <message-bundle>MyMessages</message-bundle>
    </application>

Application get deployed successfully but after that i am getting error of class cast exception at the time starting an application in browser :

服务器记录如下:

INFO: myApp was successfully deployed in 21,635 milliseconds.
SEVERE: Error Rendering View[/login.xhtml]
javax.faces.FacesException: java.lang.ClassCastException: java.lang.String cannot be cast to javax.faces.component.UIComponent
    at com.sun.faces.application.ApplicationImpl.createComponentApplyAnnotations(ApplicationImpl.java:1923)

如何解决这一问题?

最佳回答
问题回答

我不得不将Ajax4jsf图书馆从我的申请中删除,然后才能消除这一错误。 显而易见,Ajax4jsf图书馆与JF2.0不兼容。

Here where I found this.
Migrating JSF 1.1 with Ajax4jsf-1.x to JSF2





相关问题
Recommended way to develop using Jetty and Eclipse

I am currently developing a J2EE application and I would like to use Jetty. I would like to have iot integrated with Eclipse, so I could debug the appliaction. I ve tried out couple of plugins (...

Call function periodically in Java

we need run one function periodically in Java web application . How to call function of some class periodically ? Is there any way that call function when some event occured like high load in server ...

Why make an EJB rather than a Web Service?

I would have thought that there is a lot of information out there on this, but I haven t found anything that really answers my question. What are the advantages of making an EJB rather than a web ...

Where should I put this configuration setting?

I m designing a fairly small web application which will run on a Sun application server (v9.1). It only has a few pages, no database of its own, and will retrieve/update data via web services. There s ...

JNDI Names -- Is Prefix "jdbc/" needed?

What s up with JNDI names? I m trying to get a javax.sql.DataSource using the new annotations feature of Java 5. It s not working for me, so I want to ask... I have a in my web.xml, inside of it is ...

hibernate interceptors : afterTransactionCompletion

I wrote a Hibernate interceptor : public class MyInterceptor extends EmptyInterceptor { private boolean isCanal=false; public boolean onSave(Object entity, Serializable arg1, Object[] arg2, String[]...

热门标签