Details
Description
09:08:25,254 ERROR [[Persistent Faces Servlet]] Servlet.service() for servlet Persistent Faces Servlet threw exception
java.lang.RuntimeException: Failed to append element[tag: html; attributes: ] into #document
at com.icesoft.faces.context.DOMResponseWriter.appendToCursor(DOMResponseWriter.java:528)
at com.icesoft.faces.context.DOMResponseWriter.startElement(DOMResponseWriter.java:169)
..............
Caused by: org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is not permitted.
at com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.insertBefore(CoreDocumentImpl.java:419)
The attached test case is a very basic web app. It has the required ICEfaces jar and myFaces jars along with this context param which tells jboss that the war bundles the JSF implementation:
<context-param>
<param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
<param-value>true</param-value>
</context-param>
-
Hide
- TestIcefacesMyfaces.war
- 6.49 MB
- Tyler Johnson
-
- META-INF/MANIFEST.MF 0.1 kB
- JBoss4.dpf 0.2 kB
- WEB-INF/.faces-config.mex 0.1 kB
- WEB-INF/faces-config.xml 0.2 kB
- WEB-INF/jboss-web.xml 0.2 kB
- WEB-INF/web.xml 3 kB
- index.jsp 0.5 kB
- test.jsp 0.5 kB
- xmlhttp/css/.../PnlClpsblCnt_bullet.gif 0.5 kB
- xmlhttp/css/.../PnlHdr_bgslice.gif 0.1 kB
- xmlhttp/css/.../PnlHdr_collapsed.gif 1 kB
- xmlhttp/css/.../css-images/PnlHdr_down.gif 1 kB
- xmlhttp/css/.../css-images/PnlHdr_file.gif 0.9 kB
- xmlhttp/css/.../ProgFill_Indet_Bg_active.gif 13 kB
- xmlhttp/.../ProgFill_Indet_Bg_inactive.gif 0.7 kB
- xmlhttp/css/.../css-images/ProgFill_bg.gif 0.1 kB
- xmlhttp/css/.../Tab_Btm_LftBtm.gif 0.1 kB
- xmlhttp/css/.../Tab_Btm_LftBtm_off.gif 0.1 kB
- xmlhttp/css/.../Tab_Btm_LftMid.gif 0.1 kB
- xmlhttp/css/.../Tab_Btm_LftMid_off.gif 0.1 kB
- xmlhttp/css/.../Tab_Btm_MidBtm.gif 0.0 kB
- xmlhttp/css/.../Tab_Btm_MidBtm_off.gif 0.0 kB
- xmlhttp/css/.../Tab_Btm_MidMid.gif 0.1 kB
- xmlhttp/css/.../Tab_Btm_MidMid_off.gif 0.1 kB
- xmlhttp/css/.../css-images/Tab_Btm_RtBtm.gif 0.1 kB
- xmlhttp/css/.../Tab_Btm_RtBtm_off.gif 0.1 kB
- xmlhttp/css/.../css-images/Tab_Btm_RtMid.gif 0.1 kB
- xmlhttp/css/.../Tab_Btm_RtMid_off.gif 0.1 kB
- xmlhttp/css/.../css-images/Tab_LftMid.gif 0.1 kB
- xmlhttp/css/.../Tab_LftMid_off.gif 0.1 kB
Activity
- All
- Comments
- History
- Activity
- Remote Attachments
- Subversion
Sample app demonstrating issue. Uses 1.8 RC2 jars.
http://localhost:8080/TestIcefacesMyfaces/test.jsp
The page renders correctly but the exception is thrown in the server logs. I've attempted to add xercesImpl and xml-api but no luck.
Ty
This is caused by the simultaneous presence of both JSF 1.2 and MyFaces 1.1.
MyFaces has been specified for initialization through the WAR_BUNDLES_JSF_IMPL parameter, but JSF 1.2 is still on the classpath. ICEfaces automatically detects JSF 1.2 and performs certain operations under that assumption. In this case, JSF 1.1 and 1.2 conflict over the role of the View tag: with JSF 1.1, the View tag is responsible for rendering, but with JSF 1.2, the ViewHandler takes this role. When both JSF 1.2 and JSF 1.1 are present, ICEfaces attempts to render the view twice resulting in the exception (the DOMResponseWriter document has been cleared by the termination of the initial render pass, so is null for the redundant pass driven by JSF 1.2 detection).
Candidate fix is to disable JSF12 detection when MyFaces is detected.
Index: src/com/icesoft/faces/webapp/parser/ImplementationUtil.java
===================================================================
— src/com/icesoft/faces/webapp/parser/ImplementationUtil.java (revision 18814)
+++ src/com/icesoft/faces/webapp/parser/ImplementationUtil.java (working copy)
@@ -111,16 +111,6 @@
} catch (ClassNotFoundException e) {
}
- try
{
- Class.forName(MYFACES_MARKER);
- isMyFaces = true;
- }
catch (ClassNotFoundException e)
{ - }-
- if (log.isTraceEnabled())
{
- log.trace("JSF-RI: " + isRI + " MyFaces: " + isMyFaces);
- }
-
{ Class.forName(JSF12_MARKER); @@ -144,6 +134,18 @@ }
//Test for JSF 1.2
try
try
{ + Class.forName(MYFACES_MARKER); + isMyFaces = true; + //Disable JSF12 detection in MyFaces environment + isJSF12 = false; + }catch (ClassNotFoundException e)
{ + }+
+ if (log.isTraceEnabled())
+
+ try {
javax.faces.component.html.HtmlOutputText comp =
new javax.faces.component.html.HtmlOutputText();
isStockAttributeTracking = isAttributeTracking(comp);
The DOMException is with 1.7.2 SP1. Here is the beginning of the exception when using 1.8 RC2:
23:38:44,356 INFO [MainServlet] Adapting to Push environment.
23:38:46,184 ERROR [[Persistent Faces Servlet]] Servlet.service() for servlet Pe
rsistent Faces Servlet threw exception
java.lang.NullPointerException
at com.icesoft.faces.context.DOMResponseWriter.startElement(DOMResponseW
riter.java:199)
at com.icesoft.faces.renderkit.dom_html_basic.XMLRenderer.encodeBegin(XM
LRenderer.java:51)
at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.jav
a:515)
at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHa
ndler.java:514)