【发布时间】:2014-12-10 08:22:35
【问题描述】:
我已经安装了 jasypt-encryption,我相信是正确的:
在我的 BuildConfig.groovy 插件闭包中:
compile ":jasypt-encryption:1.3.1"
runtime ":hibernate4:4.3.5.5"
所以我有对应休眠版本的正确 jasypt 版本。
在我的 Config.groovy 中:
jasypt {
algorithm = "PBEWITHSHA256AND256BITAES-CBC-BC"
providerName = "BC"
password = "test"
keyObtentionIterations = 1000
}
在我需要加密的域类之一中,有一个Groovy:unable to resolve class com.bloomhealthco.jasypt.GormEncryptedStringType 错误:
import com.bloomhealthco.jasypt.* //ok
import com.bloomhealthco.jasypt.GormEncryptedStringType //error
所以,jasypt 导入正常,因为第一行导入正常,但似乎 grails 从哪里导入,没有像 GormEncryptedStringType 这样的类。是这样吗?
我完全迷路了,我在 grails irc 频道寻求帮助,我还联系了官方 wiki 指向的人 - dtanner。
按照他的建议,我从 github 下载了源代码并在 test-jasypt 文件夹中运行 grails test-app,并且所有测试都通过了,因此,正如他所说,问题应该出在我的项目中。同样在该测试项目中,GormEncryptedStringType 导入工作正常。这两个项目都在 grails 2.4.3 上。
【问题讨论】: