我的开发人员在我的本地机器上建立了一个基于 Grails/Spring 框架的应用程序。我不小心删除了他给我的 Unix exe 脚本,以便在我的浏览器中本地运行它,并且无法再访问该站点。不幸的是,直到假期结束后我才能与他取得联系,我需要访问这个网站尽快完成工作。
我现在的剧本是...
#!/bin/sh
grails -Dserver.port.https=443 -Dserver.port=80 run-app -https
它只是返回错误。谁能帮我弄清楚如何在本地运行它。这是unix错误。
Last login: Mon Dec 24 08:34:43 on ttys000
/Users/admin/Projects/.... ; exit;
gio-2:~ admin$ /Users/admin/Projects/.... ; exit;
| Configuring classpath
| Error java.io.FileNotFoundException: /Users/admin/.grails/.slcache/.index (Permission denied)
| Error at java.io.FileOutputStream.openAppend(Native Method)
| Error at java.io.FileOutputStream.<init>(FileOutputStream.java:192)
| Error at java.io.FileWriter.<init>(FileWriter.java:90)
| Error at com.springsource.loaded.MethodInvokerRewriter.addToCacheIndex(MethodInvokerRewriter.java:326 )
| Error at com.springsource.loaded.MethodInvokerRewriter.rewrite(MethodInvokerRewriter.java:271)
| Error at com.springsource.loaded.MethodInvokerRewriter.rewriteUsingCache(MethodInvokerRewriter.java:1 41)
| Error at com.springsource.loaded.TypeRegistry.methodCallRewriteUseCacheIfAvailable(TypeRegistry.java: 775)
| Error at com.springsource.loaded.agent.SpringLoadedPreProcessor.preProcess(SpringLoadedPreProcessor.j ava:251)
| Error at com.springsource.loaded.agent.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:89)
| Error at sun.instrument.TransformerManager.transform(TransformerManager.java:169)
| Error at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:365)
| Error at java.lang.ClassLoader.defineClass1(Native Method)
| Error at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
| Error at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
| Error at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
| Error at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
| Error at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
| Error at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
| Error at java.security.AccessController.doPrivileged(Native Method)
| Error at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
| Error at org.codehaus.groovy.tools.RootLoader.oldFindClass(RootLoader.java:152)
| Error at org.codehaus.groovy.tools.RootLoader.loadClass(RootLoader.java:124)
| Error at org.codehaus.groovy.grails.cli.support.GrailsRootLoader.loadClass(GrailsRootLoader.java:43)
| Error at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
| Error at org.codehaus.groovy.grails.cli.GrailsScriptRunner.main(GrailsScriptRunner.java:228)
| Error at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| Error at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| Error at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| Error at java.lang.reflect.Method.invoke(Method.java:597)
| Error at com.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1231)
| Error at org.codehaus.groovy.grails.cli.support.GrailsStarter.rootLoader(GrailsStarter.java:234)
| Error at org.codehaus.groovy.grails.cli.support.GrailsStarter.main(GrailsStarter.java:262)
| Error Error executing script RunApp: /Users/admin/.grails/ivy-cache/resolved-org.grails.internal-grails-2.0.3.xml (Permission denied) (Use --stacktrace to see the full trace)
logout
[Process completed]
我尝试使用 sudo 它给出了这个错误......
/Users/admin/Projects/... 2 ; exit;
gio-2:~ admin$ /Users/admin/Projects/... 2 ; exit;
Password:
| Configuring classpath
| Error /Users/admin does not appear to be part of a Grails application.
| Error The following commands are supported outside of a project:
add-proxy
clear-proxy
create-app
create-plugin
help
list-plugins
package-plugin
plugin-info
remove-proxy
set-proxy
| Run 'grails help' for a complete list of available scripts.
logout
[Process completed]
我不知道这是否有帮助,但我在 Users/admin/Tools 目录中有一个 grails-2.0.3 文件。同样,我没有设置任何这些,所以我真的不知道如何设置的输入/输出。我只需要能够通过 http 在我的本地服务器上看到它,这样我就可以完成我的前端工作。
这是有效的脚本...
#!/bin/sh
cd /Users/admin/Projects/...
sudo grails -Dserver.port.https=443 -Dserver.port=80 run-app -https