facebook

Badly formed jsp problem.

  1. MyEclipse Archived
  2.  > 
  3. ICEfaces Integration
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #302471 Reply

    BizzyB
    Participant

    I just created a new web project. I added JSF support, IceFaces Capabilities and then Icefaces Facelets capabilities.

    The index.jsp created with the project works fine, but then I used the Flow Designer to add a new JSP page. When I try to access this page I get the same error all the time.

    com.sun.facelets.FaceletException: Error Parsing /login.jsp: Error Traced[line: 1] The markup in the document preceding the root element must be well-formed.

    Here is my JSP page that was auto generated by the Flow Designer.

    <%@ taglib uri=”http://java.sun.com/jsf/html&#8221; prefix=”h” %>
    <%@ taglib uri=”http://java.sun.com/jsf/core&#8221; prefix=”f” %>
    <%@ taglib uri=”http://www.icesoft.com/icefaces/component&#8221; prefix=”ice” %>
    <html>
    <head>
    <meta http-equiv=”Content-Type” content=”text/html; charset=ISO-8859-1″ />
    <title>ICEfaces, Ajax for Java EE</title>
    <link rel=”stylesheet” type=”text/css” href=”./xmlhttp/css/rime/rime.css” />
    </head>
    <body>
    <f:view>

    <ice:outputText value=”Thank you for using ICEfaces.” />

    <ice:form>
    <ice:messages />
    </ice:form>

    </f:view>
    </body>
    </html>

    Here is my stack trace:

    SEVERE: Problem in renderResponse: Error Parsing /login.jsp: Error Traced[line: 1] The markup in the document preceding the root element must be well-formed.
    com.sun.facelets.FaceletException: Error Parsing /login.jsp: Error Traced[line: 1] The markup in the document preceding the root element must be well-formed.
    at com.sun.facelets.compiler.SAXCompiler.doCompile(SAXCompiler.java:239)
    at com.sun.facelets.compiler.Compiler.compile(Compiler.java:109)
    at com.sun.facelets.impl.DefaultFaceletFactory.createFacelet(DefaultFaceletFactory.java:218)
    at com.sun.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:149)
    at com.sun.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:100)
    at com.icesoft.faces.facelets.D2DFaceletViewHandler.renderResponse(D2DFaceletViewHandler.java:268)
    at com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:153)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)

    I can’t believe other people haven’t run into this problem. MyEclipse has been a great tool for me in developing with plain JSF, but now I want to use some of IceFaces and Facelet components.

    Thanks,
    Barry

    #302472 Reply

    Barry,
    I could not replicate this at my end. Can you give some more information?
    1. what are your installation details? You can get them from MyEclipse > Installation Summary > Installation Details.
    2. Do you have any 3rd party tools installed?
    3. What are the versions of ICEFaces, JSF and Facelets that you are using?
    4. Did you install ICEFaces plug-in for MyEclipse?
    5. What is the editor that you are using to open the JSP page?

    #302477 Reply

    BizzyB
    Participant

    Thanks for your reply Shalani.

    I am using MyEclipse Blue without installing any additional plugins.

    1) Here are my Installation Details

    *** Date:
    Wednesday, September 16, 2009 8:56:26 AM PDT

    ** System properties:
    OS=WindowsVista
    OS version=6.0.0
    Java version=1.6.0_13

    *** MyEclipse details:
    MyEclipse Enterprise Workbench
    Version: 7.5
    Build id: 7.5-20090609

    *** Eclipse details:
    MyEclipse Enterprise Workbench

    Version: 7.5
    Build id: 7.5-20090609

    Eclipse Plug-in Development Environment

    Version: 3.4.2.R342_v20090122-7T7U1E9imVKz-A8Vz-p_jRS
    Build id: M20080703-0800

    Eclipse Platform

    Version: 3.4.2.R342_v20090122-9I96EiWElHi8lheoJKJIvhM3JfVsYbRrgVIWL
    Build id: M20090211-1700

    Eclipse Graphical Editing Framework GEF

    Version: 3.4.2.v20090218-1145-67728084A56B4I233613552
    Build id: 200809101400

    Eclipse RCP

    Version: 3.4.200.R342_v20090122-989JESTEbig-SVaL8UJHcYBr4A63
    Build id: M20090211-1700

    Eclipse Java Development Tools

    Version: 3.4.2.r342_v20081217-7o7tEAoEEDWEm5HTrKn-svO4BbDI
    Build id: M20090211-1700

    Eclipse startup command=-os
    win32
    -ws
    win32
    -arch
    x86
    -showsplash
    -launcher
    C:\Genuitec\MyEclipse 7.5\myeclipse.exe
    -name
    Myeclipse
    –launcher.library
    C:\Genuitec\MyEclipse 7.5\../Common\plugins\org.eclipse.equinox.launcher.win32.win32.x86_1.0.101.R34x_v20080731\eclipse_1115.dll
    -startup
    C:\Genuitec\MyEclipse 7.5\../Common\plugins\org.eclipse.equinox.launcher_1.0.101.R34x_v20081125.jar
    -clean
    -configuration
    configuration
    -vm
    C:\Genuitec\Common\binary\com.sun.java.jdk.win32.x86_1.6.0.013\jre\bin\client\jvm.dll

    2) No 3rd party tools.

    3) I chose the Java EE 5 Libraries, JRE 1.6.0.013, JSF 1.2, IceFaces Library v1.8.1, IceFaces Facelets Library v1.8.1. These were all picked by automatically adding the capabilities from the MyEclipse Menu Item and selecting the latest version.

    4) I did NOT install a plug in. Just straightforward MyEclipse Blue.

    5) I added my JSP page automatically in the Flow Designer and then double clicked on it, but I have also tried editing and saving it with both the MyEclipse JSP and JSF editors. Same result.

    All of this code is auto generated with the latest version of MyEclipse and I an debugging it with the integrated version of Tomcat. The Index Page worked fine when I created the project, but I wanted to add a login page so I added a forward tag to my index.jsp page:

    <body>
    <jsp:forward page=”/login.faces”/>
    </body>

    However, this can’t be the problem because I get the same error even if I try to access the login.jsp page directly.

    http://localhost:8080/appName/login.faces.

    Barry

    #302490 Reply

    Barry,
    Can you share your project? You can send a mail to support@genuitec.com. Please add ATTN: Shalini in the subject and refer to this post. This will help us reproduce the error internally. Also please list out the steps in detail, starting from creating a new web project, to replicate this issue. Thank you for your help.

    #302494 Reply

    BizzyB
    Participant

    Hi Shalini,
    I solved the problem.

    When I use the flow designer to create a new page and select “ICEFaces jspx template”, the file extension the designer defaults to is actually “.jsp” In fact, if I change the extension to “.jspx” the designer gives me a warning message saying “File naming conventions recommend a JSP extension (.jsp,.jspf)”. This is very confusing because it made me think that the correct extension to use for these templates should be “.jsp”.

    In order to make the “.jsp” extension work correctly I then went into my web.xml and changed the default suffix to be “.jsp”. Shown below.

    <context-param>
    <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
    <param-value>.jsp</param-value>
    </context-param>

    Anyway, this is the scenarion that created this bug.

    In order to fix the problem I decided to ignore the warning from the Flow Designer and I created my new pages with a “.jspx” extension. I also changed back my default suffix to be “.jspx” and then all of my pages render correctly. No more errors.

    This information should enable you to recreate it, but if you can’t I can send you a test project that shows the problem.

    I guess the only remaining question I have is why does the Flow Designer gives this misleading warning message when I add new jsp files with the using the ICEFaces jspx template?

    Thanks,
    Barry

    #306755 Reply

    NickSSS
    Member

    Thanks a lot. As for me I always miss such details. And usually it turns out that I missed something small but as a result this small often transfers into a headache. As for me, to save headaches I use guides and tutorials. I find lots of them at rapidshare SE http://rapidpedia.com .
    Your help was immense. Thanks a lot!

    #308273 Reply

    Good to hear that you are all set. Thanks Barry for a such detailed information. This may be helpful for the other users in this forum.

    Thanks,
    Chakri Vedula.

Viewing 7 posts - 1 through 7 (of 7 total)
Reply To: Badly formed jsp problem.

This topic is marked as closed to new replies, however your posting capabilities still allow you to do so.

You must be logged in to post in the forum log in