1

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!

risingTide
  • 1,754
  • 7
  • 31
  • 60
  • see if this helps you: http://stackoverflow.com/questions/30247567/error-invoking-restful-webservice-on-websphere-8-5-5-2-server/30714543#30714543 – Prerak Tiwari Jul 07 '15 at 18:43
  • Yep, I have already have everything completed in the answer on that post. My main question is what should the web.xml entry look like above when integrating with Spring? – risingTide Jul 07 '15 at 18:52
  • This article talks about Spring Integration with wink: http://www.ibm.com/developerworks/library/wa-apachewink2/ you can also try using RestServlet Instead of IBMRestServlet. – Prerak Tiwari Jul 07 '15 at 18:56
  • where is "wink-core-context.xml" is packaged ? inside EAR or WAR? – Prerak Tiwari Jul 07 '15 at 18:58
  • Yes, I have looked at that link as well. This portion: _To load the Spring context, you must first define and add the context load listener to the web.xml file of the Web application. Also, the contextConfigLocation context-param should indicate the location of the Apache Wink core context file and the application-specific context file._ actually led me to my question above. I'm trying to find out exactly where that Apache WInk core context file is...and what it is called. – risingTide Jul 07 '15 at 19:01
  • 1
    Have you included "wink-spring-support--incubating.jar" in the classpath? If not then this could be the issue. – Prerak Tiwari Jul 07 '15 at 19:16
  • Is that an Apache Wink jar or an IBM specific jar? – risingTide Jul 07 '15 at 19:24
  • 1
    Its Apace wink jar. Download the 1.1 version. – Prerak Tiwari Jul 07 '15 at 19:30
  • Easy now Prerak; I just had a chance to test it! :) And yes, it did work! That eliminated the error shown above. I do have another error now however, but I will post that into a different question. If you could look for another question coming soon I would appreciate it! Thanks for help; if you post the inclusion of the wink-spring-support.jar as an answer I'll mark it and give you credit! – risingTide Jul 08 '15 at 15:34

1 Answers1

1

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.

Prerak Tiwari
  • 3,436
  • 4
  • 34
  • 64