Quoting Andrew Bayer <[email protected]>:
java.lang.IllegalArgumentException: backend type:
org.jclouds.rest.ApiContext<org.jclouds.ec2.EC2Api> not assignable from
org.jclouds.rest.ApiContext<org.jclouds.aws.ec2.AWSEC2Api>
at
com.google.common.base.Preconditions.checkArgument(Preconditions.java:120)
at org.jclouds.internal.BaseView.unwrap(BaseView.java:54)
at org.jclouds.internal.BaseView.unwrapApi(BaseView.java:77)
at
org.jclouds.aws.ec2.compute.AWSEC2ComputeServiceLiveTest.testExtendedOptionsAndLogin(AWSEC2ComputeServiceLiveTest.java:81)
And others with that same exception - any ideas?
Well, the error itself seems correct since, from what I recall about
generics [1],
A.isAssignableFrom(B)
does not imply
ApiContext<A>.isAssignableFrom(ApiContext<B>)
(although ApiContext<? extends A>.isAssignableFrom(ApiContext<B>)
should work).
So I'm not sure if the checkArgument [2] is actually correct. If it
is, then our API contexts are not correctly set up.
ap
[1] http://docs.oracle.com/javase/tutorial/java/generics/inheritance.html
[2]
https://github.com/jclouds/jclouds/blob/master/core/src/main/java/org/jclouds/internal/BaseView.java#L54