Search code examples
javaspringweb.xmlwebsphere-8apache-wink

Using Spring with WebSphere 8.5.5 and Apache Wink - web.xml error on server startup


I'm currently migrating a Java app using Wink 1.1.1 and Spring 3.1.2 from WAS 7 to WAS 8.5.5. I'm trying to use the native Wink-integration that is available in WAS 8.5 instead of using the separate Wink jars we currently have now with WAS 7.

I'm getting an error on server startup that looks like this:

Caused by: java.io.FileNotFoundException: class path resource [META-INF/server/wink-core-context.xml] cannot be opened because it does not exist at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:157)

Now, in my current WAS 7 world where I'm explicitly using the Wink jars I have this entry in my web.xml:

  <servlet>
    <servlet-name>Wink Servlet</servlet-name>
    <servlet-class>org.apache.wink.server.internal.servlet.RestServlet</servlet-class>
  </servlet>

  <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath:META-INF/server/wink-core-context.xml
        /WEB-INF/spring/applicationContext-configuration.xml</param-value>
  </context-param>

which works just fine.

I'm trying to figure out the correct web.xml entry for WAS 8.5 using the native Wink-integration that it has. Here is what I currently have:

  <servlet>
    <servlet-name>IBM Rest Servlet</servlet-name>
    <servlet-class>com.ibm.websphere.jaxrs.server.IBMRestServlet</servlet-class>
  </servlet>

  <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath:META-INF/server/wink-core-context.xml
        /WEB-INF/spring/applicationContext-configuration.xml</param-value>
  </context-param>

However, I'm getting the error above. I'm wondering if the Wink core context file is simply located at a different place in the IBM setup? Also, which jar in the IBM setup actually houses the wink implementation? I haven't been able to find a definitive answer on that either.

Thanks for your help!


Solution

  • As wink-spring-support-1.1-incubating.jar is not supplied with WAS 8.5 Wink Distribution, you need to include that jar explicitly in application classpath.