Spring com cucumber - resolvido

Códigos

bairro.feature

# language: pt
Funcionalidade: Cadastrar um bairro

  Cenário: 01 - Usuário cadastra um bairro
    Dado que um usário está logado no sistema
    E que os bairros existentes são
      | idEstado | idMunicipio | descricao |
      |        1 |           1 | Savassi   |
      |        1 |           1 | Ipanema   |
      |        1 |           1 | Glória    |
      |        1 |           1 | Castelo   |
    E o usuário informou o nome do estado igual à "Minas Gerais"
    E o usuário informou a descricao igual à "Álvaro Camargos"
    Quando o usuário confirmar a inclusão
    Entao o sistema deverá fazer o seguinte registro
      | idEstado | idMunicipio | descricao       |
      |        1 |           1 | Álvaro Camargos |
    E o sistema deverá informar a mensagem "Bairro inserido com sucesso !"

cucumber.properties

cucumber.publish.quiet=true
cucumber.publish.quiet=true

junit-platform.properties

cucumber.publish.enabled=true
cucumber.publish.quiet=true

CucumberIntegrationTest

package br.com.ghnetsoft.escolar;

import org.junit.runner.RunWith;

import io.cucumber.junit.Cucumber;
import io.cucumber.junit.CucumberOptions;

@RunWith(Cucumber.class)
@CucumberOptions(features = "src/test/resources")
public class CucumberIntegrationTest {
}

BairroFeature

package br.com.ghnetsoft.escolar.crud;

import org.springframework.transaction.annotation.Transactional;

import io.cucumber.java.pt.Dado;
import io.cucumber.java.pt.E;
import io.cucumber.java.pt.Entao;
import io.cucumber.java.pt.Quando;

public class BairroFeature {

    @Dado("^que um usário está logado no sistema$")
    public void usuario() {
    }

    @E("^que os bairros existentes são$")
    public void bairros() {

    }

    @E("^o usuário informou o nome do estado igual à \"([^\"]*)\"$")
    public void usuarioInformouNomeEstado() {

    }

    @E("^o usuário informou a descricao igual à \"([^\"]*)\"$")
    public void usuarioInformouADescricao() {

    }

    @Quando("^o usuário confirmar a inclusão$")
    @Transactional
    public void usuarioConfirmarInclusao() {

    }

    @Entao("^o sistema deverá fazer o seguinte registro$")
    @Transactional
    public void sistemaDeveraFazerSeguinteRegistro() {

    }

    @Entao("^o sistema deverá informar a mensagem \"([^\"]*)\"$")
    public void entaoSistemaDeveraInformarMensagem(final String mensagem) {
        //Mensagem será enviada pelo frontend
    }
}

pom.xml

