SpringBeanFacesELResolver的javax.faces.el.VariableResolver类广播异常 [英] javax.faces.el.VariableResolver Classcast Exception with SpringBeanFacesELResolver

查看:99
本文介绍了SpringBeanFacesELResolver的javax.faces.el.VariableResolver类广播异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试升级到JSF2和Spring 3.0.5,在部署到Tomcat时出现以下错误.

I am trying to upgrade to JSF2 and Spring 3.0.5, I am getting the following error when I deploy to Tomcat.

任何帮助表示赞赏.

SEVERE: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener
java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! org.springframework.web.jsf.el.SpringBeanFacesELResolver cannot be cast to javax.faces.el.VariableResolver
    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:292)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4723)
    at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5226)
    at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5221)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    at java.lang.Thread.run(Thread.java:619)
Caused by: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! org.springframework.web.jsf.el.SpringBeanFacesELResolver cannot be cast to javax.faces.el.VariableResolver
    at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:375)
    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:225)
    ... 8 more
Caused by: java.lang.ClassCastException: org.springframework.web.jsf.el.SpringBeanFacesELResolver cannot be cast to javax.faces.el.VariableResolver
    at com.sun.faces.config.processor.ApplicationConfigProcessor.addVariableResolver(ApplicationConfigProcessor.java:652)
    at com.sun.faces.config.processor.ApplicationConfigProcessor.process(ApplicationConfigProcessor.java:305)
    at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:114)
    at com.sun.faces.config.processor.LifecycleConfigProcessor.process(LifecycleConfigProcessor.java:116)
    at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:114)
    at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:222)
    at com.sun.faces.config.ConfigManager.initialize(ConfigM

anager.java:360)

anager.java:360)

推荐答案

您没有提供太多信息,但是您的配置中肯定有错误. 提示:

You don't give too much information but you must have something wrong in your configuration. Tips:

  • 错误的Spring或JSF版本或某些库卡在Tomcat库中.您正在使用任何类型的依赖项管理吗?您的spring-web-xxx.jar的确切版本是什么?您正在使用什么JSF实现?那是什么版本?
  • 任何xml配置文件中的架构位置/版本错误.异常表明问题出在面孔配置上.它应该看起来像这样:

  • Wrong Spring or JSF version or some library is stuck in Tomcat lib. Are you using any kind of dependency management? What is the exact version of your spring-web-xxx.jar? What JSF implementation are you using? What's the version of that one?
  • Wrong schemalocation / version in any of your xml config files. Exception suggests the problem is with faces config. It should look like this:

<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
          version="2.0">
<application>
    <el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>
</application>

您可以在此处此处.如果您无法解决问题,请发布一些配置文件. (appcontext.xml,web.xml,faces-config.xml)

You can find some examples here and here. If you are not able to resolve the issue, please post some of your config files. (appcontext.xml, web.xml, faces-config.xml)

这篇关于SpringBeanFacesELResolver的javax.faces.el.VariableResolver类广播异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