1 Reply Latest reply on Feb 20, 2013 3:07 AM by Kevin Zhang

    ProxyAsyncConfiguration

    Shivam Sinha Newbie

      Hi,

       

      I have spent atleast 14+ hrs on trying to migrate my exisiting spring app to jbossAS7 and would really appreciate anyhelp with the following issue, when attempting to start JBoss:

       

       

      {code}

      Exception:

      02:25:44,885 INFO  [org.springframework.beans.factory.support.DefaultListableBeanFactory] (MSC service thread 1-4) Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@78090631: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,econDateInitDatabaseImpl,forexPro,importStaticDataImpl,edIndicatorValueFactoryImpl,edCityDAOImpl,edCountryDAOImpl,edHistoryDAOImpl,edHolidayDAOImpl,edIndicatorDAOImpl,edIndicatorValueDAOImpl,edJobDAOImpl,edRegionDAOImpl,edIndicatorSchedulerImpl,proxyAsyncConfiguration,schedulingConfiguration,loadTimeWeavingConfiguration,proxyTransactionManagementConfiguration,delegatingWebMvcConfiguration,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,emf,dataSource,transactionManager,exporter,testBean,schedulerFactoryBean,org.springframework.context.annotation.ConfigurationClassPostProcessor$ImportAwareBeanPostProcessor#0,org.springframework.context.annotation.internalAsyncAnnotationProcessor,org.springframework.context.annotation.internalScheduledAnnotationProcessor,loadTimeWeaver,transactionAttributeSource,transactionInterceptor,requestMappingHandlerMapping,viewControllerHandlerMapping,beanNameHandlerMapping,resourceHandlerMapping,defaultServletHandlerMapping,requestMappingHandlerAdapter,mvcConversionService,mvcValidator,httpRequestHandlerAdapter,simpleControllerHandlerAdapter,handlerExceptionResolver]; root of factory hierarchy

      02:25:44,888 ERROR [org.springframework.web.context.ContextLoader] (MSC service thread 1-4) Context initialization failed: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.context.annotation.internalAsyncAnnotationProcessor' defined in class path resource [org/springframework/scheduling/annotation/ProxyAsyncConfiguration.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.scheduling.annotation.AsyncAnnotationBeanPostProcessor org.springframework.scheduling.annotation.ProxyAsyncConfiguration.asyncAdvisor()] threw exception; nested exception is java.lang.IllegalArgumentException: @EnableAsync annotation metadata was not injected

                at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:581) [spring-beans-3.1.0.RC1.jar:]

                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1008) [spring-beans-3.1.0.RC1.jar:]

                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:904) [spring-beans-3.1.0.RC1.jar:]

                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:488) [spring-beans-3.1.0.RC1.jar:]

                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:459) [spring-beans-3.1.0.RC1.jar:]

                at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) [spring-beans-3.1.0.RC1.jar:]

                at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) [spring-beans-3.1.0.RC1.jar:]

                at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) [spring-beans-3.1.0.RC1.jar:]

                at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) [spring-beans-3.1.0.RC1.jar:]

                at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:728) [spring-context-3.1.0.RC1.jar:]

                at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:449) [spring-context-3.1.0.RC1.jar:]

                at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:381) [spring-web-3.1.0.RC1.jar:]

                at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283) [spring-web-3.1.0.RC1.jar:]

                at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111) [spring-web-3.1.0.RC1.jar:]

                at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3368) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                at org.apache.catalina.core.StandardContext.start(StandardContext.java:3821) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:70) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]

                at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824)

                at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759)

                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_29]

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_29]

                at java.lang.Thread.run(Thread.java:680) [:1.6.0_29]

      Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.scheduling.annotation.AsyncAnnotationBeanPostProcessor org.springframework.scheduling.annotation.ProxyAsyncConfiguration.asyncAdvisor()] threw exception; nested exception is java.lang.IllegalArgumentException: @EnableAsync annotation metadata was not injected

                at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:169) [spring-beans-3.1.0.RC1.jar:]

                at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:570) [spring-beans-3.1.0.RC1.jar:]

                ... 21 more

      Caused by: java.lang.IllegalArgumentException: @EnableAsync annotation metadata was not injected

                at org.springframework.util.Assert.notNull(Assert.java:112) [spring-core-3.1.0.RC1.jar:]

                at org.springframework.scheduling.annotation.ProxyAsyncConfiguration.asyncAdvisor(ProxyAsyncConfiguration.java:45) [spring-context-3.1.0.RC1.jar:]

                at org.springframework.scheduling.annotation.ProxyAsyncConfiguration$$EnhancerByCGLIB$$c8304691.CGLIB$asyncAdvisor$0(<generated>) [cglib-nodep-2.2.jar:]

                at org.springframework.scheduling.annotation.ProxyAsyncConfiguration$$EnhancerByCGLIB$$c8304691$$FastClassByCGLIB$$df56e036.invoke(<generated>) [cglib-nodep-2.2.jar:]

                at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:215) [cglib-nodep-2.2.jar:]

                at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:253) [spring-context-3.1.0.RC1.jar:]

                at org.springframework.scheduling.annotation.ProxyAsyncConfiguration$$EnhancerByCGLIB$$c8304691.asyncAdvisor(<generated>) [cglib-nodep-2.2.jar:]

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_29]

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_29]

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_29]

                at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_29]

                at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:149) [spring-beans-3.1.0.RC1.jar:]

                ... 22 more

       

      02:25:44,890 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/econdates]] (MSC service thread 1-4) Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.context.annotation.internalAsyncAnnotationProcessor' defined in class path resource [org/springframework/scheduling/annotation/ProxyAsyncConfiguration.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.scheduling.annotation.AsyncAnnotationBeanPostProcessor org.springframework.scheduling.annotation.ProxyAsyncConfiguration.asyncAdvisor()] threw exception; nested exception is java.lang.IllegalArgumentException: @EnableAsync annotation metadata was not injected

                at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:581) [spring-beans-3.1.0.RC1.jar:]

                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1008) [spring-beans-3.1.0.RC1.jar:]

                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:904) [spring-beans-3.1.0.RC1.jar:]

                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:488) [spring-beans-3.1.0.RC1.jar:]

                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:459) [spring-beans-3.1.0.RC1.jar:]

                at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) [spring-beans-3.1.0.RC1.jar:]

                at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) [spring-beans-3.1.0.RC1.jar:]

                at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) [spring-beans-3.1.0.RC1.jar:]

                at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) [spring-beans-3.1.0.RC1.jar:]

                at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:728) [spring-context-3.1.0.RC1.jar:]

                at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:449) [spring-context-3.1.0.RC1.jar:]

                at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:381) [spring-web-3.1.0.RC1.jar:]

                at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283) [spring-web-3.1.0.RC1.jar:]

                at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111) [spring-web-3.1.0.RC1.jar:]

                at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3368) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                at org.apache.catalina.core.StandardContext.start(StandardContext.java:3821) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:70) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]

                at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824)

                at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759)

                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_29]

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_29]

                at java.lang.Thread.run(Thread.java:680) [:1.6.0_29]

      Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.scheduling.annotation.AsyncAnnotationBeanPostProcessor org.springframework.scheduling.annotation.ProxyAsyncConfiguration.asyncAdvisor()] threw exception; nested exception is java.lang.IllegalArgumentException: @EnableAsync annotation metadata was not injected

                at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:169) [spring-beans-3.1.0.RC1.jar:]

                at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:570) [spring-beans-3.1.0.RC1.jar:]

                ... 21 more

      Caused by: java.lang.IllegalArgumentException: @EnableAsync annotation metadata was not injected

                at org.springframework.util.Assert.notNull(Assert.java:112) [spring-core-3.1.0.RC1.jar:]

                at org.springframework.scheduling.annotation.ProxyAsyncConfiguration.asyncAdvisor(ProxyAsyncConfiguration.java:45) [spring-context-3.1.0.RC1.jar:]

                at org.springframework.scheduling.annotation.ProxyAsyncConfiguration$$EnhancerByCGLIB$$c8304691.CGLIB$asyncAdvisor$0(<generated>) [cglib-nodep-2.2.jar:]

                at org.springframework.scheduling.annotation.ProxyAsyncConfiguration$$EnhancerByCGLIB$$c8304691$$FastClassByCGLIB$$df56e036.invoke(<generated>) [cglib-nodep-2.2.jar:]

                at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:215) [cglib-nodep-2.2.jar:]

                at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:253) [spring-context-3.1.0.RC1.jar:]

                at org.springframework.scheduling.annotation.ProxyAsyncConfiguration$$EnhancerByCGLIB$$c8304691.asyncAdvisor(<generated>) [cglib-nodep-2.2.jar:]

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_29]

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_29]

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_29]

                at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_29]

                at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:149) [spring-beans-3.1.0.RC1.jar:]

                ... 22 more

       

      02:25:44,915 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-4) Initializing Mojarra 2.1.3 (SNAPSHOT 20110825) for context '/econdates'

      02:25:45,809 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-4) Error listenerStart

      02:25:45,809 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-4) Context [/econdates] startup failed due to previous errors

      02:25:45,810 INFO  [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/econdates]] (MSC service thread 1-4) Closing Spring root WebApplicationContext

      02:25:45,812 INFO  [org.jboss.web] (MSC service thread 1-4) registering web context: /econdates

      02:25:45,858 INFO  [org.jboss.as.server.controller] (DeploymentScanner-threads - 2) Deployed "econdates.war"

      {code}

       

       

       

      {code}

      spring application-infrastructure.xml:


      <?xml version="1.0" encoding="UTF-8"?>

      <beans xmlns="http://www.springframework.org/schema/beans"

      ...

       

      <tx:annotation-driven />

      <tx:jta-transaction-manager />

      <jee:jndi-lookup jndi-name="java:jboss/myEntityManagerFactory" id="emf"/>          

      <jee:jndi-lookup jndi-name="java:jboss/datasources/EconDatesDB" id="dataSource" expected-type="javax.sql.DataSource"/>

      {code}

       

       


      {code}

      persistence.xml:

      <persistence xmlns="http://java.sun.com/xml/ns/persistence"

      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

      xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"

      version="2.0">

       

      <persistence-unit name="EconDatesDB" transaction-type="JTA">

        <!-- Using the example datasource set up by JBoss AS 7 For your application,

        set up a managed datasource and use that instead -->

        <jta-data-source>java:jboss/datasources/EconDatesDB</jta-data-source>

       

        <properties>

        <property name="hibernate.show_sql" value="true" />

        <!-- Bind entity manager factory to JNDI at java:jboss/myEntityManagerFactory" -->

        <property name="jboss.entity.manager.factory.jndi.name"

        value="java:jboss/myEntityManagerFactory" />

        </properties>

      </persistence-unit>

      </persistence>

      {code}

       

       

       

       

      {code}

      web.xml:

      <display-name>Econ Dates</display-name>

      <context-param>

                          <param-name>contextConfigLocation</param-name>

                          <param-value>classpath:/META-INF/spring/application-context.xml,

                    classpath:/META-INF/spring/application-infrastructure.xml,

                    <!-- classpath:/META-INF/spring/econdates-security-context.xml  -->

        </param-value>

      </context-param>

      ....

      <servlet-mapping>

        <servlet-name>EconDates</servlet-name>

        <url-pattern>/</url-pattern>

      </servlet-mapping>


      ...

      <persistence-context-ref>

        <persistence-context-ref-name>jboss/myEntityManagerFactory</persistence-context-ref-name>

        <persistence-unit-name>EconDatesDB</persistence-unit-name>

      </persistence-context-ref>

      {code}