Open jarekwas opened 7 years ago
In version 3.2 below, the code included was able to find a view of any plug-in from the entire application. In version 3.3, the following code can find the view only contained in the same plugin as the controller.
class VueTemplateController {
GroovyPageLocator groovyPageLocator
def index(String id) {
if(groovyPageLocator.findPage('/vue/'+id+'.gsp')){
render(view: '/vue/'+id)
}else{
render(status: 404)
}
}
}
I just need your help! I try run app Grails app a i find this error! ---
"C:\Program Files\Java\jdk1.7.0_51\bin\java" -Dgrails.home=C:\CHAGUALA\Grails\grails-2.4.4 "-Dtools.jar=C:\Program Files\Java\jdk1.7.0_51\lib\tools.jar" -Dgroovy.starter.conf=C:\CHAGUALA\Grails\grails-2.4.4/conf/groovy-starter.conf -Xmx768M -Xms768M -XX:MaxPermSize=256m -XX:PermSize=256m -Djline.WindowsTerminal.directConsole=false -javaagent:C:\CHAGUALA\Grails\grails-2.4.4\lib\org.springframework\springloaded\jars\springloaded-1.2.1.RELEASE.jar -noverify -Dspringloaded=profile=grails;cacheDir=. -Dbase.dir=C:\Users\ccsadmin\SIGEM -Dgrails.project.fork.run.debugArgs= -Dfile.encoding=UTF-8 -classpath C:\CHAGUALA\Grails\grails-2.4.4\lib\org.codehaus.groovy\groovy-all\jars\groovy-all-2.3.7.jar;C:\CHAGUALA\Grails\grails-2.4.4\dist\grails-bootstrap-2.4.4.jar org.codehaus.groovy.grails.cli.support.GrailsStarter --main org.codehaus.groovy.grails.cli.GrailsScriptRunner --conf C:\CHAGUALA\Grails\grails-2.4.4/conf/groovy-starter.conf "run-app -plain-output" | Loading Grails 2.4.4 | Configuring classpath . | Environment set to development ................................. | Packaging Grails application ........... | Compiling 1 source files ...................... | Running Grails application | Server running. Browse to http://localhost:8080/SIGEM ....Error |
---|
2017-12-10 19:30:50,919 [http-bio-8080-exec-1] ERROR errors.GrailsExceptionResolver - IllegalStateException occurred when processing request: [GET] /SIGEM/requerente/create
Method on class [SIGEM.Requerente] was used outside of a Grails application. If running in the context of a test using the mocking API or bootstrap Grails correctly.. Stacktrace follows:
Message: Error processing GroovyPageView: Error executing tag |
Method ->> 527 | runWorker in C:\Users\ccsadmin\SIGEM\grails-app\views\requerente\create.gsp |
---|
Caused by GrailsTagException: Error executing tag |
doCall in C:/Users/ccsadmin/SIGEM/grails-app/views/requerente/create.gsp |
---|
Caused by IllegalStateException: Method on class [SIGEM.Requerente] was used outside of a Grails application. If running in the context of a test using the mocking API or bootstrap Grails correctly. ->> 78 | doCall in C__Users_ccsadmin_SIGEM_grails_app_views_requerente_create_gsp$_run_closure2 |
---|---|
81 | run in C__Users_ccsadmin_SIGEM_grails_app_views_requerente_create_gsp |
1145 | runWorker in java.util.concurrent.ThreadPoolExecutor |
615 | run in java.util.concurrent.ThreadPoolExecutor$Worker |
^ 744 | run . . . in java.lang.Thread |
Process finished with exit code 1
Task List
Steps to Reproduce
render(view: 'templates/example', plugin: 'plugina')
Expected Behaviour
Grails will find the view and as usual.
Actual Behaviour
Throw Exception
Environment Information