Updated to camden release issue - spring-cloud

I tried updating to Camden.M1 from Brixton.SR5.
I have the software running with consul and spring cloud stream. I assume that there is an additional init step that is required.
Here is part of the pom
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.0.RELEASE</version>
</parent>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Camden.M1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/libs-milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<properties>
<java.version>1.8</java.version>
<maven.javadoc.skip>true</maven.javadoc.skip>
<lombok.version>1.14.8</lombok.version>
<rpm-maven-plugin.version>2.1.2</rpm-maven-plugin.version>
</properties>
<dependencies>
<dependency>
<groupId>com.cisco.phisphere</groupId>
<artifactId>servicesupport</artifactId>
<version>1.0.0</version>
</dependency>
<!-- jolokia -->
<dependency>
<groupId>org.jolokia</groupId>
<artifactId>jolokia-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jetty</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-zuul</artifactId>
</dependency>
<!--used for consul discovery-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-consul-all</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-consul-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.10</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-sleuth-stream</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-sleuth</artifactId>
</dependency>
<!-- EXAMPLE FOR RABBIT BINDING -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream-binder-rabbit</artifactId>
</dependency>
<!-- spectator metrics -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-spectator</artifactId>
</dependency>
</dependencies>
<build>
<finalName>routerservice</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<!-- compiler plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<!-- docker build plugin -->
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.3.9</version>
<configuration>
<imageName>${project.build.finalName}</imageName>
<dockerDirectory>.</dockerDirectory>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.jar</include>
</resource>
</resources>
</configuration>
</plugin>
</plugins>
</build>
Here is the exception trace on start.
016-08-30 20:24:13.177 INFO 24602 --- [ main] c.c.p.routerservice.RouterService : No active profile set, falling back to default profiles: default
2016-08-30 20:24:16.211 INFO 24602 --- [ main] org.eclipse.jetty.util.log : Logging initialized #6408ms
2016-08-30 20:24:16.308 INFO 24602 --- [ main] org.eclipse.jetty.server.Server : jetty-9.3.11.v20160721
2016-08-30 20:24:16.428 INFO 24602 --- [ main] application : Initializing Spring embedded WebApplicationContext
2016-08-30 20:24:18.748 WARN 24602 --- [ main] c.n.c.sources.URLConfigurationSource : No URLs will be polled as dynamic configuration sources.
2016-08-30 20:24:18.749 INFO 24602 --- [ main] c.n.c.sources.URLConfigurationSource : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
2016-08-30 20:24:18.761 INFO 24602 --- [ main] c.netflix.config.DynamicPropertyFactory : DynamicPropertyFactory is initialized with configuration sources: com.netflix.config.ConcurrentCompositeConfiguration#7bc10d84
2016-08-30 20:24:19.527 INFO 24602 --- [ main] o.e.jetty.server.handler.ContextHandler : Started o.s.b.c.e.j.JettyEmbeddedWebAppContext#3c0fae6c{/,file:///private/var/folders/8_/yq1cv_hs4jqd49v2zlzm8l9w0000gn/T/jetty-docbase.2269375622778918038.8765/,AVAILABLE}
2016-08-30 20:24:19.527 INFO 24602 --- [ main] org.eclipse.jetty.server.Server : Started #9726ms
2016-08-30 20:24:21.043 INFO 24602 --- [ main] application : jolokia: No access restrictor found, access to any MBean is allowed
2016-08-30 20:24:26.427 WARN 24602 --- [ main] c.n.c.sources.URLConfigurationSource : No URLs will be polled as dynamic configuration sources.
2016-08-30 20:24:26.428 INFO 24602 --- [ main] c.n.c.sources.URLConfigurationSource : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
2016-08-30 20:24:27.734 INFO 24602 --- [ main] application : jolokia: No access restrictor found, access to any MBean is allowed
2016-08-30 20:24:27.745 INFO 24602 --- [ main] application : jolokia: jolokia:type=Config is already registered. Adding it with jolokia:type=Config,uuid=bf0dd481-342f-452a-9935-5fad3e90d10b, but you should revise your setup in order to either use a qualifier or ensure, that only a single agent gets registered (otherwise history functionality might not work)
2016-08-30 20:24:27.745 INFO 24602 --- [ main] application : jolokia: Cannot register (legacy) MBean handler for config store with name jmx4perl:type=Config since it already exists. This is the case if another agent has been already started within the same JVM. The registration is skipped.
2016-08-30 20:24:27.745 INFO 24602 --- [ main] application : jolokia: Jolokia Discovery MBean registration is skipped because there is already one registered.
2016-08-30 20:24:27.890 INFO 24602 --- [ main] o.e.jetty.server.handler.ContextHandler : Stopped o.s.b.c.e.j.JettyEmbeddedWebAppContext#3c0fae6c{/,file:///private/var/folders/8_/yq1cv_hs4jqd49v2zlzm8l9w0000gn/T/jetty-docbase.2269375622778918038.8765/,UNAVAILABLE}
2016-08-30 20:24:27.917 ERROR 24602 --- [ main] o.s.boot.SpringApplication : Application startup failed
org.springframework.context.ApplicationContextException: Failed to start bean 'outputBindingLifecycle'; nested exception is java.lang.IllegalStateException: A default binder has been requested, but there is more than one binder available: rabbit,consul, and no default binder has been set.
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:176)
at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:51)
at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:346)
at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:149)
at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:112)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:874)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:144)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:544)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:369)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:313)
at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:134)
at com.cisco.phisphere.routerservice.RouterService.main(RouterService.java:30)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:58)
Caused by: java.lang.IllegalStateException: A default binder has been requested, but there is more than one binder available: rabbit,consul, and no default binder has been set.
at org.springframework.cloud.stream.binder.DefaultBinderFactory.getBinder(DefaultBinderFactory.java:116)
at org.springframework.cloud.stream.binding.ChannelBindingService.getBinderForChannel(ChannelBindingService.java:142)
at org.springframework.cloud.stream.binding.ChannelBindingService.bindProducer(ChannelBindingService.java:104)
at org.springframework.cloud.stream.binding.BindableProxyFactory.bindOutputs(BindableProxyFactory.java:206)
at org.springframework.cloud.stream.binding.OutputBindingLifecycle.start(OutputBindingLifecycle.java:57)
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:173)
... 21 common frames omitted

Don't use the consul-all starter. Change it to consul-discovery. The all starter brings in a consul stream binder.

In your case you need to set the default binder for rabbit.
spring.cloud.stream.default-binder=rabbit

Related

Arquillian- Test class not found as the war is undeployed

I'm trying to run my unit testing with Arquillian. I configured it with Maven having both Wildfly managed and remote servers. After running the test the server starts and deploys my war. Immediately after deploying it undeploys and removes the war resluting in ClassNotFound exception, I'm providing below the stacktrace:
19:46:23,101 INFO  [org.jboss.as.repository]
(management-handler-thread - 3) JBAS014900: Content added at location
/home/remotedev/QSDev2/app-qs/target/wildfly-8.2.1.Final/standalone/data/content/29/401e4f9cd9cff55c2a0cd817a4163817b4d7c4/content
19:46:23,172 INFO  [org.jboss.as.server.deployment] (MSC service
thread 1-2) JBAS015876: Starting deployment of "testwar.war"
(runtime-name: "testwar.war") 19:46:25,769 WARN
 [org.jboss.weld.deployer] (MSC service thread 1-1) JBAS016012:
Deployment deployment "testwar.war" contains CDI annotations but no
bean archive was found (no beans.xml or class with bean defining
annotations). 19:46:26,590 INFO  [org.wildfly.extension.undertow] (MSC
service thread 1-2) JBAS017534: Registered web context: /testwar
19:46:26,736 INFO  [org.jboss.as.server] (management-handler-thread -
3) JBAS018559: Deployed "testwar.war" (runtime-name : "testwar.war")
2021-03-23 19:46:28 DEBUG nio:429 - Started channel thread 'Remoting
"endpoint" I/O-1', selector sun.nio.ch.EPollSelectorImpl#381d206c
2021-03-23 19:46:28 DEBUG VersionedConectionFactory:173 - Available
version (Versions  0x00 0x01) 2021-03-23 19:46:28 DEBUG
VersionedConectionFactory:179 - Calling a stable server 2021-03-23
19:46:28 DEBUG VersionedConectionFactory:131 - Selecting version 0x00
to receive full version list. 2021-03-23 19:46:28 DEBUG
VersionedConectionFactory:173 - Available version (Versions  0x01
0x02) 2021-03-23 19:46:28 DEBUG VersionedConectionFactory:179 -
Calling a stable server 2021-03-23 19:46:28 DEBUG
VersionedConectionFactory:194 - Server version 2.0.0.Final
19:46:29,576 INFO  [org.wildfly.extension.undertow] (MSC service
thread 1-2) JBAS017535: Unregistered web context: /testwar
19:46:29,678 INFO  [org.hibernate.validator.internal.util.Version]
(MSC service thread 1-1) HV000001: Hibernate Validator 5.1.3.Final
19:46:30,504 INFO  [org.jboss.as.server.deployment] (MSC service
thread 1-1) JBAS015877: Stopped deployment testwar.war (runtime-name:
testwar.war) in 945ms 19:46:30,543 INFO  [org.jboss.as.repository]
(management-handler-thread - 3) JBAS014901: Content removed from
location
/home/remotedev/QSDev2/app-qs/target/wildfly-8.2.1.Final/standalone/data/content/29/401e4f9cd9cff55c2a0cd817a4163817b4d7c4/content
19:46:30,551 INFO  [org.jboss.as.server] (management-handler-thread -
3) JBAS018558: Undeployed "testwar.war" (runtime-name: "testwar.war")
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 24.115
sec <<< FAILURE!
testSaveLeaveRequest(com.maestro.application.authentication.util.PasswordStrengthTest)
 Time elapsed: 0.343 sec  <<< ERROR! java.lang.ClassNotFoundException:
