Topic
  • No replies
SystemAdmin
SystemAdmin
4447 Posts

Pinned topic Websphere common j workmanager with spring giving exception

‏2012-01-19T17:05:13Z |
Recieving an exception while running workmanager task executor of spring in websphere. The following is my code

<bean id="workManager" class="org.springframework.scheduling.commonj.WorkManagerTaskExecutor">
<property name="workManagerName" value="wm/MyWorkManager"/>
<property name="resourceRef" value="false"/>
</bean>

<bean name="myWorkManager" class="com.spring.test.services.concurrent.ConcurrentWorkManager" />
<bean name="myWorkListener" class="com.spring.test.services.concurrent.ConcurrentWorkListener" />
Code in my ConcurrentWorkManager

@Autowired
private WorkManagerTaskExecutor workManager;

@Autowired
private WorkListener myWorkListener;

if(workList==null){
throw new WorkException("There are no works present in worklist to do work");
}

ArrayList<WorkItem> workItems = new ArrayList<WorkItem>();
for(Work work : workList){
workItems.add(workManager.schedule(work,myWorkListener));
}
workManager.waitForAll(workItems,WorkManager.INDEFINITE);
for(WorkItem work:workItems){
ConcurrentWorker worker=(ConcurrentWorker)work.getResult();
resultString.add(worker.getResult());
}
Now when i am executing my code it is giving stackoverflow exception at workmanager.schedule(work) method

stackoverflow exception

at org.springframework.scheduling.commonj.WorkManagerTaskExecutor.schedule(WorkManagerTaskExecutor.java:202)
at org.springframework.scheduling.commonj.WorkManagerTaskExecutor.schedule(WorkManagerTaskExecutor.java:202)
at org.springframework.scheduling.commonj.WorkManagerTaskExecutor.schedule(WorkManagerTaskExecutor.java:202)
at org.springframework.scheduling.commonj.WorkManagerTaskExecutor.schedule(WorkManagerTaskExecutor.java:202)
at org.springframework.scheduling.commonj.WorkManagerTaskExecutor.schedule(WorkManagerTaskExecutor.java:202)
at org.springframework.scheduling.commonj.WorkManagerTaskExecutor.schedule(WorkManagerTaskExecutor.java:202)
at org.springframework.scheduling.commonj.WorkManagerTaskExecutor.schedule(WorkManagerTaskExecutor.java:202)
at org.springframework.scheduling.commonj.WorkManagerTaskExecutor.schedule(WorkManagerTaskExecutor.java:202)
at org.springframework.scheduling.commonj.WorkManagerTaskExecutor.schedule(WorkManagerTaskExecutor.java:202)
at org.springframework.scheduling.commonj.WorkManagerTaskExecutor.schedule(WorkManagerTaskExecutor.java:202)
at org.springframework.scheduling.commonj.WorkManagerTaskExecutor.schedule(WorkManagerTaskExecutor.java:202)
at org.springframework.scheduling.commonj.WorkManagerTaskExecutor.schedule(WorkManagerTaskExecutor.java:202)
at org.springframework.scheduling.commonj.WorkManagerTaskExecutor.schedule(WorkManagerTaskExecutor.java:202)
at org.springframework.scheduling.commonj.WorkManagerTaskExecutor.schedule(WorkManagerTaskExecutor.java:202)
at org.springframework.scheduling.commonj.WorkManagerTaskExecutor.schedule(WorkManagerTaskExecutor.java:202)