I've been having some issues with setting up selenium tests lately. I had to upgrade my project's Java version from 11 to 17 to support Spring Boot V3, and my functional tests seem to fail with this error:
java.lang.NoSuchMethodError: 'void org.openqa.selenium.chrome.ChromeOptions.mergeInOptionsFromCaps(java.lang.String, org.openqa.selenium.Capabilities)'
at org.openqa.selenium.chrome.ChromeOptions.merge(ChromeOptions.java:78)
at org.openqa.selenium.chrome.ChromeOptions.merge(ChromeOptions.java:48)
at com.codeborne.selenide.webdriver.AbstractDriverFactory.merge(AbstractDriverFactory.java:90)
at com.codeborne.selenide.webdriver.AbstractDriverFactory.createCommonCapabilities(AbstractDriverFactory.java:82)
at com.codeborne.selenide.webdriver.ChromeDriverFactory.createCapabilities(ChromeDriverFactory.java:56)
at com.codeborne.selenide.webdriver.ChromeDriverFactory.createCapabilities(ChromeDriverFactory.java:25)
at com.codeborne.selenide.webdriver.WebDriverFactory.createWebDriverInstance(WebDriverFactory.java:111)
at com.codeborne.selenide.webdriver.WebDriverFactory.createWebDriver(WebDriverFactory.java:67)
at com.codeborne.selenide.drivercommands.CreateDriverCommand.lambda$createDriver$0(CreateDriverCommand.java:76)
at com.codeborne.selenide.logevents.SelenideLogger.get(SelenideLogger.java:118)
at com.codeborne.selenide.drivercommands.CreateDriverCommand.createDriver(CreateDriverCommand.java:52)
at com.codeborne.selenide.impl.WebDriverThreadLocalContainer.createDriver(WebDriverThreadLocalContainer.java:180)
at com.codeborne.selenide.impl.WebDriverThreadLocalContainer.getAndCheckWebDriver(WebDriverThreadLocalContainer.java:149)
at com.codeborne.selenide.WebDriverRunner.getAndCheckWebDriver(WebDriverRunner.java:130)
at com.codeborne.selenide.impl.StaticDriver.getAndCheckWebDriver(StaticDriver.java:65)
at com.codeborne.selenide.SelenideDriver.getAndCheckWebDriver(SelenideDriver.java:220)
at com.codeborne.selenide.drivercommands.Navigator.lambda$navigateTo$0(Navigator.java:72)
at com.codeborne.selenide.logevents.SelenideLogger.run(SelenideLogger.java:105)
at com.codeborne.selenide.drivercommands.Navigator.navigateTo(Navigator.java:70)
at com.codeborne.selenide.drivercommands.Navigator.open(Navigator.java:32)
at com.codeborne.selenide.SelenideDriver.open(SelenideDriver.java:101)
at com.codeborne.selenide.Selenide.open(Selenide.java:52)
at com.sonatype.sab.SabFunctionalTest.testIndexHtml(SabFunctionalTest.java:19)
I have a feeling it is due to mismatched dependencies, but not entirely sure. This is the relevant part of the pom.xml:
<properties>
<selenium.version>4.8.0</selenium.version>
<docker.image.registry></docker.image.registry>
<docker.image.version>4.8</docker.image.version>
<docker.image>standalone-chrome:${docker.image.version}</docker.image>
<webdriver.chrome.driver>${project.build.directory}/chromedriver</webdriver.chrome.driver>
</properties>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>${unified.artifactId}</artifactId>
<version>${project.version}</version>
<!-- NOTE: this is not the executable jar since that one wont work with #SpringBootTest -->
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-test</artifactId>
<version>${spring.boot.version}</version>
</dependency>
<dependency>
<groupId>com.codeborne</groupId>
<artifactId>selenide</artifactId>
<version>6.11.2</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>${selenium.version}</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-api</artifactId>
<version>${selenium.version}</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-chrome-driver</artifactId>
<version>${selenium.version}</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-remote-driver</artifactId>
<version>${selenium.version}</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.9.2</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>6.0.4</version>
</dependency>
</dependencies>
Originally, I was running selenium V4.1.1, and with that I was getting this error:
java.lang.NoClassDefFoundError: io/opentelemetry/sdk/metrics/exemplar/ExemplarFilter
I thought updating selenium to 4.8 would fix it (which it did) but now I'm running into other problems.
Related
I'm getting the above exception when IntelliJ tries to launch the Chrome browser.
I am running this code on Ubuntu 16.04 and I have already tried updating the browser and using the specific jars for ChromeDriver.
Code to launch browser:
WebDriverManager.chromedriver().setup();
driver = new ChromeDriver();
POM.xml:
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-chrome-driver</artifactId>
<version>3.141.59</version>
</dependency>
<dependency>
<groupId>io.github.bonigarcia</groupId>
<artifactId>webdrivermanager</artifactId>
<version>2.2.5</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.53.1</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.14.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.17</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.17</version>
</dependency>
<dependency>
<groupId>com.aventstack</groupId>
<artifactId>extentreports</artifactId>
<version>3.1.2</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-api</artifactId>
<version>2.53.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.5</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.5</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-remote-driver</artifactId>
<version>2.53.1</version>
</dependency>
You are using an ancient version of Selenium (2.53.1) that is not compatible with the latest chrome driver binaries.
See the following parts of your POM:
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.53.1</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-api</artifactId>
<version>2.53.1</version>
<scope>test</scope>
</dependency>
The Current Java version of Selenium as of the time of writing this is 3.141.59 (Have a look at https://www.seleniumhq.org/download/ to see what the latest revision is).
You need to update to a much more recent version of Selenium.
In your pom place that as a property:
<properties>
<selenium.version>3.5.3</selenium.version>
</properties>
Then, in each dependency where you use a selenium version, just replace by the property reference, like that:
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>${selenium.version}</version>
</dependency>
I'm using Selenium and Maven to build a project in Eclipse and I'm getting the build error: Cannot find the class file for org.openqa.selenium.internal.Locatable.
I'm using Selenium-Server-Standalone 3.141.59, which I've noticed has the Locatable class under...
org.openqa.selenium.**interactions**.Locatable
instead of...
org.openqa.selenium.**internal**.Locatable.
Is this a different class altogether?
How do I get Eclipse to recognize that the class is there?
Please find followings are my relevant dependencies from my Pom.xml
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.141.59</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>3.141.59</version>
</dependency>
<dependency>
<groupId>com.codeborne</groupId>
<artifactId>selenide</artifactId>
<version>2.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.codeborne/phantomjsdriver -->
<dependency>
<groupId>com.codeborne</groupId>
<artifactId>phantomjsdriver</artifactId>
<version>1.3.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/junit/junit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
<!-- https://mvnrepository.com/artifact/log4j/log4j -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
Remove Selenium Server from your dependencies.
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>3.141.59</version>
</dependency>
If I remember correctly you now need WebDriver, which is included in Selenium Java.
Include also Selenium API
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-api</artifactId>
<version>3.141.59</version>
</dependency>
and update selenide and phantomjsdriver
<dependency>
<groupId>com.codeborne</groupId>
<artifactId>selenide</artifactId>
<version>5.1.0</version>
</dependency>
<dependency>
<groupId>com.codeborne</groupId>
<artifactId>phantomjsdriver</artifactId>
<version>1.4.4</version>
</dependency>
The current version of selenide you're pulling in is 2.3, which will bring in selenium-java 2.33.0.
The current version of phantomjsdriver you're pulling in is 1.3.0, which will bring in selenium-java 2.53.0.
You need selenide 5.1.0 and phantomjsdriver 1.4.4
Is it a spring project? What is below solved my problem:
<dependency>
<groupId>com.codeborne</groupId>
<artifactId>selenide</artifactId>
<version>5.2.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-api</artifactId>
<version>3.141.59</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-remote-driver</artifactId>
<version>3.141.59</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-support</artifactId>
<version>3.141.59</version>
</dependency>
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.
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.
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.