voyent
[MyEclipse][Solved] JSP taglib declaration Problem  XML
Forum Index -> Tools Go to Page: 1, 2 Next 
Author Message
Baleyba

Joined: 16/Nov/2006 00:00:00
Messages: 110
Offline


Hi,

I have installed the ICEfaces Tool Integration for MyEclipse 5.1

I'm using the last version of IceFace lib (1.5.0.1)

I have a problem when I use the template syntax.
With this plugin We can create a new jsp with this template.


<%@ 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"%>

<f:view >
<html>
<head>
<title>ICEface page</title>
</head>
<body>

<ice:form >

</ice:form >

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


Under MyEclipse this template with taglib declaration allow us to get the autocompletion into the JSP editor.

All is ok.
But when I deploy under jboss I get this error message.

11:41:36,396 INFO [STDOUT] 11:41:36,396 ERROR [Digester] Parse Fatal Error at line 1 column 2: The markup in the document preceding the root element must be well-formed.
org.xml.sax.SAXParseException: The markup in the document preceding the root element must be well-formed.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.apache.commons.digester.Digester.parse(Digester.java:1586)
at com.icesoft.faces.webapp.parser.Parser.parse(Parser.java:122)
at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:502)
at com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:149)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:107)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:268)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:137)
at com.icesoft.faces.webapp.xmlhttp.PersistentFacesServlet.service(PersistentFacesServlet.java:390)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:595)
...

 


Please help me to making work this jsp template. I don't know what to do for making this syntax working.

Thanks.

regards,

Bal

JBoss 4.2.3 | Java 1.6.0_16 | IceFaces 1.8.2
msanders

Joined: 21/Nov/2006 00:00:00
Messages: 14
Offline


Hi Bal,

As ICEfaces uses jspx files , i.e. JSP documents which are valid XML documents, you need to convert your taglibs to using namespace declarations, as follows:

<f:view
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ice="http://www.icesoft.com/icefaces/component">...</f:view>

I'm not sure whether MyEclipse understands this part of the JSP spec, but other IDEs such BEA Workshop for JSF do.

I hope this helps.

- Mark
Baleyba

Joined: 16/Nov/2006 00:00:00
Messages: 110
Offline


Hi msanders,

thanks for your quick answer!

That is what I thought before.

But the Iceface MyEclipse plugin give this possibility (When I create a new JSP file):



So I think it should be possible... Otherwise this option shouldn't exist... not ?

Thanks

Bal.

JBoss 4.2.3 | Java 1.6.0_16 | IceFaces 1.8.2
msanders

Joined: 21/Nov/2006 00:00:00
Messages: 14
Offline


Baleyba wrote:
That is what I thought before.

But the Iceface MyEclipse plugin give this possibility:
...
So I think it should be possible... Otherwise this option shouldn't exist... not ?
 

Hi,

Yes, I noticed that in the integration plugin for BEA Workshop for JSF, but the very first step in the tutorial section of the Getting Started guide shows you have to use JSP document syntax. I think it is a mistake in the plugin.

See: http://www.icesoft.com/developer_guides/icefaces/htmlguide/gettingstarted/TimezoneTutorial10.html

- Mark
Baleyba

Joined: 16/Nov/2006 00:00:00
Messages: 110
Offline


Great!!!!!

I have found the solution! It is working fine!

In fact I must name the file with ".jsp" extension and I can use it with ".iface" extension througt the web explorer.

Before I used ".jspx" extension...

My problem is solved.

Thanks again msanders for your help

Regards,

Bal.

JBoss 4.2.3 | Java 1.6.0_16 | IceFaces 1.8.2
liming.wu

Joined: 26/Oct/2004 00:00:00
Messages: 441
Offline


We should have put a special note on using provided template. The template is added into eclipse-based integration bundles in order to get the auto-completion working.
[Email]
bpaduraru

Joined: 19/Oct/2006 00:00:00
Messages: 32
Offline


