Gatling error during compilation for assertion - scala

I was previously using gatling mvn plugin
<plugin>
<groupId>io.gatling</groupId>
<artifactId>gatling-maven-plugin</artifactId>
<version>3.0.5</version>
</plugin>
Now I have added the below dependency because I wanted to use a feature added in that version
<dependency>
<groupId>io.gatling</groupId>
<artifactId>gatling-core</artifactId>
<version>3.5.0</version>
</dependency>
And it gives compilation error
Symbol 'type io.gatling.commons.shared.unstable.model.stats.assertion.AssertionPathParts' is missing from the classpath.
This symbol is required by 'method io.gatling.core.assertion.AssertionSupport.string2PathParts'.
Make sure that type AssertionPathParts is in your classpath and check for conflicting dependencies with `-Ylog-classpath`.
A full rebuild may help if 'AssertionSupport.class' was compiled against an incompatible version of io.gatling.commons.shared.unstable.model.stats.assertion.
val feeder: BatchableFeederBuilder[String]#F = csv(usersFile).circular
^
The code sample is
object UserFeeder {
val feeder: BatchableFeederBuilder[String]#F = csv(usersFile).circular
}

Related

SAP jscoverage-plugin does not work on new Java/JDK

I have run the auto test of my UI5 app locally successfully. When I tried to generate the cobertura coverage report with:
mvn verify -f pom.xml com.sap.ca:jscoverage-plugin:1.36.0:jscoverage
I got following error.
[ERROR] Failed to execute goal
com.sap.ca:jscoverage-plugin:1.36.0:jscoverage (default-cli) on
project sap.support.sccd: Execution default-cli of goal
com.sap.ca:jscoverage-plugin:1.36.0:jscoverage failed: A required
class was missing while executing
com.sap.ca:jscoverage-plugin:1.36.0:jscoverage:
javax/xml/bind/JAXBException
The javax is not available in JDK>7 anymore for a such long time. Why SAP jscoverage-plugin still use it? Is there any method to get rid of the issue.
I have tried all following dependencies with version 2.3.2 and 3.0.0 in my pom:
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.3.2</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>2.3.2</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.3.2</version>
<scope>runtime</scope>
</dependency>
However, they can't solve the problem.
How can I mitigate the issue and go on cobertura coverage report generation with this plugin?

build fail with cxf-codegen-plugin

I imported an existing project with modules into eclipse and this is existing code created by a third party that I need to try and understand. But one project keeps failed on mvn clean install and the following error keeps occurring; which seems to be related to a webservice issue:
ERROR] Failed to execute goal org.apache.cxf:cxf-codegen-
plugin:2.7.6:wsdl2java (xxxxxxxxxx) on project
xxxxxxxxxx:
com/sun/tools/xjc/BadCommandLineException:
com.sun.tools.xjc.BadCommandLineException -> [Help 1]
This is user security project that verifies credentials using a webservice.
If you activate "DEBUG"-mode for Maven and "Print exception stack traces", and the error is a NoClassDefFoundError for the BadCommandLineException, then I solved it by providing a dependency to the cxf-codegen-plugin:
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>${cxf.version}</version>
<executions>
<execution>
...
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-xjc</artifactId>
<version>2.4.0-b180725.0644</version>
</dependency>
</dependencies>
</plugin>

querydsl-jpa 3.7.3 error when used with spring-data-jpa 1.10.0

I'm using
<groupId>com.mysema.querydsl</groupId>
<artifactId>querydsl-jpa</artifactId>
<version>3.7.3</version>
no problem with
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>1.9.4.RELEASE</version>
instead using
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>1.10.1.RELEASE</version>
on the same code I've the following errors:
[ERROR] /C:/Prj/Java/Eclipse/Elfolab/src/main/java/com/interlabsrl/elfolab/persistence/multiple/repository/elettroforesi/springdatajpa/LinguaRepository.java:[13,8] cannot access com.querydsl.core.types.OrderSpecifier
class file for com.querydsl.core.types.OrderSpecifier not found
[ERROR] /C:/Prj/Java/Eclipse/Elfolab/src/main/java/com/interlabsrl/elfolab/controller/ricercaPaziente/RicercaPazienteController.java:[487,33] cannot access com.querydsl.core.types.Predicate
class file for com.querydsl.core.types.Predicate not found
[ERROR] /C:/Prj/Java/Eclipse/Elfolab/src/main/java/com/interlabsrl/elfolab/controller/ricercaArchivio/RicercaArchivioController.java:[74,32] no suitable constructor found for QSort(com.mysema.query.types.OrderSpecifier<java.util.Date>)
constructor org.springframework.data.querydsl.QSort.QSort(com.querydsl.core.types.OrderSpecifier<?>...) is not applicable
(varargs mismatch; com.mysema.query.types.OrderSpecifier<java.util.Date> cannot be converted to com.querydsl.core.types.OrderSpecifier<?>)
constructor org.springframework.data.querydsl.QSort.QSort(java.util.List<com.querydsl.core.types.OrderSpecifier<?>>) is not applicable
(argument mismatch; com.mysema.query.types.OrderSpecifier<java.util.Date> cannot be converted to java.util.List<com.querydsl.core.types.OrderSpecifier<?>>)
[ERROR] /C:/Prj/Java/Eclipse/Elfolab/src/main/java/com/interlabsrl/elfolab/controller/ricercaArchivio/RicercaArchivioController.java:[611,31] no suitable constructor found for QSort(com.mysema.query.types.OrderSpecifier<java.lang.String>)
constructor org.springframework.data.querydsl.QSort.QSort(com.querydsl.core.types.OrderSpecifier<?>...) is not applicable
(varargs mismatch; com.mysema.query.types.OrderSpecifier<java.lang.String> cannot be converted to com.querydsl.core.types.OrderSpecifier<?>)
constructor org.springframework.data.querydsl.QSort.QSort(java.util.List<com.querydsl.core.types.OrderSpecifier<?>>) is not applicable
(argument mismatch; com.mysema.query.types.OrderSpecifier<java.lang.String> cannot be converted to java.util.List<com.querydsl.core.types.OrderSpecifier<?>>)
Any idea about what's wrong between these versions?
EDIT:
Using
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-jpa</artifactId>
<version>4.1.0</version>
</dependency>
i still have these errors:
C:\Prj\Java\Eclipse\Elfolab\src\main\java\com\interlabsrl\elfolab\persistence\multiple\repository\elettroforesi\table\custom\impl\MetodicaRepositoryImpl.java:11: error: package com.mysema.query.jpa.impl does not exist
import com.mysema.query.jpa.impl.JPAQuery;
Instead of
<dependency>
<groupId>com.mysema.querydsl</groupId>
<artifactId>querydsl-*</artifactId>
<version>3.7.3</version>
</dependency>
you should use now
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-*</artifactId>
<version>4.1.3</version>
</dependency>
The packages inside the jar files also have been changed so you have to change imported querydsl classes in your source code.
You should update the version of your querydsl to 4.1. Note that the groupId also have changed.
In here you can see that the 1.10.1.RELEASE uses the 4.1 of querydsl and that could be interfering with you using an old version.
Use the following configuration found(barely) here
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-apt</artifactId>
<version>${querydsl.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-jpa</artifactId>
<version>${querydsl.version}</version>
</dependency>
and for the maven plugin
<plugin>
<groupId>com.mysema.maven</groupId>
<artifactId>apt-maven-plugin</artifactId>
<version>1.1.3</version>
<executions>
<execution>
<goals>
<goal>process</goal>
</goals>
<configuration>
<outputDirectory>target/generated-sources/annotations</outputDirectory>
<processor>com.querydsl.apt.jpa.JPAAnnotationProcessor</processor>
</configuration>
</execution>
</executions>
</plugin>
Even though the majority were moved to com.querydsl the plugin should currently still be com.mysema.

Scala package throws java.lang.UnsupportedClassVersionError

Our java application has dependencies on Spark, which is written in Scala. Build tool is Maven, and am running from within Eclipse. The JDK_HOME used to compile the application on the command line using Maven, and the JRE used to run within Eclipse, are both 1.7.0_15.
The Maven POM contains the following:
<plugin>
<groupId>org.scala-tools</groupId>
<artifactId>maven-scala-plugin</artifactId>
...
<configuration>
<scalaVersion>1.10.5</scalaVersion>
<args>
<arg>-target:jvm-1.7</arg>
</args>
</configuration>
</plugin>
I understand that Spark is built using Scala 2.10
The maven dependencies include the following:
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.11</artifactId>
<version>1.3.1</version>
</dependency>
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch-hadoop</artifactId>
<version>2.1.0.Beta4</version>
</dependency>
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch-spark_2.10</artifactId>
<version>2.1.0.Beta4</version>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-xml</artifactId>
<version>2.11.0-M4</version>
</dependency>
<dependency>
<groupId>org.scala-lang.modules</groupId>
<artifactId>scala-parser-combinators_2.12.0-M2</artifactId>
<version>1.0.4</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-sql_2.10</artifactId>
<version>1.3.0</version>
</dependency
>
At runtime, the folowing exception is thrown:
Exception in thread "main" java.lang.UnsupportedClassVersionError: scala/util/parsing/combinator/PackratParsers : Unsupported major.minor version 52.0
I cannot find a 2.10.* version of the scala-parser-combinators jar.
Can anyone assist with the solution?
Thanks!
The scala-parser-combinators_2.12.0-M2 module is part of the Scala 2.12 distribution.
2.12 is targeted for Java 8 - bytecode major version 52, hence the error.
Your best bet is to either use an older Spark distribution or switch to Java 8 (Java 7 is at End-Of-Life since April 2015).
EDIT (addressing question edit): you cannot find an older version of the scala-parser-combinators library, because it was isolated to a stand-alone module at some point after 2.10. You can attempt to simply exclude this dependency in your POM, but there's no guarantee your chosen Spark version will be compatible with this older library version.

Changed JDK version in pom.xml but eclipse still using default of 1.5

I'm trying to get an existing project building using maven and m2eclipse. I've created a new maven project for it and imported my source files and added necessary dependencies, but I'm getting compile errors because it's defaulting to using Java 1.5 settings. I've tried updating the pom.xml file to instruct the system to use Java 1.7, following which I've told eclipse to update the project settings from maven, closed and reopened the project, and restarted eclipse to see if it would flush the information that Java 1.5 should be used, but eclipse is still insisting that the project should be compiled with 1.5. My pom.xml file is pasted below:
<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>uk.org.dsf</groupId>
<artifactId>util-test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>util-test</name>
<description>utility classes for testing purposes</description>
<plugin> <!-- enable java 1.7 -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
</dependency>
<dependency>
<groupId>org.jmock</groupId>
<artifactId>jmock</artifactId>
<version>2.6.0</version>
</dependency>
<dependency>
<groupId>org.jmock</groupId>
<artifactId>jmock-junit4</artifactId>
<version>2.6.0</version>
</dependency>
<dependency>
<groupId>asm</groupId>
<artifactId>asm</artifactId>
<version>3.3.1</version>
</dependency>
</dependencies>
</project>
Any ideas what's going wrong here?
The POM file quoted above is malformed. The <plugin> tag should be nested inside a <build><plugins> block; m2eclipse is therefore unable to find the compiler details from it. The only strange thing here is that this doesn't produce any kind of error or warning message; it should at the least be resulting in a warning that the XML file doesn't conform to its specified schema.
Another related problem I've encountered: if you specify a java version > 1.7 in eclipse Juno, the value is ignored, even if you have a Java 8 JDK configured. It appears 1.8 only works correctly in Luna, and perhaps Kepler with some updates installed (haven't tested that configuration).