3

I'm trying to migrate a spring web application to WebSphere liberty profile 8.5 from WebSphere application server 7. I'm getting "java.lang.NoClassDefFoundError: commonj/work/WorkException" at the application start up. I configured the data sources and common libraries using feature manager but couldn't find a way to configure WorkManager.

Can someone tell me how to achieve this?

Here is the exception log:

java.lang.NoClassDefFoundError: commonj/work/WorkException
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:162)
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:76)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:990)
    ... 29 more
Caused by: java.lang.NoClassDefFoundError: commonj/work/WorkException
    at com.foo.mytravel.business.TravelBusinessDelegate.<init>(TravelBusinessDelegate.java:55)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147)
    ... 31 more
Brett Kail
  • 33,593
  • 2
  • 85
  • 90
user3767688
  • 51
  • 1
  • 3

2 Answers2

2

The Liberty profile does not support the commonj or asynchbeans programming models. Instead, it supports the JSR 236 programming model with the concurrent-1.0 feature. You will need to update your application code.

Brett Kail
  • 33,593
  • 2
  • 85
  • 90
  • Thanks for your reply. is there anyway I can add the commonj workmanager as a external library to the server and get it work? I cannot change the application code because it is common component shared across different modules. Could you please suggest any workarounds you know of ? – user3767688 Jan 23 '15 at 18:41
  • I'm not aware of a pre-made solution. In theory, you could probably write an implementation of commonj that uses JSR 236 interfaces. – Brett Kail Jan 23 '15 at 22:15
  • 1
    @user3767688 There is a standalone implementation of CommonJ - http://commonj.myfoo.de. I have not used it myself. Please also see http://stackoverflow.com/questions/6607101/commonj-timermanager-versus-ejb3-timerservice – ᄂ ᄀ Jan 25 '15 at 12:30
0

I had same issue. Fixed by adding commonj-twm.jar to application libs.