Getting package javax.ws.rs does not exist error - java

I keep getting the javax.ws.rs error while my dependencies should be right. How do I fix this?
I am using the IntelliJ IDE and when I import it in my project it does recognise javax.ws.rs.*. It does not give any error there.
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
</properties>
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>5.2.6.Final</version>
</dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>persistence-api</artifactId>
<version>1.0.2</version>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>org.apache.johnzon</groupId>
<artifactId>johnzon-jaxrs</artifactId>
<version>0.9.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-jaxrs</artifactId>
<version>1.9.13</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.johnzon</groupId>
<artifactId>johnzon-jaxrs</artifactId>
<version>1.1.7</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.44</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.192</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.github.binout</groupId>
<artifactId>jaxrs-unit-api</artifactId>
<version>1.1.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.github.binout</groupId>
<artifactId>jaxrs-unit-resteasy</artifactId>
<version>1.1.1</version>
<scope>test</scope>
</dependency>
</dependencies>

Yes, your dependencies seem to be right.
Try to update Idea's Maven indices as described here. Go to Preferences and type into search box Repositories than find it under Maven section, select remote repo in the table and press update button.
You might run then into another problem, when it takes infinite time to update indices('processing indices' phase takes minutes at any case) - just use this answers to fix the issue. To give more memory you can use Help->Edit Custom VM Options and set xmx to something like 2g

The problem was that my project was in my OneDrive location. This caused me a lot of trouble but as soon as I moved it to my local drive it solved all of the problems.

Related

How can I get rid of the 'no changelog could be found' error related to Liquibase without using Liquibase?

I'm working with the project, where I have as a POM file:
<dependencies>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
<version>2.3.2.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.liquibase/liquibase-core -->
<dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-core</artifactId>
<version>4.16.1</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.4.4</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jooq</artifactId>
<version>2.7.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.5</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish.web</groupId>
<artifactId>jakarta.servlet.jsp.jstl</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.20</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.jooq/jooq -->
<dependency>
<groupId>org.jooq</groupId>
<artifactId>jooq</artifactId>
<version>3.15.0</version>
</dependency>
</dependencies>
While I'm running the current version of the project, I'm getting constantly the issue as:
Liquibase failed to start because no changelog could be found at 'classpath:/db/changelog/db.changelog-master.yaml'.
I've already researched answers based on:
https://stackoverflow.com/a/63227085/8370915
Liquibase failed to start because no changelog could be found at 'Migration File: class path
Why liquibase unable to resolved the db.changelog classpath?
and my question based on it is:
if I don't have any requirements in the task to use Liquibase as an additional tool, can I fix this issue somehow and avoid it as I don't need it.
If yes, do you know what can be the cause of reproducing it? What do I need to change in my POM specifically to remove this error?
I'm asking it, because if I remove the dependency as liquibase-core:
<dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-core</artifactId>
<version>4.16.1</version>
</dependency>
I'm getting another issue as:
Caused by: java.lang.ClassNotFoundException: liquibase.exception.ChangeLogParseException
and to solve it, I need to add dependency of Liquibase.
I can provide any additional details, if you need.
Thank you in advance for any smart ideas.
As one of the use cases, it can be added the changelog file:
db.changelog-master.yaml
inside the directory resource/db/changelog/ with the following content as:
databaseChangeLog:
- changeSet:
id: 1
author: invzbl3
name: db.changelog-master.yaml
environment: testing
is-enabled: false
using is-enabled with the value as false.

Latest tomcat-embed-logging-juli does not match with other embedded artifacts.. Is it not part of tomcat?

I'm working on a legacy maven project and it uses embedded tomcat. Recently as part of fixing the security vulnerabilities, tomcat is upgraded to latest version 9.0.55. But surprisingly I don't see the corresponding version for the artifact tomcat-embed-logging-juli. We've already have the slf4j logging library for project. Do I really need the library tomcat-embed-logging-juli dependency as I don't have any logs written with servletContext log?
Following is the relevant section from my pom.xml
<properties>
<tomcat.version>9.0.55</tomcat.version>
</properties>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.30</version>
</dependency>
<!-- Tomcat -->
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-websocket</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-logging-juli</artifactId>
<version>8.0.53</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<version>${tomcat.version}</version>
</dependency>
I am just learning Java & it's dependencies. I ran into this issue when trying to follow this Oracle Template. I got this error:
Dependency 'org.apache.tomcat.embed:tomcat-embed-logging-juli:10.0.20' not found
So did some digging and It appears as though the original repo: org.apache.tomcat.embed » tomcat-embed-logging-juli lost support or moved to the core repo as the last update was for 7.0.109 in APR, 2021.
Which leads me to believe that this moved to the core tomcat:
Maintained Repo: org.apache.tomcat » tomcat-juli
So, I was able to get a new repo working using the following:
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<tomcat.version>10.0.20</tomcat.version>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-juli</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jasper</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jasper-el</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jsp-api</artifactId>
<version>${tomcat.version}</version>
</dependency>
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
</dependencies>
Again I am no expert, just an observation from basic research. Please let me know if this is wrong or needs adjustment.
Using:
IntelliJ IDEA: 2022.1.4
Java: 18
Tomcat: 10.0.20
Maven: 4.0.0
Maven Compiler: 1.7

