我正在使用Grails 1.3.7.我无法让Grails自动安装插件.我只尝试了一个"grails install-plugin quartz 0.4.2",但失败了.如何调整我的Grails安装,以便Grails能够找到并安装我的插件?以下是我得到的错误......
$ grails install-plugin quartz 0.4.2
Welcome to Grails 1.3.7 - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: /Library/grails-1.3.7
Base Directory: /Users/davea/Documents/workspace-sts-2.6.0.SR1/NissanUSA/Technology/Leaf Microsite/eCommerce/eComm
Resolving dependencies...
Dependencies resolved in 1231ms.
Running script /Library/grails-1.3.7/scripts/InstallPlugin.groovy
Environment set to development
[mkdir] Created dir: /Users/davea/.grails/1.3.7/plugins
Resolving plugin quartz. Please wait...
:: problems summary ::
:::: WARNINGS
module not found: org.grails.plugins#quartz;0.4.2
==== grailsPlugins: tried
-- artifact org.grails.plugins#quartz;0.4.2!quartz.zip:
/Users/davea/Documents/workspace-sts-2.6.0.SR1/NissanUSA/Technology/Leaf Microsite/eCommerce/eComm/lib/quartz-0.4.2.zip
==== grailsHome: tried
/Library/grails-1.3.7/lib/quartz-0.4.2.xml
-- artifact org.grails.plugins#quartz;0.4.2!quartz.zip:
/Library/grails-1.3.7/lib/quartz-0.4.2.zip …Run Code Online (Sandbox Code Playgroud) 我有4个类,事件,问题,请求,另一个是附件.
每个域看起来像.........
Class Incidents
{
// other fields
static hasOne = [attachment: Attachment]
static constraints = [attachment nullable:true]
}
Class Problems
{
// other fields
static hasOne = [attachment: Attachment]
static constraints = [attachment nullable:true]
}
Class Requests
{
// other fields
static hasOne = [attachment: Attachment]
static constraints = [attachment nullable:true]
}
Class Attachment
{
// other fields
static belongsTo= [
incident: Incidents,
problem: Problems,
requests: Requests
]
static constraints = {
incident nullable: true
problem nullable: true
requests …Run Code Online (Sandbox Code Playgroud) grails grails-orm grails-plugin grails-domain-class grails-2.0
我重建了插件grails-skin-loader并将其放在grails-skin-loader.zip文件中.
我的BuildConfig.groovy有:
grails.plugin.location.skin-loader = "../interlated_git/interlated/grails-skin-loader"
grails.project.dependency.resolution = {
...
plugins {
compile ":skin-loader:1.0.9"
Run Code Online (Sandbox Code Playgroud)
我得到的错误消息似乎与' - '有关:
(grails.plugin.location.skin - loader) is a binary expression, but it should be a variable expression at line: 18 column: 36. File: grails-contact-form/grails-app/conf/BuildConfig.groovy @ line 18, column 36.
grails.plugin.location.skin-loader = "../interlated_git/interlated/grails-skin-loader"
Run Code Online (Sandbox Code Playgroud) 如何设置Spring Security Core以调用某种模式(例如/ api/**)不被过滤?
grails.plugins.springsecurity.filterChain.chainMap = [
'/api/**': '',
'/**': 'JOINED_FILTERS',
]
Run Code Online (Sandbox Code Playgroud)
不起作用,因为它会尝试解决bean''.
除了'JOINED_FILTERS,-filter1,-filter2,......'之外,还有什么不好的解决方法吗?
如何从Spring Security中排除静态资源?
我正在使用grails spring security,并希望在注销后将用户重定向到某个URL.到目前为止我发现的是被调用的特殊属性'logout.afterLogoutUrl',grails.plugin.springsecurity.logout.postOnly应该设置为false.所以在我的Config.groovy中我有:
grails.plugin.springsecurity.logout.postOnly = false
logout.afterLogoutUrl = "/"
Run Code Online (Sandbox Code Playgroud)
我的注销按钮看起来像:
<sec:ifLoggedIn>
<g:remoteLink class="logout buttons" controller="logout"><g:message code="btn.logout"
default="Loading…"/></g:remoteLink>
</sec:ifLoggedIn>
Run Code Online (Sandbox Code Playgroud)
当我点击退出按钮时,会出现以下请求序列:
从最后一个我得到'状态代码:401未授权'但用户仍然看到我点击退出按钮的页面.有谁知道如何处理这种情况?非常感谢你!
我正在尝试在 grails mail-plugin中配置 zoho 邮件服务。这是到目前为止我的配置,
grails {
mail {
host = "smtp.zoho.com"
port = 465
username = "email@valid.com"
password = "some-valid-password"
props = ["mail.smtp.auth":"true",
"mail.smtp.starttls.enable":"true",
"mail.smtp.socketFactory.port":"465",
"mail.smtp.socketFactory.class":"javax.net.ssl.SSLSocketFactory",
"mail.smtp.socketFactory.fallback":"false"]
}
}
Run Code Online (Sandbox Code Playgroud)
这是我的服务方法。如果我把gmail smtp配置放在上面的配置中,效果很好,所以我认为服务方法完全没有问题。另外,email@valid.com 是 Zoho 中的注册电子邮件,我可以使用 zoho 仪表板发送电子邮件。
def sendImageProcessedNotification(用户用户,imageLink){
尝试{
如果(用户){
def 接收者 = user.email
mailService.sendMail {
异步真
至接收者
主题“主题”
html "HTML 正文"
}
}
}抓住(e){
日志错误(e)
}
}
这是堆栈跟踪,
2015-07-19 08:17:37,782 [pool-12-thread-1] 错误 mail.MailMessageBuilder - 无法发送电子邮件
org.springframework.mail.MailSendException:消息失败后无法关闭服务器连接;嵌套异常是 javax.mail.MessagingException: 无法将命令发送到 SMTP 主机;
嵌套异常是:
java.net.SocketException:连接被远程主机关闭。失败的消息:com.sun.mail.smtp.SMTPSendFailedException:553 不允许中继,因为
; 消息异常详情(1)为:
失败消息1:
com.sun.mail.smtp.SMTPSendFailedException:553 … 我正在运行 grails 战争。
错误:错误 WAR 打包错误:存档包含超过 65535 个条目。
如何在 grails 中启用 zip64?
在我使用 grails4 的调度程序依赖项中出错:任何人都让我知道调度程序的正确依赖项
dependencies {
compile "org.grails.plugins:quartz:2.0.1"
Run Code Online (Sandbox Code Playgroud)
}
也试过这个:
dependencies {
compile "com.agileorbit:schwartz:1.0.1"
Run Code Online (Sandbox Code Playgroud)
}
两者都无法编译:
grails 运行应用程序 | 解决依赖关系。请稍等...
| 正在运行应用程序...
FAILURE:构建失败,出现异常。
出了什么问题:任务“:compileGroovy”执行失败。
org/quartz/JobExecutionContext
尝试:使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。使用 --scan 运行以获得完整的见解。
在https://help.gradle.org获取更多帮助
构建在 10 秒内失败 | 错误无法启动服务器(使用 --stacktrace 查看完整跟踪)
如何从应用程序获取grails插件版本?
详细信息:我的应用程序也是一个grails插件.
当我设置版本时,使用
grails set-version 0.5
我无法使用值,grailsApplication.metadata['app.version']
因为我的FooBarGrailsPlugin.groovy类中的值已更新
在application.properties文件保持不变.
韩国社交协会.
当我运行set-version时,我的类改为:
class FooBarGrailsPlugin {
def version = 0.1
}
Run Code Online (Sandbox Code Playgroud)
至
class FooBarGrailsPlugin {
def version = 0.5
}
Run Code Online (Sandbox Code Playgroud) 我创建了一项服务 NotifierService
class NotifierService {
MailService mailService
def sendEmail(String email) {
mailService.sendMail {
to email
from "myemail@domain.com"
subject "Subject"
body "Some text"
}
}
}
Run Code Online (Sandbox Code Playgroud)
然后,我试图在服务sendEmail中的另一种方法updateUser中调用方法DbService
class DbService {
NotifierService notifierService
def updateUser(){
//Some Logic
//Get userObject
def email = userObject.email
//Send email
try {
notifierService.sendEmail(email)
} catch (Exception e) {
e.printStackTrace()
}
}
//Other methods
.
.
.
}
Run Code Online (Sandbox Code Playgroud)
当我调用sendEmailmethod 时它工作正常BootStrap,但是当我使用它时我得到以下错误DbService
| Error java.lang.NullPointerException: Cannot invoke method sendMail() on …Run Code Online (Sandbox Code Playgroud) grails ×10
grails-plugin ×10
grails-2.0 ×4
grails-4 ×1
grails-orm ×1
smtp ×1
spring ×1
version ×1
zoho ×1