How to configure spring commonj workManager in webSphere liberty profile server 8.5

6.6k Views Asked by At

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
2

There are 2 best solutions below

0
On

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

3
On

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.