在Spring定义中定义多个WorkManagerTaskExecutor

时间:2018-09-20 17:13:13

标签: java spring threadpoolexecutor commonj workmanagertaskexecutor

我正在尝试在我的if (input.hasNextInt()) { lines = input.nextInt(); } else { System.out.println("Please enter a number"); input.nextLine(); // Drop the current input up to the end-of-line marker } 文件中定义多个WorkManagerTaskExecutor,但是我一直收到错误消息

applicationContext.xml

我的bean定义很简单:

javax.naming.NoInitialContextException: Need to specify class name in environment or system 
property, or as an applet parameter, or as an application resource file

我尝试使用<bean id="exo.cc.core.comms.external.SecondaryCommonJExecutor" class="org.springframework.scheduling.commonj.WorkManagerTaskExecutor" scope="prototype"> <property name="workManagerName" value="java:comp/env/springSecondaryWorkManager"/> <property name="workListener"> <bean class="exo.cc.core.util.LoggingListener"/> </property> </bean> <bean id="exo.cc.core.comms.external.CommonJExecutor" class="org.springframework.scheduling.commonj.WorkManagerTaskExecutor" scope="prototype"> <property name="workManagerName" value="java:comp/env/springWorkManager"/> <property name="workListener"> <bean class="exo.cc.core.util.LoggingListener"/> </property> </bean> 作为有效措施,但这并不重要。当我只使用一个scope="prototype" bean时,一切都很好。我只需要添加另一个CommonJExecutor

0 个答案:

没有答案