GF## 2021-04-29 12:47 采纳率: 0%
浏览 63

IntelliJ IDEA 运行时报错,求大神指教

Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: ognl.OgnlException: source is null for getProperty(null, "showapi_res_body")
    at com.imooc.weather.impl.WeatherUtilsImpl.w24h(WeatherUtilsImpl.java:82)
    at com.imooc.weather.Application.main(Application.java:23)
Caused by: java.lang.RuntimeException: ognl.OgnlException: source is null for getProperty(null, "showapi_res_body")
    at com.imooc.weather.impl.WeatherUtilsImpl.getValue(WeatherUtilsImpl.java:34)
    at com.imooc.weather.impl.WeatherUtilsImpl.w24h(WeatherUtilsImpl.java:63)
    ... 1 more
Caused by: ognl.OgnlException: source is null for getProperty(null, "showapi_res_body")
    at ognl.OgnlRuntime.getProperty(OgnlRuntime.java:2410)
    at ognl.ASTProperty.getValueBody(ASTProperty.java:114)
    at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212)
    at ognl.SimpleNode.getValue(SimpleNode.java:258)
    at ognl.ASTChain.getValueBody(ASTChain.java:141)
    at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212)
    at ognl.SimpleNode.getValue(SimpleNode.java:258)
    at ognl.Ognl.getValue(Ognl.java:467)
    at ognl.Ognl.getValue(Ognl.java:569)
    at ognl.Ognl.getValue(Ognl.java:539)
    at com.imooc.weather.impl.WeatherUtilsImpl.getValue(WeatherUtilsImpl.java:31)
    ... 2 more

Process finished with exit code 1

  • 写回答

5条回答 默认 最新

  • 关注

    检查一下showapi_res_body对象有没有值。

    评论

报告相同问题?