qase-tms / qase-java

Qase TMS Java SDK
https://developers.qase.io
Apache License 2.0
17 stars 5 forks source link

[TestNG] mvn clean install Fails to Build Due to java.lang.AbstractMethodError #144

Open eokwakpam opened 6 days ago

eokwakpam commented 6 days ago

A client reported that when running mvn clean install, the build fails with the following error:

java.lang.AbstractMethodError: Missing implementation of resolved method 'abstract void configure()' of abstract class com.google.inject.AbstractModule. at com.google.inject.AbstractModule.configure(AbstractModule.java:62) at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:340) ...

After commenting out the following dependency in the pom.xml, the build succeeded:

However, when the dependency was reintroduced and the guice version was updated to 5.1.0, the build failed again with a different error:

Exception in thread "TestNG-test=TransactionMgmt-1" java.lang.NoClassDefFoundError: Could not initialize class io.qase.testng.guice.module.TestNgModule at io.qase.testng.QaseListener.createQaseListener(QaseListener.java:88) ...

Here is the provided pom.xml file:

<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://www.apache.org/xsd/maven-4.0.0.xsd">

4.0.0
<groupId>OTTO</groupId>
<artifactId>payfac-onboarding</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>payfac-onboarding</name>
<url><http://www.example.com</url>>
<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>
    <aspectj.version>1.9.8</aspectj.version>
</properties>
<dependencies>
    <!-- Various other dependencies -->
    <dependency>
        <groupId>io.qase</groupId>
        <artifactId>qase-testng</artifactId>
        <version>3.2.1</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>com.google.inject</groupId>
        <artifactId>guice</artifactId>
        <version>5.1.0</version>
    </dependency>
</dependencies>
<!-- Build and Plugin configurations -->

Steps Taken: The client commented out the Qase TestNG dependency and the build succeeded. image

Upon guidance, they updated the guice dependency to version 5.1.0 to resolve the AbstractMethodError, but the issue persisted with a different error indicating a missing class.

Additional Information: The client is using Java version 1.7 for their project.

The issue may involve a dependency conflict or a missing implementation within one of the libraries.

cskmnrpt commented 6 days ago

The complete pom.xml -

<?xml version="1.0" encoding="UTF-8"?>

<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>XXX</groupId>
<artifactId>XXXX</artifactId>
<version>0.0.1-SNAPSHOT</version>

<name>XXXXX</name>
<!-- FIXME change it to the project's website -->
<url>[http://www.example.com</url](http://www.example.com%3C/url)>

<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>
​
<aspectj.version>1.9.8</aspectj.version>
</properties>

<dependencies>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20210307</version> <!-- Use the latest version -->
</dependency>

<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>3.141.59</version>
</dependency>
​
<dependency>
<groupId>io.github.bonigarcia</groupId>
<artifactId>webdrivermanager</artifactId>
<version>5.6.2</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.testng/testng -->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>7.1.0</version>
</dependency>
​
<dependency>
<groupId>io.qase</groupId>
<artifactId>qase-testng</artifactId>
<version>3.2.1</version>
<scope>test</scope>
</dependency>
​
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>5.1.0</version>
</dependency>
</dependencies>

<build>
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins>
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
</plugin>
<!--<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
</plugin>-->
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
</plugin>
<plugin>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.0.0</version>
</plugin>
​
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<configuration>
<argLine>
-javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
</argLine>
<suiteXmlFiles>
<suiteXmlFile>
src\test\resources\testng.xml
</suiteXmlFile>
</suiteXmlFiles>
</configuration>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectj.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>

The trace -

[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running TestSuite
SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
SLF4J: Class path contains SLF4J bindings targeting slf4j-api versions 1.7.x or earlier.
SLF4J: Ignoring binding found at [jar:file:/C:/Users/jason.han/.m2/repository/ch/qos/logback/logback-classic/1.2.9/logback-classic-1.2.9.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See https://www.slf4j.org/codes.html#ignoredBindings for an explanation.
Starting ChromeDriver 128.0.6613.137 (fe621c5aa2d6b987e964fb1b5066833da5fb613d-refs/branch-heads/6613@{#1711}) on port 62486
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully on port 62486.
Sep. 11, 2024 11:50:45 A.M. org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
Exception in thread "TestNG-test=TransactionMgmt-1" java.lang.NoClassDefFoundError: Could not initialize class io.qase.testng.guice.module.TestNgModule
at io.qase.testng.QaseListener.createQaseListener(QaseListener.java:88)
at io.qase.testng.QaseListener.getQaseTestCaseListener(QaseListener.java:28)
at io.qase.testng.QaseListener.onTestFailure(QaseListener.java:50)
at org.testng.internal.TestListenerHelper.runTestListeners(TestListenerHelper.java:66)
savkk commented 1 day ago

hi, @eokwakpam!

The issue may involve a dependency conflict or a missing implementation within one of the libraries.

Correct, this could be one of the problems. Can they try to remove quice from their pom.xml?

Also, can they try to upgrade the java version to 8+