Hibernate Issue with Spring Maven & Tomcat

I have been scratching my head for a few hours and can't seem to solve this issue. I have been following several tutorials on getting started with Maven & Hibernate, following this and this. Each time I deploy on Virgo Tomcat, I get the following error spitting out
An Import-Package could not be resolved. Caused by missing constraint in bundle <com.stuart.contextmanagement_0.1.0>
constraint: <Import-Package: javassist.util.proxy; version="[3.18.0,4.0.0)">
So I added Java Assist as a dependency in my pom, then is spat out
An Import-Package could not be resolved. Caused by missing constraint in bundle
com.stuart.contextmanagement_0.1.0>
constraint: <Import-Package: com.sun.jdi.request; version="0.0.0">
I can't find the above package when searching through repo's. I have also experienced a similar issue before, and every time I add a new dependency which it can't find, it can't find another one and so on...
A snippet of my pom is as follows;
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.3.5.Final</version>
</dependency>
<dependency>
<groupId>javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.12.1.GA</version>
</dependency>
Thanks for your help.
hm, have you tried also the jboss javassist?
I ended up finding a solution. For any one who's interested, I ended up creating another maven project and exporting several other dependencies than I could see any any documentation or tutorial. Below is the snippet of my final pom.xml.
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>org.springframework.spring-library</artifactId>
<type>libd</type>
<version>3.0.5.RELEASE</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.javassist</groupId>
<artifactId>com.springsource.javassist</artifactId>
<version>3.15.0.GA</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>com.springsource.javax.persistence</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>persistence-api</artifactId>
<version>1.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>jsr250-api</artifactId>
<version>1.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>com.springsource.org.apache.commons.dbcp</artifactId>
<version>1.2.2.osgi</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>com.springsource.org.apache.derby</artifactId>
<version>10.5.1000001.764942</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>com.springsource.org.hibernate</artifactId>
<version>3.3.2.GA</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>com.springsource.org.hibernate.annotations</artifactId>
<version>3.4.0.GA-A</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>com.springsource.org.hibernate.annotations.common</artifactId>
<version>3.3.0.ga</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.dom4j</groupId>
<artifactId>com.springsource.org.dom4j</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.9</version>
<scope>compile</scope>
</dependency>
</dependencies>

multiple containers error in Arquillian

