[ https://issues.apache.org/jira/browse/AMBARI-23465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16426668#comment-16426668 ]
JaySenSharma edited comment on AMBARI-23465 at 4/5/18 9:49 AM: --------------------------------------------------------------- As "weather-view" view is using "openweathermap.org" APIs to fetch the weather data, However as per the "https://openweathermap.org/faq" these APIs have become commercialised now Starting from 9 October 2015 and it requires a valid APPID so it might not work as desired. {code} HTTP ERROR 500 Problem accessing /views/WEATHER/1.0.0/US_WEST/ui. Reason: Server Error Caused by: java.io.IOException: org.apache.ambari.view.SystemException: Can't get city resource Los Angeles, US. at org.apache.ambari.view.weather.WeatherServlet.doGet(WeatherServlet.java:86) at javax.servlet.http.HttpServlet.service(HttpServlet.java:735) at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1507) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84) . . Caused by: org.apache.ambari.view.SystemException: Can't get city resource Los Angeles, US. at org.apache.ambari.view.weather.CityResourceProvider.getResource(CityResourceProvider.java:77) at org.apache.ambari.view.weather.CityResourceProvider.getResource(CityResourceProvider.java:49) at org.apache.ambari.view.weather.WeatherServlet.doGet(WeatherServlet.java:84) ... 60 more Caused by: java.io.IOException: Server returned HTTP response code: 401 for URL: http://api.openweathermap.org/data/2.5/weather?q=Los+Angeles%2C+US&units=imperial at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1876) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474) at org.apache.ambari.view.weather.CityResourceProvider.readFrom(CityResourceProvider.java:181) at org.apache.ambari.view.weather.CityResourceProvider.getWeatherProperty(CityResourceProvider.java:158) at org.apache.ambari.view.weather.CityResourceProvider.getResource(CityResourceProvider.java:131) at org.apache.ambari.view.weather.CityResourceProvider.getResource(CityResourceProvider.java:75) ... 62 more {code} was (Author: jaysensharma): As "weather-view" view is using "openweathermap.org" APIs to fetch the weather data, However as per the "https://openweathermap.org/faq" these APIs have become commercialised now Starting from 9 October 2015 and it requires a valid APPID so it might not work as desired. > the weather view example does not work? > --------------------------------------- > > Key: AMBARI-23465 > URL: https://issues.apache.org/jira/browse/AMBARI-23465 > Project: Ambari > Issue Type: Bug > Components: ambari-views > Affects Versions: trunk, 2.6.0, 2.7.0 > Reporter: Yanyan Zhang > Assignee: JaySenSharma > Priority: Major > Labels: pull-request-available > Attachments: weather-view-error.png > > Time Spent: 10m > Remaining Estimate: 0h > > I was practicing the weather view example: > [https://github.com/apache/ambari/blob/trunk/ambari-views/examples/weather-view/docs/index.md] > I could only get the following (also shown in the attached picture), instead > of a nice web page as described/shown in the above link. > h1. Directory: /views/WEATHER/1.0.0/EUROPE/ > |[META-INF/ |http://127.0.0.1:8080/views/WEATHER/1.0.0/EUROPE/META-INF/]|4096 > bytes |Mar 23, 2018 11:16:00 PM| > |[WEB-INF/ |http://127.0.0.1:8080/views/WEATHER/1.0.0/EUROPE/WEB-INF/]|4096 > bytes |Mar 23, 2018 11:16:00 PM| > |[org/ |http://127.0.0.1:8080/views/WEATHER/1.0.0/EUROPE/org/]|4096 bytes > |Mar 23, 2018 11:16:00 PM| > |[view.xml |http://127.0.0.1:8080/views/WEATHER/1.0.0/EUROPE/view.xml]|2782 > bytes |Mar 23, 2018 11:16:00 PM| > > Versions I used: > Apache Ambari version 2.6.0.0 > openjdk version "1.8.0_151" > Apache Maven 3.2.5 > > Is there anything wrong with the versions I used? Or, there are other > problems? > Thanks in advance for any help! > Yanyan -- This message was sent by Atlassian JIRA (v7.6.3#76005)