执行脚本CreateAuthDomains时出错:null\scripts\Init.groovy(系统找不到指定的路径) [英] Error executing script CreateAuthDomains: null\scripts\Init.groovy (The system cannot find the path specified)

查看:355
本文介绍了执行脚本CreateAuthDomains时出错:null\scripts\Init.groovy(系统找不到指定的路径)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试构建一个在grails中使用acegi和multitenant插件的应用程序。我正在按照本教程中的说明操作:



  grails create-auth-domains org.racetrack.User org.racetrack.Role请求映射

我得到这个错误:

 运行脚本C: \ Users \roise\.grails\1.3.7\projects\racetrack\plugins\acegi-0.5.2\scripts\CreateAuthDomains.groovy 
执行脚本CreateAuthDomains时出错:null\\ \\ scripts \Init.groovy(系统找不到指定的路径)
java.io.FileNotFoundException:null\scripts\Init.groovy(系统找不到指定的路径)
在java .io.FileInputStream.open(Native Method)
在java.io. FileInputStream。< init>(FileInputStream.java:138)
at gant.Gant $ _closure1.doCall(Gant.groovy:128)
at gant.Gant $ _closure1.call(Gant.groovy)
at _SecurityTargets_groovy.run(_SecurityTargets_groovy:25)
at _SecurityTargets_groovy $ run.call(未知来源)
在CreateAuthDomains.run(CreateAuthDomains:23)
在CreateAuthDomains $ run.call未知源)
at gant.Gant.prepareTargets(Gant.groovy:606)
执行脚本时出错CreateAuthDomains:null\scripts\Init.groovy(系统找不到指定的路径)

我试着按照最后一个逗号教程。唯一不同的是我在STS中开发,我不能从命令行运行create-app命令,实际上我必须从New菜单创建一个新的应用程序。其他三个命令我已经到了目前为止 - 我已经进入并执行完全如图所示。

我相信@ arcdegree是正确的,因为一个脚本不能找出GRAILS_HOME是什么,但在我的情况下,环境变量设置正确,我仍然遇到问题。



什么我发现解决了我的问题,我相信会解决您的问题,您尝试运行的命令(create-auth-domains)正在访问需要更新的acegi插件中的脚本(CreateAuthDomains.groovy)。现在,这个问题很老,没有被接受的答案,所以我不确定你是否仍然遇到这个问题,但我认为这个答案会帮助其他人寻找类似的问题。我的原因是尝试使用旧版插件来替换jsecurity,而这个插件已被更新的插件所取代,但我的意图是使用我所指的文档所使用的相同内容。

在这种情况下,您的脚本CreateAuthDomains可能会使用旧的对grailsHome和includeTargets的引用,应该用调用grailsS​​cript(Init)的单行代替。所以,注释掉这些行:


  • grailsHome = Ant.project.properties。environment.GRAILS_HOME code>

  • includeTargets<<新文件($ {grailsHome} /scripts/Init.groovy)



然后添加这个line

  includeTargets<< grailsS​​cript(Init)

保存文件并再次尝试您的命令。


I am trying to build an app that makes use of the acegi and multitenant-plugin in grails. I am following the instructions from this tutorial:

http://ridingthetiger.wikia.com/wiki/Creating_a_Secure,_Multi-Tenant_Web_App_with_Grails

however when I get to this instruction:

grails create-auth-domains org.racetrack.User org.racetrack.Role Requestmap

I get this error:

Running script C:\Users\roise\.grails\1.3.7\projects\racetrack\plugins\acegi-0.5.2\scripts\CreateAuthDomains.groovy
Error executing script CreateAuthDomains: null\scripts\Init.groovy (The system cannot find the path specified)
java.io.FileNotFoundException: null\scripts\Init.groovy (The system cannot find the path specified)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:138)
    at gant.Gant$_closure1.doCall(Gant.groovy:128)
    at gant.Gant$_closure1.call(Gant.groovy)
    at _SecurityTargets_groovy.run(_SecurityTargets_groovy:25)
    at _SecurityTargets_groovy$run.call(Unknown Source)
    at CreateAuthDomains.run(CreateAuthDomains:23)
    at CreateAuthDomains$run.call(Unknown Source)
    at gant.Gant.prepareTargets(Gant.groovy:606)
Error executing script CreateAuthDomains: null\scripts\Init.groovy (The system cannot find the path specified)

I have tried to follow the tutorial to the last comma. The only thing that is different is that i am developing in STS and I cannot run the create-app command from the command line, I actually have to create a new app from the New menu. The other three commands I have got up to so far - I have entered and executed exactly as shown.

解决方案

I believe that @arcdegree is right that the problem is because a script cannot figure out what GRAILS_HOME is but in my case that environment variable was set correctly and I was still experiencing the problem.

What I found to fix my problem and I believe will fix your problem is that the command you are trying to run (create-auth-domains ) is accessing a script (CreateAuthDomains.groovy) within the acegi plugin that needs updating. Now, this question is quite old with no accepted answers so I'm not sure if you are still experiencing this problem but I do think this answer will help anyone else looking into a similar problem. Mine stems from trying to use an old plugin for jsecurity that has been replaced with a newer plugin but I was intent on using the same thing a document I was referring to had used.

Your script in this case, CreateAuthDomains, probably uses an old reference to grailsHome and includeTargets that should be replaced with a single line that calls grailsScript("Init") instead. So, comment out these lines:

  • grailsHome = Ant.project.properties."environment.GRAILS_HOME"
  • includeTargets << new File ("${grailsHome}/scripts/Init.groovy")

then add this one line

includeTargets << grailsScript("Init")

Save the file and try your command again.

这篇关于执行脚本CreateAuthDomains时出错:null\scripts\Init.groovy(系统找不到指定的路径)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