Why does adding hibernate-validator-annotation-processor dependency result in "AssertionError: Couldn't find ... java.time.chrono.HijrahDate"? - spring

So after applying various Java Hibernate Validator dependencies via Maven in IntelliJ, I get the following error whenever I attempt to run the program:
I have the following dependencies related to Hibernate:
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<version>6.2.3.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator-cdi</artifactId>
<version>6.2.3.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator-annotation-processor</artifactId>
<version>6.2.3.Final</version>
</dependency>
I discovered that by removing the last one (hibernate-validator-annotation-processor), the problem goes away; I can run the program (but I lose any functionality that the annotation-processor package provides). Adding it back reproduces the error perfectly every time. I've never even heard or seen of 'HijrahDate' before and Googling this error yields surprisingly few clues, if any, on how to solve this error. Any ideas on how to fix this? Any help is appreciated!

I had this error and I fixed it by using another person's suggestion, that being adding this dependency.
<dependency>
<groupId>com.github.seratch</groupId>
<artifactId>java-time-backport</artifactId>
<version>1.0.0</version>
</dependency>

Related

Maven Fatal Error because of cucumber-junit dependency

Something very strange is happening.
I have the following dependency in my pom.xml:
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-junit</artifactId>
<version>1.2.5</version>
<type>pom</type>
<scope>test</scope>
</dependency>
The project compiles perfectly.
But as soon as I change the cucumber version in this dependency to 1.2.6 I get an error when compling the progect:
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project gp-it-test-product: Fatal error compiling
I also attempted to use the most recent cucumber version:
<!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-junit -->
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>6.10.1</version>
<scope>test</scope>
</dependency>
But I got the same error. Why is this happening? Version 1.2.5 works OK
It was moved to another group io.cucumber after version 1.2.5 check the maven repository
Okay, I finally solved this. The problem was not in maven, but in cucumber. It appeared that some old packages that I was using in my code disappeared, so I had to change all old imports to new ones and also make some other changes in accordance with the new version to make it work. Nullpointer exception that I posted was due to changed package of Scenario class.

Perfomance Test and API test are not working together in same framework

#ptrthomas - I am able to perform API test and performance test separate in karate. But when I try to merge both in same framework, either of them stopped working.
Reason that I can see here - karate-core is sub dependency of both karate-junit4 and karate-apache. But both of them install different version of karate-core. Hence either have to exclude one of them. But wherever you exclude it, it will stop working. If you exclude it from karate-junit4 then API test will not work, if you exclude it from karate-apache or gatling, performance will not work.
Is there any common version for dependencies for both performance and API test (which run through junit) or any github location where someone might have integrated both in one project?
Below are the version that I am using -
UTF-8 1.8 3.6.0 0.9.0.RC3 2.2.4
<dependency>
<groupId>com.intuit.karate</groupId>
<artifactId>karate-junit4</artifactId>
<version>0.2.7</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>com.intuit.karate</groupId>
<artifactId>karate-core</artifactId>
</exclusion>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.intuit.karate</groupId>
<artifactId>karate-apache</artifactId>
<version>${karate.version}</version>
</dependency>
<dependency>
<groupId>com.intuit.karate</groupId>
<artifactId>karate-gatling</artifactId>
<version>${karate.version}</version>
<scope>test</scope>
</dependency>
Can someone please help here?
Just use this sample project: https://github.com/ptrthomas/karate-gatling-demo
This has the right dependencies set as a simple, stand-alone project and many teams have used and validated it.
If you are still facing issues, please follow the instructions here: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue

Ratpack 1.5.4 hystrix dependency cannot be resolved

