Search code examples
spring-mvcgoogle-vision

java.lang.VerifyError exception while authenticating for Google Vision Api


The code for vision api works fine when using a java application however when using spring a java.lang.VerifyError exception is thrown on the following line.

Labels app = new Labels(label.getVisionService());

It was certain that i had specified the json credentials for the system and not the web app so i have included the following bean in my root-context.xml:-

<bean id="googleVisionApiAuthenticator" class="com.something.mypackage.Labels">
<property name="APPLICATION_NAME" value="myCompany-VisionLabelSample/1.0" />
<property name="MAX_LABELS" value="3" />
</bean>

After inclusion of these lines in the root-context its gives page not found.


Solution

  • Well the problem was that some of the jars present were duplicate hence the error. A detailed study of the dependencies and removing the extra jars helped solve the error.