0

I'm building a Java web App using JSF 2.0 running on a tomcat server. And i'm using facelets1.1.10 .I've recently seen what primefaces can do and I'm very impressed by it. So i'd like to add primefaces into my web project.

I downloaded the primefaces3.2.jar from the website and added it to my project lib folder ( where I keep all the jars). and added it to my build path. but when test it out to see if the primefaces worked I get the following error:

SEVERE: Error Loading Library: jar:file:/C:/tomcat/wtpwebapps/miloWeb/WEB-INF/lib/primefaces-3.2.jar!/META-INF/primefaces-p.taglib.xml java.io.IOException: Error parsing [jar:file:/C:/tomcat/wtpwebapps/miloWeb/WEB-INF/lib/primefaces-3.2.jar!/META-INF/primefaces-p.taglib.xml]: at com.sun.facelets.compiler.TagLibraryConfig.create(TagLibraryConfig.java:397) at com.sun.facelets.compiler.TagLibraryConfig.loadImplicit(TagLibraryConfig.java:418) at com.sun.facelets.compiler.Compiler.initialize(Compiler.java:86) at com.sun.facelets.compiler.Compiler.compile(Compiler.java:103) at com.sun.facelets.impl.DefaultFaceletFactory.createFacelet(DefaultFaceletFactory.java:192) at com.sun.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:141) at com.sun.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:93) at com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:503) at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:553) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:349) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:242) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:203) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:108) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:558) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:379) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:242) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:259) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:237) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:281) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: org.xml.sax.SAXException: Error Handling [jar:file:/C:/tomcat/wtpwebapps/miloWeb/WEB-INF/lib/primefaces-3.2.jar!/META-INF/primefaces-p.taglib.xml@5,17] at com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.error(TagLibraryConfig.java:363) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source) at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.rootElementSpecified(Unknown Source) at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source) at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$ContentDriver.scanRootElementHook(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at javax.xml.parsers.SAXParser.parse(Unknown Source) at javax.xml.parsers.SAXParser.parse(Unknown Source) at com.sun.facelets.compiler.TagLibraryConfig.create(TagLibraryConfig.java:394) ... 31 more

What does that mean? what do I have to do in order to keep facelets and add primefaces?

BenMorel
  • 30,280
  • 40
  • 163
  • 285
Myy
  • 16,507
  • 11
  • 33
  • 55
  • Yes it is working with facelets... remove the facelets1.1.10 from your project and try again... take a look at this detailed answer... http://stackoverflow.com/a/4532870/617373 – Daniel Apr 03 '12 at 06:15

2 Answers2

3

Yes it is working with Facelets...(Facelets 2.0)

Take a look at this detailed answer by BalusC Migrating from JSF 1.2 to JSF 2.0

Some Snippet from Original BalusC answer...

Facelets 1.x to Facelets 2.0

If you're using Facelets 1.x as view technology and want to use the JSF 2.0 supplied Facelets 2.0, then you need to do the following additional steps:

  • Remove Facelets 1.x JAR from /WEB-INF/lib.
  • Remove Facelets 1.x FaceletViewHandler from faces-config.xml.
  • Any custom FaceletViewHandler implementation needs to be updated to extend [ViewHandlerWrapper][2] instead.
  • Not necessary, but just for cleanup, remove any Facelets 1.x related <context-param> values from web.xml which are already default in Facelets 2.0, like the javax.faces.DEFAULT_SUFFIX with value of *.xhtml.
  • Update root declaration of existing Facelet taglib XML's to comply Facelets 2.0.

    <facelet-taglib 
        xmlns="http://java.sun.com/xml/ns/javaee"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd"
        version="2.0">
    
Community
  • 1
  • 1
Daniel
  • 35,598
  • 9
  • 108
  • 184
  • That last part of updating the root declaration of existing facelet taglib, where is that? I searched all my files and don't find any – Myy Apr 03 '12 at 08:35
  • I think it is somehow related to custom components.... http://www.mkyong.com/jsf2/custom-tags-in-jsf-2-0/ and I guess you don't have one in your project... – Daniel Apr 03 '12 at 08:46
  • I tried those changes and I get a class not found error. do I need to add a facelets 2.0 jar? – Myy Apr 03 '12 at 17:02
  • no , no such thing as far as i know , edit your question and post the stack trace... or some details – Daniel Apr 03 '12 at 17:17
  • I actually already asked that here http://stackoverflow.com/questions/9998524/migrating-to-facelets-2-0-from-facelets-1-x can you please take a look to see if anything looks fishy? – Myy Apr 03 '12 at 17:42
  • you already got an answer over there... include jstl-1.2.jar.... seems that it will solve the new issue over there... – Daniel Apr 03 '12 at 17:56
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/9652/discussion-between-myy-and-daniel) – Myy Apr 03 '12 at 18:41
  • I don't believe I ever actually Thank you. I greatly appreciate the time, I finally fixed it, and I believe I am running fine now. =) – Myy Apr 05 '12 at 16:34
0

Remove view-hander config from your faces-config.xml

Here is a similar problem and its solution at primefaces forum.