gpt4 book ai didi

java - 在 playframework 项目上配置 deadbolt

转载 作者:太空宇宙 更新时间:2023-11-04 06:32:44 25 4
gpt4 key购买 nike

您好,我在 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

我不知道我添加了良好的门锁配置,因为它看起来与 application.conf 中的其他配置有点不同

当我开始 Play 应用程序时 Play 调试 ~run

正在更新和安装某些内容,然后出现错误

[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)

也许有人遇到过这个问题或者知道我做错了什么,我将非常感谢每一个帮助!

最佳答案

看起来你的处理程序 block 也是错误的。它应该是键/值对,但里面只有一对。它应该看起来更像

handlers { 
defaultHandler=com.example.security.MyDeadboltHandler,
foo=com.example.security.FooDeadboltHandler,
bar=com.example.security.BarDeadboltHandler
}

关于java - 在 playframework 项目上配置 deadbolt,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25890118/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com