com.maestro.application.authentication.util.PasswordStrengthTest from
[Module "deployment.testwar.war:main" from Service Module Loader]
I can't figure out why it's undeploying the war after deploying. Could anyone help me figure out the problem? (Posted at Arquillian forum, no reply yet http://discuss.arquillian.org/t/test-class-not-found-as-the-war-is-undeployed/656). Thanks
--Rashed
Latest update- 04-07-2021
Now getting following exception, CNFE is gone:
Caused by: java.lang.Exception: {
"JBAS014671: Failed services" => {"jboss.deployment.unit."test.war".INSTALL" => "org.jboss.msc.service.StartException in service jboss.deployment.unit."test.war".INSTALL: JBAS018733: Failed to process phase INSTALL of deployment "test.war"
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011047: Component class com.maestro.ejb.dao.EntityManagerProvider for component LeaveRequestLocalHome has errors:
JBAS011440: Can't find a persistence unit named optimalOneDefaultPersistenceUnit in deployment "test.war""},
"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.deployment.unit."test.war".weld.weldClassIntrospector is missing [jboss.deployment.unit."test.war".beanmanager]"]
}
The test code looks like below:
#RunWith(Arquillian.class)
public class PasswordStrengthTest {
#Deployment
public static JavaArchive createDeployment() {
return ShrinkWrap
.create(JavaArchive.class)
.addClasses(LeaveRequestLocal.class,
LeaveRequestLocalHome.class, LeaveRequestInfo.class,
LeaveRequestManagerBean.class,
LeaveRequestController.class, LeaveRequestBean.class,
EntityManagerProvider.class, JpaEntity.class,
MaestroEntityBean.class, MaestroValueObject.class,
JpaDaoBean.class, GenericDao.class,
SearchManagerException.class, MaestroException.class,
NoSuchLeaveRequestException.class,
MaestroExceptionDetails.class,
MaestroRuntimeException.class, TableParameters.class,
SearchParameters.class, PagedList.class)
.addAsManifestResource("META-INF/persistence.xml")
.addAsResource(EmptyAsset.INSTANCE, "beans.xml");
}
#Inject
private LeaveRequestManagerBean leaveRequestManagerBean;
#Inject
private LeaveRequestLocalHome leaveRequestLocalHome;
#Inject
private LeaveRequestController leaveRequestController;
#Test
public void testSaveLeaveRequest() throws Exception {
String name = "abc";
String requestDetails = "req1";
leaveRequestManagerBean = (LeaveRequestManagerBean) EJBUtil
.getLocalEJBManager("LeaveRequestManager");
LeaveRequestInfo leaveReuestInfo = leaveRequestManagerBean.add();
leaveReuestInfo.setName(name);
leaveReuestInfo.setRequestDetails(requestDetails);
leaveRequestManagerBean.update(leaveReuestInfo);
}
}
And the POM looks like 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>com.quickschools</groupId>
<artifactId>app-qs</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>app-qs</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<version.org.jboss.arquillian>1.1.5.Final</version.org.jboss.arquillian>
<version.org.wildfly>8.2.1.Final</version.org.wildfly>
<version.junit>4.11</version.junit>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemProperties>
<property>
<name>java.util.logging.config.file</name>
<value>log4j.properties</value>
</property>
</systemProperties>
</configuration>
</plugin>
</plugins>
</build>
<dependencyManagement>
<dependencies>
<!-- Arquillian BOM (Bill Of Materials). -->
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>1.1.5.Final</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<!-- JUnit regression testing framework. -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
</dependency>
</dependencies>
</dependencyManagement>
<profiles>
<!-- Arquillian WildFly managed profile -->
<profile>
<id>arq-wildfly-managed</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<dependencies>
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-arquillian-container-managed</artifactId>
<version>${version.org.wildfly}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>sun.jdk</groupId>
<artifactId>jconsole</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<testResources>
<testResource>
<directory>src/test/resources</directory>
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack</id>
<phase>process-test-classes</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-dist</artifactId>
<version>${version.org.wildfly}</version>
<type>zip</type>
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!-- Arquillian WildFly remote profile -->
<profile>
<id>arq-widlfly-remote</id>
<!-- <activation> <activeByDefault>true</activeByDefault> </activation> -->
<dependencies>
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-arquillian-container-remote</artifactId>
<version>${version.org.wildfly}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>sun.jdk</groupId>
<artifactId>jconsole</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>com.quickschools</groupId>
<artifactId>sms-core</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>/home/remotedev/mnt/sms2/build/ear/01sms.jar</systemPath>
</dependency>
<dependency>
<groupId>com.quickschools</groupId>
<artifactId>gengo</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>/home/remotedev/ProgramFiles/wildfly-12.0.0.Final/modules/com/quickschools/libs/main/gengo.jar</systemPath>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.7</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<!-- for arqillian -->
<dependency>
<groupId>javax.ejb</groupId>
<artifactId>ejb-api</artifactId>
<version>3.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.ejb</groupId>
<artifactId>javax.ejb-api</artifactId>
<version>3.2</version>
</dependency>
<dependency> <!-- for arqillian -->
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<version>1.1.5.Final</version>
<!-- <version>1.6.0.Final</version> -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.protocol</groupId>
<artifactId>arquillian-protocol-servlet</artifactId>
<version>1.1.5.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-jpamodelgen</artifactId>
<version>1.3.0.Final</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.3</version>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<version>3.0.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>1.6.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<version>1.6.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.9.5</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.2.11</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>2.2.11</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.2.11</version>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.8</version>
</dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>javax.persistence-api</artifactId>
<version>2.2</version>
<scope>runtime</scope>
</dependency>
</dependencies>
</project>
Thanks
Update 09-04-2021
Changed accordingly, now the delpoyment code looks like below:
return ShrinkWrap
.create(JavaArchive.class)
.addClasses(LeaveRequestLocal.class,
LeaveRequestLocalHome.class, LeaveRequestInfo.class,
LeaveRequestManagerBean.class,
LeaveRequestController.class, LeaveRequestBean.class,
EntityManagerProvider.class, JpaEntity.class,
MaestroEntityBean.class, MaestroValueObject.class,
JpaDaoBean.class, GenericDao.class,
SearchManagerException.class, MaestroException.class,
NoSuchLeaveRequestException.class,
MaestroExceptionDetails.class,
MaestroRuntimeException.class, TableParameters.class,
SearchParameters.class, PagedList.class)
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
.addAsManifestResource("persistence.xml");
After deleting META-INF from persistence.xml path, it can't find it now, showing exception as follows:
Caused by: java.lang.IllegalArgumentException: persistence.xml doesn't exist or can't be accessed
at org.jboss.shrinkwrap.impl.base.Validate.notNull(Validate.java:43)
at org.jboss.shrinkwrap.impl.base.container.ContainerBase.fileFromResource(ContainerBase.java:1966)
at org.jboss.shrinkwrap.impl.base.container.ContainerBase.addAsManifestResource(ContainerBase.java:683)
I tried with keeping beans.xml and presistence.xml at both /resources/META-INF and /test/resources/META-INF, which path is correct? Thanks

Spring Cloud Contract, Openapi with contract extension

I am trying to run Spring Cloud Contract Stub runner as a Spring Boot server application (#EnableStubRunnerServer). Also I wanted to use OpenApi yaml specification with contract extension by Springframeworkguru, with oas3 converter.
But that setup does not work. When I try to boot the Spring Boot app (java -jar ...), it fails with exception:
Caused by: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "openapi" (class org.springframework.cloud.contract.verifier.converter.YamlContract), not marked as ignorable (10 known properties: "response", "ignored", "metaClass", "label", "outputMessage", "input", "name", "description", "request", "priority"])
Obviously (?) the reason of this error is openapi.yml file, that is also included in generated stubs jar.
I am hoping that someone could come up with a solution. Spring Cloud Contract stub server deployed as Spring Boot app would be really nice and agile way to set up/deploy a stub server. And also today the use of "contract first" with OpenApi 3 spec is a requirement in all projects.
I'm using the classpath option, so the stubs jar is included in Spring Boot application dependencies (in fat jar).
ADDED LOG with part of stacktrace. Contracts get generated ok and can be found in target directory.
2020-03-02 11:24:12.098 INFO 89835 --- [ main] c.example.sccoas31.SccOas31Application : Starting SccOas31Application on XXXXXXX-MacBook-Air.local with PID 89835 (/Users/ok/dev/spring-cloud-contract/oa3-example/scc-oas3-1/target/classes started by ok in /Users/ok/dev/spring-cloud-contract/oa3-example/scc-oas3-1)
2020-03-02 11:24:12.109 INFO 89835 --- [ main] c.example.sccoas31.SccOas31Application : No active profile set, falling back to default profiles: default
2020-03-02 11:24:14.128 INFO 89835 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'stubrunner-org.springframework.cloud.contract.stubrunner.spring.StubRunnerProperties' of type [org.springframework.cloud.contract.stubrunner.spring.StubRunnerProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-03-02 11:24:14.131 INFO 89835 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.contract.stubrunner.spring.StubRunnerConfiguration' of type [org.springframework.cloud.contract.stubrunner.spring.StubRunnerConfiguration$$EnhancerBySpringCGLIB$$a516edc8] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-03-02 11:24:14.164 INFO 89835 --- [ main] o.s.c.c.s.ClasspathStubProvider : Will download stubs from classpath
2020-03-02 11:24:14.310 WARN 89835 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'batchStubRunnerBeanPostProcessor' defined in org.springframework.cloud.contract.stubrunner.spring.StubRunnerConfiguration: Unsatisfied dependency expressed through method 'batchStubRunnerBeanPostProcessor' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'batchStubRunner' defined in org.springframework.cloud.contract.stubrunner.spring.StubRunnerConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.contract.stubrunner.BatchStubRunner]: Factory method 'batchStubRunner' threw exception; nested exception is java.lang.IllegalStateException: No stubs were found on classpath for [com.example:scc-oas3-1]
2020-03-02 11:24:14.323 INFO 89835 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-03-02 11:24:14.348 ERROR 89835 --- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'batchStubRunnerBeanPostProcessor' defined in org.springframework.cloud.contract.stubrunner.spring.StubRunnerConfiguration: Unsatisfied dependency expressed through method 'batchStubRunnerBeanPostProcessor' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'batchStubRunner' defined in org.springframework.cloud.contract.stubrunner.spring.StubRunnerConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.contract.stubrunner.BatchStubRunner]: Factory method 'batchStubRunner' threw exception; nested exception is java.lang.IllegalStateException: No stubs were found on classpath for [com.example:scc-oas3-1]
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:769) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:509) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1288) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1127) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:538) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:204) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate.java:240) ~[spring-context-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:707) ~[spring-context-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:531) ~[spring-context-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142) ~[spring-boot-2.1.1.RELEASE.jar:2.1.1.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) [spring-boot-2.1.1.RELEASE.jar:2.1.1.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.1.1.RELEASE.jar:2.1.1.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) [spring-boot-2.1.1.RELEASE.jar:2.1.1.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260) [spring-boot-2.1.1.RELEASE.jar:2.1.1.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248) [spring-boot-2.1.1.RELEASE.jar:2.1.1.RELEASE]
at com.example.sccoas31.SccOas31Application.main(SccOas31Application.java:16) [classes/:na]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'batchStubRunner' defined in org.springframework.cloud.contract.stubrunner.spring.StubRunnerConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.contract.stubrunner.BatchStubRunner]: Factory method 'batchStubRunner' threw exception; nested exception is java.lang.IllegalStateException: No stubs were found on classpath for [com.example:scc-oas3-1]
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:627) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:607) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1288) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1127) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:538) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:273) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1237) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1164) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:857) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:760) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
... 19 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.contract.stubrunner.BatchStubRunner]: Factory method 'batchStubRunner' threw exception; nested exception is java.lang.IllegalStateException: No stubs were found on classpath for [com.example:scc-oas3-1]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:622) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
... 33 common frames omitted
Caused by: java.lang.IllegalStateException: No stubs were found on classpath for [com.example:scc-oas3-1]
at org.springframework.cloud.contract.stubrunner.ClasspathStubProvider$1.downloadAndUnpackStubJar(ClasspathStubProvider.java:101) ~[spring-cloud-contract-stub-runner-2.1.5.RELEASE.jar:2.1.5.RELEASE]
at org.springframework.cloud.contract.stubrunner.CompositeStubDownloader.downloadAndUnpackStubJar(CompositeStubDownloaderBuilder.java:80) ~[spring-cloud-contract-stub-runner-2.1.5.RELEASE.jar:2.1.5.RELEASE]
at org.springframework.cloud.contract.stubrunner.StubRunnerFactory.createStubsFromServiceConfiguration(StubRunnerFactory.java:66) ~[spring-cloud-contract-stub-runner-2.1.5.RELEASE.jar:2.1.5.RELEASE]
at org.springframework.cloud.contract.stubrunner.BatchStubRunnerFactory.buildBatchStubRunner(BatchStubRunnerFactory.java:69) ~[spring-cloud-contract-stub-runner-2.1.5.RELEASE.jar:2.1.5.RELEASE]
at org.springframework.cloud.contract.stubrunner.spring.StubRunnerConfiguration.batchStubRunner(StubRunnerConfiguration.java:84) ~[spring-cloud-contract-stub-runner-2.1.5.RELEASE.jar:2.1.5.RELEASE]
at org.springframework.cloud.contract.stubrunner.spring.StubRunnerConfiguration$$EnhancerBySpringCGLIB$$a516edc8.CGLIB$batchStubRunner$0(<generated>) ~[spring-cloud-contract-stub-runner-2.1.5.RELEASE.jar:2.1.5.RELEASE]
at org.springframework.cloud.contract.stubrunner.spring.StubRunnerConfiguration$$EnhancerBySpringCGLIB$$a516edc8$$FastClassBySpringCGLIB$$5a4ce29b.invoke(<generated>) ~[spring-cloud-contract-stub-runner-2.1.5.RELEASE.jar:2.1.5.RELEASE]
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) ~[spring-core-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:363) ~[spring-context-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.cloud.contract.stubrunner.spring.StubRunnerConfiguration$$EnhancerBySpringCGLIB$$a516edc8.batchStubRunner(<generated>) ~[spring-cloud-contract-stub-runner-2.1.5.RELEASE.jar:2.1.5.RELEASE]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_181]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_181]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_181]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_181]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
... 34 common frames omitted
Disconnected from the target VM, address: '127.0.0.1:60216', transport: 'socket'
Process finished with exit code 1
--- pom:
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>scc-oas3-1</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>scc-oas3-1</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
<spring-cloud.version>Greenwich.SR5</spring-cloud.version>
</properties>
<dependencies>
<dependency>
<groupId>com.example</groupId>
<artifactId>scc-oas3-1</artifactId>
<classifier>stubs</classifier>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-contract-stub-runner</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-contract-verifier</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>guru.springframework</groupId>
<artifactId>spring-cloud-contract-oa3</artifactId>
<version>2.1.2.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-contract-maven-plugin</artifactId>
<version>2.1.5.RELEASE</version>
<extensions>true</extensions>
<dependencies>
<!--needed to include oa3 converter-->
<dependency>
<groupId>guru.springframework</groupId>
<artifactId>spring-cloud-contract-oa3</artifactId>
<version>2.1.2.0</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
Stub mappings jar packages generated using
Spring Cloud Contract OpenAPI 3.0 Contract Converter (by springframeworkguru)
when used with Spring Boot app with #EnableStubRunnerServer
requires Spring Cloud Hoxton release.
After looking at your POM it seems that you're mixing the test and production dependencies. Since you want to use a Spring Cloud Contract Server you need to have all the dependencies in compile scope. Moreover, you're using a maven plugin. Maven plugin should be used if you want to generate tests from your contracts, whereas you want to only run stubs (so you should remove the plugin).
Sth like this should work I guess (of course please upgrade to the latest GA versions)
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>scc-oas3-1</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>scc-oas3-1</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
<spring-cloud.version>Greenwich.SR5</spring-cloud.version>
</properties>
<dependencies>
<dependency>
<groupId>com.example</groupId>
<artifactId>scc-oas3-1</artifactId>
<classifier>stubs</classifier>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-contract-stub-runner</artifactId>
</dependency>
<dependency>
<groupId>guru.springframework</groupId>
<artifactId>spring-cloud-contract-oa3</artifactId>
<version>2.1.2.0</version>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

