java.lang.ClassNotFoundException:org.jboss.netty.channel.ChannelFactory在intellij idea中运行play项目

时间:2014-11-29 06:16:55

标签: java scala intellij-idea jboss playframework

我正在尝试在intellij idea中创建一个play框架项目。但是当我尝试运行或调试我的项目时,它在我的控制台中显示以下错误。

 java.lang.NoClassDefFoundError: org/jboss/netty/channel/ChannelFactory
        at play.api.test.TestServer.start(Selenium.scala:142)
        at play.api.test.PlayRunners$class.running(Helpers.scala:59)
        at play.api.test.Helpers$.running(Helpers.scala:364)
        at play.api.test.WithBrowser.around(Specs.scala:57)
        at org.specs2.mutable.Around$class.delayedInit(Around.scala:12)
        at play.api.test.WithBrowser.delayedInit(Specs.scala:45)
        at IntegrationSpec$$anonfun$1$$anonfun$apply$1$$anon$1.<init>(IntegrationSpec.scala:17)
        at IntegrationSpec$$anonfun$1$$anonfun$apply$1.apply(IntegrationSpec.scala:17)
        at IntegrationSpec$$anonfun$1$$anonfun$apply$1.apply(IntegrationSpec.scala:17)
        at org.specs2.specification.FragmentsBuilder$$anon$1.asResult(FragmentsBuilder.scala:142)
        at org.specs2.specification.FragmentsBuilder$$anon$1.asResult(FragmentsBuilder.scala:141)
        at org.specs2.execute.AsResult$.apply(Result.scala:250)
        at org.specs2.specification.Example$$anonfun$apply$1.apply(Fragment.scala:209)
        at org.specs2.specification.Example$$anonfun$apply$1.apply(Fragment.scala:209)
        at org.specs2.specification.Example.execute(Fragment.scala:176)
        at org.specs2.specification.FragmentExecution$$anonfun$1.apply(FragmentExecution.scala:52)
        at org.specs2.specification.FragmentExecution$$anonfun$1.apply(FragmentExecution.scala:52)
        at org.specs2.execute.ResultExecution$class.execute(ResultExecution.scala:22)
        at org.specs2.execute.ResultExecution$.execute(ResultExecution.scala:116)
        at org.specs2.specification.FragmentExecution$class.executeBody(FragmentExecution.scala:28)
        at org.specs2.runner.JUnitRunner$$anon$3.executeBody(JUnitRunner.scala:43)
        at org.specs2.specification.FragmentExecution$class.execute(FragmentExecution.scala:52)
        at org.specs2.runner.JUnitRunner$$anon$3.execute(JUnitRunner.scala:43)
        at org.specs2.specification.FragmentExecution$$anonfun$executeFragment$1$$anonfun$apply$1.apply(FragmentExecution.scala:35)
        at org.specs2.specification.FragmentExecution$$anonfun$executeFragment$1$$anonfun$apply$1.apply(FragmentExecution.scala:35)
        at org.specs2.control.Exceptions$class.catchAllOr(Exceptions.scala:54)
        at org.specs2.control.Exceptions$.catchAllOr(Exceptions.scala:109)
        at org.specs2.specification.FragmentExecution$$anonfun$executeFragment$1.apply(FragmentExecution.scala:35)
        at org.specs2.specification.FragmentExecution$$anonfun$executeFragment$1.apply(FragmentExecution.scala:35)
        at org.specs2.reporter.JUnitReporter$$anonfun$executeFragment$1.execute$1(JUnitReporter.scala:47)
        at org.specs2.reporter.JUnitReporter$$anonfun$executeFragment$1.apply(JUnitReporter.scala:54)
        at org.specs2.reporter.JUnitReporter$$anonfun$executeFragment$1.apply(JUnitReporter.scala:46)
        at org.specs2.reporter.DefaultExecutionStrategy$class.executeWithBarrier$1(ExecutionStrategy.scala:103)
        at org.specs2.reporter.DefaultExecutionStrategy$$anonfun$executeConcurrently$1$$anonfun$apply$2.apply(ExecutionStrategy.scala:105)
        at org.specs2.reporter.DefaultExecutionStrategy$$anonfun$executeConcurrently$1$$anonfun$apply$2.apply(ExecutionStrategy.scala:105)
        at scalaz.concurrent.Promise$Unfulfilled$.fulfill(Promise.scala:125)
        at scalaz.concurrent.Promise$Done.eval(Promise.scala:153)
        at scalaz.concurrent.Promise$$anonfun$e$1.apply(Promise.scala:17)
        at scalaz.concurrent.Promise$$anonfun$e$1.apply(Promise.scala:17)
        at scalaz.concurrent.Actor.batchHandle(Actor.scala:73)
        at scalaz.concurrent.Actor.scalaz$concurrent$Actor$$act(Actor.scala:57)
        at scalaz.concurrent.Actor$$anonfun$schedule$1.apply$mcV$sp(Actor.scala:52)
        at scalaz.concurrent.Actor$$anonfun$schedule$1.apply(Actor.scala:52)
        at scalaz.concurrent.Actor$$anonfun$schedule$1.apply(Actor.scala:52)
        at scalaz.concurrent.StrategysLow$$anon$3$$anon$4.call(Strategy.scala:65)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:722)
    Caused by: java.lang.ClassNotFoundException: org.jboss.netty.channel.ChannelFactory
        at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
        ... 50 more

    java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/jboss/netty/channel/ChannelFactory
        at play.api.test.TestServer.start(Selenium.scala:146)
        at play.api.test.PlayRunners$class.running(Helpers.scala:59)
        at play.api.test.Helpers$.running(Helpers.scala:364)
        at play.api.test.WithBrowser.around(Specs.scala:57)
        at play.api.test.WithBrowser.delayedInit(Specs.scala:45)
        at IntegrationSpec$$anonfun$1$$anonfun$apply$1$$anon$1.<init>(IntegrationSpec.scala:17)
        at IntegrationSpec$$anonfun$1$$anonfun$apply$1.apply(IntegrationSpec.scala:17)
        at IntegrationSpec$$anonfun$1$$anonfun$apply$1.apply(IntegrationSpec.scala:17)
    Caused by: java.lang.NoClassDefFoundError: org/jboss/netty/channel/ChannelFactory
        at play.api.test.TestServer.start(Selenium.scala:142)
        ... 7 more
    Caused by: java.lang.ClassNotFoundException: org.jboss.netty.channel.ChannelFactory
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        ... 8 more

    Disconnected from the target VM, address: '127.0.0.1:1698', transport: 'socket'

    Process finished with exit code -1

我在intellij中安装了游戏插件并从File创建了我的项目 - &gt;新项目 - &gt; scala - &gt; Play2.x

为什么我的游戏项目无法运行?

由于

1 个答案:

答案 0 :(得分:1)

首先,检查您的类名和文件名是否相同,如果为真。 然后,检查您的类路径是否正确指定,并在声明类路径后,您还没有编辑类路径中的文件夹名称或更改了位置。