I cannot compile my project that uses Ratpack 1.5.4 because there is a missing dependency to Hystrix 1.5.13 which cannot be resolved.
http://search.maven.org/#search%7Cga%7C1%7Cg%3A"com.netflix.hystrix"%20AND%20v%3A"1.5.13"
What is wrong here?
You can try excluding com.netflix:hystrix-core:1.5.13 from io.ratpack:ratpack-hystrix:1.5.4 and then you can add com.netflix:hystrix-core:1.5.12 directly to your pom.xml file, something like that:
<dependencies>
<dependency>
<groupId>io.ratpack</groupId>
<artifactId>ratpack-core</artifactId>
<version>1.5.4</version>
</dependency>
<dependency>
<groupId>io.ratpack</groupId>
<artifactId>ratpack-hystrix</artifactId>
<version>1.5.4</version>
<exclusions>
<exclusion>
<groupId>com.netflix.hystrix</groupId>
<artifactId>hystrix-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.netflix.hystrix</groupId>
<artifactId>hystrix-core</artifactId>
<version>1.5.12</version>
</dependency>
</dependencies>
I've tested this simple Maven Ratpack "Hello, World!" app https://github.com/wololock/ratpack-maven-example
It compiles in Travis without any issue - https://travis-ci.org/wololock/ratpack-maven-example (I have com.netflix:hystrix-core:1.5.13 in my local .m2 repository, so I wanted to use something with a clean local Maven repository like Travis CI)
I don't know if version 1.5.13 got rolled back or something like that. It can be found in MvnRepository.com https://mvnrepository.com/artifact/com.netflix.hystrix/hystrix-core/1.5.13 however it says that 1.5.12 is newer, even though it got released 2 months earlier.

Imported Git Repository but some imports are not found?

I have a Git Repository that I imported into Eclipse but it has some import errors.
I'm using Spring Redis version 1.8.4 and following their examples on how to do object mapping. I used the Jackson Mapper link and then followed that to the jackson-datatype-mongo mapper.
https://github.com/commercehub-oss/jackson-datatype-mongo
On my work computer everything is fine.
<dependency>
<groupId>com.commercehub.jackson</groupId>
<artifactId>jackson-datatype-mongo</artifactId>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.7.6</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-redis</artifactId>
<version>1.8.4.RELEASE</version>
</dependency>
If I remove the jackson-datatype-mongo dependency then the imports are fine but then I wouldn't have the MongoModule import. I tried one of eclipse's solutions and it said that it could an archive 'jackson-databind-2.8.1.jar' and everything would be clear. But then my '.classpath' file is now changed.
I don't understand how it is fine on one machine and all I did was clone the repository into another machine.
I solved the issue. I checked libraries in the project and it showed that the class was in there. So I went into '.m2\repository\com\fasterxml\jackson\core' and deleted the whole 'jackson-databind' folder and restarted eclipse and all the imports were now resolved.

OpenJDK gives error: package org.jboss.weld.context.bound does not exist

I have a web app that compiles fine under Oracle's JDK 7, but gives the following error under OpenJDK 7:
error: package org.jboss.weld.context.bound does not exist
The error refers to a import in my code:
import org.jboss.weld.context.bound.BoundRequestContext;
In my pom.xml, I have the following weld-related dependencies:
<dependency>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-core</artifactId>
<version>1.1.8.Final</version>
<exclusions>
<exclusion>
<artifactId>jsr250-api</artifactId>
<groupId>javax.annotation</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jboss.weld.servlet</groupId>
<artifactId>weld-servlet-core</artifactId>
<version>1.1.8.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.weld.se</groupId>
<artifactId>weld-se-core</artifactId>
<version>1.1.8.Final</version>
</dependency>
Is there any way to make it compile using OpenJDK?
The problem is not OpenJDK's fault. You would most likely get the same problem with an Oracle badged JDK or a third-party Java compiler ... if you did an equivalent build with the respective compilers.
The problem is most likely caused by an incorrect Maven dependency.
According to GrepCode, that class (org.jboss.weld.context.bound.BoundRequestContext) is defined in "weld-api", "weld-servlet", "weld-se" and "weld-osgi-bundle". Try adding one of those as a dependency.
UPDATE
Judging from this page, "weld-api" is probably the way to go. You might want to read it thoroughly to figure out the recommended set of dependencies.

Resources