I'm having the same problem when I use myEclipse plugin and Icefaces.
If I use :

<f:view xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jstl/core"
xmlns:ice="http://www.icesoft.com/icefaces/component">

none of Icefaces JSF tags are recognized!

If I add the jsp tags corresponding to what is above, it says something about malformed XML.
If I make the jspx as a jsp, then it tells that my index.jsp forward directive is not bound...

[Email]
Baleyba

Joined: 16/Nov/2006 00:00:00
Messages: 110
Offline


Hi,

For my case, if I use this format:

<f:view xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jstl/core"
xmlns:ice="http://www.icesoft.com/icefaces/component">  


I must name the file with ".jspx" extension and use an address like http://localhost:8080/myFile.iface



Otherwise, if I use this format:

<%@ 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"%> 


I have autocompletion with myeclipse!
and I must name the file with ".jsp" extension and use an address like: http://localhost:8080/myFile.iface

If it doesn't work, check your faces-config.xml and your web.xml files.

I hope it will help you.

Regards,
Chris

JBoss 4.2.3 | Java 1.6.0_16 | IceFaces 1.8.2
bpaduraru

Joined: 19/Oct/2006 00:00:00
Messages: 32
Offline


Doesn't work, I tried this before...
It throws me a HTTP 404.

In my web.xml I have the mapping for *.ifaces

I would rather think of making the plugin work in the normal manner since jsp doesn't protects you from malformed tags like jspx does.
[Email]
Baleyba

Joined: 16/Nov/2006 00:00:00
Messages: 110
Offline


This is my Web.xml
I'm using IceFaces 1.5.1

<?xml version="1.0"?>

<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>

<display-name>ICEfaces Component Showcase</display-name>
<description>
ICEfaces Component Showcase was designed to make developers aware
of the rich set of features available in the custom and extended
components.
</description>

<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/WEB-INF/faces-config.xml</param-value>
</context-param>


<context-param>
<param-name>com.icesoft.faces.debugDOMUpdate</param-name>
<param-value>false</param-value>
</context-param>

<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
<description>
State saving method: "client" or "server" (= default)
See JSF Specification 2.5.2
</description>
</context-param>

<context-param>
<param-name>com.icesoft.faces.uploadDirectory</param-name>
<param-value>upload</param-value>
</context-param>

<!-- concurrent DOM views -->
<context-param>
<param-name>com.icesoft.faces.concurrentDOMViews</param-name>
<param-value>false</param-value>
</context-param>
<!-- Asynchronous Updates -->
<context-param>
<param-name>com.icesoft.faces.synchronousUpdate</param-name>
<param-value>false</param-value>
</context-param>

<listener>
<listener-class>com.icesoft.faces.util.event.servlet.ContextEventRepeater</listener-class>
</listener>

<!-- Source Code reader servlet-->
<servlet>
<servlet-name>SourceCode Reader</servlet-name>
<servlet-class>com.icesoft.icefaces.samples.showcase.util.SourceCodeLoaderServlet</servlet-class>
</servlet>

<!-- file upload Servlet -->
<servlet>
<servlet-name>uploadServlet</servlet-name>
<servlet-class>com.icesoft.faces.component.inputfile.FileUploadServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>


<!-- Faces Servlet -->
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet>
<servlet-name>Persistent Faces Servlet</servlet-name>
<servlet-class>com.icesoft.faces.webapp.xmlhttp.PersistentFacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet>
<servlet-name>Blocking Servlet</servlet-name>
<servlet-class>com.icesoft.faces.webapp.xmlhttp.BlockingServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

<!-- extension mapping -->

