When I try to deploy a war to WildFly directly from Eclipse I get an error. This only happens when I deploy the war from Eclipse, there is no problem, when I copy the war manually into standalone/deployments directory of Wildfly.
Yesterday it worked, no configuration changes in application has been made since then (no new maven dependencies, no changes in web.xml, persistence.xml etc), just some code modifications. There was some Java 8 code added, maybe that could be the problem. But we had Java 8 code in the project before, and it wasn't an issue.
Stacktrace:
12:13:38,595 INFO [org.jboss.as.jpa] (ServerService Thread Pool -- 228) JBAS011409: Starting Persistence Unit (phase 2 of 2) Service 'user-rest.war#mfss-user'
12:13:38,611 INFO [org.hibernate.dialect.Dialect] (ServerService Thread Pool -- 228) HHH000400: Using dialect: org.hibernate.dialect.PostgreSQL9Dialect
12:13:38,611 INFO [org.hibernate.engine.jdbc.internal.LobCreatorBuilder] (ServerService Thread Pool -- 228) HHH000424: Disabling contextual LOB creation as createClob() method threw error : java.lang.reflect.InvocationTargetException
12:13:38,637 INFO [org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory] (ServerService Thread Pool -- 228) HHH000397: Using ASTQueryTranslatorFactory
12:13:38,827 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC000001: Failed to start service jboss.deployment.unit."user-rest.war".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."user-rest.war".WeldStartService: Failed to start service
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1904) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_20]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_20]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_20]
Caused by: java.lang.NullPointerException
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:213)
at com.google.common.cache.LocalCache.get(LocalCache.java:3933)
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3938)
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4821)
at org.jboss.weld.util.cache.LoadingCacheUtils.getCacheValue(LoadingCacheUtils.java:52)
at org.jboss.weld.resources.SharedObjectCache.getTypeClosureHolder(SharedObjectCache.java:98)
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedParameter.initTypeClosure(BackedAnnotatedParameter.java:46)
at org.jboss.weld.annotated.slim.backed.BackedAnnotated.<init>(BackedAnnotated.java:19)
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedParameter.<init>(BackedAnnotatedParameter.java:39)
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedParameter.of(BackedAnnotatedParameter.java:32)
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedMethod.initParameters(BackedAnnotatedMethod.java:51)
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedMethod.initParameters(BackedAnnotatedMethod.java:27)
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedCallable.<init>(BackedAnnotatedCallable.java:34)
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedMethod.<init>(BackedAnnotatedMethod.java:38)
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedMethod.of(BackedAnnotatedMethod.java:32)
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType$BackedAnnotatedMethods.computeValue(BackedAnnotatedType.java:193)
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType$BackedAnnotatedMethods.computeValue(BackedAnnotatedType.java:186)
at org.jboss.weld.util.LazyValueHolder.get(LazyValueHolder.java:35)
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType$EagerlyInitializedLazyValueHolder.<init>(BackedAnnotatedType.java:154)
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType$BackedAnnotatedMethods.<init>(BackedAnnotatedType.java:186)
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType$BackedAnnotatedMethods.<init>(BackedAnnotatedType.java:186)
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType.<init>(BackedAnnotatedType.java:66)
at org.jboss.weld.annotated.slim.backed.BackedAnnotatedType.of(BackedAnnotatedType.java:47)
at org.jboss.weld.resources.ClassTransformer$TransformClassToBackedAnnotatedType.load(ClassTransformer.java:83)
at org.jboss.weld.resources.ClassTransformer$TransformClassToBackedAnnotatedType.load(ClassTransformer.java:80)
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3524)
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2317)
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2280)
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2195)
at com.google.common.cache.LocalCache.get(LocalCache.java:3934)
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3938)
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4821)
at org.jboss.weld.util.cache.LoadingCacheUtils.getCacheValue(LoadingCacheUtils.java:52)
at org.jboss.weld.util.cache.LoadingCacheUtils.getCastCacheValue(LoadingCacheUtils.java:80)
at org.jboss.weld.resources.ClassTransformer.getBackedAnnotatedType(ClassTransformer.java:175)
at org.jboss.weld.resources.ClassTransformer.getBackedAnnotatedType(ClassTransformer.java:194)
at org.jboss.weld.bootstrap.BeanDeployer.loadAnnotatedType(BeanDeployer.java:119)
at org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:96)
at org.jboss.weld.bootstrap.ConcurrentBeanDeployer$1.doWork(ConcurrentBeanDeployer.java:62)
at org.jboss.weld.bootstrap.ConcurrentBeanDeployer$1.doWork(ConcurrentBeanDeployer.java:60)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:60)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:53)
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_20]
... 3 more
12:13:38,832 ERROR [org.jboss.as.controller.management-operation] (DeploymentScanner-threads - 2) JBAS014613: Operation ("deploy") failed - address: ([("deployment" => "user-rest.war")]) - failure description: {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"user-rest.war\".WeldStartService" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"user-rest.war\".WeldStartService: Failed to start service
Caused by: java.lang.NullPointerException"}}
12:13:38,845 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "user-rest.war" (runtime-name : "user-rest.war")
12:13:38,846 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report
JBAS014777: Services which failed to start: service jboss.deployment.unit."user-rest.war".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."user-rest.war".WeldStartService: Failed to start service
web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
</web-app>
beans.xml:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
<alternatives>
</alternatives>
</beans>
persistence.xml:
<persistence version="2.1"
xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="mfss-user" transaction-type="JTA">
<description>Default Persistence Unit for mfss-user.</description>
<jta-data-source>java:jboss/datasources/mfss-user</jta-data-source>
<shared-cache-mode>ENABLE_SELECTIVE</shared-cache-mode>
<properties>
<property name="hibernate.cache.use_second_level_cache" value="false" />
<property name="hibernate.cache.use_query_cache" value="false" />
<property name="hibernate.show_sql" value="true"/>
</properties>
</persistence-unit>
</persistence>
I found that somebody else had a similar problem before, but I can't see any solution there:
https://developer.jboss.org/message/905207
I tried doing all kinds of Project->Clean, MavenProject->Clean, WildflyServer->Clean etc.
I am using Ubuntu 14.04, Wildfly 8, Java 8 (Oracle JDK), Eclipse Luna, Maven
EDIT:
mvn dependency:tree
[INFO]
[INFO] --- maven-dependency-plugin:2.1:tree (default-cli) # user-rest ---
[INFO] com.domainname.user:user-rest:war:1.0-SNAPSHOT
[INFO] +- com.domainname.user:user-common:jar:1.0-SNAPSHOT:compile
[INFO] | +- com.intdomainname.ihg:constituent-api:jar:14.6.0-SNAPSHOT:compile
[INFO] | | +- commons-lang:commons-lang:jar:2.6:compile (version managed from 2.4)
[INFO] | | +- org.jvnet.jaxb2_commons:jaxb2-basics-runtime:jar:0.5.2:compile
[INFO] | | \- org.codehaus.jackson:jackson-core-asl:jar:1.9.2:compile
[INFO] | +- com.intdomainname.ihg:constituent-utils:jar:14.6.0-SNAPSHOT:compile
[INFO] | | +- com.intdomainname.qhg.hub.schemas:Messages:jar:14.6.0-SNAPSHOT:compile
[INFO] | | +- commons-vfs:commons-vfs:jar:1.0:compile
[INFO] | | | \- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] | | +- commons-beanutils:commons-beanutils:jar:1.8.0:compile
[INFO] | | +- com.sun.jersey:jersey-client:jar:1.15:compile
[INFO] | | +- com.sun.jersey:jersey-core:jar:1.15:compile
[INFO] | | +- com.sun.jersey:jersey-json:jar:1.15:compile
[INFO] | | | +- org.codehaus.jettison:jettison:jar:1.1:compile
[INFO] | | | +- com.sun.xml.bind:jaxb-impl:jar:2.2.3-1:compile
[INFO] | | | | \- javax.xml.bind:jaxb-api:jar:2.2.2:compile
[INFO] | | | | \- javax.xml.stream:stax-api:jar:1.0-2:compile
[INFO] | | | +- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.2:compile
[INFO] | | | \- org.codehaus.jackson:jackson-xc:jar:1.9.2:compile
[INFO] | | +- com.thoughtworks.xstream:xstream:jar:1.4.2:compile
[INFO] | | | +- xmlpull:xmlpull:jar:1.1.3.1:compile
[INFO] | | | \- xpp3:xpp3_min:jar:1.1.4c:compile
[INFO] | | +- apache-log4j:log4j:jar:1.2.14:compile
[INFO] | | +- org.codehaus.jackson:jackson-jaxrs:jar:1.9.2:compile
[INFO] | | +- org.apache.activemq:activemq-core:jar:5.5.0:compile
[INFO] | | | +- org.apache.geronimo.specs:geronimo-jms_1.1_spec:jar:1.1.1:compile
[INFO] | | | +- org.apache.activemq:activeio-core:jar:3.1.2:compile
[INFO] | | | +- org.apache.activemq:kahadb:jar:5.5.0:compile
[INFO] | | | +- org.apache.activemq.protobuf:activemq-protobuf:jar:1.1:compile
[INFO] | | | +- org.osgi:org.osgi.core:jar:4.1.0:compile
[INFO] | | | +- org.apache.geronimo.specs:geronimo-j2ee-management_1.1_spec:jar:1.0.1:compile
[INFO] | | | +- org.springframework:spring-context:jar:3.0.3.RELEASE:compile
[INFO] | | | | +- org.springframework:spring-aop:jar:3.0.3.RELEASE:compile
[INFO] | | | | | \- aopalliance:aopalliance:jar:1.0:compile
[INFO] | | | | +- org.springframework:spring-beans:jar:3.0.3.RELEASE:compile
[INFO] | | | | +- org.springframework:spring-core:jar:3.0.3.RELEASE:compile
[INFO] | | | | +- org.springframework:spring-expression:jar:3.0.3.RELEASE:compile
[INFO] | | | | \- org.springframework:spring-asm:jar:3.0.3.RELEASE:compile
[INFO] | | | +- commons-net:commons-net:jar:2.0:compile
[INFO] | | | \- org.jasypt:jasypt:jar:1.7:compile
[INFO] | | \- org.apache.activemq:activemq-pool:jar:5.5.0:compile
[INFO] | | \- commons-pool:commons-pool:jar:1.5.4:compile
[INFO] | \- javax:javaee-api:jar:7.0:compile
[INFO] | \- com.sun.mail:javax.mail:jar:1.5.1:compile (version managed from 1.5.0)
[INFO] | \- javax.activation:activation:jar:1.1.1:compile
[INFO] +- com.domainname.user:user-ejb:jar:1.0-SNAPSHOT:compile
[INFO] | +- com.domainname.user:user-jpa:jar:1.0-SNAPSHOT:compile
[INFO] | | +- org.mockito:mockito-all:jar:1.9.5:compile
[INFO] | | +- com.h2database:h2:jar:1.4.181:compile
[INFO] | | +- org.hibernate:hibernate-entitymanager:jar:4.3.1.Final:compile
[INFO] | | | +- org.jboss.logging:jboss-logging:jar:3.1.1.GA:compile
[INFO] | | | +- org.jboss.logging:jboss-logging-annotations:jar:1.2.0.Beta1:compile
[INFO] | | | +- org.hibernate:hibernate-core:jar:4.3.1.Final:compile
[INFO] | | | | +- antlr:antlr:jar:2.7.7:compile
[INFO] | | | | \- org.jboss:jandex:jar:1.1.0.Final:compile
[INFO] | | | +- dom4j:dom4j:jar:1.6.1:compile
[INFO] | | | | \- xml-apis:xml-apis:jar:1.0.b2:compile
[INFO] | | | +- org.hibernate.common:hibernate-commons-annotations:jar:4.0.4.Final:compile
[INFO] | | | +- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:compile
[INFO] | | | +- org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:jar:1.0.0.Final:compile
[INFO] | | | \- org.javassist:javassist:jar:3.18.1-GA:compile
[INFO] | | \- org.hibernate:hibernate-annotations:jar:3.4.0.GA:compile
[INFO] | | +- org.hibernate:ejb3-persistence:jar:1.0.2.GA:compile
[INFO] | | \- org.hibernate:hibernate-commons-annotations:jar:3.1.0.GA:compile
[INFO] | +- com.intdomainname.health:identity-api:jar:14.6.0-SNAPSHOT:compile
[INFO] | \- com.intdomainname.health:identity-client-helper:jar:14.6.0-SNAPSHOT:compile
[INFO] | \- apache-codec:commons-codec:jar:1.2:compile
[INFO] +- com.domainname.mfss.common:mfss-common-rest:jar:1.1.0-SNAPSHOT:compile
[INFO] | \- com.domainname.mfss.common:mfss-common-api:jar:1.1.0-SNAPSHOT:compile
[INFO] +- org.jboss.resteasy:jaxrs-api:jar:3.0.6.Final:provided
[INFO] +- org.jboss.spec.javax.ejb:jboss-ejb-api_3.2_spec:jar:1.0.0.Final:provided
[INFO] +- javax.enterprise:cdi-api:jar:1.1:provided
[INFO] | \- javax.inject:javax.inject:jar:1:provided
[INFO] +- org.jboss.resteasy:resteasy-hibernatevalidator-provider:jar:3.0.8.Final:provided
[INFO] | +- org.hibernate:hibernate-validator:jar:5.0.3.Final:provided (version managed from 4.3.1.Final)
[INFO] | | +- javax.validation:validation-api:jar:1.1.0.Final:provided
[INFO] | | \- com.fasterxml:classmate:jar:1.0.0:provided
[INFO] | \- org.jboss.weld.se:weld-se:jar:2.1.0.Final:provided
[INFO] +- org.jboss.resteasy:resteasy-jaxrs:jar:3.0.8.Final:provided
[INFO] | +- org.jboss.spec.javax.annotation:jboss-annotations-api_1.1_spec:jar:1.0.1.Final:provided
[INFO] | +- org.apache.httpcomponents:httpclient:jar:4.2.1:provided
[INFO] | | +- org.apache.httpcomponents:httpcore:jar:4.2.1:provided
[INFO] | | \- commons-codec:commons-codec:jar:1.6:provided
[INFO] | +- commons-io:commons-io:jar:2.1:provided
[INFO] | \- net.jcip:jcip-annotations:jar:1.0:provided
[INFO] +- junit:junit:jar:4.11:test
[INFO] | \- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- org.mockito:mockito-core:jar:1.9.5:test
[INFO] | \- org.objenesis:objenesis:jar:1.0:test
[INFO] +- org.powermock:powermock-module-junit4:jar:1.5.4:test
[INFO] | \- org.powermock:powermock-module-junit4-common:jar:1.5.4:test
[INFO] | +- org.powermock:powermock-core:jar:1.5.4:test
[INFO] | \- org.powermock:powermock-reflect:jar:1.5.4:test
[INFO] +- org.powermock:powermock-api-mockito:jar:1.5.4:test
[INFO] | \- org.powermock:powermock-api-support:jar:1.5.4:test
[INFO] \- org.slf4j:slf4j-api:jar:1.7.6:compile
pom.xml without dependencies:
<?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>
<artifactId>mfss-user</artifactId>
<groupId>com.domainname.user</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>user-rest</artifactId>
<packaging>war</packaging>
<name>user-rest</name>
<description>REST resources for mfss-user</description>
<dependencies>
...
dependencies
...
</dependencies>
<build>
<finalName>user-rest</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<webResources>
<resource>
<!-- this is relative to the pom.xml directory -->
<directory>target/apidocs</directory>
</resource>
</webResources>
<archive>
<manifestEntries>
<Dependencies>org.codehaus.jackson.jackson-mapper-asl</Dependencies>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>generate-service-docs</id>
<phase>generate-resources</phase>
<configuration>
<show>private</show>
<doclet>com.hypnoticocelot.jaxrs.doclet.ServiceDoclet</doclet>
<docletArtifact>
<groupId>com.hypnoticocelot</groupId>
<artifactId>jaxrs-doclet</artifactId>
<version>0.0.2</version>
</docletArtifact>
<reportOutputDirectory>${project.build.directory}</reportOutputDirectory>
<useStandardDocletOptions>false</useStandardDocletOptions>
<additionalparam>-apiVersion 1.0 -docBasePath ./ -apiBasePath
services</additionalparam>
<tags>
<tag>
<name>errorResponse</name>
<!-- Http error code for method and type -->
<placement>tm</placement>
<head>Http error code:</head>
</tag>
</tags>
</configuration>
<goals>
<goal>javadoc</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
With your comments above it seems to be the same issue that I've seem several times. I will try to explain you:
You are using maven to build your project and package the WAR. In case of using maven to build and deploy the WAR package, everything is fine and your application runs as expected on the server. In case of using the 'Run on Server' feature of eclipse you always get exceptions which might also differ depending on the state of your project (built with maven, changed some things in eclipse, cleaned the project and built with eclipse, ...) This is probably caused by the incompatibility of the build steps performed by eclipse and those done by maven. I think it's likely that you have some build steps in your pom which are not covered by the eclipse "builders" and are thus missing which results in different errors depending on whether you've built the project with maven prior to the deployment or not and the type of changes you allied.
Sorry if this sounds a bit confusing but its hard to explain this behavior. Best is to try some different workflows like:
build with maven
deploy with maven (everything should work)
undeploy and change some source code
deploy with eclipse (may work)
And analyse your pom(s) if there are some build steps that look like these cannot be covered by eclipse without maven.
I also faced the same issue, it seems that there is some mismatch between the Maven build and the way Eclipse deploy it. The deployment in some way got corrupted and did not allow to re-deploy again and giving NullPointer. I solved it by removing JBoss from Eclipse and adding it back again, updated some of my custom configuration again and started. It worked. Its a workaround but solved my issue.
Related
I've project with dependency to finagle 7.1.0 and related libraries with Scala version as 2.11.11
When I upgraded the scala version to 2.12.6 and finagle version as 17.12.0 I'm getting below error.
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.twitter.finagle.Init$
at com.twitter.finagle.client.StackClient$.endpointStack(StackClient.scala:54)
at com.twitter.finagle.client.StackClient$.newStack(StackClient.scala:220)
at com.twitter.finagle.builder.ClientConfig$NilClient$.apply$default$1(ClientBuilder.scala:74)
at com.twitter.finagle.builder.ClientConfig$.nilClient(ClientBuilder.scala:91)
at com.twitter.finagle.builder.ClientBuilder.<init>(ClientBuilder.scala:248)
at com.twitter.finagle.builder.ClientBuilder$.apply(ClientBuilder.scala:46)
at com.twitter.finagle.builder.ClientBuilder$.get(ClientBuilder.scala:52)
at com.twitter.finagle.builder.ClientBuilder.get(ClientBuilder.scala)
Below is the dependency graph for finagle related jars -
[INFO] +- com.twitter:finagle-core_2.12:jar:17.12.0:compile
[INFO] | +- com.twitter:finagle-toggle_2.12:jar:17.12.0:compile
[INFO] | | +- com.fasterxml.jackson.core:jackson-databind:jar:2.8.8:compile
[INFO] | | | \- com.fasterxml.jackson.core:jackson-annotations:jar:2.8.8:compile
[INFO] | | \- com.fasterxml.jackson.module:jackson-module-scala_2.12:jar:2.8.8:compile
[INFO] | | \- com.fasterxml.jackson.module:jackson-module-paranamer:jar:2.8.8:compile
[INFO] | +- com.twitter:finagle-init_2.12:jar:17.12.0:compile
[INFO] | +- com.twitter:util-app_2.12:jar:17.12.0:compile
[INFO] | +- com.twitter:util-cache_2.12:jar:17.12.0:compile
[INFO] | +- com.twitter:util-codec_2.12:jar:17.12.0:compile
[INFO] | +- com.twitter:util-core_2.12:jar:17.12.0:compile
[INFO] | | +- com.twitter:util-function_2.12:jar:17.12.0:compile
[INFO] | | +- org.scala-lang:scala-reflect:jar:2.12.6:compile
[INFO] | | \- org.scala-lang.modules:scala-parser-combinators_2.12:jar:1.0.4:compile
[INFO] | +- com.twitter:util-hashing_2.12:jar:17.12.0:compile
[INFO] | +- com.twitter:util-jvm_2.12:jar:17.12.0:compile
[INFO] | +- com.twitter:util-lint_2.12:jar:17.12.0:compile
[INFO] | +- com.twitter:util-logging_2.12:jar:17.12.0:compile
[INFO] | +- com.twitter:util-registry_2.12:jar:17.12.0:compile
[INFO] | +- com.twitter:util-security_2.12:jar:17.12.0:compile
[INFO] | +- com.twitter:util-stats_2.12:jar:17.12.0:compile
[INFO] | +- com.twitter:util-tunable_2.12:jar:17.12.0:compile
[INFO] | +- com.github.ben-manes.caffeine:caffeine:jar:2.3.4:compile
[INFO] | \- com.google.code.findbugs:jsr305:jar:2.0.1:compile
[INFO] +- org.scala-lang.modules:scala-java8-compat_2.12:jar:0.9.0:compile
[INFO] +- com.twitter:finagle-http_2.12:jar:17.12.0:compile
[INFO] | +- com.twitter:finagle-base-http_2.12:jar:17.12.0:compile
[INFO] | | \- com.twitter:finagle-netty3_2.12:jar:17.12.0:compile
[INFO] | +- com.twitter:finagle-netty3-http_2.12:jar:17.12.0:compile
[INFO] | +- com.twitter:finagle-netty4-http_2.12:jar:17.12.0:compile
[INFO] | | +- com.twitter:finagle-netty4_2.12:jar:17.12.0:compile
[INFO] | | \- io.netty:netty-codec-http:jar:4.1.16.Final:compile
[INFO] | | \- io.netty:netty-codec:jar:4.1.16.Final:compile
[INFO] | +- com.twitter:finagle-http2_2.12:jar:17.12.0:compile
[INFO] | | +- io.netty:netty-codec-http2:jar:4.1.16.Final:compile
[INFO] | | +- io.netty:netty-handler:jar:4.1.16.Final:compile
[INFO] | | | \- io.netty:netty-buffer:jar:4.1.16.Final:compile
[INFO] | | +- io.netty:netty-transport:jar:4.1.16.Final:compile
[INFO] | | | \- io.netty:netty-resolver:jar:4.1.16.Final:compile
[INFO] | | +- io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.16.Final:compile
[INFO] | | | \- io.netty:netty-common:jar:4.1.16.Final:compile
[INFO] | | +- io.netty:netty-transport-native-unix-common:jar:4.1.16.Final:compile
[INFO] | | \- io.netty:netty-handler-proxy:jar:4.1.16.Final:compile
[INFO] | | \- io.netty:netty-codec-socks:jar:4.1.16.Final:compile
[INFO] | \- com.twitter:util-collection_2.12:jar:17.12.0:compile
I do see similar issue when upgrading finagle version here but in my case util dependencies are valid.
Any Idea how to resolve this issue?
I am trying to use Feign Client with the new Spring Cloud version (Brixton.SR7) but I am having problems.
Every time I try to make a REST call to a registered service in Eureka Server I got the exception:
Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: rx/functions/Func1] with root cause
java.lang.ClassNotFoundException: rx.functions.Func1
My main class is enabling the FeignClients using #EnableFeignClients.
There are my project dependencies:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.2.RELEASE</version>
<relativePath/>
</parent>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Brixton.SR7</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
Using an old Spring Cloud version (Brixton.SR6) it was running ok.
Should I add some dependency RxJava?
edit:
SR6 dependency tree:
[INFO] com.pillo:client:jar:0.0.1-SNAPSHOT
[INFO] +- org.springframework.cloud:spring-cloud-starter-eureka:jar:1.1.6.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-web:jar:1.4.2.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter:jar:1.4.2.RELEASE:compile
[INFO] | | | +- org.springframework.boot:spring-boot-starter-logging:jar:1.4.2.RELEASE:compile
[INFO] | | | | +- ch.qos.logback:logback-classic:jar:1.1.7:compile
[INFO] | | | | | \- ch.qos.logback:logback-core:jar:1.1.7:compile
[INFO] | | | | +- org.slf4j:jcl-over-slf4j:jar:1.7.21:compile
[INFO] | | | | +- org.slf4j:jul-to-slf4j:jar:1.7.21:compile
[INFO] | | | | \- org.slf4j:log4j-over-slf4j:jar:1.7.21:compile
[INFO] | | | \- org.yaml:snakeyaml:jar:1.17:runtime
[INFO] | | +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.4.2.RELEASE:compile
[INFO] | | | +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.5.6:compile
[INFO] | | | +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.5.6:compile
[INFO] | | | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.5.6:compile
[INFO] | | +- com.fasterxml.jackson.core:jackson-databind:jar:2.8.4:compile
[INFO] | | \- org.springframework:spring-webmvc:jar:4.3.4.RELEASE:compile
[INFO] | | \- org.springframework:spring-expression:jar:4.3.4.RELEASE:compile
[INFO] | +- org.springframework.cloud:spring-cloud-starter:jar:1.1.3.RELEASE:compile
[INFO] | | +- org.springframework.cloud:spring-cloud-context:jar:1.1.3.RELEASE:compile
[INFO] | | \- org.springframework.security:spring-security-rsa:jar:1.0.1.RELEASE:compile
[INFO] | | \- org.bouncycastle:bcpkix-jdk15on:jar:1.47:compile
[INFO] | | \- org.bouncycastle:bcprov-jdk15on:jar:1.47:compile
[INFO] | +- org.springframework.cloud:spring-cloud-netflix-core:jar:1.1.6.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot:jar:1.4.2.RELEASE:compile
[INFO] | | \- org.springframework.boot:spring-boot-autoconfigure:jar:1.4.2.RELEASE:compile
[INFO] | +- org.springframework.cloud:spring-cloud-netflix-eureka-client:jar:1.1.6.RELEASE:compile
[INFO] | +- com.netflix.eureka:eureka-client:jar:1.4.10:compile
[INFO] | | +- org.codehaus.jettison:jettison:jar:1.3.7:runtime
[INFO] | | | \- stax:stax-api:jar:1.0.1:runtime
[INFO] | | +- com.netflix.netflix-commons:netflix-eventbus:jar:0.3.0:runtime
[INFO] | | +- com.netflix.archaius:archaius-core:jar:0.7.4:compile
[INFO] | | +- javax.ws.rs:jsr311-api:jar:1.1.1:runtime
[INFO] | | +- com.netflix.servo:servo-core:jar:0.10.1:runtime
[INFO] | | | \- com.netflix.servo:servo-internal:jar:0.10.1:runtime
[INFO] | | +- com.sun.jersey:jersey-core:jar:1.19.1:runtime
[INFO] | | +- com.sun.jersey:jersey-client:jar:1.19.1:runtime
[INFO] | | +- com.sun.jersey.contribs:jersey-apache-client4:jar:1.19.1:runtime
[INFO] | | +- org.apache.httpcomponents:httpclient:jar:4.5.2:runtime
[INFO] | | | +- org.apache.httpcomponents:httpcore:jar:4.4.5:runtime
[INFO] | | | \- commons-codec:commons-codec:jar:1.10:runtime
[INFO] | | +- com.google.inject:guice:jar:4.0:runtime
[INFO] | | | \- aopalliance:aopalliance:jar:1.0:runtime
[INFO] | | +- com.netflix.governator:governator-api:jar:1.12.10:runtime
[INFO] | | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.8.4:compile
[INFO] | | \- com.fasterxml.jackson.core:jackson-core:jar:2.8.4:compile
[INFO] | +- com.netflix.eureka:eureka-core:jar:1.4.10:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-core:jar:1.11.18:runtime
[INFO] | | | \- com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:jar:2.8.4:runtime
[INFO] | | +- com.amazonaws:aws-java-sdk-ec2:jar:1.11.18:runtime
[INFO] | | +- com.amazonaws:aws-java-sdk-autoscaling:jar:1.11.18:runtime
[INFO] | | +- com.amazonaws:aws-java-sdk-sts:jar:1.11.18:runtime
[INFO] | | +- com.amazonaws:aws-java-sdk-route53:jar:1.11.18:runtime
[INFO] | | +- com.netflix.governator:governator:jar:1.12.10:runtime
[INFO] | | | \- com.netflix.governator:governator-core:jar:1.12.10:runtime
[INFO] | | \- org.codehaus.woodstox:woodstox-core-asl:jar:4.4.1:runtime
[INFO] | | +- javax.xml.stream:stax-api:jar:1.0-2:runtime
[INFO] | | \- org.codehaus.woodstox:stax2-api:jar:3.1.4:runtime
[INFO] | +- org.springframework.cloud:spring-cloud-starter-archaius:jar:1.1.6.RELEASE:compile
[INFO] | | +- commons-configuration:commons-configuration:jar:1.8:compile
[INFO] | | \- com.google.guava:guava:jar:18.0:compile
[INFO] | +- com.netflix.ribbon:ribbon-eureka:jar:2.2.0:compile
[INFO] | | \- org.slf4j:slf4j-api:jar:1.7.21:compile
[INFO] | \- com.thoughtworks.xstream:xstream:jar:1.4.2:compile
[INFO] | +- xmlpull:xmlpull:jar:1.1.3.1:compile
[INFO] | \- xpp3:xpp3_min:jar:1.1.4c:compile
[INFO] +- org.springframework.cloud:spring-cloud-starter-feign:jar:1.1.6.RELEASE:compile
[INFO] | +- org.springframework:spring-web:jar:4.3.4.RELEASE:compile
[INFO] | | +- org.springframework:spring-aop:jar:4.3.4.RELEASE:compile
[INFO] | | +- org.springframework:spring-beans:jar:4.3.4.RELEASE:compile
[INFO] | | +- org.springframework:spring-context:jar:4.3.4.RELEASE:compile
[INFO] | | \- org.springframework:spring-core:jar:4.3.4.RELEASE:compile
[INFO] | +- org.springframework.cloud:spring-cloud-commons:jar:1.1.3.RELEASE:compile
[INFO] | | \- org.springframework.security:spring-security-crypto:jar:4.1.3.RELEASE:compile
[INFO] | +- com.netflix.feign:feign-core:jar:8.16.2:compile
[INFO] | | \- org.jvnet:animal-sniffer-annotation:jar:1.0:runtime
[INFO] | +- com.netflix.feign:feign-slf4j:jar:8.16.2:compile
[INFO] | \- com.netflix.feign:feign-hystrix:jar:8.16.2:compile
[INFO] +- org.springframework.cloud:spring-cloud-starter-ribbon:jar:1.1.6.RELEASE:compile
[INFO] | +- com.netflix.ribbon:ribbon:jar:2.2.0:compile
[INFO] | | +- com.netflix.ribbon:ribbon-transport:jar:2.2.0:runtime
[INFO] | | | +- io.reactivex:rxnetty-contexts:jar:0.4.9:runtime
[INFO] | | | \- io.reactivex:rxnetty-servo:jar:0.4.9:runtime
[INFO] | | +- javax.inject:javax.inject:jar:1:runtime
[INFO] | | \- io.reactivex:rxnetty:jar:0.4.9:runtime
[INFO] | | +- io.netty:netty-codec-http:jar:4.0.27.Final:runtime
[INFO] | | | +- io.netty:netty-codec:jar:4.0.27.Final:runtime
[INFO] | | | \- io.netty:netty-handler:jar:4.0.27.Final:runtime
[INFO] | | \- io.netty:netty-transport-native-epoll:jar:4.0.27.Final:runtime
[INFO] | | +- io.netty:netty-common:jar:4.0.27.Final:runtime
[INFO] | | +- io.netty:netty-buffer:jar:4.0.27.Final:runtime
[INFO] | | \- io.netty:netty-transport:jar:4.0.27.Final:runtime
[INFO] | +- com.netflix.ribbon:ribbon-core:jar:2.2.0:compile
[INFO] | | \- commons-lang:commons-lang:jar:2.6:compile
[INFO] | +- com.netflix.ribbon:ribbon-httpclient:jar:2.2.0:compile
[INFO] | | +- commons-collections:commons-collections:jar:3.2.2:compile
[INFO] | | \- com.netflix.netflix-commons:netflix-commons-util:jar:0.1.1:runtime
[INFO] | +- com.netflix.ribbon:ribbon-loadbalancer:jar:2.2.0:compile
[INFO] | | \- com.netflix.netflix-commons:netflix-statistics:jar:0.1.1:runtime
[INFO] | \- io.reactivex:rxjava:jar:1.1.5:compile
[INFO] +- org.springframework.cloud:spring-cloud-starter-hystrix:jar:1.1.6.RELEASE:compile
[INFO] | +- com.netflix.hystrix:hystrix-core:jar:1.5.3:compile
[INFO] | | \- org.hdrhistogram:HdrHistogram:jar:2.1.7:compile
[INFO] | +- com.netflix.hystrix:hystrix-metrics-event-stream:jar:1.5.3:compile
[INFO] | \- com.netflix.hystrix:hystrix-javanica:jar:1.5.3:compile
[INFO] | +- org.aspectj:aspectjweaver:jar:1.8.9:compile
[INFO] | +- org.apache.commons:commons-lang3:jar:3.1:compile
[INFO] | \- org.ow2.asm:asm:jar:5.0.4:compile
[INFO] \- org.projectlombok:lombok:jar:1.16.10:provided
SR7 dependency tree:
[INFO] com.pillo:client:jar:0.0.1-SNAPSHOT
[INFO] +- org.springframework.cloud:spring-cloud-starter-eureka:jar:1.1.7.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-web:jar:1.4.2.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter:jar:1.4.2.RELEASE:compile
[INFO] | | | +- org.springframework.boot:spring-boot-starter-logging:jar:1.4.2.RELEASE:compile
[INFO] | | | | +- ch.qos.logback:logback-classic:jar:1.1.7:compile
[INFO] | | | | | \- ch.qos.logback:logback-core:jar:1.1.7:compile
[INFO] | | | | +- org.slf4j:jcl-over-slf4j:jar:1.7.21:compile
[INFO] | | | | +- org.slf4j:jul-to-slf4j:jar:1.7.21:compile
[INFO] | | | | \- org.slf4j:log4j-over-slf4j:jar:1.7.21:compile
[INFO] | | | \- org.yaml:snakeyaml:jar:1.17:runtime
[INFO] | | +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.4.2.RELEASE:compile
[INFO] | | | +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.5.6:compile
[INFO] | | | +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.5.6:compile
[INFO] | | | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.5.6:compile
[INFO] | | +- com.fasterxml.jackson.core:jackson-databind:jar:2.8.4:compile
[INFO] | | \- org.springframework:spring-webmvc:jar:4.3.4.RELEASE:compile
[INFO] | | \- org.springframework:spring-expression:jar:4.3.4.RELEASE:compile
[INFO] | +- org.springframework.cloud:spring-cloud-starter:jar:1.1.3.RELEASE:compile
[INFO] | | +- org.springframework.cloud:spring-cloud-context:jar:1.1.3.RELEASE:compile
[INFO] | | \- org.springframework.security:spring-security-rsa:jar:1.0.3.RELEASE:compile
[INFO] | | \- org.bouncycastle:bcpkix-jdk15on:jar:1.55:compile
[INFO] | | \- org.bouncycastle:bcprov-jdk15on:jar:1.55:compile
[INFO] | +- org.springframework.cloud:spring-cloud-netflix-core:jar:1.1.7.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot:jar:1.4.2.RELEASE:compile
[INFO] | | \- org.springframework.boot:spring-boot-autoconfigure:jar:1.4.2.RELEASE:compile
[INFO] | +- org.springframework.cloud:spring-cloud-netflix-eureka-client:jar:1.1.7.RELEASE:compile
[INFO] | +- com.netflix.eureka:eureka-client:jar:1.4.12:compile
[INFO] | | +- org.codehaus.jettison:jettison:jar:1.3.7:runtime
[INFO] | | | \- stax:stax-api:jar:1.0.1:runtime
[INFO] | | +- com.netflix.netflix-commons:netflix-eventbus:jar:0.3.0:runtime
[INFO] | | +- com.netflix.archaius:archaius-core:jar:0.7.4:compile
[INFO] | | +- javax.ws.rs:jsr311-api:jar:1.1.1:runtime
[INFO] | | +- com.netflix.servo:servo-core:jar:0.10.1:runtime
[INFO] | | | \- com.netflix.servo:servo-internal:jar:0.10.1:runtime
[INFO] | | +- com.sun.jersey:jersey-core:jar:1.19.1:runtime
[INFO] | | +- com.sun.jersey:jersey-client:jar:1.19.1:runtime
[INFO] | | +- com.sun.jersey.contribs:jersey-apache-client4:jar:1.19.1:runtime
[INFO] | | +- org.apache.httpcomponents:httpclient:jar:4.5.2:runtime
[INFO] | | | +- org.apache.httpcomponents:httpcore:jar:4.4.5:runtime
[INFO] | | | \- commons-codec:commons-codec:jar:1.10:runtime
[INFO] | | +- com.google.inject:guice:jar:4.0:runtime
[INFO] | | | \- aopalliance:aopalliance:jar:1.0:runtime
[INFO] | | +- com.netflix.governator:governator-api:jar:1.12.10:runtime
[INFO] | | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.8.4:compile
[INFO] | | \- com.fasterxml.jackson.core:jackson-core:jar:2.8.4:compile
[INFO] | +- com.netflix.eureka:eureka-core:jar:1.4.12:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-core:jar:1.11.18:runtime
[INFO] | | | \- com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:jar:2.8.4:runtime
[INFO] | | +- com.amazonaws:aws-java-sdk-ec2:jar:1.11.18:runtime
[INFO] | | +- com.amazonaws:aws-java-sdk-autoscaling:jar:1.11.18:runtime
[INFO] | | +- com.amazonaws:aws-java-sdk-sts:jar:1.11.18:runtime
[INFO] | | +- com.amazonaws:aws-java-sdk-route53:jar:1.11.18:runtime
[INFO] | | +- com.netflix.governator:governator:jar:1.12.10:runtime
[INFO] | | | \- com.netflix.governator:governator-core:jar:1.12.10:runtime
[INFO] | | \- org.codehaus.woodstox:woodstox-core-asl:jar:4.4.1:runtime
[INFO] | | +- javax.xml.stream:stax-api:jar:1.0-2:runtime
[INFO] | | \- org.codehaus.woodstox:stax2-api:jar:3.1.4:runtime
[INFO] | +- org.springframework.cloud:spring-cloud-starter-archaius:jar:1.1.7.RELEASE:compile
[INFO] | | +- commons-configuration:commons-configuration:jar:1.8:compile
[INFO] | | \- com.google.guava:guava:jar:18.0:compile
[INFO] | +- com.netflix.ribbon:ribbon-eureka:jar:2.2.0:compile
[INFO] | | \- org.slf4j:slf4j-api:jar:1.7.21:compile
[INFO] | \- com.thoughtworks.xstream:xstream:jar:1.4.9:compile
[INFO] | +- xmlpull:xmlpull:jar:1.1.3.1:compile
[INFO] | \- xpp3:xpp3_min:jar:1.1.4c:compile
[INFO] +- org.springframework.cloud:spring-cloud-starter-feign:jar:1.1.7.RELEASE:compile
[INFO] | +- org.springframework:spring-web:jar:4.3.4.RELEASE:compile
[INFO] | | +- org.springframework:spring-aop:jar:4.3.4.RELEASE:compile
[INFO] | | +- org.springframework:spring-beans:jar:4.3.4.RELEASE:compile
[INFO] | | +- org.springframework:spring-context:jar:4.3.4.RELEASE:compile
[INFO] | | \- org.springframework:spring-core:jar:4.3.4.RELEASE:compile
[INFO] | +- org.springframework.cloud:spring-cloud-commons:jar:1.1.3.RELEASE:compile
[INFO] | | \- org.springframework.security:spring-security-crypto:jar:4.1.3.RELEASE:compile
[INFO] | +- com.netflix.feign:feign-core:jar:8.16.2:compile
[INFO] | | \- org.jvnet:animal-sniffer-annotation:jar:1.0:runtime
[INFO] | +- com.netflix.feign:feign-slf4j:jar:8.16.2:compile
[INFO] | \- com.netflix.feign:feign-hystrix:jar:8.16.2:compile
[INFO] +- org.springframework.cloud:spring-cloud-starter-ribbon:jar:1.1.7.RELEASE:compile
[INFO] | +- com.netflix.ribbon:ribbon:jar:2.2.0:compile
[INFO] | | +- com.netflix.ribbon:ribbon-transport:jar:2.2.0:runtime
[INFO] | | | +- io.reactivex:rxnetty-contexts:jar:0.4.9:runtime
[INFO] | | | \- io.reactivex:rxnetty-servo:jar:0.4.9:runtime
[INFO] | | +- javax.inject:javax.inject:jar:1:runtime
[INFO] | | \- io.reactivex:rxnetty:jar:0.4.9:runtime
[INFO] | | +- io.netty:netty-codec-http:jar:4.0.27.Final:runtime
[INFO] | | | +- io.netty:netty-codec:jar:4.0.27.Final:runtime
[INFO] | | | \- io.netty:netty-handler:jar:4.0.27.Final:runtime
[INFO] | | \- io.netty:netty-transport-native-epoll:jar:4.0.27.Final:runtime
[INFO] | | +- io.netty:netty-common:jar:4.0.27.Final:runtime
[INFO] | | +- io.netty:netty-buffer:jar:4.0.27.Final:runtime
[INFO] | | \- io.netty:netty-transport:jar:4.0.27.Final:runtime
[INFO] | +- com.netflix.ribbon:ribbon-core:jar:2.2.0:compile
[INFO] | | \- commons-lang:commons-lang:jar:2.6:compile
[INFO] | +- com.netflix.ribbon:ribbon-httpclient:jar:2.2.0:compile
[INFO] | | +- commons-collections:commons-collections:jar:3.2.2:compile
[INFO] | | \- com.netflix.netflix-commons:netflix-commons-util:jar:0.1.1:runtime
[INFO] | +- com.netflix.ribbon:ribbon-loadbalancer:jar:2.2.0:compile
[INFO] | | \- com.netflix.netflix-commons:netflix-statistics:jar:0.1.1:runtime
[INFO] | \- io.reactivex:rxjava:jar:1.1.10:compile
[INFO] +- org.springframework.cloud:spring-cloud-starter-hystrix:jar:1.1.7.RELEASE:compile
[INFO] | +- com.netflix.hystrix:hystrix-core:jar:1.5.3:compile
[INFO] | | \- org.hdrhistogram:HdrHistogram:jar:2.1.7:compile
[INFO] | +- com.netflix.hystrix:hystrix-metrics-event-stream:jar:1.5.3:compile
[INFO] | \- com.netflix.hystrix:hystrix-javanica:jar:1.5.3:compile
[INFO] | +- org.aspectj:aspectjweaver:jar:1.8.9:compile
[INFO] | +- org.apache.commons:commons-lang3:jar:3.1:compile
[INFO] | \- org.ow2.asm:asm:jar:5.0.4:compile
[INFO] \- org.projectlombok:lombok:jar:1.16.10:provided
Thanks!
I am trying to load a sample MongoDB collection to Spark using Scala, then save the RDD to a text file. The following is my code:
val sc = new SparkContext(conf)
val mongoConfig = new Configuration()
mongoConfig.set("mongo.input.uri",
"mongodb://localhost:27017/myDB.myCollectionData")
val sparkConf = new SparkConf()
val documents = sc.newAPIHadoopRDD(
mongoConfig, // Configuration
classOf[MongoInputFormat], // InputFormat
classOf[Object], // Key type
classOf[BSONObject]) // Value type
documents.map(t => t._1).saveAsTextFile("myMongo")
//----------------------------------------------------------
Then I got the following error:
Exception in thread "main" java.lang.IncompatibleClassChangeError: Implementing class
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at com.mongodb.MongoClientOptions$Builder.<init>(MongoClientOptions.java:55)
at com.mongodb.MongoClientURI.<init>(MongoClientURI.java:165)
at com.mongodb.hadoop.util.MongoConfigUtil.getMongoClientURI(MongoConfigUtil.java:318)
at com.mongodb.hadoop.util.MongoConfigUtil.getInputURI(MongoConfigUtil.java:322)
at com.mongodb.hadoop.splitter.MongoSplitterFactory.getSplitter(MongoSplitterFactory.java:107)
at com.mongodb.hadoop.MongoInputFormat.getSplits(MongoInputFormat.java:56)
at org.apache.spark.rdd.NewHadoopRDD.getPartitions(NewHadoopRDD.scala:95)
at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:219)
at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:217)
at scala.Option.getOrElse(Option.scala:120)
at org.apache.spark.rdd.RDD.partitions(RDD.scala:217)
at org.apache.spark.rdd.MapPartitionsRDD.getPartitions(MapPartitionsRDD.scala:32)
at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:219)
at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:217)
at scala.Option.getOrElse(Option.scala:120)
at org.apache.spark.rdd.RDD.partitions(RDD.scala:217)
at org.apache.spark.rdd.MapPartitionsRDD.getPartitions(MapPartitionsRDD.scala:32)
at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:219)
at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:217)
at scala.Option.getOrElse(Option.scala:120)
at org.apache.spark.rdd.RDD.partitions(RDD.scala:217)
at org.apache.spark.SparkContext.runJob(SparkContext.scala:1505)
at org.apache.spark.rdd.PairRDDFunctions.saveAsHadoopDataset(PairRDDFunctions.scala:1087)
at org.apache.spark.rdd.PairRDDFunctions.saveAsHadoopFile(PairRDDFunctions.scala:954)
at org.apache.spark.rdd.PairRDDFunctions.saveAsHadoopFile(PairRDDFunctions.scala:863)
at org.apache.spark.rdd.RDD.saveAsTextFile(RDD.scala:1290)
from this line:
documents.map(t => t._1).saveAsTextFile("myMongo")
Does anyone have any idea what this error means? Thanks a lot!
Also, below is my dependency tree:
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) # myProject ---
[INFO] +- junit:junit:jar:4.11:compile
[INFO] | \- org.hamcrest:hamcrest-core:jar:1.3:compile
[INFO] +- org.scala-lang:scala-library:jar:2.10.3:compile
[INFO] +- org.scalatest:scalatest_2.10:jar:2.0.M5b:test
[INFO] +- com.thoughtworks.xstream:xstream:jar:1.4.4:compile
[INFO] | +- xmlpull:xmlpull:jar:1.1.3.1:compile
[INFO] | \- xpp3:xpp3_min:jar:1.1.4c:compile
[INFO] +- com.google.code.gson:gson:jar:2.2.4:compile
[INFO] +- org.apache.hadoop:hadoop-client:jar:2.6.0:compile
[INFO] | +- org.apache.hadoop:hadoop-common:jar:2.6.0:compile
[INFO] | | +- commons-cli:commons-cli:jar:1.2:compile
[INFO] | | +- xmlenc:xmlenc:jar:0.52:compile
[INFO] | | +- commons-httpclient:commons-httpclient:jar:3.1:compile
[INFO] | | +- commons-codec:commons-codec:jar:1.4:compile
[INFO] | | +- commons-io:commons-io:jar:2.4:compile
[INFO] | | +- commons-collections:commons-collections:jar:3.2.1:compile
[INFO] | | +- commons-logging:commons-logging:jar:1.1.3:compile
[INFO] | | +- commons-lang:commons-lang:jar:2.6:compile
[INFO] | | +- commons-configuration:commons-configuration:jar:1.6:compile
[INFO] | | | +- commons-digester:commons-digester:jar:1.8:compile
[INFO] | | | | \- commons-beanutils:commons-beanutils:jar:1.7.0:compile
[INFO] | | | \- commons-beanutils:commons-beanutils-core:jar:1.8.0:compile
[INFO] | | +- org.codehaus.jackson:jackson-core-asl:jar:1.9.13:compile
[INFO] | | +- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.13:compile
[INFO] | | +- org.apache.avro:avro:jar:1.7.4:compile
[INFO] | | +- com.google.protobuf:protobuf-java:jar:2.5.0:compile
[INFO] | | +- org.apache.hadoop:hadoop-auth:jar:2.6.0:compile
[INFO] | | | +- org.apache.httpcomponents:httpclient:jar:4.2.5:compile
[INFO] | | | | \- org.apache.httpcomponents:httpcore:jar:4.2.4:compile
[INFO] | | | +- org.apache.directory.server:apacheds-kerberos-codec:jar:2.0.0-M15:compile
[INFO] | | | | +- org.apache.directory.server:apacheds-i18n:jar:2.0.0-M15:compile
[INFO] | | | | +- org.apache.directory.api:api-asn1-api:jar:1.0.0-M20:compile
[INFO] | | | | \- org.apache.directory.api:api-util:jar:1.0.0-M20:compile
[INFO] | | | \- org.apache.curator:curator-framework:jar:2.6.0:compile
[INFO] | | +- org.apache.curator:curator-client:jar:2.6.0:compile
[INFO] | | +- org.apache.curator:curator-recipes:jar:2.6.0:compile
[INFO] | | +- org.htrace:htrace-core:jar:3.0.4:compile
[INFO] | | \- org.apache.commons:commons-compress:jar:1.4.1:compile
[INFO] | | \- org.tukaani:xz:jar:1.0:compile
[INFO] | +- org.apache.hadoop:hadoop-hdfs:jar:2.6.0:compile
[INFO] | | +- org.mortbay.jetty:jetty-util:jar:6.1.26:compile
[INFO] | | +- io.netty:netty:jar:3.6.2.Final:compile
[INFO] | | \- xerces:xercesImpl:jar:2.9.1:compile
[INFO] | | \- xml-apis:xml-apis:jar:1.3.04:compile
[INFO] | +- org.apache.hadoop:hadoop-mapreduce-client-app:jar:2.6.0:compile
[INFO] | +- org.apache.hadoop:hadoop-yarn-api:jar:2.6.0:compile
[INFO] | +- org.apache.hadoop:hadoop-mapreduce-client-core:jar:2.6.0:compile
[INFO] | | \- org.apache.hadoop:hadoop-yarn-common:jar:2.6.0:compile
[INFO] | | +- javax.xml.bind:jaxb-api:jar:2.2.2:compile
[INFO] | | | +- javax.xml.stream:stax-api:jar:1.0-2:compile
[INFO] | | | \- javax.activation:activation:jar:1.1:compile
[INFO] | | +- com.sun.jersey:jersey-core:jar:1.9:compile
[INFO] | | +- com.sun.jersey:jersey-client:jar:1.9:compile
[INFO] | | +- org.codehaus.jackson:jackson-jaxrs:jar:1.9.13:compile
[INFO] | | \- org.codehaus.jackson:jackson-xc:jar:1.9.13:compile
[INFO] | +- org.apache.hadoop:hadoop-mapreduce-client-jobclient:jar:2.6.0:compile
[INFO] | \- org.apache.hadoop:hadoop-annotations:jar:2.6.0:compile
[INFO] +- org.eclipse.jetty:jetty-servlet:jar:8.1.14.v20131031:compile
[INFO] | \- org.eclipse.jetty:jetty-security:jar:8.1.14.v20131031:compile
[INFO] | \- org.eclipse.jetty:jetty-server:jar:8.1.14.v20131031:compile
[INFO] | +- org.eclipse.jetty:jetty-continuation:jar:8.1.14.v20131031:compile
[INFO] | \- org.eclipse.jetty:jetty-http:jar:8.1.14.v20131031:compile
[INFO] | \- org.eclipse.jetty:jetty-io:jar:8.1.14.v20131031:compile
[INFO] | \- org.eclipse.jetty:jetty-util:jar:8.1.14.v20131031:compile
[INFO] +- com.google.guava:guava:jar:14.0.1:compile
[INFO] +- net.sourceforge.argparse4j:argparse4j:jar:0.4.3:compile
[INFO] +- com.amazonaws:aws-java-sdk:jar:1.9.1:compile
[INFO] | +- com.amazonaws:aws-java-sdk-elasticloadbalancing:jar:1.9.1:compile
[INFO] | | \- com.amazonaws:aws-java-sdk-core:jar:1.9.1:compile
[INFO] | | \- joda-time:joda-time:jar:2.9:compile (version selected from constraint [2.2,))
[INFO] | +- com.amazonaws:aws-java-sdk-cloudfront:jar:1.9.1:compile
[INFO] | +- com.amazonaws:aws-java-sdk-datapipeline:jar:1.9.1:compile
[INFO] | +- com.amazonaws:aws-java-sdk-storagegateway:jar:1.9.1:compile
[INFO] | +- com.amazonaws:aws-java-sdk-ec2:jar:1.9.1:compile
[INFO] | +- com.amazonaws:aws-java-sdk-elasticbeanstalk:jar:1.9.1:compile
[INFO] | +- com.amazonaws:aws-java-sdk-emr:jar:1.9.1:compile
[INFO] | +- com.amazonaws:aws-java-sdk-simpledb:jar:1.9.1:compile
[INFO] | +- com.amazonaws:aws-java-sdk-cloudsearch:jar:1.9.1:compile
[INFO] | +- com.amazonaws:aws-java-sdk-directconnect:jar:1.9.1:compile
[INFO] | +- com.amazonaws:aws-java-sdk-redshift:jar:1.9.1:compile
[INFO] | +- com.amazonaws:aws-java-sdk-rds:jar:1.9.1:compile
[INFO] | +- com.amazonaws:aws-java-sdk-cloudformation:jar:1.9.1:compile
[INFO] | +- com.amazonaws:aws-java-sdk-kinesis:jar:1.9.1:compile
[INFO] | +- com.amazonaws:aws-java-sdk-logs:jar:1.9.1:compile
[INFO] | +- com.amazonaws:aws-java-sdk-cloudwatchmetrics:jar:1.9.1:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-cloudwatch:jar:1.9.1:compile
[INFO] | | \- com.amazonaws:aws-java-sdk-dynamodb:jar:1.9.1:compile
[INFO] | +- com.amazonaws:aws-java-sdk-cognitosync:jar:1.9.1:compile
[INFO] | +- com.amazonaws:aws-java-sdk-importexport:jar:1.9.1:compile
[INFO] | +- com.amazonaws:aws-java-sdk-glacier:jar:1.9.1:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-sqs:jar:1.9.1:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-sns:jar:1.9.1:compile
[INFO] | | \- com.amazonaws:aws-java-sdk-s3:jar:1.9.1:compile
[INFO] | +- com.amazonaws:aws-java-sdk-elastictranscoder:jar:1.9.1:compile
[INFO] | +- com.amazonaws:aws-java-sdk-cloudtrail:jar:1.9.1:compile
[INFO] | +- com.amazonaws:aws-java-sdk-sts:jar:1.9.1:compile
[INFO] | +- com.amazonaws:aws-java-sdk-support:jar:1.9.1:compile
[INFO] | +- com.amazonaws:aws-java-sdk-cognitoidentity:jar:1.9.1:compile
[INFO] | +- com.amazonaws:aws-java-sdk-autoscaling:jar:1.9.1:compile
[INFO] | +- com.amazonaws:aws-java-sdk-elasticache:jar:1.9.1:compile
[INFO] | +- com.amazonaws:aws-java-sdk-ses:jar:1.9.1:compile
[INFO] | +- com.amazonaws:aws-java-sdk-swf-libraries:jar:1.9.1:compile
[INFO] | | \- com.amazonaws:aws-java-sdk-simpleworkflow:jar:1.9.1:compile
[INFO] | +- com.amazonaws:aws-java-sdk-opsworks:jar:1.9.1:compile
[INFO] | +- com.amazonaws:aws-java-sdk-route53:jar:1.9.1:compile
[INFO] | \- com.amazonaws:aws-java-sdk-iam:jar:1.9.1:compile
[INFO] +- log4j:log4j:jar:1.2.16:compile
[INFO] +- com.github.scopt:scopt_2.10:jar:3.2.0:compile
[INFO] +- org.apache.spark:spark-mllib_2.10:jar:1.3.1:compile
[INFO] | +- org.apache.spark:spark-streaming_2.10:jar:1.3.1:compile
[INFO] | +- org.apache.spark:spark-sql_2.10:jar:1.3.1:compile
[INFO] | | +- org.apache.spark:spark-catalyst_2.10:jar:1.3.1:compile
[INFO] | | | +- org.scala-lang:scala-compiler:jar:2.10.4:compile
[INFO] | | | +- org.scala-lang:scala-reflect:jar:2.10.4:compile
[INFO] | | | \- org.scalamacros:quasiquotes_2.10:jar:2.0.1:compile
[INFO] | | +- com.twitter:parquet-column:jar:1.6.0rc3:compile
[INFO] | | | +- com.twitter:parquet-common:jar:1.6.0rc3:compile
[INFO] | | | \- com.twitter:parquet-encoding:jar:1.6.0rc3:compile
[INFO] | | | \- com.twitter:parquet-generator:jar:1.6.0rc3:compile
[INFO] | | +- com.twitter:parquet-hadoop:jar:1.6.0rc3:compile
[INFO] | | | +- com.twitter:parquet-format:jar:2.2.0-rc1:compile
[INFO] | | | \- com.twitter:parquet-jackson:jar:1.6.0rc3:compile
[INFO] | | \- org.jodd:jodd-core:jar:3.6.3:compile
[INFO] | +- org.apache.spark:spark-graphx_2.10:jar:1.3.1:compile
[INFO] | +- org.jblas:jblas:jar:1.2.3:compile
[INFO] | +- org.scalanlp:breeze_2.10:jar:0.11.2:compile
[INFO] | | +- org.scalanlp:breeze-macros_2.10:jar:0.11.2:compile
[INFO] | | +- com.github.fommil.netlib:core:jar:1.1.2:compile
[INFO] | | +- net.sourceforge.f2j:arpack_combined_all:jar:0.1:compile
[INFO] | | +- net.sf.opencsv:opencsv:jar:2.3:compile
[INFO] | | +- com.github.rwl:jtransforms:jar:2.4.0:compile
[INFO] | | \- org.spire-math:spire_2.10:jar:0.7.4:compile
[INFO] | | \- org.spire-math:spire-macros_2.10:jar:0.7.4:compile
[INFO] | +- org.apache.commons:commons-math3:jar:3.1.1:compile
[INFO] | \- org.spark-project.spark:unused:jar:1.0.0:compile
[INFO] +- org.apache.lucene:lucene-spellchecker:jar:3.6.2:compile
[INFO] | +- org.apache.lucene:lucene-core:jar:3.6.2:compile
[INFO] | \- org.apache.lucene:lucene-analyzers:jar:3.6.2:compile
[INFO] +- org.mongodb:bson:jar:2.5.1:compile
[INFO] +- org.mongodb.mongo-hadoop:mongo-hadoop-core:jar:1.4.1:compile
[INFO] | +- org.apache.hadoop:hadoop-mapreduce-client-shuffle:jar:2.6.0:compile
[INFO] | | +- org.apache.hadoop:hadoop-yarn-server-common:jar:2.6.0:compile
[INFO] | | | \- org.apache.zookeeper:zookeeper:jar:3.4.6:compile
[INFO] | | | \- jline:jline:jar:0.9.94:compile
[INFO] | | +- org.apache.hadoop:hadoop-yarn-server-nodemanager:jar:2.6.0:compile
[INFO] | | | +- org.codehaus.jettison:jettison:jar:1.1:compile
[INFO] | | | +- javax.servlet:servlet-api:jar:2.5:compile
[INFO] | | | +- com.google.inject:guice:jar:3.0:compile
[INFO] | | | | +- javax.inject:javax.inject:jar:1:compile
[INFO] | | | | \- aopalliance:aopalliance:jar:1.0:compile
[INFO] | | | +- com.sun.jersey:jersey-json:jar:1.9:compile
[INFO] | | | | \- com.sun.xml.bind:jaxb-impl:jar:2.2.3-1:compile
[INFO] | | | \- com.sun.jersey.contribs:jersey-guice:jar:1.9:compile
[INFO] | | | \- com.sun.jersey:jersey-server:jar:1.9:compile
[INFO] | | | \- asm:asm:jar:3.1:compile
[INFO] | | +- org.fusesource.leveldbjni:leveldbjni-all:jar:1.8:compile
[INFO] | | \- com.google.inject.extensions:guice-servlet:jar:3.0:compile
[INFO] | +- org.apache.hadoop:hadoop-mapreduce-client-common:jar:2.6.0:compile
[INFO] | | \- org.apache.hadoop:hadoop-yarn-client:jar:2.6.0:compile
[INFO] | \- org.mongodb:mongo-java-driver:jar:3.0.0:compile
[INFO] \- org.apache.spark:spark-core_2.10:jar:1.3.1:compile
[INFO] +- com.twitter:chill_2.10:jar:0.5.0:compile
[INFO] | \- com.esotericsoftware.kryo:kryo:jar:2.21:compile
[INFO] | +- com.esotericsoftware.reflectasm:reflectasm:jar:shaded:1.07:compile
[INFO] | +- com.esotericsoftware.minlog:minlog:jar:1.2:compile
[INFO] | \- org.objenesis:objenesis:jar:1.2:compile
[INFO] +- com.twitter:chill-java:jar:0.5.0:compile
[INFO] +- org.apache.spark:spark-network-common_2.10:jar:1.3.1:compile
[INFO] +- org.apache.spark:spark-network-shuffle_2.10:jar:1.3.1:compile
[INFO] +- net.java.dev.jets3t:jets3t:jar:0.7.1:compile
[INFO] +- org.eclipse.jetty.orbit:javax.servlet:jar:3.0.0.v201112011016:compile
[INFO] +- org.apache.commons:commons-lang3:jar:3.3.2:compile
[INFO] +- com.google.code.findbugs:jsr305:jar:1.3.9:compile
[INFO] +- org.slf4j:slf4j-api:jar:1.7.10:compile
[INFO] +- org.slf4j:jul-to-slf4j:jar:1.7.10:compile
[INFO] +- org.slf4j:jcl-over-slf4j:jar:1.7.10:compile
[INFO] +- org.slf4j:slf4j-log4j12:jar:1.7.10:compile
[INFO] +- com.ning:compress-lzf:jar:1.0.0:compile
[INFO] +- org.xerial.snappy:snappy-java:jar:1.1.1.6:compile
[INFO] +- net.jpountz.lz4:lz4:jar:1.2.0:compile
[INFO] +- org.roaringbitmap:RoaringBitmap:jar:0.4.5:compile
[INFO] +- commons-net:commons-net:jar:2.2:compile
[INFO] +- org.spark-project.akka:akka-remote_2.10:jar:2.3.4-spark:compile
[INFO] | +- org.spark-project.akka:akka-actor_2.10:jar:2.3.4-spark:compile
[INFO] | | \- com.typesafe:config:jar:1.2.1:compile
[INFO] | +- org.spark-project.protobuf:protobuf-java:jar:2.5.0-spark:compile
[INFO] | \- org.uncommons.maths:uncommons-maths:jar:1.2.2a:compile
[INFO] +- org.spark-project.akka:akka-slf4j_2.10:jar:2.3.4-spark:compile
[INFO] +- org.json4s:json4s-jackson_2.10:jar:3.2.10:compile
[INFO] | \- org.json4s:json4s-core_2.10:jar:3.2.10:compile
[INFO] | \- org.json4s:json4s-ast_2.10:jar:3.2.10:compile
[INFO] +- org.apache.mesos:mesos:jar:shaded-protobuf:0.21.0:compile
[INFO] +- io.netty:netty-all:jar:4.0.23.Final:compile
[INFO] +- com.clearspring.analytics:stream:jar:2.7.0:compile
[INFO] +- io.dropwizard.metrics:metrics-core:jar:3.1.0:compile
[INFO] +- io.dropwizard.metrics:metrics-jvm:jar:3.1.0:compile
[INFO] +- io.dropwizard.metrics:metrics-json:jar:3.1.0:compile
[INFO] +- io.dropwizard.metrics:metrics-graphite:jar:3.1.0:compile
[INFO] +- com.fasterxml.jackson.core:jackson-databind:jar:2.4.4:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.4.0:compile
[INFO] | \- com.fasterxml.jackson.core:jackson-core:jar:2.4.4:compile
[INFO] +- com.fasterxml.jackson.module:jackson-module-scala_2.10:jar:2.4.4:compile
[INFO] | \- com.thoughtworks.paranamer:paranamer:jar:2.6:compile
[INFO] +- org.apache.ivy:ivy:jar:2.4.0:compile
[INFO] +- oro:oro:jar:2.0.8:compile
[INFO] +- org.tachyonproject:tachyon-client:jar:0.5.0:compile
[INFO] | \- org.tachyonproject:tachyon:jar:0.5.0:compile
[INFO] +- org.spark-project:pyrolite:jar:2.0.1:compile
[INFO] \- net.sf.py4j:py4j:jar:0.8.2.1:compile
Thanks for imagin's help, here is the final combination of dependencies libraries that works:
<dependencies>
<dependency> <!-- Spark dependency -->
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.10</artifactId>
<version>1.5.0</version>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>2.10.4</version>
</dependency>
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>bson</artifactId>
<version>3.0.4</version>
</dependency>
<dependency>
<groupId>org.mongodb.mongo-hadoop</groupId>
<artifactId>mongo-hadoop-core</artifactId>
<version>1.4.1</version>
</dependency>
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>3.0.4</version>
</dependency>
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongodb-driver</artifactId>
<version>3.0.4</version>
</dependency>
</dependencies>
You have a version mismatch between your dependencies. Take a look at your dependency tree and see where the mismatch is happening. The current version of mongo-hadoop-core is using hadoop-* 2.6.0 make sure all your org.apache.hadoop dependencies are using the same version.
We compile an Adobe CQ project (services, taglib, view, content, etc.) with maven. At some point in time, we introduced the following dependencies:
<dependency>
<groupId>org.eclipse.core</groupId>
<artifactId>resources</artifactId>
<version>3.3.0-v20070604</version>
</dependency>
<dependency>
<groupId>org.eclipse.equinox</groupId>
<artifactId>registry</artifactId>
<version>3.3.0-v20070522</version>
</dependency>
<dependency>
<groupId>org.eclipse.core</groupId>
<artifactId>jobs</artifactId>
<version>3.3.0-v20070423</version>
</dependency>
This resulted in the following dependencies e.g. for org.eclipse.resources (extracted with mvn dependency:tree -Dverbose ):
[INFO] +- org.eclipse.core:resources:jar:3.3.0-v20070604:compile
[INFO] | +- org.eclipse.core:expressions:jar:3.3.0-v20070606-0010:compile
[INFO] | | \- (org.eclipse.core:runtime:jar:3.3.100-v20070530:compile - omitted for duplicate)
[INFO] | +- org.eclipse.core:filesystem:jar:1.1.0-v20070606:compile
[INFO] | | +- (org.eclipse.equinox:common:jar:3.3.0-v20070426:compile - omitted for duplicate)
[INFO] | | +- (org.eclipse.equinox:registry:jar:3.3.0-v20070522:compile - omitted for duplicate)
[INFO] | | \- (org.eclipse:osgi:jar:3.3.0-v20070530:compile - omitted for duplicate)
[INFO] | \- org.eclipse.core:runtime:jar:3.3.100-v20070530:compile
[INFO] | +- (org.eclipse:osgi:jar:3.8.2.v20130124-134944:compile - omitted for duplicate)
[INFO] | +- (org.eclipse.equinox:common:jar:3.3.0-v20070426:compile - omitted for duplicate)
[INFO] | +- (org.eclipse.core:jobs:jar:3.3.0-v20070423:compile - omitted for duplicate)
[INFO] | +- (org.eclipse.equinox:registry:jar:3.3.1:compile - omitted for duplicate)
[INFO] | +- org.eclipse.equinox:preferences:jar:3.2.100-v20070522:compile
[INFO] | | \- (org.eclipse.equinox:common:jar:3.3.0-v20070426:compile - omitted for duplicate)
[INFO] | +- org.eclipse.core:contenttype:jar:3.2.100-v20070319:compile
[INFO] | | +- (org.eclipse.equinox:preferences:jar:3.2.100-v20070522:compile - omitted for duplicate)
[INFO] | | +- (org.eclipse.equinox:registry:jar:3.3.1:compile - omitted for duplicate)
[INFO] | | \- (org.eclipse.equinox:common:jar:3.3.0-v20070426:compile - omitted for duplicate)
[INFO] | \- org.eclipse.equinox:app:jar:1.0.0-v20070606:compile
[INFO] | +- (org.eclipse.equinox:registry:jar:3.3.1:compile - omitted for duplicate)
[INFO] | \- (org.eclipse.equinox:common:jar:3.3.0-v20070426:compile - omitted for duplicate)
Then, from Monday 19th of August 2013 to the 20th of August, the org.eclipse:osgi dependency suddenly changed from 3.3.0-something to 3.8.2-something without any apparent reason (This broke our build quite nastily):
[INFO] +- org.eclipse.core:resources:jar:3.3.0-v20070604:compile
[INFO] | +- org.eclipse.core:expressions:jar:3.3.0-v20070606-0010:compile
[INFO] | | \- (org.eclipse.core:runtime:jar:3.3.100-v20070530:compile - omitted for duplicate)
[INFO] | +- org.eclipse.core:filesystem:jar:1.1.0-v20070606:compile
[INFO] | | +- (org.eclipse.equinox:common:jar:3.3.0-v20070426:compile - omitted for duplicate)
[INFO] | | +- (org.eclipse.equinox:registry:jar:3.3.0-v20070522:compile - omitted for duplicate)
[INFO] | | \- org.eclipse:osgi:jar:3.8.2.v20130124-134944:compile
[INFO] | \- org.eclipse.core:runtime:jar:3.3.100-v20070530:compile
[INFO] | +- (org.eclipse:osgi:jar:3.8.2.v20130124-134944:compile - omitted for duplicate)
[INFO] | +- (org.eclipse.equinox:common:jar:3.3.0-v20070426:compile - omitted for duplicate)
[INFO] | +- (org.eclipse.core:jobs:jar:3.3.0-v20070423:compile - omitted for duplicate)
[INFO] | +- (org.eclipse.equinox:registry:jar:3.3.1:compile - omitted for duplicate)
[INFO] | +- org.eclipse.equinox:preferences:jar:3.2.100-v20070522:compile
[INFO] | | \- (org.eclipse.equinox:common:jar:3.3.0-v20070426:compile - omitted for duplicate)
[INFO] | +- org.eclipse.core:contenttype:jar:3.2.100-v20070319:compile
[INFO] | | +- (org.eclipse.equinox:preferences:jar:3.2.100-v20070522:compile - omitted for duplicate)
[INFO] | | +- (org.eclipse.equinox:registry:jar:3.3.1:compile - omitted for duplicate)
[INFO] | | \- (org.eclipse.equinox:common:jar:3.3.0-v20070426:compile - omitted for duplicate)
[INFO] | \- org.eclipse.equinox:app:jar:1.0.0-v20070606:compile
[INFO] | +- (org.eclipse.equinox:registry:jar:3.3.1:compile - omitted for duplicate)
[INFO] | \- (org.eclipse.equinox:common:jar:3.3.0-v20070426:compile - omitted for duplicate)
We were able to resolve this by adding the dependency explicitely:
<dependency>
<groupId>org.eclipse</groupId>
<artifactId>osgi</artifactId>
<version>3.3.0-v20070530</version>
</dependency>
But still, we do not have any clue, why the dependency changed. Does anybody know the reason or experienced the same issue?
After digging through pom files, .m2/repository/repository.xml and several maven-metadata.xml files, I found the root cause.
The maven-metadata.xml file in Maven repository http://repo.adobe.com for org.eclipse.osgi seems to have been changed on 20th August. For some reason the date of this file was reset now to 11th of July, but the change remains:
The metadata file changed from
<metadata>
<groupId>org.eclipse</groupId>
<artifactId>osgi</artifactId>
<version>3.3.0-v20070530</version>
<versioning>
<versions>
...
</versions>
<lastUpdated>20071127073207</lastUpdated>
</versioning>
</metadata>
to
<metadata modelVersion="1.1.0">
<groupId>org.eclipse</groupId>
<artifactId>osgi</artifactId>
<version>3.3.0-v20070530</version>
<versioning>
<latest>3.8.2.v20130124-134944</latest>
<release>3.8.2.v20130124-134944</release>
<versions>
...
</versions>
<lastUpdated>20130711152942</lastUpdated>
</versioning>
</metadata>
Obviously, the latest version was provided after the change, which is now 3.8.2 and not 3.3.0 anymore.
The problem is likely caused by version ranges. These ranges do not even have to be used for the Eclipse artifacts.
Assume you depend on [1,2) and 1.1, and 1.2 are available. At a moment in time, 1.3 is added that has different dependencies. If it finds multiple groupId:artifactId with a different version then it picks the first it finds. Maven follows a breadth first strategy to find dependencies so that you can override it in your top level pom. This is of course very obscure and error prone. A better way is to specify all your app dependencies in one pom so you can ensure valid versions.
I want to map over the characters in a string, but I'm getting runtime errors.
Example:
object Hello {
def hello(c: Char) {
print(c)
}
def main(args: Array[String]) {
"Hello World!".map(hello)
}
}
Trace:
scalac Hello.scala
java Hello
Exception in thread "main" java.lang.NoClassDefFoundError: scala/LowPriorityImplicits
at Hello.main(Hello.scala)
Caused by: java.lang.ClassNotFoundException: scala.LowPriorityImplicits
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 1 more
make: *** [test] Error 1
I think that your problem is that scala library is not in your runtime classpath. you must manually add manually.
If you are using tools like maven or sbt, maybe the dependency is marked as provided instead compiled.
If you are not using these tools, add "scala-library.jar" to your library directory
Also seeing this problem because I don't have the right version of Scala. For those who are using IntelliJ, you can add/change the scala SDK under File > Project Structures > Global Libraries:
If you are compiling and running your project in command line, make sure you have the right version of Scala installed too. e.g.:
Check the Scala version installed:
$ scala -version
Scala code runner version 2.11.8 -- Copyright 2002-2016, LAMP/EPFL
Check the build.sbt to have the right version of Scala:
scalaVersion := "2.11.8"
I can confirm the fix is validation dependencies. Or rather what was included by my test library.
For me I upgraded my SpringBoot version which changed my spring-kafka-test version which intern included kafka 2.13.x which finally included scala libs.
I used mvn dependency:tree on my project's build file and searched for '2.12' to find where the old dependency was coming from. Example dependency tree (unrelated dependencies removed). Notice org.apache.kafka:kafka_2.11:jar:0.10.0.0 included as part of my.company.riptide.api:ness-logger:jar:1.0.0 but org.springframework.kafka:spring-kafka-test:jar:2.7.9 includes a newer version org.apache.kafka:kafka_2.13:jar:2.7.2
My solution was to exclude kafaka_2.11 from my ness-logger dependency like this:
<dependency>
<groupId>my.company.riptide.api</groupId>
<artifactId>ness-logger</artifactId>
<version>1.0.0</version>
<exclusions>
<exclusion>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka_2.11</artifactId>
</exclusion>
</exclusions>
</dependency>
Truncated output of mvn dependency:tree:
[INFO] +- my.company.riptide.api:ness-logger:jar:1.0.0:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-validation:jar:2.5.7:compile
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-el:jar:9.0.55:compile
[INFO] | | \- org.hibernate.validator:hibernate-validator:jar:6.2.0.Final:compile
[INFO] | | \- jakarta.validation:jakarta.validation-api:jar:2.0.2:compile
[INFO] | +- commons-io:commons-io:jar:2.7:compile
[INFO] | +- my.company.eis:ness-logging-package:jar:4.0.1:compile
[INFO] | | +- org.apache.avro:avro:jar:1.8.2:compile
[INFO] | | | +- org.codehaus.jackson:jackson-core-asl:jar:1.9.13:compile
[INFO] | | | +- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.13:compile
[INFO] | | | +- com.thoughtworks.paranamer:paranamer:jar:2.7:compile
[INFO] | | | \- org.tukaani:xz:jar:1.5:compile
[INFO] | | +- org.apache.avro:avro-compiler:jar:1.8.2:compile
[INFO] | | | +- org.apache.velocity:velocity:jar:1.7:compile
[INFO] | | | \- joda-time:joda-time:jar:2.7:compile
[INFO] | | +- org.apache.kafka:kafka_2.11:jar:0.10.0.0:compile
[INFO] | | | +- com.101tec:zkclient:jar:0.8:compile
[INFO] | | | \- org.scala-lang.modules:scala-parser-combinators_2.11:jar:1.0.4:compile
[INFO] | | \- com.netflix.hystrix:hystrix-core:jar:1.5.18:compile
[INFO] | | +- com.netflix.archaius:archaius-core:jar:0.4.1:compile
[INFO] | | \- io.reactivex:rxjava:jar:1.3.8:compile
[INFO] | +- org.springframework.boot:spring-boot-loader-tools:jar:2.5.7:compile
[INFO] | | \- org.apache.commons:commons-compress:jar:1.21:compile
[INFO] | \- my.company.riptide.springboot:graceful-shutdown:jar:1.0.2:compile
[INFO] +- org.springframework.kafka:spring-kafka:jar:2.7.9:compile
[INFO] | +- org.springframework:spring-messaging:jar:5.3.13:compile
[INFO] | +- org.springframework:spring-tx:jar:5.3.13:compile
[INFO] | +- org.springframework.retry:spring-retry:jar:1.3.1:compile
[INFO] | | \- javax.annotation:javax.annotation-api:jar:1.3.2:compile
[INFO] | +- org.apache.kafka:kafka-clients:jar:2.7.2:compile
[INFO] | | +- com.github.luben:zstd-jni:jar:1.4.5-6:compile
[INFO] | | +- org.lz4:lz4-java:jar:1.7.1:compile
[INFO] | | \- org.xerial.snappy:snappy-java:jar:1.1.7.7:compile
[INFO] | \- com.google.code.findbugs:jsr305:jar:3.0.2:compile
[INFO] +- junit:junit:jar:4.13.2:test
[INFO] | \- org.hamcrest:hamcrest-core:jar:2.2:compile
[INFO] +- io.cucumber:cucumber-spring:jar:7.0.0:test
[INFO] | \- org.apiguardian:apiguardian-api:jar:1.1.2:test
[INFO] +- io.cucumber:cucumber-core:jar:7.0.0:test
[INFO] | +- io.cucumber:cucumber-gherkin:jar:7.0.0:test
[INFO] | +- io.cucumber:cucumber-gherkin-messages:jar:7.0.0:test
[INFO] | +- io.cucumber:messages:jar:17.1.1:test
[INFO] | +- io.cucumber:tag-expressions:jar:4.0.2:test
[INFO] | +- io.cucumber:cucumber-expressions:jar:13.0.1:test
[INFO] | +- io.cucumber:datatable:jar:7.0.0:test
[INFO] | +- io.cucumber:cucumber-plugin:jar:7.0.0:test
[INFO] | +- io.cucumber:docstring:jar:7.0.0:test
[INFO] | +- io.cucumber:html-formatter:jar:17.0.0:test
[INFO] | \- io.cucumber:create-meta:jar:6.0.1:test
[INFO] +- org.springframework.kafka:spring-kafka-test:jar:2.7.9:test
[INFO] | +- org.apache.kafka:kafka-clients:jar:test:2.7.2:test
[INFO] | +- org.apache.kafka:kafka-streams:jar:2.7.2:test
[INFO] | | +- org.apache.kafka:connect-json:jar:2.7.2:test
[INFO] | | | \- org.apache.kafka:connect-api:jar:2.7.2:test
[INFO] | | \- org.rocksdb:rocksdbjni:jar:5.18.4:test
[INFO] | +- org.apache.kafka:kafka-streams-test-utils:jar:2.7.2:test
[INFO] | +- org.apache.kafka:kafka_2.13:jar:2.7.2:test
[INFO] | | +- org.apache.kafka:kafka-raft:jar:2.7.2:test
[INFO] | | +- com.fasterxml.jackson.module:jackson-module-scala_2.13:jar:2.12.5:test
[INFO] | | +- com.fasterxml.jackson.dataformat:jackson-dataformat-csv:jar:2.12.5:test
[INFO] | | +- net.sf.jopt-simple:jopt-simple:jar:5.0.4:compile
[INFO] | | +- com.yammer.metrics:metrics-core:jar:2.2.0:compile
[INFO] | | +- org.scala-lang.modules:scala-collection-compat_2.13:jar:2.2.0:test
[INFO] | | +- org.scala-lang.modules:scala-java8-compat_2.13:jar:0.9.1:test
[INFO] | | +- org.scala-lang:scala-library:jar:2.13.3:compile
[INFO] | | +- org.scala-lang:scala-reflect:jar:2.13.3:test
[INFO] | | +- com.typesafe.scala-logging:scala-logging_2.13:jar:3.9.2:test
[INFO] | | +- org.apache.zookeeper:zookeeper:jar:3.5.9:compile
[INFO] | | | +- org.apache.zookeeper:zookeeper-jute:jar:3.5.9:compile
[INFO] | | | +- org.apache.yetus:audience-annotations:jar:0.5.0:compile
[INFO] | | | \- io.netty:netty-transport-native-epoll:jar:4.1.70.Final:compile
[INFO] | | \- commons-cli:commons-cli:jar:1.4:test
[INFO] | +- org.apache.kafka:kafka_2.13:jar:test:2.7.2:test
[INFO] | \- org.junit.jupiter:junit-jupiter-api:jar:5.7.2:test
[INFO] | +- org.opentest4j:opentest4j:jar:1.2.0:test
[INFO] | \- org.junit.platform:junit-platform-commons:jar:1.7.2:test