0 Replies Latest reply on Apr 10, 2014 6:45 AM by amine bennani

    JBOSS 6.1.0 - Deployement error - Error creating bean

    amine bennani Newbie

      Hello,

       

      I'm trying to deploy my woo-0.2.0-SNAPSHOT.ear and I have the following error

       

       

      11:06:56,316 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/woo-woo]] (ServerService Thread Pool -- 191) JBWEB000287: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener: org.springframework.beans.factory.access.BootstrapException: Unable to initialize group definition. Group resource name [classpath*:beanRefContext.xml], factory key [applicationBeanRefFactory]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'applicationBeanRefFactory' defined in URL [vfs:/content/woo-0.2.0-SNAPSHOT.ear/lib/woo-application-0.2.0-SNAPSHOT.jar/beanRefContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.context.support.ClassPathXmlApplicationContext]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.jmx.export.MBeanExporter#0' defined in class path resource [spring/dao-context.xml]: Invocation of init method failed; nested exception is org.springframework.jmx.export.UnableToRegisterMBeanException: Unable to register MBean [org.hibernate.jmx.StatisticsService@77dc02f5] with key 'Hibernate:name=woo-statistics'; nested exception is javax.management.InstanceAlreadyExistsException: Hibernate:name=woo-statistics

              at org.springframework.beans.factory.access.SingletonBeanFactoryLocator.useBeanFactory(SingletonBeanFactoryLocator.java:386) [spring-beans-3.2.4.RELEASE.jar:3.2.4.RELEASE]

              at org.springframework.web.context.ContextLoader.loadParentContext(ContextLoader.java:539) [spring-web-3.2.4.RELEASE.jar:3.2.4.RELEASE]

              at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:291) [spring-web-3.2.4.RELEASE.jar:3.2.4.RELEASE]

              at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112) [spring-web-3.2.4.RELEASE.jar:3.2.4.RELEASE]

              at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3339) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]

              at org.apache.catalina.core.StandardContext.start(StandardContext.java:3777) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]

              at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:156) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

              at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:60) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

              at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:93) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_09-icedtea]

              at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [rt.jar:1.7.0_09-icedtea]

              at java.util.concurrent.FutureTask.run(FutureTask.java:166) [rt.jar:1.7.0_09-icedtea]

              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_09-icedtea]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_09-icedtea]

              at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_09-icedtea]

              at org.jboss.threads.JBossThread.run(JBossThread.java:122)

      Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'applicationBeanRefFactory' defined in URL [vfs:/content/woo-0.2.0-SNAPSHOT.ear/lib/woo-application-0.2.0-SNAPSHOT.jar/beanRefContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.context.support.ClassPathXmlApplicationContext]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.jmx.export.MBeanExporter#0' defined in class path resource [spring/dao-context.xml]: Invocation of init method failed; nested exception is org.springframework.jmx.export.UnableToRegisterMBeanException: Unable to register MBean [org.hibernate.jmx.StatisticsService@77dc02f5] with key 'Hibernate:name=woo-statistics'; nested exception is javax.management.InstanceAlreadyExistsException: Hibernate:name=woo-statistics

              at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:288) [spring-beans-3.2.4.RELEASE.jar:3.2.4.RELEASE]

              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1045) [spring-beans-3.2.4.RELEASE.jar:3.2.4.RELEASE]

              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:949) [spring-beans-3.2.4.RELEASE.jar:3.2.4.RELEASE]

              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:487) [spring-beans-3.2.4.RELEASE.jar:3.2.4.RELEASE]

              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458) [spring-beans-3.2.4.RELEASE.jar:3.2.4.RELEASE]

              at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295) [spring-beans-3.2.4.RELEASE.jar:3.2.4.RELEASE]

              at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) [spring-beans-3.2.4.RELEASE.jar:3.2.4.RELEASE]

          at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) [spring-beans-3.2.4.RELEASE.jar:3.2.4.RELEASE]
          at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) [spring-beans-3.2.4.RELEASE.jar:3.2.4.RELEASE]
          at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:628) [spring-beans-3.2.4.RELEASE.jar:3.2.4.RELEASE]
          at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932) [spring-context-3.2.4.RELEASE.jar:3.2.4.RELEASE]
          at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479) [spring-context-3.2.4.RELEASE.jar:3.2.4.RELEASE]
          at org.springframework.context.access.ContextSingletonBeanFactoryLocator.initializeDefinition(ContextSingletonBeanFactoryLocator.java:143) [spring-context-3.2.4.RELEASE.jar:3.2.4.RELEASE]
          at org.springframework.beans.factory.access.SingletonBeanFactoryLocator.useBeanFactory(SingletonBeanFactoryLocator.java:381) [spring-beans-3.2.4.RELEASE.jar:3.2.4.RELEASE]
          ... 15 more

      Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.context.support.ClassPathXmlApplicationContext]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.jmx.export.MBeanExporter#0' defined in class path resource [spring/dao-context.xml]: Invocation of init method failed; nested exception is org.springframework.jmx.export.UnableToRegisterMBeanException: Unable to register MBean [org.hibernate.jmx.StatisticsService@77dc02f5] with key 'Hibernate:name=woo-statistics'; nested exception is javax.management.InstanceAlreadyExistsException: Hibernate:name=woo-statistics

          at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:163) [spring-beans-3.2.4.RELEASE.jar:3.2.4.RELEASE]
          at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:121) [spring-beans-3.2.4.RELEASE.jar:3.2.4.RELEASE]
          at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:280) [spring-beans-3.2.4.RELEASE.jar:3.2.4.RELEASE]
          ... 28 more

      Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.jmx.export.MBeanExporter#0' defined in class path resource [spring/dao-context.xml]: Invocation of init method failed; nested exception is org.springframework.jmx.export.UnableToRegisterMBeanException: Unable to register MBean [org.hibernate.jmx.StatisticsService@77dc02f5] with key 'Hibernate:name=woo-statistics'; nested exception is javax.management.InstanceAlreadyExistsException: Hibernate:name=woo-statistics

          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1482) [spring-beans-3.2.4.RELEASE.jar:3.2.4.RELEASE]
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521) [spring-beans-3.2.4.RELEASE.jar:3.2.4.RELEASE]
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458) [spring-beans-3.2.4.RELEASE.jar:3.2.4.RELEASE]
          at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295) [spring-beans-3.2.4.RELEASE.jar:3.2.4.RELEASE]
          at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) [spring-beans-3.2.4.RELEASE.jar:3.2.4.RELEASE]
          at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) [spring-beans-3.2.4.RELEASE.jar:3.2.4.RELEASE]
          at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) [spring-beans-3.2.4.RELEASE.jar:3.2.4.RELEASE]
          at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:628) [spring-beans-3.2.4.RELEASE.jar:3.2.4.RELEASE]
          at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932) [spring-context-3.2.4.RELEASE.jar:3.2.4.RELEASE]
          at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479) [spring-context-3.2.4.RELEASE.jar:3.2.4.RELEASE]
          at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139) [spring-context-3.2.4.RELEASE.jar:3.2.4.RELEASE]
          at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93) [spring-context-3.2.4.RELEASE.jar:3.2.4.RELEASE]
          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.7.0_09-icedtea]
          at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) [rt.jar:1.7.0_09-icedtea]
          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [rt.jar:1.7.0_09-icedtea]
          at java.lang.reflect.Constructor.newInstance(Constructor.java:525) [rt.jar:1.7.0_09-icedtea]
          at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:148) [spring-beans-3.2.4.RELEASE.jar:3.2.4.RELEASE]
          ... 30 more

      Caused by: org.springframework.jmx.export.UnableToRegisterMBeanException: Unable to register MBean [org.hibernate.jmx.StatisticsService@77dc02f5] with key 'Hibernate:name=woo-statistics'; nested exception is javax.management.InstanceAlreadyExistsException: Hibernate:name=woo-statistics

          at org.springframework.jmx.export.MBeanExporter.registerBeanNameOrInstance(MBeanExporter.java:602) [spring-context-3.2.4.RELEASE.jar:3.2.4.RELEASE]
          at org.springframework.jmx.export.MBeanExporter.registerBeans(MBeanExporter.java:527) [spring-context-3.2.4.RELEASE.jar:3.2.4.RELEASE]
          at org.springframework.jmx.export.MBeanExporter.afterPropertiesSet(MBeanExporter.java:413) [spring-context-3.2.4.RELEASE.jar:3.2.4.RELEASE]
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1541) [spring-beans-3.2.4.RELEASE.jar:3.2.4.RELEASE]
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1479) [spring-beans-3.2.4.RELEASE.jar:3.2.4.RELEASE]
          ... 46 more

      Caused by: javax.management.InstanceAlreadyExistsException: Hibernate:name=woo-statistics

          at com.sun.jmx.mbeanserver.Repository.addMBean(Repository.java:437) [rt.jar:1.7.0_09-icedtea]
          at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerWithRepository(DefaultMBeanServerInterceptor.java:1898) [rt.jar:1.7.0_09-icedtea]
          at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:966) [rt.jar:1.7.0_09-icedtea]
          at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:900) [rt.jar:1.7.0_09-icedtea]
          at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:324) [rt.jar:1.7.0_09-icedtea]
          at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:512) [rt.jar:1.7.0_09-icedtea]
          at org.jboss.as.jmx.PluggableMBeanServerImpl$TcclMBeanServer.registerMBean(PluggableMBeanServerImpl.java:551)
          at org.jboss.as.jmx.PluggableMBeanServerImpl.registerMBean(PluggableMBeanServerImpl.java:319)
          at org.springframework.jmx.support.MBeanRegistrationSupport.doRegister(MBeanRegistrationSupport.java:193) [spring-context-3.2.4.RELEASE.jar:3.2.4.RELEASE]
          at org.springframework.jmx.export.MBeanExporter.registerBeanInstance(MBeanExporter.java:647) [spring-context-3.2.4.RELEASE.jar:3.2.4.RELEASE]
          at org.springframework.jmx.export.MBeanExporter.registerBeanNameOrInstance(MBeanExporter.java:592) [spring-context-3.2.4.RELEASE.jar:3.2.4.RELEASE]
          ... 50 more

       

      It seems that it cannot instantiate the following bean (dao-context.xml)

       

      <!-- Expose Hibernate statistics on JMX - To be removed on production environment -->

       

          <bean id="hibernateSessionFactory" factory-bean="entityManagerFactory"

         factory-method="getSessionFactory" />

          <bean id="hibernateStatistics" class="org.hibernate.jmx.StatisticsService">

         <property name="statisticsEnabled" value="true" />
         <property name="sessionFactory" ref="hibernateSessionFactory" />

          </bean>

          <bean class="org.springframework.jmx.export.MBeanExporter"

         lazy-init="false">
         <property name="beans">
         <map>
         <entry key="Hibernate:name=woo-statistics" value-ref="hibernateStatistics" />
         </map>
         </property>

          </bean>

       

      Is someone able to help me?

      Thank you