Search code examples
odataodata4j

How to handle the "Unknow ODataVersion 3.0" exception when I use odata4j?


I am studying the odata protocal, and find the odata4j, but when I follow the Consumers Example, an exception occurred, "java.lang.IllegalArgumentException: Unknown ODataVersion 3.0". I debug it and found the odata4j is not supported odata version 3. My question is how can I fix it, or how can I use odata4j? Can I change something to make the version to 2 or 1?? Thank you very much. By the way, I dowloaded the latest odata4j, which is version 0.7.


Solution

  • A sincere recommendation is to switch to Apache Olingo if you would like to implement OData services or clients on the Java platform. The only reason is that OData4J hasn't been updated for more than a year and is not currently supported or maintained. Apache Olingo, on the other hand, is been actively contributed by SAP, Microsoft, and many others. Thus, there are also more samples and documentations there.