RichFaces4 startup fails with java.lang.IllegalArgumentException: duplicate key: class javax.faces.convert.DoubleConverter

后端 未结 1 745
忘掉有多难
忘掉有多难 2020-12-16 07:52

This seems not be not a simple task with RichFaces4 without Maven, I download myfaces-2.0.9 jars and richfaces 4.0.0 and added sac-1.3.jar, guava-r08.jar and cssparser-0.9.5

相关标签:
1条回答
  • 2020-12-16 08:27

    This can happen if you also include the RichFaces source code JAR files in the classpath. They do not belong in the webapp's runtime classpath. It are the ones with a filename ending in -source.jar. You should remove them from the /WEB-INF/lib and put them if necessary somewhere else which do not end up in the webapp's runtime classpath.

    The culprit is the csv.xml file which is present in /META-INF folder of both the richfaces-components-ui-4.0.0.Final.jar and richfaces-components-ui-4.0.0.Final-source.jar files. That file definies the standard converters and validators. However, because that file now appears twice in the classpath, it's been read twice, resulting in this duplicate key exception.


    Unrelated to the concrete problem, removing Tomahawk because you're using MyFaces is a non-argument. The MyFaces JSF implementation does not contain the same components as Tomahawk. It's just another JSF implementation and technically the competitor of Mojarra. Tomahawk is a standalone component library which offers more enhanced components on top of the standard JSF implementation and can be used as good on top of every JSF implementation.

    0 讨论(0)
提交回复
热议问题