2 Replies Latest reply on Nov 2, 2009 11:28 AM by Thomas Goettlich

    Using JBoss EL without SEAM

    Thomas Goettlich Novice

      Hi,


      I want to use JBoss EL in our web application without incorporating SEAM completely.
      (I'm currently evaluating SEAM for our projects btw. :) ).


      I was quite successful but now I had to change my app to use an isolated classloader (in order to use an updated hibernate version).
      Now I'm getting errors like this:




      22:01:28,022 ERROR [config] Unable to instantiate ExpressionFactory 'org.jboss.el.ExpressionFactoryImpl'
      22:01:28,085 ERROR [[/interpraesent]] Exception sending context initialized event to listener instance of class org.jboss.web.jsf.integration.config.J
      BossJSFConfigureListener
      com.sun.faces.config.ConfigurationException: It appears the JSP version of the container is older than 2.1 and unable to locate the EL RI expression f
      actory, com.sun.el.ExpressionFactoryImpl.  If not using JSP or the EL RI, make sure the context initialization parameter, com.sun.faces.expressionFact
      ory, is properly set.
              at com.sun.faces.config.ConfigureListener.registerELResolverAndListenerWithJsp(ConfigureListener.java:545)
              at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:211)
              at org.jboss.web.jsf.integration.config.JBossJSFConfigureListener.contextInitialized(JBossJSFConfigureListener.java:71)
              at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3856)
              at org.apache.catalina.core.StandardContext.start(StandardContext.java:4361)
              at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:790)
              at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:770)
              at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:553)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:585)
              at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:296)
              at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
              at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
              at org.apache.catalina.core.StandardContext.init(StandardContext.java:5312)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:585)
              at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:296)
              at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
              at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
              at org.jboss.web.tomcat.service.TomcatDeployer.performDeployInternal(TomcatDeployer.java:301)
              at org.jboss.web.tomcat.service.TomcatDeployer.performDeploy(TomcatDeployer.java:104)
              at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:375)
              at org.jboss.web.WebModule.startModule(WebModule.java:83)
              at org.jboss.web.WebModule.startService(WebModule.java:61)
              at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
              at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
              at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:585)
              at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
              at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
              at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
              at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
              at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
              at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
              ...|



      Before I used the isolated classloader, I had JBoss EL defined as a dependency like this:


      <dependency>
           <groupId>org.jboss.el</groupId>
           <artifactId>jboss-el</artifactId>
           <type>jar</type>
           <exclusions>
                <exclusion>
                     <groupId>javax.el</groupId>
                     <artifactId>el-api</artifactId>
                </exclusion>
           </exclusions>
      </dependency>



      Am I missing a dependency or a specific version?


      Thanks for your help.


      Thomas


      PS.: I'm using JBoss 4.2.3.GA, JSF 1.2, Facelets 1.1.14, RichFaces 3.3.2.SR1 (and in case you need it: Hibernate 3.3.2.GA)

        • 1. Re: Using JBoss EL without SEAM
          Thomas Goettlich Novice

          I think I found a workaround, but I'm not quite satisfied with that.


          I replaced jsf-api.jar and jsf-impl.jar in my server's deploy/jboss-web.deployer/sf-libs folder with jsf-api-1.213.jar and jsf-impl-1.213.jar and now it works.


          However, I don't like the option of replacing jars that are bundled with JBoss. I'd rather like to override them, i.e. make JBoss use the jars I provided in my app instead of the bundled ones.


          When I only provide the jars with my application I get the following exception:




          09:35:12,611 ERROR [application] JSF1029: The specified InjectionProvider implementation 'org.jboss.web.jsf.integration.injection.JBossInjectionProvider' does not implement the InjectionProvider interface.
          09:35:12,611 INFO  [application] JSF1048: PostConstruct/PreDestroy annotations present.  ManagedBeans methods marked with these annotations will have said annotations processed.
          09:35:15,107 ERROR [[/interpraesent]] Exception sending context initialized event to listener instance of class org.jboss.web.jsf.integration.config.JBossJSFConfigureListener
          java.lang.ClassCastException: com.sun.faces.config.WebConfiguration
                  at com.sun.faces.config.WebConfiguration.getInstance(WebConfiguration.java:154)
                  at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:144)
                  at org.jboss.web.jsf.integration.config.JBossJSFConfigureListener.contextInitialized(JBossJSFConfigureListener.java:71)
                  at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3856)
                  at org.apache.catalina.core.StandardContext.start(StandardContext.java:4361)
                  at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:790)
                  at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:770)
                  at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:553)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                  at java.lang.reflect.Method.invoke(Method.java:585)
                  ...



          If anyone can help me with this, I'd appreciate it. However, I know this now is more of a JBoss specific question, so I'll also ask the guys in the JBoss AS forum.


          Thanks.


          Thomas

          • 2. Re: Using JBoss EL without SEAM
            Thomas Goettlich Novice

            I thought I'd share the solution I found:


            I need to add jboss-faces.jar to my war's lib folder, so that it now looks like this:




            lib
             +-- jboss-faces-4.2.3.GA.jar
             +-- jsf-api-1.2_13.jar
             +-- jsf_impl-1.2_13.jar
             +-- ... (other jars)