3 Replies Latest reply: Mar 15, 2011 5:55 AM by gimbal2 RSS

    Reusable Component Packaging

    846979
      I have successfully packaged a number of custom component 'widgets' in a jar. Some of my widgets are implemented as composite components, and others are implemented as full fledged Java components.

      My problem is that I get repeated errors in my server log similar to *'WARNING: JSF1064: Unable to find or serve resource, jcal.xhtml, from library, comps.'* when a using page includes a Java component.

      The using page renders and acts correctly, it's just the server log message that's an issue. JSF seems to attempt to find the widget using the composite-library-name before seeing (and using)the tag declaration.

      I would like to use the same namespace for all my widgets, regardless of their implementation. Perhaps I can't?

      Mojarra 2.0.4 (FCS b09) deployed in war's WEB-INF/lib to Tomcat 6.0.20 under Java 1.6.0_05

      Following is a snippet of my jar's taglib:
      <facelet-taglib .... version="2.0">
           <namespace>http://dev.jimo.org/jimo</namespace>
           <composite-library-name>comps</composite-library-name>
           <tag>
                <tag-name>jcal</tag-name>
                <component>
           <component-type>jimo.HtmlJCal<;/component-type>
                </component>
           </tag>
      </facelet-taglib>


      Any pointers would be appreciated.

      Thanks,

      Jim
        • 1. Re: Reusable Component Packaging
          gimbal2
          Did you try pasting "JSF1064" into Google? There is a reason why such messages contain an identifying code; this makes it easy to research them.
          • 2. Re: Reusable Component Packaging
            846979
            My first post, so your response is completely valid and appreciated.

            I did look through the first 8 or 10 pages of Google hits. All the java.net urls were dead links, the rest were specific to either servers (glassfish/JBoss) or implementations(Ice/Prime/Rich faces), and of those that I dug into, seemed related to css/js resources that were packaging problems or relative URL issues. The java.net links seem to be functional this morning, so I will go through them.

            Like I said, everything is working, it's just the log warnings that my component consumers are eventually going to be reporting to me...

            It's my first foray into component packaging, so It's quite possible that I'm breaking a rule or missing a config somewhere, so perhaps I should rephrase my question...

            When developing JSF2 widgets for deployment in a jar, do seperate namespaces have to be defined for Facelet composite versus Java code implemented components?

            Thanks,

            Jim
            • 3. Re: Reusable Component Packaging
              gimbal2
              JimO wrote:
              My first post, so your response is completely valid and appreciated.
              You don't have to tell me that. Even if you wouldn't agree with what I said or slanted it as completely outrageous, I couldn't care less. Whatever is said is with helpful intentions, even if your initial response is to be offended. That is your own problem that you choose to do that. If you can deal with honest, direct and sometimes intentionally harsh replies, you'll get plenty of use out of these forums.
              I did look through the first 8 or 10 pages of Google hits. All the java.net urls were dead links, the rest were specific to either servers (glassfish/JBoss) or implementations(Ice/Prime/Rich faces), and of those that I dug into, seemed related to css/js resources that were packaging problems or relative URL issues. The java.net links seem to be functional this morning, so I will go through them.
              Okay. The next time you make a post, be sure to note what you have already tried. Let me put it more plainly: don't post a question for which reading minds / crystal ball reading is required to get all the details.
              Like I said, everything is working, it's just the log warnings that my component consumers are eventually going to be reporting to me...
              Unfortunately, sometimes warnings are logged when they shouldn't be, usually on the wrong log level (warn in stead of trace for example). Often I have seen messages being logged that were kind of "TODO" reminders to the devs of the API in question :/ The only 'solution' is to filter them out.

              >
              It's my first foray into component packaging, so It's quite possible that I'm breaking a rule or missing a config somewhere, so perhaps I should rephrase my question...
              When developing JSF2 widgets for deployment in a jar, do seperate namespaces have to be defined for Facelet composite versus Java code implemented components?
              I can't answer that unfortunately, my knowledge of JSF 2 does not extend into custom widgets yet. The only thing I can advise is to grab a copy of the JSF 2 cookbook (of course, make your boss pay ;) ); it contains articles and examples for everything that JSF 2.0 provides, which includes custom JSF2 widgets (chapter 5). Then you can compare your work with what is documented there.