MyEclipse Forums
This thread has been locked & this forum has been archived.
Please post new topics to Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
View previous topic Printable version Log in to check your private messages View next topic
Author Message
BizzyB
Post subject: Badly formed jsp problem.  PostPosted: Sep 16, 2009 - 08:05 AM
Registered Member
Registered Member


Joined: Aug 26, 2009
Posts: 5

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" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://www.icesoft.com/icefaces/component" 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
 
 View user's profile Send private message  
Reply with quote Back to top
support-shalini
Post subject: RE: Badly formed jsp problem.  PostPosted: Sep 16, 2009 - 11:16 AM
Registered Member
Registered Member


Joined: May 18, 2009
Posts: 1532

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?

_________________
Shalini
MyEclipse Support
 
 View user's profile Send private message  
Reply with quote Back to top
BizzyB
Post subject: RE: Badly formed jsp problem.  PostPosted: Sep 16, 2009 - 05:07 PM
Registered Member
Registered Member


Joined: Aug 26, 2009
Posts: 5

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
 
 View user's profile Send private message  
Reply with quote Back to top
support-shalini
Post subject: RE: Badly formed jsp problem.  PostPosted: Sep 17, 2009 - 09:59 AM
Registered Member
Registered Member


Joined: May 18, 2009
Posts: 1532

Barry,
Can you share your project? You can send a mail to support@myeclipseide.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.

_________________
Shalini
MyEclipse Support
 
 View user's profile Send private message  
Reply with quote Back to top
BizzyB
Post subject: RE: Badly formed jsp problem.  PostPosted: Sep 17, 2009 - 05:11 PM
Registered Member
Registered Member


Joined: Aug 26, 2009
Posts: 5

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
 
 View user's profile Send private message  
Reply with quote Back to top
NickSSS
Post subject: Thanks  PostPosted: Mar 12, 2010 - 10:40 AM



Joined: Mar 12, 2010
Posts: 1

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!
 
 View user's profile Send private message  
Reply with quote Back to top
support-chakri
Post subject: RE: Thanks  PostPosted: May 10, 2010 - 02:04 PM
Registered Member
Registered Member


Joined: Apr 05, 2010
Posts: 68

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.
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits