apache httpclient clientprotocol classnotfoundexception when gradle with program args - spring

I am trying to run gradlew test -Penv="envLocal"
this is throwing ClassNotFound : ClientProtocolException but without -Penv its working well.
Can you someone help with this issue?
Running spring test

Found the answer, it was due to different configurations for different environment.

Related

In the Quarkus Amazon Lambda HTTP guide the Lambda runtime cannot find QuarkusStreamHandler on the classpath

As this issue hasn't been raised already I'm obviously missing something simple. I am following the Quarkus - Amazon Lambda with Resteasy, Undertow, or Vert.x Web guide using the 1.0.0.Final release (I've also tried the CR and 0.28.1 releases).
I have this packaged as an Uber jar.
I have run the mvn quarkus-bootstrap:build-tree and this shows the io.quarkus:quarkus-amazon-lambda-http-deployment:jar:1.0.0.Final with it's dependant jars and checking the generated runner jar shows that the io.quarkus.amazon.lambda.runtime.QuarkusStreamHandler.class file is present.
However, whenever I run this either in the AWS SAM environment or in AWS proper I get the dreaded java.lang.ClassNotFoundException: io.quarkus.amazon.lambda.runtime.QuarkusStreamHandler
I'm at a loss where to turn. I'm compiling using Maven 3.6.2 and Graal 19.2.1 (though not the native compilation).
If anyone stumbles across this, I found that adding "quarkus.package.uber-jar=true" to application.properties folder is required when working with maven.
https://quarkus.io/guides/maven-tooling

Maven clean package lead to random "Application failed to start"

I encounter a very strange issue with my jhipster application (Spring Boot + Angular, v5.0.2).
Randomly, maven compilation (./mvnw -Pprod clean package -DskipTests) give me a war that cannot be executed : I can compile and launch the war and all work fine, and one minute later, without any change, I can compile but when I launch the war I get this stack trace :
11:46:32.286 [main] ERROR org.springframework.boot.SpringApplication - Application run failed
java.lang.NoSuchMethodError: org.yaml.snakeyaml.Yaml.<init>(Lorg/yaml/snakeyaml/constructor/BaseConstructor;Lorg/yaml/snakeyaml/representer/Representer;Lorg/yaml/snakeyaml/DumperOptions;Lorg/yaml/snakeyaml/LoaderOptions;Lorg/yaml/snakeyaml/resolver/Resolver;)V
This behaviour is seen on my laptop, my collegue laptop, and a Jenkins Docker image, so does not seem to be an environment issue.
** EDIT : **
Here is the pom : http://jsfiddle.net/ewn6qLzd/ (sorry I did not found something more appropriate to share it)
Any help would be much appreciated.
Best Regards,

Running Spark Unit Tests in IntelliJ

I have a spark job I'm developing in IntelliJ. It's builds via maven, the tests pass, and I can run the job locally. However, If I try to run the tests via IntelliJ, I get
Error:scalac: bad symbolic reference. A signature in
SparkContext.class refers to term akka in package root which is not
available. It may be completely missing from the current classpath, or
the version on the classpath might be incompatible with the version
used when compiling SparkContext.class.
I ended up just busting and rebuilding the IMLs in IntelliJ and this fixed the issue.

Does Gradle has any issue with parsing Jargs.jar

I'm using JArgs.jar for the command line parsing. It's working fine without Gradle but when I'm using Gradle to run my tests it's now working. It seems somehow the jar is not copied by Gradle!
Any help will be highly appreciated.

Query Regarding Maven Aspectj

I’m using AspectJ in my project. My project is based on Maven.
I’m able to successfully compile the .aj file and when I try to run the testcase using maven my aspects are working fine.
But when I start executing the program from command prompt (eg.. java <*.jar>) my aspects are not working. Is it necessary to set any Java JVM option for my aspect to execute.
Thanks In Advance

Resources