4 Replies Latest reply on Nov 6, 2010 9:28 PM by paulwaldo

    Duplicate websession prevents deployment

    paulwaldo

      Hi all,


      I'm just starting to learn seam, so forgive me if this a simple question :-)


      I am using jboss-5.1.0.GA and jboss-seam-2.2.0.GA on OS-X 10.6.  I have tried to create a new starter project, but it will not deploy:



      09:18:05,319 INFO  [TomcatDeployment] deploy, ctxPath=/seamtest
      09:18:05,367 INFO  [config] Initializing Mojarra (1.2_12-b01-FCS) for context '/seamtest'
      09:18:05,861 WARN  [SeamPhaseListener] There should only be one Seam phase listener per application
      09:18:07,722 INFO  [ServletContextListener] Welcome to Seam 2.2.0.GA
      09:18:10,321 ERROR [[/seamtest]] Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
      java.lang.IllegalStateException: duplicate factory for: org.jboss.seam.web.webSession (duplicate is specified in components.xml)
           at org.jboss.seam.core.Init.checkDuplicateFactoryExpressions(Init.java:227)
           at org.jboss.seam.core.Init.checkDuplicateFactory(Init.java:220)
           at org.jboss.seam.core.Init.addFactoryValueExpression(Init.java:283)
           at org.jboss.seam.init.Initialization.installComponents(Initialization.java:1152)
           at org.jboss.seam.init.Initialization.init(Initialization.java:733)
           at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:36)
           at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3910)


      I have scoured the forums and google, and others seem to have run across this in previous seam versions.  The consensus was that there was an extra jboss-seam.jar floating around.  I have tried removing the one instance of the jar, but that causes other obvious problems :-)


      I have found this problem to occur in a freshly created project via seam-gen as well as Jboss Tools.  Any help would be greatly appreciated, as I am dead in the water!

        • 1. Re: Duplicate websession prevents deployment
          lvdberg

          Hi,


          Look into the created directory and see if things are copied. I've found that sometimes the build just copies content twice in the deploy-directory and therefor in the final directory/WAR.


          If that is the case, you probably have a build path problem.


          Leo

          • 2. Re: Duplicate websession prevents deployment
            paulwaldo

            Leo van den Berg wrote on Nov 06, 2010 15:48:

            Look into the created directory and see if things are copied. I've found that sometimes the build just copies content twice in the deploy-directory and therefor in the final directory/WAR.

            Thanks for the reply, Leo.  From what I can see there are no duplicates:


            MacBook-Pro:seamtest paul$ find ~/projects/seamtest ~/Java/jboss-5.1.0.GA -name jboss-seam.jar
            /Users/paul/projects/seamtest/exploded-archives/seamtest.ear/jboss-seam.jar
            /Users/paul/projects/seamtest/lib/jboss-seam.jar
            /Users/paul/Java/jboss-5.1.0.GA/server/default/deploy/seamtest.ear/jboss-seam.jar


            Maybe I'm missing something?

            • 3. Re: Duplicate websession prevents deployment
              lvdberg

              Hi,


              Another trick is cleaning up the JBoss directories. You can delete the directories TMP, WORK and DATA without a problem and after that do a full new deploy. See if that helps.


              Leo

              • 4. Re: Duplicate websession prevents deployment
                paulwaldo

                Leo van den Berg wrote on Nov 06, 2010 19:48:


                Hi,

                Another trick is cleaning up the JBoss directories. You can delete the directories TMP, WORK and DATA without a problem and after that do a full new deploy. See if that helps.

                Leo


                Hi Leo,


                I had already tried the tmp and work dirs.  Didn't know about data.  I tried removing all three, but no dice.  Your suggestion did spur me to get drastic; I blew away the entire jboss dir and reinstalled.  That seemed to do the trick.  Yay!


                I'd love to know what I did, because I managed to mess up a windows box in the same way...


                Thanks for all your help!!