我正在使用罗马库和 Play 框架编写一个简单的 rss 阅读器。我在控制台应用程序中尝试了 Rome,它运行良好。但是当我把它放入Play框架时,它会抛出一个异常:java.lang.ExceptionInInitializerError。
我的代码是这样的:
URL url = new URL(address);
XmlReader reader = null;
reader = new XmlReader(url);
SyndFeed feed = new SyndFeedInput().build(reader);
String title = feed.getTitle();
我正在使用 play 2.10 并将 rome1.0 和 jdom1.0 的 jar 文件放入我的 Play 应用程序的 /lib 目录中。
你能帮忙找出我的代码有什么问题吗?
非常感谢!
这是错误信息:
play.api.Application$$anon$1: Execution exception[[RuntimeException: java.lang.ExceptionInInitializerError]]
at play.api.Application$class.handleError(Application.scala:289) ~[play_2.10.jar:2.1.1]
at play.api.DefaultApplication.handleError(Application.scala:383) [play_2.10.jar:2.1.1]
at play.core.server.netty.PlayDefaultUpstreamHandler$$anon$2$$anonfun$handle$1.apply(PlayDefaultUpstreamHandler.scala:144) [play_2.10.jar:2.1.1]
at play.core.server.netty.PlayDefaultUpstreamHandler$$anon$2$$anonfun$handle$1.apply(PlayDefaultUpstreamHandler.scala:140) [play_2.10.jar:2.1.1]
at play.api.libs.concurrent.PlayPromise$$anonfun$extend1$1.apply(Promise.scala:113) [play_2.10.jar:2.1.1]
at play.api.libs.concurrent.PlayPromise$$anonfun$extend1$1.apply(Promise.scala:113) [play_2.10.jar:2.1.1]
java.lang.RuntimeException: java.lang.ExceptionInInitializerError
at play.libs.F$Promise$6.apply(F.java:401) ~[play_2.10.jar:2.1.1]
at scala.concurrent.Future$$anonfun$map$1.liftedTree2$1(Future.scala:253) ~[scala-library.jar:na]
at scala.concurrent.Future$$anonfun$map$1.apply(Future.scala:249) ~[scala-library.jar:na]
at scala.concurrent.Future$$anonfun$map$1.apply(Future.scala:249) ~[scala-library.jar:na]
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:29) ~[scala-library.jar:na]
at akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.liftedTree1$1(BatchingExecutor.scala:67) ~[akka-actor_2.10.jar:na]
Caused by: java.lang.ExceptionInInitializerError: null
at com.sun.syndication.io.SyndFeedInput.build(SyndFeedInput.java:123) ~[na:na]
at controllers.Application.addFeed(Application.java:125) ~[na:na]
at Routes$$anonfun$routes$1$$anonfun$applyOrElse$11$$anonfun$apply$11.apply(routes_routing.scala:173) ~[na:na]
at Routes$$anonfun$routes$1$$anonfun$applyOrElse$11$$anonfun$apply$11.apply(routes_routing.scala:173) ~[na:na]
at play.core.Router$HandlerInvoker$$anon$6$$anon$2.invocation(Router.scala:164) ~[play_2.10.jar:2.1.1]
at play.core.Router$Routes$$anon$1.invocation(Router.scala:345) ~[play_2.10.jar:2.1.1]
Caused by: java.lang.RuntimeException: could not instantiate plugin null
at com.sun.syndication.io.impl.PluginManager.loadPlugins(PluginManager.java:115) ~[na:na]
at com.sun.syndication.io.impl.PluginManager.<init>(PluginManager.java:55) ~[na:na]
at com.sun.syndication.io.impl.PluginManager.<init>(PluginManager.java:46) ~[na:na]
at com.sun.syndication.feed.synd.impl.Converters.<init>(Converters.java:40) ~[na:na]
at com.sun.syndication.feed.synd.SyndFeedImpl.<clinit>(SyndFeedImpl.java:59) ~[na:na]
at com.sun.syndication.io.SyndFeedInput.build(SyndFeedInput.java:123) ~[na:na]
Caused by: java.lang.ClassNotFoundException: com.sun.syndication.feed.synd.impl.ConverterForAtom10
at java.net.URLClassLoader$1.run(URLClassLoader.java:202) ~[na:1.6.0_51]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.6.0_51]
at java.net.URLClassLoader.findClass(URLClassLoader.java:190) ~[na:1.6.0_51]
at java.lang.ClassLoader.loadClass(ClassLoader.java:306) ~[na:1.6.0_51]
at java.lang.ClassLoader.loadClass(ClassLoader.java:247) ~[na:1.6.0_51]
at sbt.PlayCommands$$anonfun$53$$anonfun$55$$anon$2.loadClass(PlayCommands.scala:535) ~[na:na]