1 Reply Latest reply on Sep 13, 2012 10:20 PM by Sam W

    Child container with name  already exists

    Sam W Expert

      Hi,


      I created a sample project for testing spring session bean with aop proxy. When I added a method to handle method Post in the controller, during deployment, jboss 7.1.1 thrown the following exception:

       


      jboss.web.deployment.default-host./: Failed to start service

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) [rt.jar:1.6.0_07]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) [rt.jar:1.6.0_07]

              at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_07]

      Caused by: java.lang.IllegalArgumentException: Child container with name  already exists

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

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

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

              at org.jboss.as.web.deployment.WebContextInjector.inject(WebContextInjector.java:62)

              at org.jboss.as.web.deployment.WebContextInjector.inject(WebContextInjector.java:38)

              at org.jboss.msc.inject.CastingInjector.inject(CastingInjector.java:55) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

              at org.jboss.msc.service.ServiceControllerImpl.doInject(ServiceControllerImpl.java:1549) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

              at org.jboss.msc.service.ServiceControllerImpl.access$1900(ServiceControllerImpl.java:49) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.performInjections(ServiceControllerImpl.java:1780) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1741) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

              ... 3 more

       

       

       

      Controller code:

       

       

      package testsession.domain;

       

       

      import org.springframework.stereotype.Controller;

       

       

      import org.apache.log4j.Logger;

      import org.springframework.beans.factory.annotation.Autowired;

      import org.springframework.ui.Model;

      import org.springframework.validation.BindingResult;

      import org.springframework.web.bind.annotation.ModelAttribute;

      import org.springframework.web.bind.annotation.RequestMapping;

      import org.springframework.web.bind.annotation.RequestMethod;

      import org.springframework.web.bind.support.SessionStatus;

      import testsession.domain.bean.CategorySessionBean;

       

       

       

       

      @Controller

      public class TestController {

       

       

          private static final Logger logger = Logger.getLogger(TestController.class);

         

          @Autowired

          private CategorySessionBean categorySessionBean;

         

       

       

         

          @RequestMapping(value = "/", method = RequestMethod.GET)

          public String home(Model model) {

              logger.debug(" =======HOME PAGE========");

              model.addAttribute("categorySessionBean", categorySessionBean);

              return "index";

          }

       

          @RequestMapping(value = "/popupPage", method = RequestMethod.GET)

          public String popupPage(Model model) {

              logger.debug(" =======POPUP PAGE========");

              model.addAttribute("categorySessionBean", categorySessionBean);

              return "popupPage";

          }

         

          @RequestMapping(method = RequestMethod.POST)

          public String processSubmit(

              @ModelAttribute("categorySessionBean") CategorySessionBean categorySessionBean, BindingResult result, SessionStatus status) {

             

              return "index";

          }

      }

       

       

      Any suggestion is very appreciated.

      Thanks

      Sam