Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maps Engine API library throws IllegalArgumentException when creating a GeoJsonGeometryCollection #867

Closed
wonderfly opened this issue Jan 10, 2015 · 1 comment
Assignees
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.

Comments

@wonderfly
Copy link
Contributor

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

@wonderfly wonderfly added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. imported priority: p2 Moderately-important priority. Fix may not be included in next release. 2–5 stars labels Jan 10, 2015
@wonderfly wonderfly self-assigned this Jan 10, 2015
@wonderfly
Copy link
Contributor Author

From wonder...@google.com on September 18, 2014 18:02:34

This is fixed in the latest revision: http://search.maven.org/#artifactdetails%7Ccom.google.apis%7Cgoogle-api-services-mapsengine%7Cv1-rev44-1.19.0%7Cjar

Status: Verified

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

No branches or pull requests

1 participant