Anyone, please help me to short out. While deploying my war file on Jboss it shows this below error. I stuck myself to find out what was the reason.
[o.s.c.annotation.ConfigurationClassUtils] : Could not find class file for introspecting factory methods: java.util.concurrent.ThreadPoolExecutor.DiscardPolicy java.io.FileNotFoundException: class path resource [java/util/concurrent/ThreadPoolExecutor/DiscardPolicy.class] cannot be opened because it does not exist
at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:158) ~[org.springframework.core-3.1.0.RELEASE.jar!/:3.1.0.RELEASE] at org.springframework.core.type.classreading.SimpleMetadataReader.(SimpleMetadataReader.java:45) ~[org.springframework.core-3.1.0.RELEASE.jar!/:3.1.0.RELEASE] at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:80) ~[org.springframework.core-3.1.0.RELEASE.jar!/:3.1.0.RELEASE] at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:101) ~[org.springframework.core-3.1.0.RELEASE.jar!/:3.1.0.RELEASE] at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:76) ~[org.springframework.core-3.1.0.RELEASE.jar!/:3.1.0.RELEASE] at org.springframework.context.annotation.ConfigurationClassUtils.checkConfigurationClassCandidate(ConfigurationClassUtils.java:69) ~[org.springframework.context-3.1.0.RELEASE.jar!/:3.1.0.RELEASE] at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:216) [org.springframework.context-3.1.0.RELEASE.jar!/:3.1.0.RELEASE] at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:178) [org.springframework.context-3.1.0.RELEASE.jar!/:3.1.0.RELEASE] at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:617) [org.springframework.context-3.1.0.RELEASE.jar!/:3.1.0.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:446) [org.springframework.context-3.1.0.RELEASE.jar!/:3.1.0.RELEASE] at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:384) [org.springframework.web-3.1.0.RELEASE.jar!/:3.1.0.RELEASE] at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283) [org.springframework.web-3.1.0.RELEASE.jar!/:3.1.0.RELEASE] at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111) [org.springframework.web-3.1.0.RELEASE.jar!/:3.1.0.RELEASE] at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3339) [jbossweb-7.4.8.Final-redhat-4.jar!/:7.4.8.Final-redhat-4] at org.apache.catalina.core.StandardContext.start(StandardContext.java:3777) [jbossweb-7.4.8.Final-redhat-4.jar!/:7.4.8.Final-redhat-4] at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:161) [jboss-as-web-7.4.0.Final-redhat-19.jar!/:7.4.0.Final-redhat-19] at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:59) [jboss-as-web-7.4.0.Final-redhat-19.jar!/:7.4.0.Final-redhat-19] at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:94) [jboss-as-web-7.4.0.Final-redhat-19.jar!/:7.4.0.Final-redhat-19] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_74] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_74] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_74] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_74] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_74] at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.1.1.Final-redhat-1.jar!/:2.1.1.Final-redhat-1]
Solution that I have found
The problem with my configured spring bean ref injection.
Before
<bean id="taskExecutor" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
<property name="corePoolSize" value="100" />
<property name="maxPoolSize" value="50" />
<property name="queueCapacity" value="150" />
<property name="rejectedExecutionHandler" ref="discardPolicy" />
</bean>
<bean id="discardPolicy" class="java.util.concurrent.ThreadPoolExecutor.DiscardPolicy"/>
Modified (Solved)
<bean id="taskExecutor" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
<property name="corePoolSize" value="100" />
<property name="maxPoolSize" value="50" />
<property name="queueCapacity" value="150" />
<property name="rejectedExecutionHandler">
<bean class="java.util.concurrent.ThreadPoolExecutor.DiscardPolicy"/>
</property>
</bean>