您好我在playframework项目中配置deadbolt模块时遇到了一个小问题。我正在使用playframework 2.2.1版本,我一步一步地按照他们在deadbolt文档页面上显示的那样做 http://deadbolt.ws/#/java-docs
我遇到的第一个问题是在application.conf中,因为我在这看起来像这样:
# This is the main configuration file for the application.
# ~~~~~
# Secret key
# ~~~~~
# The secret key is used to secure cryptographics functions.
# If you deploy your application to several instances be sure to use the same key!
application.secret="0ki/vB`gn_SY]NWR;8I0OM1^/<>3AF;dMG^VFc8JQ5sGJ9eL4:/7Hpc2/y>Ug;bu"
# The application languages
# ~~~~~
application.langs="en,de"
parsers.text.maxLength=10000000K
deadbolt.java.handler
deadbolt {
before-auth-check-timeout=4000,
java {
cache-user=true,
handlers {
defaultHandler=com.example.security.MyDeadboltHandler,
be.objectify.deadbolt.java.DeadboltHandler,
be.objectify.deadbolt.core.models.Subject,
foo=com.example.security.FooDeadboltHandler,
be.objectify.deadbolt.java.DynamicResourceHandler,
bar=com.example.security.BarDeadboltHandler
}
}
}
# Global object class
# ~~~~~
# Define the Global object class for this application.
# Default to Global in the root package.
# application.global=Global
我不知道我添加了良好的deadbolt confifuration,因为它看起来有点不同于application.conf
当我开始播放应用程序时,调试〜运行
有些东西正在更新和安装,然后我得到错误
[info] Done updating.
java.lang.NoSuchMethodException:
play.core.server.NettyServer.mainDevHttpMode(play.core.SBTLink,
play.core.SBTDocHandler, int)
at java.lang.Class.getMethod(Class.java:1665)
at play.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$1.apply(PlayRun.scala:232)
at play.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$1.apply(PlayRun.scala:91)
at scala.Function7$$anonfun$tupled$1.apply(Function7.scala:35)
at scala.Function7$$anonfun$tupled$1.apply(Function7.scala:34)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
[trace] Stack trace suppressed: run last compile:run for the full output.
[error] (compile:run) java.lang.NoSuchMethodException:
play.core.server.NettyServer.mainDevHttpMode(play.core.SBTLink,
play.core.SBTDocHandler, int)
[error] Total time: 6 s, completed 2014-09-17 13:00:41
1. Waiting for source changes... (press enter to interrupt)
也许有人遇到这个问题或知道我做错了什么,我会非常感谢你们的每一个帮助!
答案 0 :(得分:1)
看起来您的处理程序块也是错误的。它应该是键/值对,但你只有一对。它看起来应该更像
handlers {
defaultHandler=com.example.security.MyDeadboltHandler,
foo=com.example.security.FooDeadboltHandler,
bar=com.example.security.BarDeadboltHandler
}