Richfaces 4.3.1 weblogic 10.3.5.0 duplicate key on deploy
japearson Apr 24, 2013 3:34 AMHi,
I'm having trouble with richfaces 4.3.1 on weblogic 10.3.5.0, on deploy the following exception happens:
java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! duplicate key: class javax.faces.validator.LongRangeValidator
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:290)
at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:481)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:181)
Truncated. see log file for complete stacktrace
Caused By: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! duplicate key: class javax.faces.validator.LongRangeValidator
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:351)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:222)
at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:481)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
Truncated. see log file for complete stacktrace
Caused By: java.lang.IllegalArgumentException: duplicate key: class javax.faces.validator.LongRangeValidator
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:115)
at com.google.common.collect.RegularImmutableMap.<init>(RegularImmutableMap.java:72)
at com.google.common.collect.ImmutableMap$Builder.fromEntryList(ImmutableMap.java:245)
at com.google.common.collect.ImmutableMap$Builder.build(ImmutableMap.java:231)
at org.richfaces.javascript.ClientServiceConfigParser.parseConfig(ClientServiceConfigParser.java:53)
I had a look inside ClientServiceConfigParser and debugged it and I found that it ended up loading /META-INF/csv.xml twice from richfaces-components-ui-4.3.1.Final.jar
The problem happens on line 45 when it calls Enumeration<URL> resources = loader.getResources(name);, because that ends up returning /META-INF/csv.xml twice because it returns a http://javasourcecode.org/html/open-source/jdk/jdk-6u23/sun/misc/CompoundEnumeration.html which seems to 2 copies. Any idea how this could be worked around?
In the debugger I made it avoid loading the file twice and it deployed without errors.
Any idea how to get around this?
I am using maven if it makes any difference.
Thanks,
-Joel