Announcement Announcement Module
No announcement yet.
OSGifying RichFaces UI Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • OSGifying RichFaces UI

    Hi everyone,

    I'm trying to prepare bundles from RichFaces. SpringSource prepared bundles, but from only 2 out of 3 JARs, namely API and Impl. We need all 3, including UI. So I created bundles, API being host and Impl and UI being fragments. Those bundles resolve OK, my application can deploy.

    But here's my problem, I get:

    javax.faces.FacesException: Expression Error: Named Object: org.richfaces.component.RichMessages not found.
    when I try to launch my application. It's not ClassNotFound, I have all required imports. I've searched the Web for a while, but cannot see any clues. In general this error is generated when an application tries to access an object which is not available (like undeclared managed bean). And I think that this situation is similar, but I have no power over RichFaces and their objects.

    I tried to run the same application (I only added a few JARs into WAR an removed two entries from web.xml) on plain Tomcat and it worked.

    What am I missing, what did I wrong? I'm pretty new to OSGi, and have a feeling I'm stepping right onto a mine if nobody, till now, prepared a bundle of RichFaces UI.

    Best regards

    Jacek Bilski

  • #2
    Hi once again,

    I got a bit further, but most likely in a dirty way. I just attached all 3 RichFaces JARs as fragments to com.springsource.javax.faces. That way all javax.faces.* classes can see RichFaces components. Can anyone tell me is this method bad? How to do that better? Is it possible to do the way I tried earlier, when API was host and Impl and UI were fragments?

    Either way, I got rid of one problem, another came up. org.ajax4jfs.Filter doesn't seem to work. When I look at html source generated from my source I see, that all rich:component tags were parsed and RichFaces did it's job, but there's no linking to JavaScript or CSS in head of my document.

    I see no errors or warnings in log files. What am I missing?

    BTW, I'm using dm Server 2.0.1.RELEASE, javax.faces, facelets 1.1.14, RichFaces 3.3.3.Final.

    Best regards

    Jacek Bilski


    • #3
      I don't have experience of the libraries you are using, but I wonder if the problem is to do with resource loading (rather than class loading) since you are not seeing a class loading exception.

      In general, you may find it beneficial to create a PAR file or a scoped plan to contain your application bundles. That way you can export all the packages from which classes and resources may need to be loaded by the libraries you are using and dm Server will construct a Thread Context Class Loader making all those packages available for loading. It just depends how these libraries are doing their class and resource loading.

      If that doesn't help, please let me know and I'll see if anyone else on the team has direct experience of these libraries.