0 Replies Latest reply on May 4, 2006 6:32 PM by Sudhir Chandekar

    Configuring JBoss Seam with Sun RI Impl

    Sudhir Chandekar Newbie

      Hi,

      I am facing problems in configuring Seam to work with Sun RI and some other custom JSF components
      Please excuse for the length of the description, but cannot help

      The following is my configuration
      1) jboss-4.0.4.CR2 with EJB3
      2) jboss-seam-1.0.0.CR2
      3) Sun RI
      4) Tomahawk Myfaces extension
      5) Facelets
      6) Exadel VCP JSF components
      7) win XP

      I configured jboss to use Sun RI instead of Myfaces as per the following link
      http://weblogs.java.net/blog/ddevore/archive/2006/01/how_to_setup_jb_1.html

      I am able to use the above link to successfully use Sun RI with all my Components in JBoss AS without issues if I am not using Seam.

      I am modifying the sample registration application and ensured that I have a valid seam.properties in my EJB-JAR root.
      I have removed the original EJBs and the persistence.xml as I dont need them as of now.
      All the dependent jars for the above components are packaged in WEB-INF/lib. Ensured that all the EJBs have proper annotations
      especially @Name
      To track whether the EJBs are loading correctly and only once, I put Sysouts in a Static Block printing the ClassLoader as well as
      in the constructor

      The following are the approaches and the problems I face.

      Approach 1:
      All my EJB are packaged in the EJB Jar and jboss-seam.jar is packaged along with EJB-jar in the EAR file. This is the default approach.

      Result:
      I get an Exception during the Deployment which states

      ,java.math.BigInteger)
      18:16:39,515 ERROR [STDERR] java.lang.ClassNotFoundException: org.jboss.seam.jsf
      .SeamPhaseListener
      18:16:39,578 ERROR [STDERR] at org.apache.catalina.loader.WebappClassLoader.
      loadClass(WebappClassLoader.java:1352)
      18:16:39,640 ERROR [STDERR] at org.apache.catalina.loader.WebappClassLoader.
      loadClass(WebappClassLoader.java:1198)
      18:16:39,687 ERROR [STDERR] at com.sun.faces.util.Util.loadClass(Util.java:4
      06)
      18:16:39,750 ERROR [STDERR] at com.sun.faces.config.ConfigureListener.config
      ure(ConfigureListener.java:710)


      Approach 2:

      Same as 1 except jboss-seam.jar (which contains the SeamPhaseListener) is also packaged inside the WEB-INF/lib of the war

      Result:

      The page loads as empty from the location where reference is first made to the EJB/ManagedBean.
      I am not getting any SYSOUTs suggessting that an attempt to load the EJBs was made.

      The following are the Errors from the JBOSS Log

      18:01:23,109 ERROR [STDERR] May 4, 2006 6:01:23 PM com.sun.facelets.compiler.Tag
      LibraryConfig loadImplicit
      INFO: Added Library from: jar:file:/C:/jboss-4.0.4.CR2/server/default/tmp/deploy
      /tmp59820jboss-seam-registration.ear-contents/jboss-seam-registration-exp.war/WE
      B-INF/lib/vcp-faces.jar!/META-INF/vcp.taglib.xml
      18:01:23,156 ERROR [STDERR] May 4, 2006 6:01:23 PM com.sun.facelets.compiler.Tag
      LibraryConfig loadImplicit
      ............

      Approch 3:
      Using the JBossWebLoader to load all the dependencies.

      I configured the jboss-4.0.4.CR2\server\default\deploy\jbossweb-tomcat55.sar\META-INF\jboss-service.xml as

      Java2ClassLoadingCompliance - true
      UseJBossWebLoader - true

      Result

      There are no Deployment Errors as in case of 1 nor any Taglib errors as in case of 2. But
      the page just does not get rendered and the JBoss Log does not move ahead.
      Also, no SYSOUTs indicating any attempts to load the EJBs
      However, on killing the Server with ^C, I get some NPE which reads

      Stacktrace:
      org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:504)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      com.exadel.vcp.framework.ajax.xmlfilter.TidyFilter.doXmlFilter(Unknown Source)
      com.exadel.vcp.framework.ajax.xmlfilter.BaseFilter.doFilter(Unknown Source)
      org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)


      root cause

      java.lang.NullPointerException
      javax.faces.component.UIComponentBase.getRenderer(UIComponentBase.java:1070)
      javax.faces.component.UIComponentBase.getClientId(UIComponentBase.java:252)
      com.exadel.vcp.framework.DebugOutputMaker.writeComponent(Unknown Source)
      com.exadel.vcp.framework.DebugOutputMaker.writeComponentsTree(Unknown Source)
      com.exadel.vcp.framework.DebugOutputMaker.writeErrorMessage(Unknown Source)
      com.exadel.vcp.framework.DebugLifecycle.execute(Unknown Source)
      javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
      org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:703)




      Has some body tested Seam to be working with SUN RI
      Also, I found a couple of dependencies in Seam UI code for MyFaces pertaining to some custom taglibs, but shud not matter
      here since none of that functionality is used here.

      Is there any specific configuration or annotation pertaining to the Class Loading that I am missing or
      is it purely because of SUN RI being used here.

      Thanks for your patience for reading this and please help with the needful