How to get the first Storm Kafka demo to work?

Submitting a simple, first Storm Topology is driving me mad. Firt, I got a Connection refused, when I tried to run it against the remote VM, where storm is installed. I understand, that I have to run it on a local cluster.
Those are my lines of code that came out:
public void execTopology_alt() throws Exception {
final TopologyBuilder tp = new TopologyBuilder();
tp.setSpout("kafka_spout", new KafkaSpout<>(KafkaSpoutConfig.builder(this.bootstrapServers, topic).build()), 1);
tp.setBolt("bolt", new LoggerBolt()).shuffleGrouping("kafka_spout");
Config conf = new Config();
LocalCluster cluster = new LocalCluster();
cluster.submitTopology("kafkaboltTest", conf, tp.createTopology());
}
There seem to be 2 issues, that keep me busy for hours.
1) a Class is not found
20:48:40.202 [main] INFO org.apache.storm.daemon.metrics.ClientMetricsUtils - Using statistics reporter plugin:org.apache.storm.daemon.metrics.reporters.JmxPreparableReporter
20:48:40.203 [main] INFO org.apache.storm.daemon.metrics.reporters.JmxPreparableReporter - Preparing...
Exception in thread "main" java.lang.NoClassDefFoundError: com/codahale/metrics/JmxReporter
at org.apache.storm.daemon.metrics.reporters.JmxPreparableReporter.prepare(JmxPreparableReporter.java:32)
at org.apache.storm.metric.StormMetricsRegistry.startMetricsReporters(StormMetricsRegistry.java:74)
at org.apache.storm.LocalCluster.<init>(LocalCluster.java:287)
at org.apache.storm.LocalCluster.<init>(LocalCluster.java:159)
at tki.bigdata.storm.StormTopology.execTopology_alt(StormTopology.java:93)
at tki.bigdata.storm.StormTopology.main(StormTopology.java:46)
Caused by: java.lang.ClassNotFoundException: com.codahale.metrics.JmxReporter
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 6 more
I post my pom.xml, I am also using Spring Boot and Spring Kafka (Kafka works). Perhaps that works not good together with the Storm stuff?
<?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>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.5.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>tki.bigdata</groupId>
<artifactId>RealTime</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>RealTime</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>log4j</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.kafka</groupId>
<artifactId>spring-kafka</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.kafka</groupId>
<artifactId>spring-kafka-test</artifactId>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.storm/storm-server -->
<dependency>
<groupId>org.apache.storm</groupId>
<artifactId>storm-server</artifactId>
<version>2.0.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.storm/storm-core -->
<dependency>
<groupId>org.apache.storm</groupId>
<artifactId>storm-core</artifactId>
<version>2.0.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.storm/storm-kafka -->
<dependency>
<groupId>org.apache.storm</groupId>
<artifactId>storm-kafka</artifactId>
<version>1.2.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.storm/storm-kafka-client -->
<dependency>
<groupId>org.apache.storm</groupId>
<artifactId>storm-kafka-client</artifactId>
<version>2.0.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
2) When I run it, there are tons of output, that repeat forever
20:48:40.968 [main-SendThread(localhost:2004)] DEBUG org.apache.storm.shade.org.apache.zookeeper.ClientCnxn - Reading reply sessionid:0x1000fc645fb0005, packet:: clientPath:null serverPath:null finished:false header:: 20,4 replyHeader:: 20,39,0 request:: '/storm/supervisors/6de1c57f-06e9-49ae-984f-09b5ad7d05e5,F response:: #1fffffff8b80000000354e41effffff8230105c1022ffffffd018ffffffe2ffffffc1ffffff8377ffffffaf6dffffffaaffffffa160f267cffffffc432d2531ffffffa6ffffffb66930115fffffffe0737cffffff94fffffffb1ffffff8d38ffffff87ffffff9dffffffddffffffd9ffffff9dffffffdd2d202ffffff8f737a7a21ffffff887dffffffb6ffffffd1ffffff9d14ffffffc65cffffffb175ffffff86cffffffee323effffff8930f4bffffffdfffffffdbffffffd5ffffffbdffffffda4bffffffd6cffffff98ffffffd6ffffff8affffffe3ffffff8a77afffffff363ffffffe54b2e58ffffffd7373d65ffffff8affffff95ffffff90146165969ffffffe0ffffffe0fffffff34860ffffffe668ffffffe6ffffffb8ffffff80ffffffe5ffffffac1ffffff82ffffffccffffffc7fffffff44028ffffffa12bffffffc85118effffffbfffffffacffffffa5ffffffbd132bffffff8d53ffffffc42a27ffffffd56d6cffffffa7ffffffbf772ffffffadffffffb47113ffffffd1ffffffa27dffffffffffffff94cfffffffcffffffc1ffffffed7ffffffbe7fffffffda34ffffffc2ffffffd4000,s{35,35,1560624520123,1560624520123,0,0,0,72074938289946636,186,0,35}
20:48:40.968 [SyncThread:0] DEBUG org.apache.storm.shade.org.apache.zookeeper.server.FinalRequestProcessor - Processing request:: sessionid:0x1000fc645fb0005 type:exists cxid:0x15 zxid:0xfffffffffffffffe txntype:unknown reqpath:/storm/supervisors/5488b159-db82-42d0-b24e-354c59ddce34
20:48:40.969 [SyncThread:0] DEBUG org.apache.storm.shade.org.apache.zookeeper.server.FinalRequestProcessor - sessionid:0x1000fc645fb0005 type:exists cxid:0x15 zxid:0xfffffffffffffffe txntype:unknown reqpath:/storm/supervisors/5488b159-db82-42d0-b24e-354c59ddce34
20:48:40.969 [main-SendThread(localhost:2004)] DEBUG org.apache.storm.shade.org.apache.zookeeper.ClientCnxn - Reading reply sessionid:0x1000fc645fb0005, packet:: clientPath:null serverPath:null finished:false header:: 21,3 replyHeader:: 21,39,0 request:: '/storm/supervisors/5488b159-db82-42d0-b24e-354c59ddce34,F response:: s{39,39,1560624520167,1560624520167,0,0,0,72074938289946638,185,0,39}
20:48:40.969 [SyncThread:0] DEBUG org.apache.storm.shade.org.apache.zookeeper.server.FinalRequestProcessor - Processing request:: sessionid:0x1000fc645fb0005 type:getData cxid:0x16 zxid:0xfffffffffffffffe txntype:unknown reqpath:/storm/supervisors/5488b159-db82-42d0-b24e-354c59ddce34
20:48:40.969 [SyncThread:0] DEBUG org.apache.storm.shade.org.apache.zookeeper.server.FinalRequestProcessor - sessionid:0x1000fc645fb0005 type:getData cxid:0x16 zxid:0xfffffffffffffffe txntype:unknown reqpath:/storm/supervisors/5488b159-db82-42d0-b24e-354c59ddce34
The issue is with your POM, and with the Kafka setup.
Remove storm-kafka, you don't need it. It is the old Kafka integration for Storm, storm-kafka-client replaces it.
I would avoid using Spring with Storm. Storm doesn't know about Spring beans, so your Spring setup is likely to only work on a local cluster, not a production setup.
You need to put storm-client on the classpath. Set it to provided scope. You can remove storm-core as well.
Most likely you need to set a consumer group in your spout Kafka configuration. Use KafkaSpoutConfig.setProp(ConsumerConfig.GROUP_ID_CONFIG, "your-group-here")
There's a complete example at https://github.com/apache/storm/blob/v2.0.0/examples/storm-kafka-client-examples, I'd use that as a starting point.

