2 Replies Latest reply on Dec 3, 2010 5:50 AM by asiandub

    Experience with JBoss 6 CR1, Weld and Seam 3

    oranheim

      Hi all,


      Many thanks to the JBoss team for releasing JBoss 6 CR1. It has been long awaited!


      I assume I'm not alone feeling held back by being dependent on JBoss M4 and old Weld/Seam modules, hence we wish to get our dependencies upgraded. After upgrading my dependencies to CR1 and a little tweaking - I almost got my app working.


      Here's what I've experienced so far.


      My app depends on (WEB-INF/lib):



      • commons-beanutils-1.8.0.jar

      • commons-codec-1.3.jar

      • commons-digester-2.0.jar

      • commons-fileupload-1.2.1.jar

      • commons-io-1.4.jar

      • commons-lang-2.4.jar

      • dom4j-1.6.1-brew.jar

      • httpclient-4.0.1.jar

      • httpcore-4.0.1.jar

      • joda-time-1.6.jar

      • prettyfaces-jsf2-3.1.0.jar

      • primefaces-2.2.RC1.jar

      • seam-faces-3.0.0.Beta1.jar

      • seam-faces-api-3.0.0.Beta1.jar

      • seam-international-3.0.0.Alpha2.jar

      • seam-international-api-3.0.0.Alpha2.jar

      • seam-remoting-core-3.0.0-Beta1.jar

      • seam-rest-3.0.0.Alpha1.jar

      • seam-rest-api-3.0.0.Alpha1.jar

      • seam-xml-config-3.0.0.Alpha3.jar

      • weld-extensions-1.0.0.Beta1.jar



      This is what I bumbed into:


      1) @Inject Logger (SLF4J)


      Weld complains about not finding any default injection point for Logger object.


      Workaround: make a producer method for log instances. Why doesn't @Inject Logger work by default?


      @Produces
      public Logger produceLog(InjectionPoint injectionPoint) {
           return LoggerFactory.getLogger(injectionPoint.getMember().getDeclaringClass().getName());
      }
      




      2) Seam International was not able to parse META-INF/seam-beans.xml at line s:specializes element.



      <beans xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:s="urn:java:seam:core" 
         xmlns:i18n="urn:java:org.jboss.seam.international.locale"
         xsi:schemaLocation="
            http://java.sun.com/xml/ns/javaee 
            http://docs.jboss.org/cdi/beans_1_0.xsd">
      
         <!-- Try out i18n support by changing defaultLocaleKey to de 
         <i18n:DefaultLocaleProducer>
            <s:specializes />
            <i18n:defaultLocaleKey>en_US</i18n:defaultLocaleKey>
         </i18n:DefaultLocaleProducer>
         -->
      </beans>
      



      Workaround: comment out the default locale producer. This of course is not a solution to the problem, but it won't break your deployment. I have configured a default locale mapping in web.xml and it looks like it's respected.



      3) Seam Remoting is broken


      JBoss won't load Seam Remoting Servlet, with exception:



      13:39:14,538 INFO  [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/parts]] Marking servlet Remoting Servlet as unavailable
      13:39:14,539 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/parts]] Servlet /parts threw load() exception: java.lang.ClassNotFoundException: org.jboss.weld.context.api.BeanStore from BaseClassLoader@4177fc5c{vfs:///opt/jboss-6.0.0.20101110-CR1/server/default/deploy/eris.war}
           at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:480) [jboss-classloader.jar:2.2.0.Alpha9]
           at java.lang.ClassLoader.loadClass(ClassLoader.java:248) [:1.6.0_22]
           at java.lang.Class.getDeclaredConstructors0(Native Method) [:1.6.0_22]
           at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389) [:1.6.0_22]
           at java.lang.Class.getConstructor0(Class.java:2699) [:1.6.0_22]
           at java.lang.Class.getDeclaredConstructor(Class.java:1985) [:1.6.0_22]
      (...cut...)
      



      4) java.lang.ClassNotFoundException: javax.portlet.ActionRequest from BaseClassLoader@


      I have this strange error shouting that BaseClassLoader is not able to find javax.portlet.ActionRequest. My code does not, nor depend on, any calls to portlet/ActionRequest. So I suspect the root cause must be somewhere in my dependencies (listed above). Has anyone else seen this error?


      Click here to see full stacktrace.

      Hi all,


      Many thanks to the JBoss team for releasing JBoss 6 CR1. It has been long awaited!


      I assume I'm not alone feeling held back by being dependent on JBoss M4 and old Weld/Seam modules, hence we wish to get our dependencies upgraded. After upgrading my dependencies to CR1 and a little tweaking - I almost got my app working.


      Here's what I've experienced so far.


      My app depends on (WEB-INF/lib):



      • commons-beanutils-1.8.0.jar

      • commons-codec-1.3.jar

      • commons-digester-2.0.jar

      • commons-fileupload-1.2.1.jar

      • commons-io-1.4.jar

      • commons-lang-2.4.jar

      • dom4j-1.6.1-brew.jar

      • httpclient-4.0.1.jar

      • httpcore-4.0.1.jar

      • joda-time-1.6.jar

      • prettyfaces-jsf2-3.1.0.jar

      • primefaces-2.2.RC1.jar

      • seam-faces-3.0.0.Beta1.jar

      • seam-faces-api-3.0.0.Beta1.jar

      • seam-international-3.0.0.Alpha2.jar

      • seam-international-api-3.0.0.Alpha2.jar

      • seam-remoting-core-3.0.0-Beta1.jar

      • seam-rest-3.0.0.Alpha1.jar

      • seam-rest-api-3.0.0.Alpha1.jar

      • seam-xml-config-3.0.0.Alpha3.jar

      • weld-extensions-1.0.0.Beta1.jar



      This is what I bumbed into:


      1) @Inject Logger (SLF4J)


      Weld complains about not finding any default injection point for Logger object.


      Workaround: make a producer method for log instances. Why doesn't @Inject Logger work by default?


      @Produces
      public Logger produceLog(InjectionPoint injectionPoint) {
           return LoggerFactory.getLogger(injectionPoint.getMember().getDeclaringClass().getName());
      }
      




      2) Seam International was not able to parse META-INF/seam-beans.xml at line s:specializes element.



      <beans xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:s="urn:java:seam:core" 
         xmlns:i18n="urn:java:org.jboss.seam.international.locale"
         xsi:schemaLocation="
            http://java.sun.com/xml/ns/javaee 
            http://docs.jboss.org/cdi/beans_1_0.xsd">
      
         <!-- Try out i18n support by changing defaultLocaleKey to de 
         <i18n:DefaultLocaleProducer>
            <s:specializes />
            <i18n:defaultLocaleKey>en_US</i18n:defaultLocaleKey>
         </i18n:DefaultLocaleProducer>
         -->
      </beans>
      



      Workaround: comment out the default locale producer. This of course is not a solution to the problem, but it won't break your deployment. I have configured a default locale mapping in web.xml and it looks like it's respected.



      3) Seam Remoting is broken


      JBoss won't load Seam Remoting Servlet, with exception:



      13:39:14,538 INFO  [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/parts]] Marking servlet Remoting Servlet as unavailable
      13:39:14,539 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/parts]] Servlet /parts threw load() exception: java.lang.ClassNotFoundException: org.jboss.weld.context.api.BeanStore from BaseClassLoader@4177fc5c{vfs:///opt/jboss-6.0.0.20101110-CR1/server/default/deploy/eris.war}
           at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:480) [jboss-classloader.jar:2.2.0.Alpha9]
           at java.lang.ClassLoader.loadClass(ClassLoader.java:248) [:1.6.0_22]
           at java.lang.Class.getDeclaredConstructors0(Native Method) [:1.6.0_22]
           at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389) [:1.6.0_22]
           at java.lang.Class.getConstructor0(Class.java:2699) [:1.6.0_22]
           at java.lang.Class.getDeclaredConstructor(Class.java:1985) [:1.6.0_22]
      (...cut...)
      



      4) java.lang.ClassNotFoundException: javax.portlet.ActionRequest from BaseClassLoader@


      I have this strange error shouting that BaseClassLoader is not able to find javax.portlet.ActionRequest. My code does not, nor depend on, any calls to portlet/ActionRequest. So I suspect the root cause must be somewhere in my dependencies (listed above). Has anyone else seen this error?


      Click here to see full stacktrace.




      If you don't need Seam Remoting, just should be able to move on to JBoss 6 CR1.


      Are there any changes to the seam-beans.xml configuration with respect to i18n?


      It would be great if the JBoss team could provide upgraded modules for Weld Extensions (JBoss6 CR1 uses Weld Core 1.1.0.Beta2, whereas Weld Extensions 1.0.0.Beta1 is built for Weld Core 1.1.0.Beta1).


      I probably should post this question in the Seam 3 forum, but what's the current story around Seam 3 and Faces? Please share an updated status.


      Ove

        • 1. Re: Experience with JBoss 6 CR1, Weld and Seam 3
          asiandub

          thanks for starting this thread!


          I ran into the same issue with @Inject Logger



          Workaround: make a producer method for log instances. Why doesn't @Inject Logger work by default?


          As far as I can see, WELDX changed from SL4J-Logger to JBoss-Logger. I haven't investigated into JBoss-Logging yet, but it's kind of obvious that @Produces doesn't work anymore :-(


          I had some minor issues with API-changes (new: BeanManager.getBeanManager()), fix is obvious.


          What I haven't been able to resolve is the following exception:



          Exception sending context initialized event to listener instance of class org.jboss.weld.integration.webtier.jsp.JspInitializationListener: java.lang.LinkageError: loader constraint violation: when resolving interface method javax.enterprise.inject.spi.BeanManager.getELResolver()Ljavax/el/ELResolver; the class loader (instance of org/jboss/classloader/spi/base/BaseClassLoader) of the current class, org/jboss/weld/integration/webtier/jsp/JspInitializationListener, and the class loader (instance of org/jboss/classloader/spi/base/BaseClassLoader) for resolved class, javax/enterprise/inject/spi/BeanManager, have different Class objects for the type javax/el/ELResolver used in the signature


          More Stacktrace:


          10:37:36,026 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/marketmap]] Exception sending context initialized event to listener instance of class org.jboss.weld.integration.webtier.jsp.JspInitializationListener: java.lang.LinkageError: loader constraint violation: when resolving interface method javax.enterprise.inject.spi.BeanManager.getELResolver()Ljavax/el/ELResolver; the class loader (instance of org/jboss/classloader/spi/base/BaseClassLoader) of the current class, org/jboss/weld/integration/webtier/jsp/JspInitializationListener, and the class loader (instance of org/jboss/classloader/spi/base/BaseClassLoader) for resolved class, javax/enterprise/inject/spi/BeanManager, have different Class objects for the type javax/el/ELResolver used in the signature
               at org.jboss.weld.integration.webtier.jsp.JspInitializationListener.contextInitialized(JspInitializationListener.java:86) [:6.0.0.20101110-CR1]
               at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3369) [:6.0.0.20101110-CR1]
               at org.apache.catalina.core.StandardContext.start(StandardContext.java:3828) [:6.0.0.20101110-CR1]
               at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:312) [:6.0.0.20101110-CR1]
               at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:149) [:6.0.0.20101110-CR1]
               at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461) [:6.0.0.20101110-CR1]
               at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118) [:6.0.0.20101110-CR1]
               at org.jboss.web.deployers.WebModule.start(WebModule.java:95) [:6.0.0.20101110-CR1]



          Any ideas greatly appreciated :-)


          cheers,


          jan

          • 2. Re: Experience with JBoss 6 CR1, Weld and Seam 3
            asiandub

            I solved the classloading exception - turned out that it was a dependency issue between el-api (WELDX) and jboss-el-api(provided).


            Hope it helps others :-)


            Cheers,


            Jan