<servlet-mapping>
<servlet-name>uploadServlet</servlet-name>
<url-pattern>/uploadHtml</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>Persistent Faces Servlet</servlet-name>
<url-pattern>*.iface</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>Persistent Faces Servlet</servlet-name>
<url-pattern>/xmlhttp/*</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>Blocking Servlet</servlet-name>
<url-pattern>/block/*</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>SourceCode Reader</servlet-name>
<url-pattern>/sourcecodeStream.html</url-pattern>
</servlet-mapping>

<session-config>
<session-timeout>15</session-timeout>
</session-config>

<!-- Welcome files -->
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
</welcome-file-list>

</web-app>
 


And my faces-config.xml

<?xml version='1.0' encoding='UTF-8'?>

<!DOCTYPE faces-config PUBLIC
"-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
"http://java.sun.com/dtd/web-facesconfig_1_1.dtd">

<faces-config>

<application>

<locale-config>
<default-locale>fr</default-locale>
<supported-locale>fr</supported-locale>
<supported-locale>en</supported-locale>
</locale-config>
</application>

<managed-bean>
<managed-bean-name>
Managedbean
</managed-bean-name>
<managed-bean-class>

</faces-config>
 

JBoss 4.2.3 | Java 1.6.0_16 | IceFaces 1.8.2
bpaduraru

Joined: 19/Oct/2006 00:00:00
Messages: 32
Offline


So it is the default Icefaces file except it does not have the entry for "*.jspx" ?
[Email]
Baleyba

Joined: 16/Nov/2006 00:00:00
Messages: 110
Offline


I don't know exactly.
I have done a lot of tests... But My starting file is the default web.xml file.

And it is working fine for me.
My goal was
- to have the taglib syntax into my jsp file for having autocompletion into myeclipse.
- And to have any error on application server when launching.

Bal

JBoss 4.2.3 | Java 1.6.0_16 | IceFaces 1.8.2
liming.wu

Joined: 26/Oct/2004 00:00:00
Messages: 441
Offline


bpaduraru,

As Philip has indicated in http://www.icefaces.org/JForum/posts/list/3082.page, files generated from the template provided is a jsp file, not jspx file and should be named as .jsp. ICEfaces parser will accept this kind of non xml jsp and convert it to xml document. if you name the template as .jspx, some servers assume it is a xml document and report validation failure even though ICEfaces accepts it. We provide the template is to get tag and attribute auto-completion working in Eclipse specific environment.

"If I make the jspx as a jsp, then it tells that my index.jsp forward directive is not bound... "

It will be much easier for me if you can post a very small example shows the problem.

[Email]
bpaduraru

Joined: 19/Oct/2006 00:00:00
Messages: 32
Offline


The index.jsp page is the same like the one from component showcase, it forwards to my page, that's all.

I change my file from jspx to jsp. Autocompletion works ofcourse but on run now it does not give me anymore that forward bound error, it gives me a new one:

ERROR 09:39:15 [http-8080-Processor25] - Problem in renderResponse: replacement
java.lang.NullPointerException: replacement
at java.util.regex.Matcher.replaceFirst(Unknown Source)
at java.lang.String.replaceFirst(Unknown Source)
at com.icesoft.faces.facelets.D2DFaceletViewHandler.getRenderedViewId(D2DFaceletViewHandler.java:231)
at com.icesoft.faces.facelets.D2DFaceletViewHandler.renderResponse(D2DFaceletViewHandler.java:245)
at com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:149)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
at com.icesoft.faces.webapp.xmlhttp.PersistentFacesServlet.service(PersistentFacesServlet.java:390)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:688)
at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:658)
at org.apache.jsp.index_jsp._jspService(index_jsp.java:49)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Unknown Source)


The same code runs perfectly if I use the jspx file.
[Email]
atomz4peace

Joined: 20/Nov/2006 00:00:00
Messages: 115
Offline


I have the same problem error with Problem in renderResponse: replacement showing up on a .jsp page.

Anyone have ideas why?
 
Forum Index -> Tools Go to Page: 1, 2 Next 
Go to:   
Powered by JForum 2.1.7ice © JForum Team