0

When I publish my EAR file to Websphere I am getting this error with four diferent beans:

[5/9/14 8:54:44:485 CDT] 00000018 DefaultListab I org.springframework.beans.factory.support.DefaultSingletonBeanRegistry destroySingletons Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@63706370: defining beans      [updateMPETask,processingNotifyerTask,calendarTask1,calendarTask2,calendarTask3,calendarTask4,calendarTask5,calendarTask6,calendarTask7,datasetNotifyerTask,updateMPEJobDetail,processingNotifyerJobDetail,calendarJob1Detail,calendarJob2Detail,calendarJob3Detail,calendarJob4Detail,calendarJob5Detail,calendarJob6Detail,calendarJob7Detail,datasetNotifyerJobDetail,updateMPENotifyerCronTrigger,processingNotifyerCronTrigger,calendar1CronTrigger,calendar2CronTrigger,calendar3CronTrigger,calendar4CronTrigger,calendar5CronTrigger,calendar6CronTrigger,calendar7CronTrigger,datasetNotifyerCronTrigger,quartzScheduleFactory]; root of factory hierarchy
[5/9/14 8:54:44:485 CDT] 00000018 ContextLoader E org.springframework.web.context.ContextLoader initWebApplicationContext Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'updateABCJobDetail' defined in ServletContext resource [/WEB-INF/classes/resources/dvl/ictt-servlet.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org/apache/commons/collections/SetUtils.orderedSet(Ljava/util/Set;)Ljava/util/Set;
Caused by: java.lang.NoSuchMethodError: org/apache/commons/collections/SetUtils.orderedSet(Ljava/util/Set;)Ljava/util/Set;
at org.quartz.JobDetail.<init>(JobDetail.java:85)

Searching for solutions, I found a lot of forums saying that it might be caused in reason of duplicated or outdated version of commons-collections.jar.

So I remove from Classpath the file commons-collections.jar and pasted commons-collections-3.2.1.jar which I downloaded from http://mvnrepository.com/artifact/commons-collections/commons-collections/3.2.1. Any clue will be very accepted.

My classpath has these files:

enter image description here

Frederic Close
  • 9,389
  • 6
  • 56
  • 67
DemeCarv
  • 249
  • 2
  • 3
  • 13
  • Did you see this http://stackoverflow.com/questions/544514/libraries-conflict-for-quartz. It suggests updating quartz version. – jny May 09 '14 at 19:42

1 Answers1

0

This error happens because your application ends up using the Commons Collections classes found in WebSphere's internals (WebSphere is using Commons Collections for its own purposes), instead of the Commons Collections bundled within your application.

According to WebSphere's documentation, whenever your application makes use of third-party libraries that WebSphere also uses internally (Commons Collections is one of them), you should:

  1. Include your third-party library within your module (such as WEB-INF/lib)
  2. Set your application's classloading mode to PARENT_LAST

That will result in your application using your bundled Commons Collections instead of WebSphere's.

Isaac
  • 16,458
  • 5
  • 57
  • 81