<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>br.com.ghnetsoft.escolar.crud</groupId>
	<artifactId>ghnetsoft-escolar-crud</artifactId>
	<version>0.0.1</version>

	<name>api escolar crud</name>
	<description>ghnetsoft-escolar-crud</description>

	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>2.3.5.RELEASE</version>
		<relativePath />
	</parent>

	<properties>
		<java.version>11</java.version>
		<spring-boot-admin.version>2.2.1</spring-boot-admin.version>
		<mapstruct.version>1.3.1.Final</mapstruct.version>
	</properties>

	<dependencies>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-actuator</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-data-jpa</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.security.oauth.boot</groupId>
			<artifactId>spring-security-oauth2-autoconfigure</artifactId>
			<version>2.0.1.RELEASE</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-devtools</artifactId>
			<scope>runtime</scope>
		</dependency>
		<dependency>
			<groupId>de.codecentric</groupId>
			<artifactId>spring-boot-admin-starter-client</artifactId>
			<version>2.0.0</version>
		</dependency>
		<dependency>
			<groupId>com.fasterxml.jackson.dataformat</groupId>
			<artifactId>jackson-dataformat-xml</artifactId>
		</dependency>
		<dependency>
			<groupId>com.google.code.gson</groupId>
			<artifactId>gson</artifactId>
		</dependency>
		<dependency>
			<groupId>io.springfox</groupId>
			<artifactId>springfox-swagger2</artifactId>
			<version>2.9.2</version>
		</dependency>
		<dependency>
			<groupId>io.springfox</groupId>
			<artifactId>springfox-swagger-ui</artifactId>
			<version>2.9.2</version>
		</dependency>
		<dependency>
			<groupId>io.springfox</groupId>
			<artifactId>springfox-bean-validators</artifactId>
			<version>2.9.2</version>
		</dependency>
		<dependency>
			<groupId>org.modelmapper</groupId>
			<artifactId>modelmapper</artifactId>
			<version>2.3.8</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-lang3</artifactId>
		</dependency>
		<dependency>
			<groupId>org.postgresql</groupId>
			<artifactId>postgresql</artifactId>
			<scope>runtime</scope>
		</dependency>
		<dependency>
			<groupId>org.projectlombok</groupId>
			<artifactId>lombok</artifactId>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-security</artifactId>
		</dependency>
		<dependency>
			<groupId>io.micrometer</groupId>
			<artifactId>micrometer-registry-prometheus</artifactId>
		</dependency>
		<dependency>
			<groupId>javax.validation</groupId>
			<artifactId>validation-api</artifactId>
		</dependency>
		<dependency>
			<groupId>com.sun.xml.ws</groupId>
			<artifactId>jaxws-ri</artifactId>
			<version>3.0.0-M2</version>
			<type>pom</type>
		</dependency>
		<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>hibernate-envers</artifactId>
		</dependency>
		<dependency>
			<groupId>org.flywaydb</groupId>
			<artifactId>flyway-core</artifactId>
		</dependency>

		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpclient</artifactId>
			<version>4.3.6</version>
		</dependency>
		<dependency>
			<groupId>com.alibaba</groupId>
			<artifactId>fastjson</artifactId>
			<version>1.2.58</version>
		</dependency>
		
		<dependency>
			<groupId>io.cucumber</groupId>
			<artifactId>cucumber-java</artifactId>
			<version>6.9.1</version>
		</dependency>
		<dependency>
			<groupId>io.cucumber</groupId>
			<artifactId>cucumber-junit</artifactId>
			<version>6.9.1</version>
		</dependency>
		<dependency>
			<groupId>io.cucumber</groupId>
			<artifactId>cucumber-spring</artifactId>
			<version>6.9.1</version>
		</dependency>
		<dependency>
			<groupId>io.cucumber</groupId>
			<artifactId>cucumber-gherkin</artifactId>
			<version>6.9.1</version>
		</dependency>
		<dependency>
			<groupId>com.querydsl</groupId>
			<artifactId>querydsl-apt</artifactId>
		</dependency>
	</dependencies>
	<reporting>
		<plugins>
			<plugin>
				<groupId>org.jacoco</groupId>
				<artifactId>jacoco-maven-plugin</artifactId>
				<reportSets>
					<reportSet>
						<reports>
							<!-- select non-aggregate reports -->
							<report>report</report>
						</reports>
					</reportSet>
				</reportSets>
			</plugin>
		</plugins>
	</reporting>
	<build>
		<finalName>${project.artifactId}</finalName>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.jacoco</groupId>
				<artifactId>jacoco-maven-plugin</artifactId>
				<version>0.8.4</version>
				<executions>
					<execution>
						<goals>
							<goal>prepare-agent</goal>
						</goals>
					</execution>
					<execution>
						<id>report</id>
						<phase>prepare-package</phase>
						<goals>
							<goal>report</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>

Erro no console

dez. 08, 2024 6:11:05 PM cucumber.api.cli.Main run

ADVERTÊNCIA: You are using deprecated Main class. Please use io.cucumber.core.cli.Main

dez. 08, 2024 6:11:06 PM io.cucumber.core.runtime.CucumberExecutionContext getRunner

GRAVE: Unable to start Cucumber

java.lang.NoClassDefFoundError: jakarta/xml/ws/WebServiceException

at java.base/java.lang.ClassLoader.defineClass1(Native Method)

at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)

at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)

at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:862)

at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:760)

at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:681)

at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639)

at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)

at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)

at java.base/java.lang.ClassLoader.defineClass1(Native Method)

at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)

at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)

at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:862)

at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:760)

at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:681)

at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639)

at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)

at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)

at java.base/java.lang.Class.getDeclaredMethods0(Native Method)

at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3402)

at java.base/java.lang.Class.privateGetPublicMethods(Class.java:3427)

at java.base/java.lang.Class.getMethods(Class.java:2019)

at io.cucumber.java.MethodScanner.scan(MethodScanner.java:24)

at io.cucumber.java.JavaBackend.lambda$loadGlue$2(JavaBackend.java:40)

at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)

at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)

at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762)

at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:276)

at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)

at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)

at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)

at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)

at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)

at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)

at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)

at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)

at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)

at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)

at io.cucumber.java.JavaBackend.loadGlue(JavaBackend.java:40)

at io.cucumber.core.runner.Runner.<init>(Runner.java:52)

at io.cucumber.core.runtime.SingletonRunnerSupplier.createRunner(SingletonRunnerSupplier.java:47)

at io.cucumber.core.runtime.SingletonRunnerSupplier.get(SingletonRunnerSupplier.java:37)

at io.cucumber.core.runtime.CucumberExecutionContext.getRunner(CucumberExecutionContext.java:128)

at io.cucumber.core.runtime.CucumberExecutionContext.runTestCase(CucumberExecutionContext.java:115)

at io.cucumber.core.runtime.Runtime.lambda$execute$6(Runtime.java:110)

at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)

at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)

at io.cucumber.core.runtime.Runtime$SameThreadExecutorService.execute(Runtime.java:233)

at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:123)

at io.cucumber.core.runtime.Runtime.lambda$run$2(Runtime.java:86)

at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)

at java.base/java.util.stream.SliceOps$1$1.accept(SliceOps.java:200)

at java.base/java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1602)

at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:129)

at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:527)

at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513)

at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)

at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)

at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)

at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)

at io.cucumber.core.runtime.Runtime.run(Runtime.java:87)

at io.cucumber.core.cli.Main.run(Main.java:92)

at cucumber.api.cli.Main.run(Main.java:30)

at cucumber.api.cli.Main.main(Main.java:15)

Caused by: java.lang.ClassNotFoundException: jakarta.xml.ws.WebServiceException

at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)

at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)

at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)

... 64 more

dez. 08, 2024 6:11:06 PM io.cucumber.core.runtime.Runtime run

GRAVE: Exception while executing pickle

java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: jakarta/xml/ws/WebServiceException

at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)

at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)

at io.cucumber.core.runtime.Runtime.run(Runtime.java:93)

at io.cucumber.core.cli.Main.run(Main.java:92)

at cucumber.api.cli.Main.run(Main.java:30)

at cucumber.api.cli.Main.main(Main.java:15)

Caused by: java.lang.NoClassDefFoundError: jakarta/xml/ws/WebServiceException

at java.base/java.lang.ClassLoader.defineClass1(Native Method)

at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)

at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)

at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:862)

at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:760)

at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:681)

at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639)

at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)

at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)

at java.base/java.lang.ClassLoader.defineClass1(Native Method)

at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)

at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)

at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:862)

at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:760)

at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:681)

at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639)

at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)

at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)

at java.base/java.lang.Class.getDeclaredMethods0(Native Method)

at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3402)

at java.base/java.lang.Class.privateGetPublicMethods(Class.java:3427)

at java.base/java.lang.Class.getMethods(Class.java:2019)

at io.cucumber.java.MethodScanner.scan(MethodScanner.java:24)

at io.cucumber.java.JavaBackend.lambda$loadGlue$2(JavaBackend.java:40)

at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)

at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)

at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762)

at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:276)

at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)

at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)

at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)

at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)

at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)

at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)

at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)

at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)

at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)

at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)

at io.cucumber.java.JavaBackend.loadGlue(JavaBackend.java:40)

at io.cucumber.core.runner.Runner.<init>(Runner.java:52)

at io.cucumber.core.runtime.SingletonRunnerSupplier.createRunner(SingletonRunnerSupplier.java:47)

at io.cucumber.core.runtime.SingletonRunnerSupplier.get(SingletonRunnerSupplier.java:37)

at io.cucumber.core.runtime.CucumberExecutionContext.getRunner(CucumberExecutionContext.java:128)

at io.cucumber.core.runtime.CucumberExecutionContext.runTestCase(CucumberExecutionContext.java:115)

at io.cucumber.core.runtime.Runtime.lambda$execute$6(Runtime.java:110)

