6 Replies Latest reply on Jul 20, 2011 4:17 PM by enira

    Error with GlassFish & RichFaces 4

    enira

      I am trying to integrate Richfaces in the project I am working on. I am currently using netbeans, GlassFish v3.1 and RichFaces 4.

       

      I added the RichFaces jars to the lib folder, I also added the:

      -commons-beanutils

      -commons-collections

      -commons-digester

      -commons-logging

      -cssparser-0.9.5

      -guava-r08

      -hibernate-validator

      -jstl

       

      Whenever I try to build the project I get the following error:

       

      INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.

      INFO: Unsanitized stacktrace from failed start...

      java.lang.IllegalArgumentException: duplicate key: class javax.faces.validator.RegexValidator

              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:54)

              at org.richfaces.application.ValidatorModule.createClientScriptService(ValidatorModule.java:68)

              at org.richfaces.application.ValidatorModule.configure(ValidatorModule.java:62)

              at org.richfaces.application.ServicesFactoryImpl.init(ServicesFactoryImpl.java:28)

              at org.richfaces.application.InitializationListener.createFactory(InitializationListener.java:136)

              at org.richfaces.application.InitializationListener.onStart(InitializationListener.java:110)

              at org.richfaces.application.InitializationListener.processEvent(InitializationListener.java:152)

              at javax.faces.event.SystemEvent.processListener(SystemEvent.java:102)

              at com.sun.faces.application.ApplicationImpl.processListeners(ApplicationImpl.java:1993)

              at com.sun.faces.application.ApplicationImpl.invokeListenersFor(ApplicationImpl.java:1969)

              at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:299)

              at com.sun.faces.config.ConfigManager.publishPostConfigEvent(ConfigManager.java:601)

              at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:344)

              at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:223)

              at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:4664)

              at com.sun.enterprise.web.WebModule.contextListenerStart(WebModule.java:535)

              at org.apache.catalina.core.StandardContext.start(StandardContext.java:5266)

              at com.sun.enterprise.web.WebModule.start(WebModule.java:499)

              at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:928)

              at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:912)

              at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:694)

              at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1947)

              at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1619)

              at com.sun.enterprise.web.WebApplication.start(WebApplication.java:90)

              at org.glassfish.internal.data.EngineRef.start(EngineRef.java:126)

              at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:241)

              at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:236)

              at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:339)

              at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:183)

              at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:272)

              at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:305)

              at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:320)

              at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1176)

              at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$900(CommandRunnerImpl.java:83)

              at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)

              at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1224)

              at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:365)

              at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:204)

              at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166)

              at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:100)

              at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:245)

              at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)

              at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)

              at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)

              at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)

              at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)

              at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)

              at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)

              at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)

              at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)

              at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)

              at com.sun.grizzly.ContextTask.run(ContextTask.java:69)

              at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)

              at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)

              at java.lang.Thread.run(Thread.java:662)

       

      Anyone any idea?

        • 1. Error with GlassFish & RichFaces 4
          ilya_shaikovsky

          remove -hibernate-validator. conflict with bundled appears I believe.

          • 2. Re: Error with GlassFish & RichFaces 4
            enira

            Thank you for the suggestion. I removed it and did a clean&build. But the problem remains the same.

             

            INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.

            INFO: Unsanitized stacktrace from failed start...

            java.lang.IllegalArgumentException: duplicate key: class javax.faces.validator.RegexValidator

            ....

             

            EDIT: I removed all added libraries and removed guava-r08 and replaced it with guava-r07. My application seems to be compiling now, I restored the guava-r08 now and I am trying to build again.

            • 3. Re: Error with GlassFish & RichFaces 4
              iabughosh

              Dear Robbert,

              i think the conflict comes from this jar : guava-r08, try to remove this jar and/or hibernate-validator,   deploy again.

               

              regards.

              • 4. Re: Error with GlassFish & RichFaces 4
                enira

                It seems to be working now, odd behaviour the error was all due to the added .jars.

                 

                Thank you very much.

                • 5. Re: Error with GlassFish & RichFaces 4
                  herve45

                  Hello,

                   

                  I'm facing the same kind of issue but after trying all the possible combination of jar, it still doesn''t work.

                   

                  The error message :

                   

                  java.lang.IllegalArgumentException: duplicate key: class javax.faces.convert.CharacterConverter

                            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:54)

                            at org.richfaces.application.ValidatorModule.createClientScriptService(ValidatorModule.java:68)

                   

                   

                  Can u explain how u manage exactly to fix it ?

                   

                  Thanks.

                  • 6. Re: Error with GlassFish & RichFaces 4
                    enira

                    I think I removed the bundles I added until the application worked. I think I added too much dependencies of my own and GlassFish already provided a lot. So I removed them all and added them one by one again until it worked. (Don't forget to clean & build).