Karaf
  1. Karaf
  2. KARAF-499

Unable to load simple standalone JSF 2.0 webapp - JSF's implementation's META-INF/*.tld files are not scanned at startup

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.2.0
    • Fix Version/s: 3.0.0
    • Component/s: karaf-webcontainer
    • Labels:
      None
    • Environment:

      windows, linux, java 6

      Activity

      Hide
      Achim Nierbeck added a comment -

      I did some research on this.

      After some refactoring in ops4j pax-web jsp bundle using the same jsp/jsf jars as used within jetty I end up with the exact same issue with a test environment I used.
      It seems to be a "race"-condition for the myfaces servlets. These Servlets need to be configured before they are started.
      I'm still researching how this can be done with pax-web, there is a issue for that at pax-web (http://issues.ops4j.org/browse/PAXWEB-255)

      Show
      Achim Nierbeck added a comment - I did some research on this. After some refactoring in ops4j pax-web jsp bundle using the same jsp/jsf jars as used within jetty I end up with the exact same issue with a test environment I used. It seems to be a "race"-condition for the myfaces servlets. These Servlets need to be configured before they are started. I'm still researching how this can be done with pax-web, there is a issue for that at pax-web ( http://issues.ops4j.org/browse/PAXWEB-255 )
      Hide
      Dan Tran added a comment -

      note: mojara-jsf implementation also has the same issue

      Show
      Dan Tran added a comment - note: mojara-jsf implementation also has the same issue
      Hide
      Achim Nierbeck added a comment -

      I'm trying to fix pax-web for this, right now I do have the following, I do get a rendering of a jsf page but the evaluation of javax.el doesn't work right now because of classloader issues regarding the implementation of it, in this case it is com.sun.el.*.
      Revision https://github.com/ops4j/org.ops4j.pax.web/commit/fcb4d66ceb463633ca0547dc1d18c671cf98b0dc of pax-web does show this.
      So I'm still working on this

      Show
      Achim Nierbeck added a comment - I'm trying to fix pax-web for this, right now I do have the following, I do get a rendering of a jsf page but the evaluation of javax.el doesn't work right now because of classloader issues regarding the implementation of it, in this case it is com.sun.el.*. Revision https://github.com/ops4j/org.ops4j.pax.web/commit/fcb4d66ceb463633ca0547dc1d18c671cf98b0dc of pax-web does show this. So I'm still working on this
      Hide
      Dan Tran added a comment -

      awesome, thank you so much for looking into this issue.

      Show
      Dan Tran added a comment - awesome, thank you so much for looking into this issue.
      Hide
      Achim Nierbeck added a comment -

      Looks good now, will port it into pax-web 1.0.2, the only "downside" right now the using bundle needs to import com.sun.el since this is the implementing provider for javax.el.
      Both packages are going to be exported by pax-web jsp bundle.

      Show
      Achim Nierbeck added a comment - Looks good now, will port it into pax-web 1.0.2, the only "downside" right now the using bundle needs to import com.sun.el since this is the implementing provider for javax.el. Both packages are going to be exported by pax-web jsp bundle.
      Hide
      Dan Tran added a comment -

      Cool, let me know when I can use latest Karaf to pick up this change. Also, the monolithic webapp ( war file ) should work right?. It will take me sometime to break my webapp into bundles

      Show
      Dan Tran added a comment - Cool, let me know when I can use latest Karaf to pick up this change. Also, the monolithic webapp ( war file ) should work right?. It will take me sometime to break my webapp into bundles
      Hide
      Achim Nierbeck added a comment -

      OK, looks good for me right now, the latest snapshot versions of Karaf 2.2.1-SNAPSHOT and 2.99.99-SNAPSHOT should work now.
      Could you please make a try with it?

      Show
      Achim Nierbeck added a comment - OK, looks good for me right now, the latest snapshot versions of Karaf 2.2.1-SNAPSHOT and 2.99.99-SNAPSHOT should work now. Could you please make a try with it?
      Hide
      Dan Tran added a comment -

      I dropped myfaces example war file mention in this issue. I dont see the issue with loading any more. However the first page show this

      "<%@ page session="false"%> <% response.sendRedirect("home.jsf"); %>"

      which is not expected.

      Show
      Dan Tran added a comment - I dropped myfaces example war file mention in this issue. I dont see the issue with loading any more. However the first page show this "<%@ page session="false"%> <% response.sendRedirect("home.jsf"); %>" which is not expected.
      Hide
      Dan Tran added a comment -

      Just want to make sure my build is not the problem, could you deploy a snapshot to test with?

      Show
      Dan Tran added a comment - Just want to make sure my build is not the problem, could you deploy a snapshot to test with?
      Hide
      Achim Nierbeck added a comment -

      The current trunk of pax-web contains samples one of them is a war-jsf sample. You can take a look at that.
      There is also a integration test testing this. This might help you too to find out.
      Do you have any special servlet configuration for "/"? Cause it seems to me that your page isn't rendered but straight send to your browser,
      as if a servlet is waiting to provide everything from "/"

      Show
      Achim Nierbeck added a comment - The current trunk of pax-web contains samples one of them is a war-jsf sample. You can take a look at that. There is also a integration test testing this. This might help you too to find out. Do you have any special servlet configuration for "/"? Cause it seems to me that your page isn't rendered but straight send to your browser, as if a servlet is waiting to provide everything from "/"
      Hide
      Dan Tran added a comment -

      I am current having problems build both karaf's trunk and karaf' 2.2.x branch. Will try to test again

      Show
      Dan Tran added a comment - I am current having problems build both karaf's trunk and karaf' 2.2.x branch. Will try to test again
      Hide
      Achim Nierbeck added a comment -

      Oh, one other thing though,
      the test that worked did work with myfaces in version 1.2.9.
      I did try with your "sample" app, that one doesn't seem to work. I looks to me like this might be because it needs servlet api 3.0?
      Right now pax-web only supports servlet api in version 2.5.
      I planned to work on 3.0 with integration of Jetty 8 which will be in version 2.0 of Pax-web.

      Show
      Achim Nierbeck added a comment - Oh, one other thing though, the test that worked did work with myfaces in version 1.2.9. I did try with your "sample" app, that one doesn't seem to work. I looks to me like this might be because it needs servlet api 3.0? Right now pax-web only supports servlet api in version 2.5. I planned to work on 3.0 with integration of Jetty 8 which will be in version 2.0 of Pax-web.
      Hide
      Dan Tran added a comment -

      my sample comes from myface 2.0.3 implementation which does not require servlet 3.0. And I dont think it uses servlet 3.0 either

      Show
      Dan Tran added a comment - my sample comes from myface 2.0.3 implementation which does not require servlet 3.0. And I dont think it uses servlet 3.0 either
      Hide
      Achim Nierbeck added a comment -

      Karaf 2.2.1-SNAPSHOT now contains Pax Web 1.0.2 which supports JSF better.

      Show
      Achim Nierbeck added a comment - Karaf 2.2.1-SNAPSHOT now contains Pax Web 1.0.2 which supports JSF better.
      Hide
      Michael Van Geertruy added a comment -

      Achim, is JIRA fixed now?

      Show
      Michael Van Geertruy added a comment - Achim, is JIRA fixed now?
      Hide
      Dan Tran added a comment -

      I downloaded teh latest apache-karaf 2.2.1-SNAPSHOT deployed on 4/15. However, the karaf' pax-web itself has issue:

      20:19:39,249 | ERROR | g.ops4j.pax.web) | configadmin | ? ? | 5 - org.apache.felix.configadmin - 1.2.8 | [org.osgi.service.cm.ManagedService, id=174, bundle=56]: Unexpected problem updating Configuration PID=org.ops4j.pax.web, factoryPID=null, b
      undleLocation=mvn:org.ops4j.pax.web/pax-web-runtime/1.0.2
      java.lang.NoSuchMethodError: org.eclipse.jetty.xml.XmlConfiguration.configure(Ljava/lang/Object;)V
      at org.ops4j.pax.web.service.jetty.internal.JettyServerImpl.start(JettyServerImpl.java:89)
      at org.ops4j.pax.web.service.jetty.internal.ServerControllerImpl$Stopped.start(ServerControllerImpl.java:356)
      at org.ops4j.pax.web.service.jetty.internal.ServerControllerImpl.start(ServerControllerImpl.java:67)
      at org.ops4j.pax.web.service.jetty.internal.ServerControllerImpl$Started.configure(ServerControllerImpl.java:261)
      at org.ops4j.pax.web.service.jetty.internal.ServerControllerImpl.configure(ServerControllerImpl.java:84)

      Achim, could you give it a try by deploy the mention myface 2.x example ?

      Show
      Dan Tran added a comment - I downloaded teh latest apache-karaf 2.2.1-SNAPSHOT deployed on 4/15. However, the karaf' pax-web itself has issue: 20:19:39,249 | ERROR | g.ops4j.pax.web) | configadmin | ? ? | 5 - org.apache.felix.configadmin - 1.2.8 | [org.osgi.service.cm.ManagedService, id=174, bundle=56] : Unexpected problem updating Configuration PID=org.ops4j.pax.web, factoryPID=null, b undleLocation=mvn:org.ops4j.pax.web/pax-web-runtime/1.0.2 java.lang.NoSuchMethodError: org.eclipse.jetty.xml.XmlConfiguration.configure(Ljava/lang/Object;)V at org.ops4j.pax.web.service.jetty.internal.JettyServerImpl.start(JettyServerImpl.java:89) at org.ops4j.pax.web.service.jetty.internal.ServerControllerImpl$Stopped.start(ServerControllerImpl.java:356) at org.ops4j.pax.web.service.jetty.internal.ServerControllerImpl.start(ServerControllerImpl.java:67) at org.ops4j.pax.web.service.jetty.internal.ServerControllerImpl$Started.configure(ServerControllerImpl.java:261) at org.ops4j.pax.web.service.jetty.internal.ServerControllerImpl.configure(ServerControllerImpl.java:84) Achim, could you give it a try by deploy the mention myface 2.x example ?
      Hide
      Achim Nierbeck added a comment -

      strange didn't see that issue before, have to take a look.

      The thing about myfaces 2.0 it doesn't work right now, but I don't know how to solve that right now.
      So I guess with 2.2.1 we only get myfaces 1 to work and 3.0 might be able to support myfaces 2

      Show
      Achim Nierbeck added a comment - strange didn't see that issue before, have to take a look. The thing about myfaces 2.0 it doesn't work right now, but I don't know how to solve that right now. So I guess with 2.2.1 we only get myfaces 1 to work and 3.0 might be able to support myfaces 2
      Hide
      Chris Dolan added a comment -

      Belated reply to Dan regarding the "NoSuchMethodError: org.eclipse.jetty.xml.XmlConfiguration.configure(Ljava/lang/Object;)V"

      This is a Jetty 7.3.1 regression, which changed the signature of the configure() method. You get this error when you compile against Jetty 7.3.0 or older and run against Jetty 7.3.1 or newer.

      See these for a little more information:
      http://jira.codehaus.org/browse/JETTY-1331
      http://ops4j1.jira.com/browse/PAXWEB-278

      Show
      Chris Dolan added a comment - Belated reply to Dan regarding the "NoSuchMethodError: org.eclipse.jetty.xml.XmlConfiguration.configure(Ljava/lang/Object;)V" This is a Jetty 7.3.1 regression, which changed the signature of the configure() method. You get this error when you compile against Jetty 7.3.0 or older and run against Jetty 7.3.1 or newer. See these for a little more information: http://jira.codehaus.org/browse/JETTY-1331 http://ops4j1.jira.com/browse/PAXWEB-278
      Hide
      Jean-Baptiste Onofré added a comment -

      We updated Karaf to use a new Jetty version. A new test should be perform to see if the issue is still there or not.

      Show
      Jean-Baptiste Onofré added a comment - We updated Karaf to use a new Jetty version. A new test should be perform to see if the issue is still there or not.
      Hide
      Raúl Kripalani added a comment -

      This has been solved in PAX Web:

      Regarding TLDs:

      JSF2 classloading specifics:

      Additionally, specific to MyFaces: https://issues.apache.org/jira/browse/MYFACES-3356.

      Tested with MyFaces 2.1.x, Tomahawk, Primefaces. Please let me know if you find any issues.

      Beware that you need to add the StartupServletContextListener listener to web.xml if you are using MyFaces. Additionally, if you are using Facelets you will need to specify your -taglib.xml files under the facelets.LIBRARIES context parameter (see http://shrubbery.mynetgear.net/c/display/W/Using+taglibs+with+Facelets).

      If your -taglib.xml files are located in imported bundles, you can use the classpath: URL from PAX URL, making sure that the bundle that provides this functionality is assigned a start-level lower than the ordinary start level. Start level 5 works well.

      Regards,
      Raúl.

      Show
      Raúl Kripalani added a comment - This has been solved in PAX Web: Regarding TLDs: http://team.ops4j.org/browse/PAXWEB-86 http://team.ops4j.org/browse/PAXWEB-130 JSF2 classloading specifics: http://team.ops4j.org/browse/PAXWEB-310 Additionally, specific to MyFaces: https://issues.apache.org/jira/browse/MYFACES-3356 . Tested with MyFaces 2.1.x, Tomahawk, Primefaces. Please let me know if you find any issues. Beware that you need to add the StartupServletContextListener listener to web.xml if you are using MyFaces. Additionally, if you are using Facelets you will need to specify your -taglib.xml files under the facelets.LIBRARIES context parameter (see http://shrubbery.mynetgear.net/c/display/W/Using+taglibs+with+Facelets ). If your -taglib.xml files are located in imported bundles, you can use the classpath: URL from PAX URL, making sure that the bundle that provides this functionality is assigned a start-level lower than the ordinary start level. Start level 5 works well. Regards, Raúl.
      Hide
      Achim Nierbeck added a comment -

      this is fixed since switch to pax-web 2.0.0-SNAPSHOT

      Show
      Achim Nierbeck added a comment - this is fixed since switch to pax-web 2.0.0-SNAPSHOT
      Hide
      Achim Nierbeck added a comment -

      resolved with switching to pax web 2.0.0 line

      Show
      Achim Nierbeck added a comment - resolved with switching to pax web 2.0.0 line

        People

        • Assignee:
          Achim Nierbeck
          Reporter:
          Dan Tran
        • Votes:
          0 Vote for this issue
          Watchers:
          1 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved:

            Development