IllegalArgumentException: duplicate key (JSF)

╄→гoц情女王★ 提交于 2019-12-02 04:02:37

I'm was the same boat as you are.

Taking off from the post you've linked to, I inspected all of my JAR files in WEB-INF/lib and found that both richfaces-components-ui-4.2.2.Final.jar and richfaces-ui-validator-ui-4.2.2.Final.jar contain a file META-INF/csv.xml which provides a mapping for the offending class (IntegerConverter, in my case).

I had the following Maven dependencies declared (with the RichFaces 4.2.2Final BOM listed earlier):

<dependency>
    <groupId>org.richfaces.ui</groupId>
    <artifactId>richfaces-components-ui</artifactId>
</dependency>
<dependency>
    <groupId>org.richfaces.core</groupId>
    <artifactId>richfaces-core-impl</artifactId>
</dependency>
<dependency>
    <groupId>org.richfaces.ui.validator</groupId>
    <artifactId>richfaces-ui-validator-ui</artifactId>
</dependency>

HOWEVER, the richfaces-components-ui is a super-set of richfaces-ui-validator-ui (that is, contains it and a few others).

Your configuration / RichFaces components may be different, but the answer lies in what's in your WEB-INF/lib directory (whether it got there from Maven or some other way)... you've likely included more than one JAR with a csv.xml file.

Identify a minimal set of dependencies and the error will go away.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!