Open AndrewReitz opened 9 years ago
I have the same problem Andrew. Works fine in pure Groovy app, but fails in my Ratpack app.
Had to add this to my gradle build
compile ratpack.dependency('rx')
rather than directly adding the rx-java dependency
@aaronzirbes do you know what ratpack.dependency('rx')
does differently? Using ratpack isn't really an option for me. If I had to guess I would say it is just loading RxJava and not RxGroovy, which is what I have been using.
It might be because there are different versions of groovy used to run vs. compile? That class is extending PropertiesModuleFactory
so it shouldn't be getting that cast exception.
Check your runtime dependency tree with gradle dependencies
, and then see if you can find any conflicts in there?
Shots in the dark really at this point...
@pieces029 @aaronzirbes Are you still experiencing this issue? I just started to use RxGroovy and got the same error. I did have a Ratpack dependency in the failing project and that smelled even more like this issue. I didn't really need that dependency so I refactored it out -- but sadly the same error.
Any insight would be greatly appreciated. My stack trace is essentially the same so I won't post that. These are my declared dependencies:
dependencies {
compile 'com.google.guava:guava:19.0'
compile 'com.google.inject:guice:4.0'
compile 'com.startwire:common:1.101.3'
compile 'io.reactivex:rxgroovy:1.0.3'
compile 'org.codehaus.groovy:groovy-all:2.4.6:indy'
storm 'org.apache.storm:storm-core:0.10.0'
testCompile 'cglib:cglib:3.1'
testCompile 'org.spockframework:spock-core:1.0-groovy-2.4'
}
Of course, you don't know anything about my private JAR and it sucks in a lot. Following is the dependency tree. I've looked at it up and down but I can't see anything that looks like trouble. (I did try reverting back to Groovy 2.4.5, but that didn't change anything).
+--- com.google.guava:guava:19.0
+--- com.google.inject:guice:4.0
| +--- javax.inject:javax.inject:1
| +--- aopalliance:aopalliance:1.0
| \--- com.google.guava:guava:16.0.1 -> 19.0
+--- com.startwire:common:1.101.3
| +--- org.apache.commons:commons-dbcp2:2.1.1
| | +--- org.apache.commons:commons-pool2:2.4.2
| | \--- commons-logging:commons-logging:1.2
| +--- redis.clients:jedis:2.7.3
| | \--- org.apache.commons:commons-pool2:2.3 -> 2.4.2
| +--- com.amazonaws:aws-java-sdk:1.10.62
| | +--- com.amazonaws:aws-java-sdk-support:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62
| | | +--- commons-logging:commons-logging:1.1.3 -> 1.2
| | | +--- org.apache.httpcomponents:httpclient:4.3.6
| | | | +--- org.apache.httpcomponents:httpcore:4.3.3
| | | | +--- commons-logging:commons-logging:1.1.3 -> 1.2
| | | | \--- commons-codec:commons-codec:1.6
| | | +--- com.fasterxml.jackson.core:jackson-databind:2.5.3
| | | | +--- com.fasterxml.jackson.core:jackson-annotations:2.5.0
| | | | \--- com.fasterxml.jackson.core:jackson-core:2.5.3
| | | \--- joda-time:joda-time:2.8.1
| | +--- com.amazonaws:aws-java-sdk-simpledb:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-simpleworkflow:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-storagegateway:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-route53:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-s3:1.10.62
| | | +--- com.amazonaws:aws-java-sdk-kms:1.10.62
| | | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-importexport:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-sts:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-sqs:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-rds:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-redshift:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-elasticbeanstalk:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-glacier:1.10.62
| | | +--- com.amazonaws:aws-java-sdk-sqs:1.10.62 (*)
| | | +--- com.amazonaws:aws-java-sdk-sns:1.10.62
| | | | +--- com.amazonaws:aws-java-sdk-sqs:1.10.62 (*)
| | | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | | +--- com.amazonaws:aws-java-sdk-s3:1.10.62 (*)
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-iam:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-datapipeline:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-elasticloadbalancing:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-emr:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-elasticache:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-elastictranscoder:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-ec2:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-dynamodb:1.10.62
| | | +--- com.amazonaws:aws-java-sdk-s3:1.10.62 (*)
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-sns:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-cloudtrail:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-cloudwatch:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-logs:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-events:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-cognitoidentity:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-cognitosync:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-directconnect:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-cloudformation:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-cloudfront:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-kinesis:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-opsworks:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-ses:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-autoscaling:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-cloudsearch:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-cloudwatchmetrics:1.10.62
| | | +--- com.amazonaws:aws-java-sdk-cloudwatch:1.10.62 (*)
| | | +--- com.amazonaws:aws-java-sdk-dynamodb:1.10.62 (*)
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-swf-libraries:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-simpleworkflow:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-codedeploy:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-codepipeline:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-kms:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-config:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-lambda:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-ecs:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-ecr:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-cloudhsm:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-ssm:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-workspaces:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-machinelearning:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-directory:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-efs:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-codecommit:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-devicefarm:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-elasticsearch:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-waf:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-marketplacecommerceanalytics:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-inspector:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-iot:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-api-gateway:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-acm:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-gamelift:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-dms:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | +--- com.amazonaws:aws-java-sdk-marketplacemeteringservice:1.10.62
| | | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| | \--- com.amazonaws:aws-java-sdk-core:1.10.62 (*)
| +--- com.google.inject:guice:4.0 (*)
| +--- org.apache.opennlp:opennlp-tools:1.6.0
| +--- org.codehaus.groovy:groovy-all:2.4.6
| +--- com.google.guava:guava:19.0
| +--- javax.mail:mail:1.4.7
| | \--- javax.activation:activation:1.1
| +--- org.codehaus.gpars:gpars:1.2.1
| | +--- org.multiverse:multiverse-core:0.7.0
| | \--- org.codehaus.jsr166-mirror:jsr166y:1.7.0
| +--- org.apache.derby:derby:10.12.1.1
| +--- org.codehaus.groovy.modules.http-builder:http-builder:0.7.1
| | +--- org.apache.httpcomponents:httpclient:4.2.1 -> 4.3.6 (*)
| | +--- net.sf.json-lib:json-lib:2.3
| | | +--- commons-beanutils:commons-beanutils:1.8.0
| | | | \--- commons-logging:commons-logging:1.1.1 -> 1.2
| | | +--- commons-collections:commons-collections:3.2.1
| | | +--- commons-lang:commons-lang:2.4
| | | +--- commons-logging:commons-logging:1.1.1 -> 1.2
| | | \--- net.sf.ezmorph:ezmorph:1.0.6
| | | \--- commons-lang:commons-lang:2.3 -> 2.4
| | +--- net.sourceforge.nekohtml:nekohtml:1.9.16
| | | \--- xerces:xercesImpl:2.9.1
| | | \--- xml-apis:xml-apis:1.3.04
| | \--- xml-resolver:xml-resolver:1.2
| +--- org.elasticsearch:elasticsearch-groovy:1.7.3
| | +--- org.elasticsearch:elasticsearch:1.7.3
| | | +--- org.apache.lucene:lucene-core:4.10.4
| | | +--- org.apache.lucene:lucene-analyzers-common:4.10.4
| | | | \--- org.apache.lucene:lucene-core:4.10.4
| | | +--- org.apache.lucene:lucene-queries:4.10.4
| | | | \--- org.apache.lucene:lucene-core:4.10.4
| | | +--- org.apache.lucene:lucene-memory:4.10.4
| | | | \--- org.apache.lucene:lucene-core:4.10.4
| | | +--- org.apache.lucene:lucene-highlighter:4.10.4
| | | | +--- org.apache.lucene:lucene-core:4.10.4
| | | | +--- org.apache.lucene:lucene-memory:4.10.4 (*)
| | | | \--- org.apache.lucene:lucene-queries:4.10.4 (*)
| | | +--- org.apache.lucene:lucene-queryparser:4.10.4
| | | | +--- org.apache.lucene:lucene-core:4.10.4
| | | | +--- org.apache.lucene:lucene-queries:4.10.4 (*)
| | | | \--- org.apache.lucene:lucene-sandbox:4.10.4
| | | | \--- org.apache.lucene:lucene-core:4.10.4
| | | +--- org.apache.lucene:lucene-sandbox:4.10.4 (*)
| | | +--- org.apache.lucene:lucene-suggest:4.10.4
| | | | +--- org.apache.lucene:lucene-analyzers-common:4.10.4 (*)
| | | | +--- org.apache.lucene:lucene-core:4.10.4
| | | | +--- org.apache.lucene:lucene-misc:4.10.4
| | | | | \--- org.apache.lucene:lucene-core:4.10.4
| | | | \--- org.apache.lucene:lucene-queries:4.10.4 (*)
| | | +--- org.apache.lucene:lucene-misc:4.10.4 (*)
| | | +--- org.apache.lucene:lucene-join:4.10.4
| | | | +--- org.apache.lucene:lucene-core:4.10.4
| | | | \--- org.apache.lucene:lucene-grouping:4.10.4
| | | | +--- org.apache.lucene:lucene-core:4.10.4
| | | | \--- org.apache.lucene:lucene-queries:4.10.4 (*)
| | | +--- org.apache.lucene:lucene-grouping:4.10.4 (*)
| | | +--- org.apache.lucene:lucene-spatial:4.10.4
| | | | +--- org.apache.lucene:lucene-core:4.10.4
| | | | +--- org.apache.lucene:lucene-queries:4.10.4 (*)
| | | | \--- com.spatial4j:spatial4j:0.4.1
| | | \--- org.yaml:snakeyaml:1.12
| | \--- org.codehaus.groovy:groovy-all:2.4.4 -> 2.4.6
| +--- com.vividsolutions:jts:1.13
| +--- org.apache.commons:commons-lang3:3.4
| +--- javax.mail:javax.mail-api:1.5.5
| +--- org.apache.commons:commons-pool2:2.4.1 -> 2.4.2
| \--- org.postgresql:postgresql:9.4-1203-jdbc42
+--- commons-cli:commons-cli:1.3.1
+--- io.reactivex:rxgroovy:1.0.3
| +--- io.reactivex:rxjava:1.0.15
| \--- org.codehaus.groovy:groovy-all:2.4.5 -> 2.4.6
+--- org.codehaus.groovy:groovy-all:2.4.6
\--- org.apache.storm:storm-core:0.10.0
+--- com.esotericsoftware.kryo:kryo:2.21
| +--- com.esotericsoftware.reflectasm:reflectasm:1.07
| | \--- org.ow2.asm:asm:4.0
| \--- com.esotericsoftware.minlog:minlog:1.2
+--- org.clojure:clojure:1.6.0
+--- com.googlecode.disruptor:disruptor:2.10.4
+--- org.apache.logging.log4j:log4j-api:2.1
+--- org.apache.logging.log4j:log4j-core:2.1
| \--- org.apache.logging.log4j:log4j-api:2.1
+--- org.apache.logging.log4j:log4j-slf4j-impl:2.1
| +--- org.slf4j:slf4j-api:1.7.7
| \--- org.apache.logging.log4j:log4j-api:2.1
+--- org.slf4j:log4j-over-slf4j:1.6.6
| \--- org.slf4j:slf4j-api:1.6.6 -> 1.7.7
+--- org.apache.hadoop:hadoop-auth:2.4.0
+--- javax.servlet:servlet-api:2.5
\--- org.slf4j:slf4j-api:1.7.7
I am actually not seeing this issue anymore on the latest version of the groovy android plugin, and latest version of this library. Should I update this issue's name to reflect more of what the issue is?
@pieces029 Good point: I am not doing anything at all on the Android. It is definitely that same error, though.
Just an update: I forked the repo and rebuilt a JAR with io.reactivex:rxjava:1.1.2
and org.codehaus.groovy:groovy-all:2.4.6:indy
just to have the same dependencies as the rest of my project, but no difference.
When I've seen inexplicable cast cast errors before it's been because there's more than one version of that class floating around -- essentially, the same class in two or more JARs. That jibes with the dependency theory earlier in this thread. As time permits, I will keep experimenting.
FWIW just on a hunch, I finally found it! I think there's a Groovy issue, rather than an RxGroovy problem.
I had been using the @CompileDynamic annotation. When I remove it, this error goes away.
I see same error in my spring boot app. After I commented out all @CompileStatic annotations, the error goes away.