找到需要的类javax.faces.FactoryFinder的多个版本 [英] Found multiple versions of the required class javax.faces.FactoryFinder

查看:675
本文介绍了找到需要的类javax.faces.FactoryFinder的多个版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从JSF2.0开始。
我跟着一个没有问题的教程,一切都很好!我使用Eclipse Helios。
但我注意到我不明白的东西。
该教程说要为JSF 2添加Project Facet。
我没有这样的东西,都可以正常工作。所以按照我所做的教程:



右键单击项目 - >属性 - >项目方面



和JavaServer Faces facet复选框未勾选。我认为这是教程意味着项目方面。我点击了它,一个



需要进一步配置



链接出现。我按照链接到JSF功能(修改面项目)对话框,我选择了用户库,我的JSF库(这是MyFaces),但是我收到了错误消息:


找到需要的类javax.faces.FactoryFinder的多个版本。


这是什么错误?创建项目后,无法添加项目方面?
我需要什么项目方面?
我的(平凡的)代码表明JSF工作正常,那么项目Facet有什么用?

解决方案

Eclipse帮助


定义Java EE项目的特征和
要求,
用作运行时
配置的一部分。



添加一个方面对于项目,
,该项目被配置为执行
a某些任务,满足某些
要求,或具有某些
特征。例如,EAR
面设置一个项目,作为企业应用程序的
,通过添加
部署描述符并设置
项目的类路径。


JSF facet


安装JSF facet时,以下功能可用




  • JSF库配置支持

  • 应用程序配置管理

  • JSP源页面语义验证和内容帮助大多数JSF
    Core和JSF HTML标签库
    使用Expression $的属性值

  • 运行服务器支持JSF JSP页面


< blockquote>

如果出现此错误:


找到需要的类javax.faces.FactoryFinder的多个版本。


看起来工具已经检测到核心的多个副本JSF API上的项目类路径。 JSF对此有一些宽容,并且历史上支持在不同的类加载器上下文中运行不同的版本 - 也就是说可以将一个放在WAR中,一个在容器中。使用打开类型对话框( CTRL + SHIFT + T )并搜索 javax.faces.FactoryFinder 应该可以帮助您找到罪魁祸首。


I started on JSF2.0. I followed a tutorial with no problem and all worked fine! I used Eclipse Helios. But I noticed something I can not understand. The tutorial said to add Project Facet for JSF 2. I did no such thing and all worked ok. So to follow tutorial exactly I did:

Right-click on Project -> Properties -> Project Facets

And JavaServer Faces facet check-box was not ticked. I assume this is what the tutorial means by Project Facet. I clicked on it and a

Further Configuration Needed

link appeared. I followed the link to a JSF capabilities (Modify Faceted Project) dialog, I selected as User library, my library of JSF(which is MyFaces) but I got the error message:

Found multiple versions of the required class javax.faces.FactoryFinder.

What is this error? Can't I add project facet after creating my project? And what do I need the project facet for? My (trivial) code indicates that JSF works ok, so what is the project Facet useful for?

解决方案

From the Eclipse help:

Facets define characteristics and requirements for Java EE projects and are used as part of the runtime configuration.

When you add a facet to a project, that project is configured to perform a certain task, fulfill certain requirements, or have certain characteristics. For example, the EAR facet sets up a project to function as an enterprise application by adding a deployment descriptor and setting up the project's classpath.

In the case of the JSF facet:

The following features are available when the JSF facet is installed:

  • JSF Library configuration support
  • Application Configuration Management
  • JSP Source Page semantic validation and content assist for most of the JSF Core and JSF HTML tag library attribute values using Expression Language (EL) or not.
  • "Run on Server" support of a JSF JSP page

In the case of this error:

Found multiple versions of the required class javax.faces.FactoryFinder.

It looks like the tooling has detected multiple copies of the core JSF API on the project classpath. JSF has some tolerance for this and has historically supported running different versions in different classloader contexts - that is, you can put one in the WAR and one in the container. Using the Open Type dialog (CTRL+SHIFT+T) and searching for javax.faces.FactoryFinder should help you locate the culprit jar.

这篇关于找到需要的类javax.faces.FactoryFinder的多个版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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