Friday, May 29, 2009

Tip: Use Facelets 1.1.15 in JBoss 5.x

I've begun my research into RichFaces, and decided to actually read their developer guide instead of just winging it. Sometimes I do crazy things, I know. Anyway, one of their initial suggestions was to get a plain JSF application in place and working, and I thought this was a decent starting point - that way, any anomalies could be more easily traced as I added RichFaces stuff.

So I put a plain vanilla Facelets-JSF app together (i.e., one that doesn't use a third-party component set, like IceFaces or RichFaces) , and got it working just fine on JBoss 4.2.2 (here I'm using Facelets 1.1.14). However, with my migration to JBoss 5.1, this rather dumb prototype stopped working, with this exception on initial deployment of the webapp:

SEVERE [compiler] Missing Built-in Tag Libraries! Make sure they are included within the META-INF directory of Facelets' Jar
15:35:25,318 SEVERE [viewhandler] Error Rendering View[/index.xhtml]
java.lang.NullPointerException
at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
at com.sun.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:95)
at com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:524)
.............

On subsequent page loads, the "Missing Built-in Tag Libraries" message stopped appearing, but the NPE on NamespaceHandler continued to happen. Googling on the NPE was not entirely fruitful, but searching against the tag libraries problem led me to various known solutions; I addressed it by using the 1.1.15 version of Facelets.

For decent guidance on constructing a simple Facelets web app, here's a nice Facelets tutorial.

19 comments:

  1. Like you I have been googling about this issue until I reached here. Thank you, I didn't have to search much and got the solution. It Worked!

    ReplyDelete
  2. I got same problem, I googled it and found the solution same as you. I will try the solution next monday.

    ReplyDelete
  3. muchisimas gracias por ayudarme con el problema .......eternamente agradecida :) gracias compaƱeros

    ReplyDelete
  4. I googled it and found ur site.It worked for me.Thanks a lot.

    ReplyDelete
  5. Sorry for my delayed response to everyone; this is great that this tip has been useful. Glad to help!

    ReplyDelete
  6. It works !! Great help!

    ReplyDelete
  7. Thank you for this. It works:)

    ReplyDelete
  8. Dieureudieuf (thanks)

    ReplyDelete
  9. The links are down. Is there anybody who could share the silution here ( if u remember ). Thanks

    ReplyDelete
  10. Here's an alternate download site:

    http://repository.jboss.org/maven2/com/sun/facelets/jsf-facelets/1.1.15/

    As the posting says, the solution is to use the 1.1.15 version of that jar.

    ReplyDelete
  11. Thanks you very much, it take's me a lot of time.

    ReplyDelete
  12. Thanks it worked.

    ReplyDelete