We need to migrate an app that runs on Glassfish to Websphere Application Server (WAS) 8.5.x version.
To see that things are working correctly with a simple setup, I created a sample project with a single rest service.
I did not extend javax.ws.rs.core.Application with my own class, and I only have a class with path annotations. I defined a servlet in web.xml named "javax.ws.rs.core.Application" so that the annotations are scanned and services are expected to be reachable from given servlet url mapping.
When I try to access the service, I get a 404 message. But the real problem is the Apache Wink that comes with standard IBM Websphere libraries.
In the library source code (class DefaultLifecycleManager), there is a part like this:
79 if (ApplicationMetadataCollector.isApplication(cls)) {
80 // by default application subclasses are singletons
81 return LifecycleManagerUtils.createSingletonObjectFactory(cls);
82 }
The isApplication(cls) method should return true, and the singleton factory for it should then be created. However, it returns false. The body of the method is as following:
76 public static boolean More ...isApplication(Class cls) {
77 return Application.class.isAssignableFrom(cls);
78 }
I put a breakpoint there and checked the values. cls is exactly javax.ws.rs.core.Application, which is the same class in the 77th line.
This leads the servlet to not start correctly and return 404 to every request that maps to it.
I don't know how this method returns false, and I need your help.