Announcement Announcement Module
Collapse
No announcement yet.
myFaces (Jsf) and Class.forName ...Does It Work in an OSGI env? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • myFaces (Jsf) and Class.forName ...Does It Work in an OSGI env?

    hi all,

    one question: is the following code supposed to work in an osgi environment?

    from myfaces-1.1.5 FacesConfigurator#getApplicationObject
    .
    .
    // com.springsource.org.apache.myfaces-1.1.5.jar loading NavigationHandlerImpl from trinidad bundle
    Class implClass = Class.forName("org.apache.myfaces.trinidadinternal .application.NavigationHandlerImpl",
    false, Thread.currentThread().getContextClassLoader());
    .
    .
    // javax.faces.application.NavigationHandler.class loaded from com.springsource.org.apache.myfaces.javax.faces-1.1.5
    if (NavigationHandler.class.isAssignableFrom(implClas s)) {
    // THIS condition is never true/fulfilled !
    }
    .
    .


    ////////////
    corresponding MANIFEST.MF for jsf web module
    ////////////
    Manifest-Version: 1.0
    Bundle-Name: Web Bundle
    Bundle-SymbolicName: org.faces.web
    Bundle-Version: 1.0.0
    Import-Package: org.faces.domain,
    org.faces.service
    Import-Bundle: com.springsource.javax.persistence;version="[1.0.0,1.0.0]",
    com.springsource.org.apache.myfaces;version="[1.1.5,1.1.5]",
    com.springsource.org.apache.myfaces.javax.faces;ve rsion="[1.1.5,1.1.5]",
    org.apache.myfaces.orchestra.myfaces-orchestra-core;version="[1.2.0.SNAPSHOT,1.2.0.SNAPSHOT]",
    org.apache.myfaces.trinidad.trinidad-impl;version="[1.0.8.SNAPSHOT,1.0.8.SNAPSHOT]",
    com.springsource.com.sun.facelets;version="[1.1.14,1.1.14]",
    com.springsource.org.apache.commons.el;version="[1.0.0,1.0.0]"
    Import-Library: org.springframework.spring;version="[2.5.4.A, 2.5.4.A]"
    Platform-ModuleType: Web
    Web-WelcomeFiles: index.html
    Web-ContextPath: facesgoodies
    Web-SessionTimeout: 5
    Web-ContextParams: javax.faces.DEFAULT_SUFFIX;param-value:=".xhtml",
    facelets.DEVELOPMENT;param-value:="true",
    facelets.LIBRARIES;param-value:="/WEB-INF/mw.taglib.xml",
    org.apache.myfaces.trinidad.ENABLE_LIGHTWEIGHT_DIA LOGS;param-value:="true",
    org.apache.myfaces.trinidad.CHANGE_PERSISTENCE;par am-value:="session",
    org.apache.myfaces.trinidad.ALTERNATE_VIEW_HANDLER ;param-value:="com.sun.facelets.FaceletViewHandler",
    javax.faces.STATE_SAVING_METHOD;param-value:="client"
    Web-Servlets: FacesServlet;servlet-class:="org.apache.myfaces.webapp.MyFacesServlet";
    load-on-startup:="1";url-patterns:="*.xhtml",
    resources;servlet-class:="org.apache.myfaces.trinidad.webapp.Resourc eServlet";
    load-on-startup:="2";url-patterns:="/adf/*"
    Web-FilterMappings: orchestraFilter;url-patterns:="*.xhtml",
    trinidadFilter;url-patterns:="*.xhtml",
    requestContextFilter;url-patterns:="*.xhtml",



    thx
    m

  • #2
    myFaces (Jsf) and Class.forName ...Does It Work in an OSGI env?

    do i have to package myfaces,trinidad and facelets into one library so that they can 'see' each other?

    thx m

    Comment


    • #3
      myFaces (Jsf) and Class.forName ...Does It Work in an OSGI env?

      It should be fine to package myfaces, trindad and facelets as separate bundles. The use of Class.forName() may cause a problem, but it seems that the thread context classloader is being used, so I would expect the class to be loaded correctly.

      Can you create a JIRA and attach a simple failing case for us to check?

      Regards,

      Rob

      Comment


      • #4
        myFaces (Jsf) and Class.forName ...Does It Work in an OSGI env?

        hi rob,

        thx for your answer...one more question..do you know any issues/problem with Class#isAssignableFrom testing 2 classes coming from different classloaders?

        thx
        m

        Comment

        Working...
        X