6 Replies Latest reply on Oct 11, 2011 4:33 AM by kemmler_eon

    Richfaces 4 duplicate key with EAR when deploying

    kemmler_eon

      Hi,

       

      I have this error when i deploy the EAR with Netbeans,richfaces 4 on server glassfish 3.1 (with bean-validator.jar)

      Project without maven

      But it works if i deploy the war and the ejb.jar

       

      Hoe can i fix it

       

      Thank you

       

      GRAVE: Exception while invoking class com.sun.enterprise.web.WebApplication start method

      java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! duplicate key: interface javax.validation.constraints.Min

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

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

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

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

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

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

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

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

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

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

          at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:96)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

       

       

      Libraries :

      WEB-INF/lib/commons-beanutils-1.8.3.jar

      WEB-INF/lib/commons-codec-1.3.jar

      WEB-INF/lib/commons-collections-3.2.1.jar

      WEB-INF/lib/commons-digester-2.0.jar

      WEB-INF/lib/commons-lang-2.4.jar

      WEB-INF/lib/commons-logging-1.1.1.jar

      WEB-INF/lib/commons-net-ftp-2.0.jar

      WEB-INF/lib/cssparser-0.9.5.jar

      WEB-INF/lib/guava-r09.jar

      WEB-INF/lib/lucene-analyzers-3.0.2.jar

      WEB-INF/lib/lucene-core-3.0.2.jar

      WEB-INF/lib/lucene-snowball-3.0.3.jar

      WEB-INF/lib/prettyfaces-jsf2-3.2.0.jar

      WEB-INF/lib/richfaces-components-api-4.0.0.Final.jar

      WEB-INF/lib/richfaces-components-ui-4.0.0.Final.jar

      WEB-INF/lib/richfaces-core-api-4.0.0.Final.jar

      WEB-INF/lib/richfaces-core-impl-4.0.0.Final.jar

      WEB-INF/lib/sac-1.3.jar

      WEB-INF/lib/velocity-1.5.jar

        • 1. Richfaces 4 duplicate key with EAR when deploying
          mvmsoft

          I've got a similar error message; it works with a war deployment;

          wrapping into an ear gives the duplicate key message:

          Caused by: java.lang.IllegalArgumentException: duplicate key: class javax.faces.convert.FloatConverter

                  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)

           

          debugging on the surface showed that

          ClientServiceConfigParser.parseConfig() digs out two resources:

           

          jar:file:/D:/Sun/glassfish/domains/nccdomain/applications/j2ee-apps/immt_ear/immt_web_war/WEB-INF/lib/richfaces-components-ui-4.0.0.Final.jar!/META-INF/csv.xml

          jar:file:/D:/Sun/glassfish/domains/nccdomain/applications/j2ee-apps/immt_ear/immt_web_war/WEB-INF/lib/richfaces-components-ui-4.0.0.Final.jar!/META-INF/csv.xml

           

          Processing this same file two times results in the above exception.

           

          Solution proposal: wrap the parse() method in a duplicate check of the URL and only do it once per same url; sorry, no time to create patch since I'm on holiday tomorrow ;-)

           

           

                  try {

                      Enumeration<URL> resources = loader.getResources(name);

                      while (resources.hasMoreElements()) {

                          URL url = (URL) resources.nextElement();

                          resultBuilder.putAll(parse(loader, url));

                      }

                  } catch (IOException e) {

          • 2. Richfaces 4 duplicate key with EAR when deploying
            nbelaevski

            Hi,

             

            Just tried deploying showcase as EAR under GF 3.1 final - works just fine. Maybe you have duplicate version of validation API classes?

            • 3. Richfaces 4 duplicate key with EAR when deploying
              m1ckey

              I AM getting this problem with 4.0.1-SNAPSHOT, but not with 4.0.0.

              • 4. Re: Richfaces 4 duplicate key with EAR when deploying
                vace117

                I had a very similar problem. I was getting a 'duplicate key' error, but for a different class.

                 

                In my case it turned out that the class was loaded twice from two different jars - once from the richfaces jar and again from the richfaces source jar. I had remove Richfaces source jars from WEB-INF/lib and the problem was solved.

                • 5. Re: Richfaces 4 duplicate key with EAR when deploying
                  kemmler_eon

                  Always no solution ?

                   

                  I try with glassfish 3.1.1 and always the same error.

                  i use

                  - eclipseLink

                  - db2 database.

                   

                  this can help ?

                   

                  And there is no sources on lib path

                  • 6. Re: Richfaces 4 duplicate key with EAR when deploying
                    kemmler_eon

                    The problem is that the ear deployement deploy two times the library : richfaces-components-ui-X.x.x.jar And inside in /META-INF/csv.xml is load twice and make the  problem of duplication key.

                    I find a solution is to remove search lib on the ear.

                    Just add this line in the application.xml of the ear : < library-directory />

                    <?xml version="1.0" encoding="UTF-8"?>
                    <application version="6" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_6.xsd">
                     
                    <display-name>ez-ear</display-name>
                     
                    <module>
                       
                    <ejb>ejb.jar</ejb>   
                     
                    </module> 
                     
                    <module>
                       
                    <web>
                         
                    <web-uri>web.war</web-uri>
                       
                    <context-root/>     
                        /web>
                     
                    </module> 
                     
                    <library-directory />
                    </application>