4 Replies Latest reply on Sep 29, 2011 11:56 AM by robert walker

    Starting with Richfaces 4.0.0 final - Trouble

    david79 Newbie

      Hey guys,

       

      I have trouble using Richfaces 4.0 final, I want to use it for my next project wherefor I'm already using

      • Glassfish 3.0.1
      • Mojarra 2.0.3
      • EclipseLink 2.1.x

      My IDE is Eclipse 3.6.2

       

      So, I was trying to get started:

      1.) importing libraries via Eclipse Java Build Path

      => No errors BUT also no rendering of richface components

       

      2.) moving libraries to WEB-INF/lib folder of my project

      => Error:

      [#|2011-03-30T00:28:24.678+0200|SEVERE|glassfish3.0.1|org.apache.catalina.core.ContainerBase|_ThreadID=26;_ThreadName=Thread-1;|ContainerBase.addChild: start:

      org.apache.catalina.LifecycleException: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! com.google.common.base.Function

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

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

      Caused by: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! com.google.common.base.Function

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

          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)

          ... 38 more

      Caused by: java.lang.ClassNotFoundException: com.google.common.base.Function

          at java.net.URLClassLoader$1.run(URLClassLoader.java:200)

          at java.security.AccessController.doPrivileged(Native Method)

          at java.net.URLClassLoader.findClass(URLClassLoader.java:188)

          at org.glassfish.web.loader.WebappClassLoader.findClass(WebappClassLoader.java:959)

          at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1430)

          at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)

          at org.richfaces.resource.ResourceHandlerImpl.<init>(ResourceHandlerImpl.java:66)

          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

          at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

          at java.lang.reflect.Constructor.newInstance(Constructor.java:513)

          at com.sun.faces.config.processor.AbstractConfigProcessor.createInstance(AbstractConfigProcessor.java:265)

          at com.sun.faces.config.processor.ApplicationConfigProcessor.setResourceHandler(ApplicationConfigProcessor.java:752)

          at com.sun.faces.config.processor.ApplicationConfigProcessor.process(ApplicationConfigProcessor.java:310)

          at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:114)

          at com.sun.faces.config.processor.LifecycleConfigProcessor.process(LifecycleConfigProcessor.java:116)

          at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:114)

          at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:223)

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

          ... 42 more

      |#]

       

      3. tried to move guava-r08.jar to my WEB-INF/lib folder

      ==> Error:

      [#|2011-03-30T00:42:12.549+0200|SEVERE|glassfish3.0.1|org.apache.catalina.core.ContainerBase|_ThreadID=26;_ThreadName=Thread-1;|ContainerBase.addChild: start:

      org.apache.catalina.LifecycleException: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! duplicate key: interface javax.validation.constraints.Max

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

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

      Caused by: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! duplicate key: interface javax.validation.constraints.Max

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

          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)

          ... 38 more

      Caused by: java.lang.IllegalArgumentException: duplicate key: interface javax.validation.constraints.Max

          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)

          ... 42 more

      |#]

       

       

      What can I do else to make Richfaces 4.0.0 working for me ? ;-)

       

      Thx

      David

        • 1. Starting with Richfaces 4.0.0 final - Trouble
          Jay Balunas Master

          Are you packaging a validation jar with your application?  It seems like you are having duplicate interfaces from the last error.

          • 2. Starting with Richfaces 4.0.0 final - Trouble
            david79 Newbie

            ok, i think, that's it...

             

            glassfish runtime brings javax.validation... with bean-validator.jar

            i removed it and added it once again (cause, well, i think, i need this runtime... *g*)

            as eclipse did not ask me to export server runtime... i have not done that, so richfaces works fine !

             

            thx

            • 3. Re: Starting with Richfaces 4.0.0 final - Trouble
              herve45 Newbie

              Hello,

               

              I've got the same issue but i don't understand what u have done to fix it...

              Can u give me more details ?

               

              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)

               

              Thanks.

              • 4. Re: Starting with Richfaces 4.0.0 final - Trouble
                robert walker Newbie

                this may be a bit different than how you are running your app, but I ran into same problem running the example code from practical richfaces second edition, I used  "mvn install" to generate a war and then plunked that in my glassfish 3.1, but I was getting the same error, then i changed to pom.xml and added <scope>provided</scope>, which tells maven that it needs it to compile with  validation jar, but when you create a war and run it, don't include the validation jar because the web app server will already has it, thereby preventing the application server from seeing 2 of them

                (its own version and the one that was included in error)

                 

                <dependency>
                      <groupId>javax.validation</groupId>
                      <artifactId>validation-api</artifactId>
                             <scope>provided</scope> <!-- added this element -->   
                </dependency>