Fixing NullPointerException in EdmNavigationPropertyImplProv.getMultiplicity

Sometimes you may receive a NullPointerException in the getMultiplicity function of EdmNavigationPropertyImplProv.java, part of the Olingo OData library. This is caused by not having set associations / association sets up correction (i.e. foreign keys). To fix the problem you either need to fix your associations and association sets to match and have ‘setMultiplicity’ calls, or […]

Fixing OData/Olingo error: “Could not find an entity set or function import for ‘x’.”

Sometimes with Apache Olingo you see this error message: Could not find an entity set or function import for ‘my_table’. The Olingo sample applications register types like so: static final String ENTITY_SET_NAME_CARS = "Cars";   private static final FullQualifiedName ENTITY_TYPE_1_1 = new FullQualifiedName( NAMESPACE, ENTITY_NAME_CAR);   …   List<EntitySet> entitySets = new ArrayList<EntitySet>();   entitySets.add( […]

Fixing Olingo Error “Format of ‘1’ is not compatible with ‘Edm.String’.”

When changing types in Olingo OData services, you may get an error like the following: Format of ‘1’ is not compatible with ‘Edm.String’. This indicates you have a line like this: return type.valueOfString(key.getLiteral(), EdmLiteralKind.DEFAULT, property.getFacets(), Integer.class); Which should in fact be like this: return type.valueOfString( key.getLiteral(), EdmLiteralKind.DEFAULT, property.getFacets(), String.class);

Tips for Debugging Olingo Services

If you get an error debugging an Olingo service (one of the Java libraries for OData), you often get an error like “An exception occurred.” This, apparently, is a result of decision by the Olingo team to not be dependent on a specific logging library (although I’m not sure how this makes sense, since they […]

,

Getting Started with OData in Java

OData is a new web service protocol, developed by Microsoft, which sits somewhere between ODBC, Rest, and a business intelligence oriented SQL. The protocol seems to be fairly complex, and as such, does not seem well-suited to “big data” workflows. It does, however have built in support for things like differential data loads, so there […]

How to fix MojoFailureException configuring Olingo

If you set up Olingo, they have you run a Maven archetype (project template) like so: mvn archetype:generate \ -DinteractiveMode=false \ -Dversion=1.0.0-SNAPSHOT \ -DgroupId=com.sample \ -DartifactId=my-car-service \ -DarchetypeGroupId=org.apache.olingo \ -DarchetypeArtifactId=olingo-odata2-sample-cars-service-archetype \ -DarchetypeVersion=RELEASE \ If you didn’t follow the instructions correctly, you’ll get the following error: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.2:generate (default-cli) on project OlingoSampleClient: […]