我使用spring security 3.1.7.RELEASE with spring 3.2.13.RELEASE.
我在spring-security.xml中输入如下:
<http auto-config="true" use-expressions="true">
<intercept-url pattern=".*admin.htm" access="hasRole(ROLE_ADMIN)" />
<intercept-url pattern="/siteadmin/*.htm" access="ROLE_ADMIN" />
<intercept-url pattern="/siteadmin/cleancache.htm" access="hasRole('ROLE_ADMIN')" />
Run Code Online (Sandbox Code Playgroud)
当我尝试点击url /siteadmin/cleancache.htm时,我得到以下异常:
java.lang.IllegalArgumentException:无法计算表达式'ROLE_ADMIN'org.springframework.security.access.expression.ExpressionUtils.evaluateAsBoolean(ExpressionUtils.java:13)org.springframework.security.web.access.expression.WebExpressionVoter.vote(WebExpressionVoter) .java:34)org.springframework.security.web.access.expression.WebExpressionVoter.vote(WebExpressionVoter.java:18)org.springframework.security.access.vote.AffirmativeBased.decide(AffirmativeBased.java:62)
根本原因:
org.springframework.expression.spel.SpelEvaluationException:EL1008E:(pos 0):在'org.springframework.security.web.access.expression.WebSecurityExpressionRoot'类型的对象上找不到属性或字段'ROLE_ADMIN' - 可能不公开?org.springframework.expression.spel.ast.PropertyOrFieldReference.readProperty(PropertyOrFieldReference.java:214)org.springframework.expression.spel.ast.PropertyOrFieldReference.getValueInternal(PropertyOrFieldReference.java:85)org.springframework.expression.spel.ast. PropertyOrFieldReference.getValueInternal(PropertyOrFieldReference.java:78)org.springframework.expression.spel.ast.SpelNodeImpl.getTypedValue(SpelNodeImpl.java:102)org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:98) org.springframework.security.access.expression.ExpressionUtils.evaluateAsBoolean(ExpressionUtils.java:11)org.springframework.security.web.access.expression.WebExpressionVoter.vote(WebExpressionVoter.java:34)
任何指针都高度赞赏.
我们有一个简单的应用程序,其中所有用户都在同一时区,因此我们对在 mongo 日期对象中存储时区信息不感兴趣。
这种极端步骤的原因是我们有多个微服务使用由不同开发人员管理的公共数据库。他们每个人都需要在查询中明确设置与时区相关的内容,并在无效数据集中忘记相同的结果。
由于目前 MongoDB 人Mongo 数据类型
不支持存储没有时区的日期。
只是想知道这是他们在 mongo 中表示没有时区的日期的任何替代方法,通过它我们仍然可以利用 mongo 数据库查询基于日期的语法,如日期范围、日期等。
同时,方便DBA 阅读和管理记录。
我正在使用log4j 2.4并尝试转换log4j2.xml为log4j.properties,但monitorInterval property似乎没有使用log4j2.properties.
虽然log4j2遵循文档
https://logging.apache.org/log4j/2.x/manual/configuration.html#Properties
显然是统计数据
属性配置文件支持广告商,monitorInterval,名称,包,shutdownHook,status
属性文件中的任何更改都不会导致重新加载日志记录配置.相反,它似乎完全有效xml format
<Configuration status="TRACE" monitorInterval="5">
每当我在.xml中进行任何更改时,我的log4j配置都被选中,并通过以下日志进行验证.
2016-06-17 14:43:17,267 Thread-5 DEBUG Reconfiguration started for context 1198108795 (org.apache.logging.log4j.core.LoggerContext@86be70a)
2016-06-17 14:43:17,268 Thread-5 DEBUG Not in a ServletContext environment, thus not loading WebLookup plugin.
2016-06-17 14:43:17,273 Thread-5 DEBUG Initializing configuration XmlConfiguration[location=/Users/userx/Desktop/logs/log4j2_prod.xml]
Run Code Online (Sandbox Code Playgroud)
我还尝试将Log4j版本升级到2.5,但仍然观察到相同的行为.
他们可以通过哪种方式使用mongodb投影功能从文档中获取所选字段.
即使在互联网上搜索一整天都找不到任何线索.
我正在尝试在CentOs 6.3上安装mercurial 2.2,但是我觉得centos的存储库有点过时,因为yum安装总是显示你的mercurial是最新的.
现在搜索了一些论坛并找到了一些其他存储库来使用以下命令和存储库来更新mercurial客户端:
**
rpm -Uvh http://pkgs.repoforge.org/mercurial/mercurial-2.2.2-1.el6.rfx.i686.rpm
**
但是它会导致以下错误:
(已安装)emacs-mercurial-1.4-3.el6.i686需要hg = 1.4-3.el6
(已安装)mercurial-hgk-1.4-3.el6.i686需要hg = 1.4-3.el6
我认为由于一些包依赖,我无法安装.
任何帮助/指针将受到高度赞赏.
centos ×1
centos6 ×1
date ×1
java ×1
log4j ×1
log4j2 ×1
mercurial ×1
mongodb ×1
mongodb-java ×1
spring ×1
spring-data ×1
spring-mvc ×1