webtier@glassfish.java.net

JSF 2.0: MalformedURLException in FaceletTaglibConfigProcessor

From: <webtier_at_javadesktop.org>
Date: Wed, 31 Dec 2008 17:22:47 PST

The platform is Glassfish v2. I have Mojarra-2.0.0-PR set up (stuff done in https://javaserverfaces.dev.java.net/nonav/rlnotes/2.0.0/releasenotes.html), changes made to web.xml and faces-config.xml as per the JSF 2.0 spec. I have tested the app, including my Facelets tags, fully under JSF 1.2; conversely, I'm satisfied that the JSF 2.0 JARs are being picked up because I am using stuff like @ManagedBean.

However, I am having a devil of a time figuring out where to put the taglib.xml when not using a JAR, and when I do use a JAR I get a MalformedURLEXception at line 382 of FaceletTaglibConfigProcessor, namely

URL url = new URL(new URL(docURI), s);

in method "processSource". Actually, I can make the exception go away by commenting out a tag which uses <tag><tag-name>blah</tag-name><source>whatever</source></tag>; once that's done the app deploys fine, and since I've now also modified one page to not use that tag, I know the taglib works in general because a function which is also defined in that taglib is working OK.

So presumably the problem here, when the taglib is in a JAR (the taglib.xml in the META-INF), has to do with the contents of the <source> tag. I've tried pretty much everything known to man for the contents of that tag, and I still get MalformedURLException. For sake of argument, if I have a tag XML called blah.xml at the top-level of the JAR, what should <source> be?

<source>blah.xml</source>
<source>./blah.xml</source>
<source>/blah.xml</source>
<source>../blah.xml</source>

I've tried 'em all...

The other issue is this. Let's say that with the Facelets taglib.xml that passes inspection (I've left the offending tag commented out) I now remove the JAR from my app libraries, and try the web.xml way of specifying where it is, with javax.faces.LIBRARIES. My understanding from the spec is that if my ahs.taglib.xml is at {WEBROOT}/facelets/ahs.taglib.xml, that for this configuration parameter I set

facelets/ahs.taglib.xml

Neither this nor any other location I've used so far has caused JSF 2.0 to locate the taglib.xml. It can deal with the JAR method but not with this.

Any suggestions welcome.

Arved Sandstrom
[Message sent by forum member 'arveds' (arveds)]

http://forums.java.net/jive/thread.jspa?messageID=323753