java.lang.IllegalStateException: CDATA tags may not nest

后端 未结 6 2039
渐次进展
渐次进展 2020-11-29 06:15

I\'ve got a problem with an ajax request in a JSF page. When I click on the button, I get this exception:

SEVERE: Servlet.service() for servlet Faces Servlet         


        
6条回答
  •  眼角桃花
    2020-11-29 06:24

    My experience to get rid of a simliar execption in Tomcat 7 is: if you are calling a method in jsf, you will have to add (), even if it does not have a parameter.

    This exception but will not appear, if you are using jetty

    EDIT: Even though this exception was eliminated, it gave another exception:

    java.lang.NoSuchMethodError: javax.el.ELResolver.invoke(Ljavax/el/ELContext;Ljava/lang/Object;Ljava/lang/Object;[Ljava/lang/Class;[Ljava/lang/Object;)Ljava/lang/Object;
    

    After researching I found the Tomcat 7 brings EL dependency by itself, thus any other dependency in the pom.xml like

    
        javax.el
        el-api
        2.2
        provided
    
    

    shoud be removed to avoid the mixing.

    After that, you have to start the tomcat7 by Run as - tomcat7:run in Eclipse, instead of tomcat:run which starts by default the tomcat 6.

    My enviroment:

    • Eclipse Kepler
    • JDK 1.7.0_45
    • Maven 3.1.1

提交回复
热议问题