[#12251] - Google Maps Marker - problem with API Key at address field

Category:
Bug report
Priority:
High
Status:
New
Project: Severity:
Minor
Resolution:
Open
Component: Reproducibility:
Always
Assigned to:
0

Hello,

we have a problem with Google Maps in Jasper Reports.
When using a marker with the address field (not long/lat) the Google API Key is not appended in the geocode url:

https://maps.googleapis.com/maps/api/geocode/xml?address=Berlin&sensor=f...

When using Long/Lat instead of address it works as expected.
The key is set in the Authentication/API Key property of the Map component.

Here is the complete error message:

net.sf.jasperreports.engine.JRException: net.sf.jasperreports.engine.JRException: net.sf.jasperreports.engine.JRException: Error loading byte data: https://maps.googleapis.com/maps/api/geocode/xml?address=Berlin&sensor=f....
at com.jaspersoft.studio.editor.preview.view.control.ReportController.fillReport(ReportController.java:550)
at com.jaspersoft.studio.editor.preview.view.control.ReportController.access$18(ReportController.java:525)
at com.jaspersoft.studio.editor.preview.view.control.ReportController$1.run(ReportController.java:443)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: net.sf.jasperreports.engine.JRException: net.sf.jasperreports.engine.JRException: Error loading byte data: https://maps.googleapis.com/maps/api/geocode/xml?address=Berlin&sensor=f....
at net.sf.jasperreports.components.map.fill.FillPlaceItem.getCoords(FillPlaceItem.java:167)
at net.sf.jasperreports.components.map.fill.FillPlaceItem.getEvaluatedValue(FillPlaceItem.java:72)
at net.sf.jasperreports.components.items.fill.FillItem.evaluateProperties(FillItem.java:75)
at net.sf.jasperreports.components.items.fill.FillItemData.evaluateItems(FillItemData.java:104)
at net.sf.jasperreports.components.items.fill.FillItemData.getEvaluateItems(FillItemData.java:123)
at net.sf.jasperreports.components.map.fill.MapFillComponent.evaluateMap(MapFillComponent.java:212)
at net.sf.jasperreports.components.map.fill.MapFillComponent.evaluate(MapFillComponent.java:154)
at net.sf.jasperreports.engine.fill.JRFillComponentElement.evaluate(JRFillComponentElement.java:110)
at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:383)
at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:548)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2583)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:813)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:264)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:110)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:615)
at net.sf.jasperreports.engine.fill.BaseFillHandle$ReportFill.run(BaseFillHandle.java:135)
at java.lang.Thread.run(Thread.java:748)
Caused by: net.sf.jasperreports.engine.JRException: Error loading byte data: https://maps.googleapis.com/maps/api/geocode/xml?address=Berlin&sensor=f....
at net.sf.jasperreports.engine.util.JRLoader.loadBytes(JRLoader.java:437)
at net.sf.jasperreports.components.map.fill.FillPlaceItem.getCoords(FillPlaceItem.java:149)
... 16 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.TwoStacksPlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:673)
at sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:173)
at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)
at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:264)
at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:367)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1156)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1050)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1564)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:263)
at java.net.URL.openStream(URL.java:1045)
at net.sf.jasperreports.engine.util.JRLoader.loadBytes(JRLoader.java:423)
... 17 more

It neither works in the Studio preview nor on the server.

v6.10
Google Map
technik_5's picture
Joined: Feb 16 2017 - 11:26pm
Last seen: 2 weeks 4 days ago
Feedback