1

I am using the following configurations for my Rest-WS application and it deploys/works well on WAS 7.x.

But when i deploy the same on WAS8.0, i get the following exception:

(java.lang.NoSuchMethodError: javax/ws/rs/core/Application.getProperties()Ljava/util/Map)

I understand that WAS 8.X has a JAX-RS-1.0 runtime and since the 1.0 api interface does not have the Application::getProperties(), i get the exception above.

So how do i get my project to work on WAS 8.X. Any pointers would be much appreciated..

My current application configuration as below -

JAX-RS-2.0/JSR339

JERSEY 2.5

JACKSON 2.3

WEB.XML

  <servlet>
    <servlet-name>jersey-serlvet</servlet-name>
    <servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
    <init-param>
        <param-name>javax.ws.rs.Application</param-name>
        <param-value>com.packagename.resources.MyAppResourceConfig</param-value>
    </init-param>

    <load-on-startup>1</load-on-startup>
  </servlet>

MyAppResourceConfig.java

public class MyAppResourceConfig extends ResourceConfig {
    public MonitoringResourceConfig() {
        // Registers JAX-RS Components
        register(RequestContextFilter.class);
        register(MyRestResource.class);
        packages( "com.packagename");
    }

}

MyRestResource.java contains @path definitions.

P.S - I tried setting the JVM property DisableIBMJAXRSEngine in WAS, but it doesn't help.

rbot
  • 249
  • 2
  • 11
  • Please check [JAX-RS Jersey 2.10 support in Websphere 8][1]. It explains how to configure JAX-RS 2.x in WAS 8.x. [1]: http://stackoverflow.com/questions/24684958/jax-rs-jersey-2-10-support-in-websphere-8 – Gas Jul 15 '14 at 19:38

1 Answers1

2

I'm having the same trouble with Jersey 2.6 and WAS 8.0.0.3. I tried changing the class loading policy to parent last (on both, web module and application) and putting the Jersey jars into the application. It solved that problem, but is too restricted for my context.

Diepe007
  • 21
  • 1
  • 6