0 Replies Latest reply on Jul 10, 2012 11:43 PM by Rogerio Gaioso

    RichFaces4 startup fails with java.lang.IllegalArgumentException: duplicate key

    Rogerio Gaioso Newbie

      I'm using Tomcat 7, Richfaces 4.2.2 and MyFaces 2.1.5. When I start Tomcat I get the error:

       

      {code}

      An error occured while initializing MyFaces: duplicate key: class javax.faces.convert.BooleanConverter

      java
      .lang.IllegalArgumentException: duplicate key: class javax.faces.convert.BooleanConverter
      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:221)
      at com
      .google.common.collect.ImmutableMap$Builder.build(ImmutableMap.java:207)
      at org
      .richfaces.javascript.ClientServiceConfigParser.parseConfig(ClientServiceConfigParser.java:53)
      at org
      .richfaces.application.ValidatorModule.createClientScriptService(ValidatorModule.java:65)
      at org
      .richfaces.application.ValidatorModule.configure(ValidatorModule.java:60)
      at org
      .richfaces.application.ServicesFactoryImpl.init(ServicesFactoryImpl.java:27)
      at org
      .richfaces.application.InitializationListener.createFactory(InitializationListener.java:139)
      at org
      .richfaces.application.InitializationListener.onStart(InitializationListener.java:112)
      at org
      .richfaces.application.InitializationListener.processEvent(InitializationListener.java:157)
      at javax
      .faces.event.SystemEvent.processListener(SystemEvent.java:43)
      at org
      .apache.myfaces.application.ApplicationImpl._traverseListenerList(ApplicationImpl.java:2105)
      at org
      .apache.myfaces.application.ApplicationImpl.access$000(ApplicationImpl.java:118)
      at org
      .apache.myfaces.application.ApplicationImpl$SystemListenerEntry.publish(ApplicationImpl.java:2292)
      at org
      .apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:537)
      at org
      .apache.myfaces.webapp.AbstractFacesInitializer._dispatchApplicationEvent(AbstractFacesInitializer.java:248)
      at org
      .apache.myfaces.webapp.AbstractFacesInitializer.initFaces(AbstractFacesInitializer.java:140)
      at org
      .apache.myfaces.webapp.StartupServletContextListener.contextInitialized(StartupServletContextListener.java:111)
      at org
      .apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4765)
      at org
      .apache.catalina.core.StandardContext.startInternal(StandardContext.java:5260)
      at org
      .apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      at org
      .apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:866)
      at org
      .apache.catalina.core.ContainerBase.addChild(ContainerBase.java:842)
      at org
      .apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
      at org
      .apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:958)
      at org
      .apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1599)
      at java
      .util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
      at java
      .util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
      at java
      .util.concurrent.FutureTask.run(Unknown Source)
      at java
      .util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
      at java
      .util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at java
      .lang.Thread.run(Unknown Source)

      {code}

       

      I saw the solution presented in another posts (like [this|https://community.jboss.org/thread/165515], or [this|http://stackoverflow.com/questions/7681582/richfaces4-startup-fails-with-java-lang-illegalargumentexception-duplicate-key]), but different in this case, I don't have "-source.jar" in my classpath. See my libs:

       

      commons-beanutils-1.8.3.jar

      commons-codec-1.3.jar

      commons-collections-3.2.jar

      commons-digester-1.8.jar

      commons-logging-1.1.1.jar

      cssparser-0.9.5.jar

      guava-10.0.1.jar

      itext-1.01.jar

      jasperreports-2.0.1.jar

      jasperreports-extensions-1.3.1.jar

      myfaces-api-2.1.8.jar
      myfaces-impl-2.1.8.jar
      richfaces-components-api-4.2.2.Final.jar
      richfaces-components-ui-4.2.2.Final.jar
      richfaces-core-api-4.2.2.Final.jar
      richfaces-core-impl-4.2.2.Final.jar
      sac-1.3.jar
      spring-beans.jar
      spring-context.jar
      spring-core.jar
      spring-jdbc.jar
      spring-tx.jar
      spring-web.jar

       

      I tried RichFaces 4.1.0, 4.2.0, 4.2.1 . I tried replacing MyFaces by Mojarra (v2.1.10), but nothing works.... Always the same error.

       

      Can someone help me?