at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)

at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)

at io.cucumber.core.runtime.Runtime$SameThreadExecutorService.execute(Runtime.java:233)

at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:123)

at io.cucumber.core.runtime.Runtime.lambda$run$2(Runtime.java:86)

at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)

at java.base/java.util.stream.SliceOps$1$1.accept(SliceOps.java:200)

at java.base/java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1602)

at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:129)

at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:527)

at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513)

at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)

at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)

at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)

at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)

at io.cucumber.core.runtime.Runtime.run(Runtime.java:87)

... 3 more

Caused by: java.lang.ClassNotFoundException: jakarta.xml.ws.WebServiceException

at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)

at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)

at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)

... 64 more

0 Scenarios

0 Steps

0m0,811s

Exception in thread "main" io.cucumber.core.exception.CucumberException: java.lang.NoClassDefFoundError: jakarta/xml/ws/WebServiceException

at io.cucumber.core.runtime.CucumberExecutionContext.getException(CucumberExecutionContext.java:82)

at io.cucumber.core.runtime.Runtime.run(Runtime.java:103)

at io.cucumber.core.cli.Main.run(Main.java:92)

at cucumber.api.cli.Main.run(Main.java:30)

at cucumber.api.cli.Main.main(Main.java:15)

Caused by: java.lang.NoClassDefFoundError: jakarta/xml/ws/WebServiceException

at java.base/java.lang.ClassLoader.defineClass1(Native Method)

at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)

at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)

at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:862)

at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:760)

at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:681)

at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639)

at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)

at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)

at java.base/java.lang.ClassLoader.defineClass1(Native Method)

at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)

at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)

at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:862)

at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:760)

at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:681)

at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639)

at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)

at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)

at java.base/java.lang.Class.getDeclaredMethods0(Native Method)

at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3402)

at java.base/java.lang.Class.privateGetPublicMethods(Class.java:3427)

at java.base/java.lang.Class.getMethods(Class.java:2019)

at io.cucumber.java.MethodScanner.scan(MethodScanner.java:24)

at io.cucumber.java.JavaBackend.lambda$loadGlue$2(JavaBackend.java:40)

at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)

at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)

at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762)

at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:276)

at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)

at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)

at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)

at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)

at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)

at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)

at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)

at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)

at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)

at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)

at io.cucumber.java.JavaBackend.loadGlue(JavaBackend.java:40)

at io.cucumber.core.runner.Runner.<init>(Runner.java:52)

at io.cucumber.core.runtime.SingletonRunnerSupplier.createRunner(SingletonRunnerSupplier.java:47)

at io.cucumber.core.runtime.SingletonRunnerSupplier.get(SingletonRunnerSupplier.java:37)

at io.cucumber.core.runtime.CucumberExecutionContext.getRunner(CucumberExecutionContext.java:128)

at io.cucumber.core.runtime.CucumberExecutionContext.runTestCase(CucumberExecutionContext.java:115)

at io.cucumber.core.runtime.Runtime.lambda$execute$6(Runtime.java:110)

at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)

at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)

at io.cucumber.core.runtime.Runtime$SameThreadExecutorService.execute(Runtime.java:233)

at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:123)

at io.cucumber.core.runtime.Runtime.lambda$run$2(Runtime.java:86)

at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)

at java.base/java.util.stream.SliceOps$1$1.accept(SliceOps.java:200)

at java.base/java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1602)

at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:129)

at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:527)

at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513)

at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)

at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)

at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)

at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)

at io.cucumber.core.runtime.Runtime.run(Runtime.java:87)

... 3 more

Caused by: java.lang.ClassNotFoundException: jakarta.xml.ws.WebServiceException

at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)

at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)

at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)

... 64 more

Leia o erro.

Incluí esta dependência, mas continua o erro.

		<dependency>
			<groupId>jakarta.xml.ws</groupId>
			<artifactId>jakarta.xml.ws-api</artifactId>
		</dependency>

Além do jakarta.xml.ws, acredito que também precisa incluir:

<dependency>
    <groupId>com.sun.xml.ws</groupId>
    <artifactId>jaxws-ri</artifactId>
</dependency>
1 curtida

Obrigado @staroski e @davidbuzatto

1 curtida