Skip to content

Reasons for the TypeNotPresentExceptionProxy Execption

Nico Hezel edited this page Oct 24, 2016 · 3 revisions

This guide was written for javacpp 1.2 to show some reasons for the TypeNotPresentExceptionProxy exception while building a preset.

1. Dependent builds

If you want to build the MXNet Library, you might have written something like this:

git clone https://github.com/bytedeco/javacpp.git
cd javacpp
git checkout tags/1.2
mvn clean install
cd ..
git clone https://github.com/bytedeco/javacpp-presets.git 
cd javacpp-presets
git checkout tags/1.2
mvn clean install -Djavacpp.platform=linux-x86_64 -Djavacpp.platform.dependency=false --projects .,mxnet

Windows user should remove the "-Djavacpp.platform.dependency=false" part.

Looks good on the first sight but at the end you get an exception:

[ERROR] Failed to execute goal org.bytedeco:javacpp:1.2:build (javacpp.parser) on project mxnet: Execution javacpp.parser of goal org.bytedeco:javacpp:1.2:build failed: sun.reflect.annotation.TypeNotPresentExceptionProxy -> [Help 1]

Since MXNet depends (its build inherits opencv_highgui.class) on OpenCV you will need to build OpenCV first.

2. Wrong javacpp version

Another reason for the exception is the wrong javacpp version in your local maven repository. The main pom of the javacpp-preset repository is defining the version, but sometimes things get mixed up when building from master. If so, it is recommended to delete javacpp from your local repository and build it again.

Unix: /home/<username>/.m2/repository/org/bytedeco/javacpp
Windows: C:\Users\<username>\.m2\repository\org\bytedeco\javacpp

Make sure to checkout the same version as the presets you want to build.

git clone https://github.com/bytedeco/javacpp.git
cd javacpp
git checkout tags/1.2
mvn clean install