com.omdbapi.OmdbConnectionErrorException 错误

com.omdbapi.OmdbConnectionErrorException error

我在 java 中编写了一段代码,通过它我可以访问 IMDB 网站中的电影详细信息。为此,我在 java 中使用 OMDB API 但我收到连接错误,为什么我不明白,因为在输出的 INFO 中它显示了有关电影的详细信息。

代码:

Omdb o = new Omdb();
    Movie movie= o.searchOneMovie("star wars");
    System.out.print(movie);

错误:

INFO: executing GET http://www.omdbapi.com/?t=star+wars HTTP/1.1
Mar 13, 2017 5:09:18 PM com.omdbapi.Omdb resultToJson
INFO: received {"Title":"Star Wars: Episode IV - A New   Hope","Year":"1977","Rated":"PG","Released":"25 May 1977","Runtime":"121 min","Genre":"Action, Adventure, Fantasy","Director":"George Lucas","Writer":"George Lucas","Actors":"Mark Hamill, Harrison Ford, Carrie Fisher, Peter Cushing","Plot":"Luke Skywalker joins forces with a Jedi Knight, a cocky pilot, a wookiee and two droids to save the galaxy from the Empire's world-destroying battle-station, while also attempting to rescue Princess Leia from the evil Darth Vader.","Language":"English","Country":"USA","Awards":"Won 6 Oscars. Another 50 wins & 28 nominations.","Poster":"https://images-na.ssl- images-amazon.com/images/M/MV5BYzQ2OTk4N2QtOGQwNy00MmI3LWEwNmEtOTk0OTY3NDk2MGJkL2ltYWdlL2ltYWdlXkEyXkFqcGdeQXVyNjc1NTYyMjg@._V1_SX300.jpg","Metascore":"92","imdbRating":"8.7","imdbVotes":"963,318","imdbID":"tt0076759","Type":"movie","Response":"True"}
 Exception in thread "main" com.omdbapi.OmdbConnectionErrorException:        Unrecognized field "Metascore" (class com.omdbapi.Movie), not marked as ignorable (15 known properties: , "Plot", "Response", "Genre", "Rated",  "imdbVotes", "Director", "Poster", "Writer", "Title", "Runtime", "Year", "imdbID", "Released", "Actors", "imdbRating"])
at [Source: java.io.StringReader@dd3b207; line: 1, column: 40] (through  reference chain: com.omdbapi.Movie["Metascore"])
at com.omdbapi.Omdb.getOneMovie(Omdb.java:65)
at com.omdbapi.Omdb.searchOneMovie(Omdb.java:54)
at test.searchMovie.main(searchMovie.java:15)

您需要 Metascore 字段,但它不存在 - 要么删除它,要么标记为 ingorable。 IMDB 的响应很好 - 没有错误,您的代码中有错误