Maps Engine API library throws IllegalArgumentException when creating a GeoJsonGeometryCollection #867
Labels
imported
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
From m...@google.com on April 08, 2014 17:38:19
Version of google-api-java-client? 1.18.0-rc
Java environment? OpenJDK 1.7.0 Describe the problem. I'm having an issue when running code against the generated mapsengine library, rev5 from Maven, 1.18.0-rc. I've attached the Jar I used, which was downloaded from here: http://search.maven.org/#artifactdetails%7Ccom.google.apis%7Cgoogle-api-services-mapsengine%7Cv1-rev5-1.18.0-rc%7Cjar This code:
import com.google.api.services.mapsengine.model.GeoJsonGeometryCollection;
class Repro {
public static void main(String[] args) {
GeoJsonGeometryCollection geoms = new GeoJsonGeometryCollection();
}
}
fails like so:
$ java -cp google-api-services-mapsengine-v1-rev5-1.18.0-rc.jar:google-http-client-1.18.0-rc.jar:. Repro
Exception in thread "main" java.lang.ExceptionInInitializerError
at Repro.main(Repro.java:6)
Caused by: java.lang.IllegalArgumentException: unable to create new instance of class com.google.api.services.mapsengine.model.GeoJsonGeometry because it is abstract and because it has no accessible default constructor
at com.google.api.client.util.Types.handleExceptionForNewInstance(Types.java:165)
at com.google.api.client.util.Types.newInstance(Types.java:120)
at com.google.api.client.util.Data.nullOf(Data.java:134)
at com.google.api.services.mapsengine.model.GeoJsonGeometryCollection.(GeoJsonGeometryCollection.java:52)
... 1 more
Caused by: java.lang.InstantiationException: com.google.api.services.mapsengine.model.GeoJsonGeometry
at java.lang.Class.newInstance(Class.java:355)
at com.google.api.client.util.Types.newInstance(Types.java:116)
... 3 more
The other geometry classes seem fine so far, it's just instantiating a GeoJsonGeometryCollection that breaks.
Original issue: http://code.google.com/p/google-api-java-client/issues/detail?id=867
The text was updated successfully, but these errors were encountered: