OnDemand User Group

Support Forums => OD/WEK & JAVA API => Topic started by: michaelwda on June 09, 2018, 08:40:33 AM

Title: ODWEK Middleware with Spring Boot
Post by: michaelwda on June 09, 2018, 08:40:33 AM
Hi all,

I saw a few posts here and there about writing ODWEK Java servlet middleware. I have actually recently done this for a customer and decided to share the process of getting my environment set up and coding a Spring Boot API to run under Tomcat. I wrote up a quick tutorial complete with a public github repository and want to share it. Our need for this arose because we were previously scraping the CGI from C#. I'm not an on-demand guru, just a developer trying to share some knowledge :)

Main things I ran into were


I don't go too deep into how to set up Spring Tool Suite, deploy to a Tomcat Application Server, or call the API from a client. I can certainly expand on my post if there's a need.

Guide: https://www.michaelwda.com/post/odwek_middleware_springboot (https://www.michaelwda.com/post/odwek_middleware_springboot)
Github: https://github.com/michaelwda/ODWEKServlet (https://github.com/michaelwda/ODWEKServlet)

Github has my plain java code for testing and my full Spring Boot project.

Happy Coding!
Title: Re: ODWEK Middleware with Spring Boot
Post by: Alessandro Perucchi on November 22, 2018, 10:16:57 AM
I've just come across your nice post.

Thank you to share your experience. I wanted to add some things that could be important.

First, if you are doing the caching of connections, be sure to cache the ODServer object, and NOT all the sub classes (like ODFolder, etc...). Because of how ODWEK Java API is created, and its use of JNI (C/C++ native libraries) if you don't do the caching on the ODServer object, you can have lots of problems on complex setup.

Second, from an IBM perspective, the only way ODWEK application is officially supported is to have ODWEK installed on your tomcat server. To package ODApi.jar in your war/ear/... is NOT officially supported, even if you package the native libraries and the codepage files and other stuff...

Cheers