I am installing Arquillian in a project which utilizes weld CDI and JPA and I am trying to use embedded GlassFish container (I read that Weld embedded container is not supporting JPA).
I have added GlassFishContainer in my pom.xml but I am getting an error message when I running the test cases. Here id the Error message:
Multiple service implementations found for interface
org.jboss.arquillian.container.spi.client.container.DeployableContainer.
org.jboss.arquillian.container.glassfish.embedded_3_1.GlassFishContainer,
org.jboss.arquillian.container.weld.ee.embedded_1_1.WeldEEMockContainer
It seems that I have both Weld embedded container and glassFilsh. I double checked my pom.xml , I have just embedded glassfish. I couldn't find any sign of Weld embedded container. Any idea?!
I encountered this error as well while setting up Arquillian with an embedded Tomcat-8 in IntelliJ with Maven.
Here is my working (for an example project) POM:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>arquillilan.tomcat.test</groupId>
<artifactId>arquillianTest</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>arquillianTest</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<version.org.eclipse.jdt.core.compiler>3.7</version.org.eclipse.jdt.core.compiler>
<version.weld_servlet>1.1.9.Final</version.weld_servlet>
<version.arquillian>1.1.5.Final</version.arquillian>
<version.tomcat>8.5.57</version.tomcat>
</properties>
<dependencies>
<!-- org.jboss.arquillian -->
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-container-spi</artifactId>
<version>${version.arquillian}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.jboss.arquillian.container/arquillian-container-test-spi -->
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-container-test-spi</artifactId>
<version>${version.arquillian}</version>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.protocol</groupId>
<artifactId>arquillian-protocol-servlet</artifactId>
<version>${version.arquillian}</version>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.testenricher</groupId>
<artifactId>arquillian-testenricher-cdi</artifactId>
<version>${version.arquillian}</version>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.testenricher</groupId>
<artifactId>arquillian-testenricher-resource</artifactId>
<version>${version.arquillian}</version>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.testenricher</groupId>
<artifactId>arquillian-testenricher-initialcontext</artifactId>
<version>${version.arquillian}</version>
</dependency>
<!-- org.apache.tomcat -->
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
<version>${version.tomcat}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<version>${version.tomcat}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-logging-juli</artifactId>
<version>8.5.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jdt.core.compiler</groupId>
<artifactId>ecj</artifactId>
<version>${version.org.eclipse.jdt.core.compiler}</version>
<scope>provided</scope>
</dependency>
<!-- testing -->
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<version>${version.arquillian}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-impl-maven</artifactId>
<version>1.0.0-beta-6</version>
<!-- 2.0.0-beta-4 is not working ** we are using old version -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.descriptors</groupId>
<artifactId>shrinkwrap-descriptors-impl-javaee</artifactId>
<version>2.0.0-alpha-5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-api-maven</artifactId>
<version>1.0.0-beta-6</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<!-- org.jboss.weld.resources.ManagerObjectFactory -->
<dependency>
<groupId>org.jboss.weld.servlet</groupId>
<artifactId>weld-servlet</artifactId>
<version>${version.weld_servlet}</version>
<scope>test</scope>
</dependency>
<!-- Hibernate dependencies -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>4.1.6.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.3.0.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.2.2.Final</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.3.171</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-dbcp</artifactId>
<version>7.0.40</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.jboss.arquillian.container/arquillian-tomcat-embedded-8 -->
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-tomcat-embedded-8</artifactId>
<version>1.0.1.Final</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-tomcat-common</artifactId>
<scope>test</scope>
<version>1.0.1.Final</version>
</dependency>
</dependencies>
</project>
I´m using Intellij and configured a "Tomcat Embedded 8.x: AruillianTest". After starting the test I got the exception:
Caused by: java.lang.IllegalStateException: Could not add a default container to registry because multiple instances of org.jboss.arquillian.container.spi.client.container.DeployableContainer found on classpath (candidates are: org.jboss.arquillian.container.tomcat.embedded.TomcatEmbeddedConfiguration, org.jboss.arquillian.container.tomcat.embedded_8.TomcatConfiguration)
The problem was caused by the auto-configuration made by Intellij. intellij_arquillian_configuration shows the path you have to take to address the error.
1 - click on "Edit configuration" -> it will open 2
2 - choose the embedded Tomcat you want to use (Tomcat 8 in my case) and click on 3 which will open 4
4 - the dependencies (5) are clickable. Double-clicking will open 6.
6 - choose your version to be exactly the same as in your pom. I'm using the 1.0.1.Final in my pom but my test-container was configured with 1.0.0.CR7 (made for this screenshot; normally its 'RELEASE'). Changing this to 1.0.1.FINAL resolved the error and the test could run.
Delete one of the container from maven local repository. The default location for maven local repository is $HOME/.m2/repository/.
Try deleting org/jboss/arquillian/container/glassfish.embedded_3_1 if you would like to run your tests with Weld Embedded Server else delete org/jboss/arquillian/container/weld.ee.embedded_1_1.
The reason being, both the Jars implement the same interface and arquillian cannot decide which one to use.

NoSuchMethodError: JsonFactory.fromInputStream

I am trying to get a clean code sample of Google API OAuth2 authentication.
My code is mostly based on the explanation at https://code.google.com/p/google-api-java-client/wiki/OAuth2
I deviate from this tutorial because I want my libraries be managed by Maven and because I want to create a project without Google Apps Engine dependencies.
Each time I try to the run the project on my Glassfish server, I get the following error, probably indicating a dependency conflict.
java.lang.NoSuchMethodError: com.google.api.client.json.JsonFactory.fromInputStream(Ljava/io/InputStream;Ljava/lang/Class;)Ljava/lang/Object;
The relevant piece of my pom.xml:
<dependencies>
<dependency>
<groupId>com.google.api-client</groupId>
<artifactId>google-api-client</artifactId>
<version>1.14.1-beta</version>
</dependency>
<dependency>
<groupId>com.google.http-client</groupId>
<artifactId>google-http-client</artifactId>
<version>1.14.1-beta</version>
</dependency>
<dependency>
<groupId>com.google.api-jackson2</groupId>
<artifactId>google-api-jackson2</artifactId>
<version>1.14.1-beta</version>
</dependency>
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-calendar</artifactId>
<version>v3-rev34-1.14.1-beta</version>
</dependency>
<dependency>
<groupId>com.google.oauth-client</groupId>
<artifactId>google-oauth-client</artifactId>
<version>1.14.1-beta</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.1.3</version>
</dependency>
<dependency>
<groupId>com.google.oauth-client</groupId>
<artifactId>google-oauth-client-servlet</artifactId>
<version>1.14.1-beta</version>
</dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>persistence-api</artifactId>
<version>1.0.2</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.1.0.CR2</version>
</dependency>
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
<version>1.1-PRD</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>jsr250-api</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>6.0</version>
</dependency>
</dependencies>
Please help me find the root cause of this error, because the used dependencies seem just fine to me and there's no similar problem case I could find.
The correct dependency for jackson2 is:
<dependency>
<groupId>com.google.http-client</groupId>
<artifactId>google-http-client-jackson2</artifactId>
<version>1.14.1-beta</version>
</dependency>
Once I changed that, the project built successfully, and I was able to call the method in question just fine.
There could be something else on the classpath that's interfering. I suggest you run the program with -verbose: class (see here for a more detailed explanation), which will show any conflicts.

Categories

Resources