0
votes

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?

2
Yes it is working with facelets... remove the facelets1.1.10 from your project and try again... take a look at this detailed answer... stackoverflow.com/a/4532870/617373Daniel

2 Answers

3
votes

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">
    
0
votes

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

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