• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

IceMobile - Failed to append element[tag: div; attributes: ] into #document

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Guys,
I have a site developed in Ice Faces framework now I want to make mobile site for the same application And for that I have decided to use Ice Mobile(Ice-mobi) framework. I modified my existing index page to redirect to login page based on caller interface (desktop/handheld device) as follows:



When I hit the server from mobile device it redirects to mobile login page, code is as follows:


Then after successful authentication I am simply returning a test view (mDashboard) to view ice-mobile components in mobile browser, but it throws an error as follows:


javax.servlet.ServletException: failed to append element[tag: div; attributes: ] into #document
javax.faces.webapp.FacesServlet.service(FacesServlet.java:606)

root cause

java.lang.RuntimeException: failed to append element[tag: div; attributes: ] into #document
org.icefaces.impl.context.DOMResponseWriter.appendToCursor(DOMResponseWriter.java:431)
org.icefaces.impl.context.DOMResponseWriter.startElement(DOMResponseWriter.java:263)
org.icefaces.mobi.component.tabset.TabSetRenderer.encodeBegin(TabSetRenderer.java:83)
javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:826)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:1777)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782)
com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:439)
com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:124)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
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)

root cause

org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is not permitted.
com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.insertBefore(CoreDocumentImpl.java:391)
com.sun.org.apache.xerces.internal.dom.NodeImpl.appendChild(NodeImpl.java:235)
org.icefaces.impl.context.DOMResponseWriter.appendToCursor(DOMResponseWriter.java:426)
org.icefaces.impl.context.DOMResponseWriter.startElement(DOMResponseWriter.java:263)
org.icefaces.mobi.component.tabset.TabSetRenderer.encodeBegin(TabSetRenderer.java:83)
javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:826)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:1777)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782)
com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:439)
com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:124)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
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)



mDashboard.xhtml code is as follows:



Jar versions I m using as follows:

1)icefaces-3.2.0.jar
2)icefaces-ace-3.2.0.jar
3)icefaces-compat-3.2.0.jar
4)icefaces-mobi-1.2.0.jar
5)icepush-3.2.0.jar
6)javax.faces-2.1.19.jar

Please help me out.
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Looks like you should remove the <ui:composition> on the mDashboard.xhtml page as well as add the other tags to make it a full page.

 
Yogesh pat
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Philip,
I tried with the replacing <ui:composition> on the mDashboard.xhtml page as well as add the other tags (code provided by you for mDashboard.xhtml) but it shows unexpected view(no tabs,panes,styles..just ordered list of tabs, etc.) like this:

Ice Sailer
Ice Breaker
Ice Skater

A
B
C

 
Philip Breau
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sounds like you're just missing the css on that page. Make sure that you have <mobi:deviceResource /> in the header and that you're requesting the page with *.jsf or whatever you're JSF servlet mapping requires.
 
Yogesh pat
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In my mDashboard.xhtml I am already including device resource like:


and also my resource mapping in web.xml is


and in faces-config.xml is:


Actually I am testing the pages on desktop browser, does it matters? Also, Is it the jars compatible issue?
thanks.
 
Saloon Keeper
Posts: 27807
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Based on your web.xml, the navigation should look like this:


The "View ID" is not a resource path, it's a limited-format context-relative URL (meaning no parameters or references to non-JSF URLs).
 
Yogesh pat
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Tim.
I made changes like <to-view-id>/mDashboard.xhtml</to-view-id> to <to-view-id>/mDashboard.iface</to-view-id> as you said. But still problem persists.
Is there any jar compatibility issue?

I am using following versions:
1)icefaces-3.2.0.jar
2)icefaces-ace-3.2.0.jar
3)icefaces-compat-3.2.0.jar
4)icefaces-mobi-1.2.0.jar
5)icepush-3.2.0.jar
6)javax.faces-2.1.6.jar
 
Tim Holloway
Saloon Keeper
Posts: 27807
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm afraid you'll have to check the IceFaces documentation. I don't work with it on a regular basis, so I can't tell what's valid and what isn't.
 
Philip Breau
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't see anythiing wrong with your navigation rule. ICEfaces doesn't add anything else to standard JSF navigation. Perhaps try using implicit navigation. Just remove the navigation rule from your faces-config.xml and return the page name (without the suffix) from your action method (eg. return "mDashboard";).
 
Yogesh pat
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Removed the navigation rules & also returned page name without suffix. But didn't solved the problem. The only impact appeared in url (remains same http://localhost:8080/project/ for eg.) for all pages.
Thanks.
 
Yogesh pat
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks guys for support. Problem got solved . Bi mistaken there were primefaces jars present in my web-inf/lib so that was causing the problem it couldn't applies styles properly. When I analyzed style/script errors on browser then it showed primefaces related errors so I removed primefaces related dependencies from maven. Sorry silly mistake. :(
Anyways, thanks again.
 
reply
    Bookmark Topic Watch Topic
  • New Topic