Class org.springframework.web.jsf.el.SpringBeanFacesELResolver must extend the type javax.el.ELResolver
Asked Answered
M

8

12

I am trying to integrate Spring into a JSF application.

In faces-config.xml, I have included this:

<application>       
  <el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>
  <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
</application>

but it shows a weird warning which I can't get rid of:

Class org.springframework.web.jsf.el.SpringBeanFacesELResolver must extend the type javax.el.ELResolver

Any ideas?

Melancon answered 29/7, 2009 at 15:16 Comment(0)
M
0

Well my problem disappeared substituting these lines by:

<!-- variable/property resolver registration -->
    <application>
        <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
        <variable-resolver>org.springframework.web.jsf.DelegatingVariableResolver</variable-resolver>
    </application>

hope it helps!

Melancon answered 18/8, 2009 at 8:8 Comment(0)
D
12

From the spring documentation, you will see that for org.springframework.web.jsf.el.SpringBeanFacesELResolver:

delegates to the Spring's 'business context' WebApplicationContext first, then to the default resolver of the underlying JSF implementation

and for org.springframework.web.jsf.DelegatingVariableResolver:

will first delegate value lookups to the default resolver of the underlying JSF implementation and then to Spring's 'business context' WebApplicationContext

As you can see, the behavior is very different. If you don't care about order, you are fine, but if you actually did intend to use org.springframework.web.jsf.el.SpringBeanFacesELResolver then all you have to do is ensure the version of el-api.jar in your dependencies is compatible with your version of spring. For me, I have this (in my maven pom):

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-web</artifactId>
    <version>3.0.5.RELEASE</version>
    <type>jar</type>
    <scope>compile</scope>
</dependency>
<dependency>
    <groupId>org.apache.tomcat</groupId>
    <artifactId>el-api</artifactId>
    <version>6.0.32</version>
    <type>jar</type>
    <scope>provided</scope>
</dependency>
Domela answered 29/7, 2011 at 15:11 Comment(0)
A
2

This is possibly a ClassLoader configuration issue. If the SpringBeanFacesELResolver's parent class is from a different ClassLoader to the one used by the JSF classes doing the bootstrapping, the check to see if it is an instance of ELResolver will fail.

Problems like this can happen if you have a META-INF/faces-config.xml in the global classpath, but I suppose there could be other causes.

It would help if you posted information on what container you are using, the classloader policy for your application and where you've placed any third party libraries (such as the Facelets and Spring libs).

Arran answered 29/7, 2009 at 15:52 Comment(0)
B
2

To solve this type of problem you should extend project with javax prefix because Class ELResolver is an abstract class under javax.el package.

Here is code:

    <application>
      <javax.el-resolver>
        org.springframework.web.jsf.el.SpringBeanFacesELResolver
      </javax.el-resolver>      
    </application>

More information about ELResolver class you can get by link.

Biographical answered 13/11, 2017 at 8:4 Comment(0)
C
1

Configure your Project facets. For run with your local server

enter image description here

Czernowitz answered 10/10, 2016 at 18:19 Comment(0)
C
0

Please check the JAR files you are using in application. Again the class paths set in application. I think it is because of the class conflicts in application class paths.

Charles answered 6/8, 2009 at 7:45 Comment(0)
M
0

Well my problem disappeared substituting these lines by:

<!-- variable/property resolver registration -->
    <application>
        <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
        <variable-resolver>org.springframework.web.jsf.DelegatingVariableResolver</variable-resolver>
    </application>

hope it helps!

Melancon answered 18/8, 2009 at 8:8 Comment(0)
R
0

Thanks #saadi90, from mvnrepository.com I found this and it solved the problem:

<dependency>
   <groupId>org.glassfish.web</groupId>
   <artifactId>el-impl</artifactId>
   <version>2.2</version>
</dependency>
Radman answered 29/12, 2015 at 15:25 Comment(0)
W
-1

You need the el-impl dependency

Why answered 21/4, 2015 at 12:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.