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 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);

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: […]

Exception in thread “main” java.lang.RuntimeException: Error parsing file: edu/stanford/nlp/models/sutime/defs.sutime.txt

The following error: Exception in thread “main” java.lang.RuntimeException: Error parsing file: edu/stanford/nlp/models/sutime/defs.sutime.txt Is caused by using the Stanford NLP jars, but not the entire project on the classpath. To fix it, you want to download the “full” distribution and add that folder to the classpath.

Fixing Scala Error: Main method is not static in class X

If you set up a Scala HelloWorld example naively, it is easy to get the following perplexing error message: :runError: Main method is not static in class com.garysieling.HelloWorld, please define the main method as: public static void main(String[] args) This happens if the code looks like the following: package com.garysieling { class HelloWorld extends App […]

Improving Performance of Gradle + Scala Build with a compiler daemon

If you find the build times of Scala programs in gradle unacceptably slow, you can add the following to build.gradle. This took my simple build from 25 seconds to five. compileScala { scalaCompileOptions.useCompileDaemon = true // optionally specify host and port of the daemon: scalaCompileOptions.daemonServer = “localhost:4243” } This doesn’t seem to be stable all […]

Fixing Gradle Error: Cannot infer Scala class path because no Scala library Jar was found on class path: configuration ‘:compile’

When you get this error: Cannot infer Scala class path because no Scala library Jar was found on class path: configuration ‘:compile’ This indicates that you need to tell gradle which version of Scala you’re interested in, so that it can download it. To fix this, add the following to build.gradle: dependencies { compile ‘org.scala-lang:scala-library:2.10.1’ […]