Not Seeing TraceID, Span ID with Spring Cloud Starter Sleuth

I am trying my first project with Spring Cloud Starter Sleuth on SpringBoot2 and am running into an issue. Let me share my app's configuration first:
POM.xml
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.2.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<spring-cloud.version>Finchley.RC2</spring-cloud.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-sleuth</artifactId>
</dependency>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
...
Application.yml
spring:
application:
name: MyApp
logging:
level:
org:
springframework:
cloud:
sleuth: DEBUG
I start my application but I dont see any spanIds or Trace ids on hitting my services.
This is how the log looks:
...
2018-05-29 15:06:39.727 INFO [MyApp,,,] 13916 --- [nio-8081-exec-1] o.s.web.servlet.DispatcherServlet : FrameworkServlet 'dispatcherServlet': initialization completed in 22 ms
2018-05-29 15:06:39.727 INFO [MyApp,,,] 13916 ---
What am I doing wrong here in my app configuration?
Why do you think that anything is wrong? Have you logged anything after getting a request? I think we write about this in the Readme of the project that if you just start the app nothing will happen. try logging sth in the controller and send a request to see ids in the logs

using m2e and getting java.lang.NoClassDefFoundError: com/ning/http/client/AsyncHttpProvider

I use the m2e plugin in eclipse luna.
When i run with the goal clean install is an error thrown.
This is my 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 http://maven.apache.org/maven-v4_0_0.xsd">
4.0.0
deconFm_Version5
decon_fm_version5
war
0.0.2
decon_fm_version5 Maven Webapp
http://maven.apache.org
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<junit.version>4.9</junit.version>
<spring.version>3.2.0.RELEASE</spring.version>
<hibernate.core>3.3.2.GA</hibernate.core>
<hibernate.annotations>3.4.0.GA</hibernate.annotations>
<javax.persistence>1.0</javax.persistence>
<javassist.version>3.12.1.GA</javassist.version>
<c3p0.version>0.9.1.2</c3p0.version>
<postgresql.version>9.1-901.jdbc4</postgresql.version>
<jersey.version>1.13</jersey.version>
<jackson.version>1.9.13</jackson.version>
<servlet.version>2.5</servlet.version>
<org.slf4j.version>1.7.2</org.slf4j.version>
<log4j.version>1.2.16</log4j.version>
<commons.collections.version>3.2.1</commons.collections.version>
2.3</commons.lang.version> -->
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<!-- Spring Komponenten -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- Datenbank Komponenten -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>${hibernate.core}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>${hibernate.annotations}</version>
</dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>persistence-api</artifactId>
<version>${javax.persistence}</version>
</dependency>
<dependency>
<groupId>javassist</groupId>
<artifactId>javassist</artifactId>
<version>${javassist.version}</version>
</dependency>
<dependency>
<groupId>c3p0</groupId>
<artifactId>c3p0</artifactId>
<version>${c3p0.version}</version>
</dependency>
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${postgresql.version}</version>
</dependency>
<!-- Jersey Komponenten -->
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-server</artifactId>
<version>${jersey.version}</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-json</artifactId>
<version>${jersey.version}</version>
</dependency>
<!-- Apache Components -->
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.3</version>
</dependency>
<!-- Jersey - Spring Integration -->
<dependency>
<groupId>com.sun.jersey.contribs</groupId>
<artifactId>jersey-spring</artifactId>
<version>1.13</version>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Jackson -->
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>${jackson.version}</version>
</dependency>
<!-- Servlet -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>${servlet.version}</version>
</dependency>
<!-- Logging Komponenten -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${org.slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${org.slf4j.version}</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>${commons.collections.version}</version>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<verbose>false</verbose>
<fork>true</fork>
<executable>${JAVA_HOME}/javac</executable>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
This the stack trace.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building decon_fm_version5 Maven Webapp 0.0.2
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) # decon_fm_version5 ---
[INFO] Deleting D:\Projects\Java\decon_fm_version5\target
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) # decon_fm_version5 ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 35 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # decon_fm_version5 ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) # decon_fm_version5 ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\Projects\Java\decon_fm_version5\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # decon_fm_version5 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to D:\Projects\Java\decon_fm_version5\target\test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.10:test (default-test) # decon_fm_version5 ---
---------------------------------------------------
constituent[0]: file:/D:/Eclipse_201502_Luna/eclipse/configuration/org.eclipse.osgi/533/0/.cp/
constituent[1]: file:/D:/Eclipse_201502_Luna/eclipse/configuration/org.eclipse.osgi/533/0/.cp/jars/maven-core-3.0.4.jar
constituent[2]: file:/D:/Eclipse_201502_Luna/eclipse/configuration/org.eclipse.osgi/533/0/.cp/jars/maven-model-3.0.4.jar
constituent[3]: file:/D:/Eclipse_201502_Luna/eclipse/configuration/org.eclipse.osgi/533/0/.cp/jars/maven-settings-3.0.4.jar
constituent[4]: file:/D:/Eclipse_201502_Luna/eclipse/configuration/org.eclipse.osgi/533/0/.cp/jars/maven-settings-builder-3.0.4.jar
constituent[5]: file:/D:/Eclipse_201502_Luna/eclipse/configuration/org.eclipse.osgi/533/0/.cp/jars/maven-repository-metadata-3.0.4.jar
constituent[6]: file:/D:/Eclipse_201502_Luna/eclipse/configuration/org.eclipse.osgi/533/0/.cp/jars/maven-artifact-3.0.4.jar
constituent[7]: file:/D:/Eclipse_201502_Luna/eclipse/configuration/org.eclipse.osgi/533/0/.cp/jars/maven-plugin-api-3.0.4.jar
constituent[8]: file:/D:/Eclipse_201502_Luna/eclipse/configuration/org.eclipse.osgi/533/0/.cp/jars/maven-model-builder-3.0.4.jar
constituent[9]: file:/D:/Eclipse_201502_Luna/eclipse/configuration/org.eclipse.osgi/533/0/.cp/jars/maven-aether-provider-3.0.4.jar
constituent[10]: file:/D:/Eclipse_201502_Luna/eclipse/configuration/org.eclipse.osgi/533/0/.cp/jars/aether-api-1.13.1.jar
constituent[11]: file:/D:/Eclipse_201502_Luna/eclipse/configuration/org.eclipse.osgi/533/0/.cp/jars/aether-util-1.13.1.jar
constituent[12]: file:/D:/Eclipse_201502_Luna/eclipse/configuration/org.eclipse.osgi/533/0/.cp/jars/plexus-interpolation-1.14.jar
constituent[13]: file:/D:/Eclipse_201502_Luna/eclipse/configuration/org.eclipse.osgi/533/0/.cp/jars/plexus-utils-2.0.6.jar
constituent[14]: file:/D:/Eclipse_201502_Luna/eclipse/configuration/org.eclipse.osgi/533/0/.cp/jars/plexus-component-annotations-1.5.5.jar
constituent[15]: file:/D:/Eclipse_201502_Luna/eclipse/configuration/org.eclipse.osgi/533/0/.cp/jars/plexus-sec-dispatcher-1.3.jar
constituent[16]: file:/D:/Eclipse_201502_Luna/eclipse/configuration/org.eclipse.osgi/533/0/.cp/jars/maven-embedder-3.0.4.jar
constituent[17]: file:/D:/Eclipse_201502_Luna/eclipse/configuration/org.eclipse.osgi/533/0/.cp/jars/plexus-cipher-1.7.jar
constituent[18]: file:/D:/Eclipse_201502_Luna/eclipse/configuration/org.eclipse.osgi/533/0/.cp/jars/commons-cli-1.2.jar
constituent[19]: file:/D:/Eclipse_201502_Luna/eclipse/configuration/org.eclipse.osgi/533/0/.cp/jars/maven-compat-3.0.4.jar
constituent[20]: file:/D:/Eclipse_201502_Luna/eclipse/configuration/org.eclipse.osgi/533/0/.cp/jars/wagon-provider-api-2.2.jar
constituent[21]: file:/D:/Eclipse_201502_Luna/eclipse/configuration/org.eclipse.osgi/533/0/.cp/jars/guice-plexus-shim-2.3.0.jar
constituent[22]: file:/D:/Eclipse_201502_Luna/eclipse/configuration/org.eclipse.osgi/533/0/.cp/jars/javax.inject-1.jar
constituent[23]: file:/D:/Eclipse_201502_Luna/eclipse/configuration/org.eclipse.osgi/533/0/.cp/jars/guice-bean-reflect-2.3.0.jar
constituent[24]: file:/D:/Eclipse_201502_Luna/eclipse/configuration/org.eclipse.osgi/533/0/.cp/jars/guice-bean-locators-2.3.0.jar
constituent[25]: file:/D:/Eclipse_201502_Luna/eclipse/configuration/org.eclipse.osgi/533/0/.cp/jars/guice-bean-binders-2.3.0.jar
constituent[26]: file:/D:/Eclipse_201502_Luna/eclipse/configuration/org.eclipse.osgi/533/0/.cp/jars/guice-bean-scanners-2.3.0.jar
constituent[27]: file:/D:/Eclipse_201502_Luna/eclipse/configuration/org.eclipse.osgi/533/0/.cp/jars/guice-bean-converters-2.3.0.jar
constituent[28]: file:/D:/Eclipse_201502_Luna/eclipse/configuration/org.eclipse.osgi/533/0/.cp/jars/guice-plexus-metadata-2.3.0.jar
constituent[29]: file:/D:/Eclipse_201502_Luna/eclipse/configuration/org.eclipse.osgi/533/0/.cp/jars/guice-plexus-converters-2.3.0.jar
constituent[30]: file:/D:/Eclipse_201502_Luna/eclipse/configuration/org.eclipse.osgi/533/0/.cp/jars/guice-plexus-locators-2.3.0.jar
constituent[31]: file:/D:/Eclipse_201502_Luna/eclipse/configuration/org.eclipse.osgi/533/0/.cp/jars/guice-plexus-binders-2.3.0.jar
constituent[32]: file:/D:/Eclipse_201502_Luna/eclipse/configuration/org.eclipse.osgi/533/0/.cp/jars/guice-bean-inject-2.3.0.jar
constituent[33]: file:/D:/Eclipse_201502_Luna/eclipse/configuration/org.eclipse.osgi/533/0/.cp/jars/guice-plexus-scanners-2.3.0.jar
constituent[34]: file:/D:/Eclipse_201502_Luna/eclipse/configuration/org.eclipse.osgi/533/0/.cp/jars/guice-plexus-lifecycles-2.3.0.jar
constituent[35]: file:/D:/Eclipse_201502_Luna/eclipse/configuration/org.eclipse.osgi/533/0/.cp/jars/sisu-guice-3.1.0-no_aop.jar
constituent[36]: file:/D:/Eclipse_201502_Luna/eclipse/configuration/org.eclipse.osgi/533/0/.cp/jars/guava-11.0.2.jar
constituent[37]: file:/D:/Eclipse_201502_Luna/eclipse/configuration/org.eclipse.osgi/533/0/.cp/jars/aether-connector-wagon-1.13.1.jar
constituent[38]: file:/D:/Eclipse_201502_Luna/eclipse/configuration/org.eclipse.osgi/533/0/.cp/jars/aether-spi-1.13.1.jar
constituent[39]: file:/D:/Eclipse_201502_Luna/eclipse/configuration/org.eclipse.osgi/533/0/.cp/jars/aether-impl-1.13.1.jar
constituent[40]: file:/D:/Eclipse_201502_Luna/eclipse/configuration/org.eclipse.osgi/533/0/.cp/jars/aether-connector-asynchttpclient-1.13.1.jar
constituent[41]: file:/D:/Eclipse_201502_Luna/eclipse/configuration/org.eclipse.osgi/533/0/.cp/jars/wagon-ahc-1.2.1.jar
constituent[42]: file:/D:/Eclipse_201502_Luna/eclipse/configuration/org.eclipse.osgi/533/0/.cp/jars/wagon-file-2.2.jar
---------------------------------------------------
Exception in thread "main" java.lang.NoClassDefFoundError: com/ning/http/client/AsyncHttpProvider
at org.sonatype.aether.connector.async.AsyncRepositoryConnectorFactory.newInstance(AsyncRepositoryConnectorFactory.java:106)
at org.sonatype.aether.impl.internal.DefaultRemoteRepositoryManager.getRepositoryConnector(DefaultRemoteRepositoryManager.java:346)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:453)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:216)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:193)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:281)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:186)
at org.sonatype.aether.impl.internal.DefaultDependencyCollector.process(DefaultDependencyCollector.java:412)
at org.sonatype.aether.impl.internal.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:240)
at org.sonatype.aether.impl.internal.DefaultRepositorySystem.collectDependencies(DefaultRepositorySystem.java:308)
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:199)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.createPluginRealm(DefaultMavenPluginManager.java:353)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.setupPluginRealm(DefaultMavenPluginManager.java:321)
at org.apache.maven.plugin.DefaultBuildPluginManager.getPluginRealm(DefaultBuildPluginManager.java:175)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:78)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: java.lang.ClassNotFoundException: com.ning.http.client.AsyncHttpProvider
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
... 35 more
What is the problem? Google did not help me.
Thanks for your help.
I solved this by adding the following dependency to my pom.xml:
<dependency>
<groupId>com.ning</groupId>
<artifactId>async-http-client</artifactId>
<version>1.9.32</version>
</dependency>
I am still investigating which dependency depends on this and why this happened now.