Sunday, 15 September 2013

tomcat - Grails Asset Pipeline causing server error -



tomcat - Grails Asset Pipeline causing server error -

i have created grails app no custom controllers have deployed using tomcat via docker. app runs ok (run-app , run-war) on local machine, not when deploy using tomcat.

i next stack trace, thought of cause please?

2014-10-17 08:08:04,158 [http-bio-8080-exec-10] error stacktrace - total stack trace: org.codehaus.groovy.grails.web.pages.exceptions.groovypagesexception: error applying layout : main @ org.codehaus.groovy.grails.web.servlet.view.groovypageview.rethrowrenderexception(groovypageview.java:179) @ org.codehaus.groovy.grails.web.sitemesh.springmvcviewdecorator.render(springmvcviewdecorator.java:78) @ org.codehaus.groovy.grails.web.sitemesh.grailslayoutview.rendertemplate(grailslayoutview.java:60) @ org.codehaus.groovy.grails.web.servlet.view.abstractgrailsview.renderwithingrailswebrequest(abstractgrailsview.java:49) @ org.codehaus.groovy.grails.web.servlet.view.abstractgrailsview.rendermergedoutputmodel(abstractgrailsview.java:33) @ org.springframework.web.servlet.view.abstractview.render(abstractview.java:267) @ org.codehaus.groovy.grails.web.servlet.errorhandlingservlet.dodispatch(errorhandlingservlet.java:163) @ org.springframework.web.servlet.dispatcherservlet.doservice(dispatcherservlet.java:870) @ org.springframework.web.servlet.frameworkservlet.processrequest(frameworkservlet.java:961) @ org.springframework.web.servlet.frameworkservlet.doget(frameworkservlet.java:852) @ javax.servlet.http.httpservlet.dohead(httpservlet.java:243) @ javax.servlet.http.httpservlet.service(httpservlet.java:643) @ org.springframework.web.servlet.frameworkservlet.service(frameworkservlet.java:837) @ javax.servlet.http.httpservlet.service(httpservlet.java:727) @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:303) @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:208) @ org.codehaus.groovy.grails.web.servlet.mvc.grailswebrequestfilter.dofilterinternal(grailswebrequestfilter.java:69) @ org.springframework.web.filter.onceperrequestfilter.dofilter(onceperrequestfilter.java:107) @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:241) @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:208) @ org.apache.catalina.core.applicationdispatcher.invoke(applicationdispatcher.java:748) @ org.apache.catalina.core.applicationdispatcher.processrequest(applicationdispatcher.java:488) @ org.apache.catalina.core.applicationdispatcher.doforward(applicationdispatcher.java:411) @ org.apache.catalina.core.applicationdispatcher.forward(applicationdispatcher.java:338) @ org.apache.catalina.core.standardhostvalve.custom(standardhostvalve.java:466) @ org.apache.catalina.core.standardhostvalve.status(standardhostvalve.java:337) @ org.apache.catalina.core.standardhostvalve.throwable(standardhostvalve.java:427) @ org.apache.catalina.core.standardhostvalve.invoke(standardhostvalve.java:200) @ org.apache.catalina.valves.errorreportvalve.invoke(errorreportvalve.java:98) @ org.apache.catalina.valves.accesslogvalve.invoke(accesslogvalve.java:950) @ org.apache.catalina.core.standardenginevalve.invoke(standardenginevalve.java:116) @ org.apache.catalina.connector.coyoteadapter.service(coyoteadapter.java:408) @ org.apache.coyote.http11.abstracthttp11processor.process(abstracthttp11processor.java:1040) @ org.apache.coyote.abstractprotocol$abstractconnectionhandler.process(abstractprotocol.java:607) @ org.apache.tomcat.util.net.jioendpoint$socketprocessor.run(jioendpoint.java:313) @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1145) @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:615) @ java.lang.thread.run(thread.java:745) caused by: org.codehaus.groovy.grails.web.pages.exceptions.groovypagesexception: error processing groovypageview: no signature of method: gsp_gradlegrailsapp_layoutsmain_gsp.assetpath() applicable argument types: (java.util.linkedhashmap) values: [[src:favicon.ico]] @ org.codehaus.groovy.grails.web.servlet.view.groovypageview.creategroovypageexception(groovypageview.java:127) @ org.codehaus.groovy.grails.web.servlet.view.groovypageview.handleexception(groovypageview.java:104) @ org.codehaus.groovy.grails.web.servlet.view.groovypageview.rendertemplate(groovypageview.java:75) @ org.codehaus.groovy.grails.web.servlet.view.abstractgrailsview.renderwithingrailswebrequest(abstractgrailsview.java:49) @ org.codehaus.groovy.grails.web.servlet.view.abstractgrailsview.rendermergedoutputmodel(abstractgrailsview.java:33) @ org.springframework.web.servlet.view.abstractview.render(abstractview.java:267) @ org.codehaus.groovy.grails.web.sitemesh.springmvcviewdecorator.render(springmvcviewdecorator.java:69) ... 36 more caused by: groovy.lang.missingmethodexception: no signature of method: gsp_gradlegrailsapp_layoutsmain_gsp.assetpath() applicable argument types: (java.util.linkedhashmap) values: [[src:favicon.ico]] @ sun.reflect.nativeconstructoraccessorimpl.newinstance0(native method) @ sun.reflect.nativeconstructoraccessorimpl.newinstance(nativeconstructoraccessorimpl.java:57) @ sun.reflect.delegatingconstructoraccessorimpl.newinstance(delegatingconstructoraccessorimpl.java:45) @ java.lang.reflect.constructor.newinstance(constructor.java:526) @ org.codehaus.groovy.reflection.cachedconstructor.invoke(cachedconstructor.java:77) @ org.codehaus.groovy.runtime.callsite.constructorsite$constructorsitenounwrapnocoerce.callconstructor(constructorsite.java:102) @ org.codehaus.groovy.runtime.callsite.abstractcallsite.callconstructor(abstractcallsite.java:198) @ org.codehaus.groovy.grails.web.pages.groovypagesmetautils.methodmissingfortaglib(groovypagesmetautils.groovy:68) @ org.codehaus.groovy.grails.web.pages.groovypagesmetautils$_registermethodmissingforgsp_closure1.docall(groovypagesmetautils.groovy:40) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:57) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:606) @ org.codehaus.groovy.reflection.cachedmethod.invoke(cachedmethod.java:90) @ org.codehaus.groovy.runtime.metaclass.closuremetamethod.invoke(closuremetamethod.java:80) @ groovy.lang.metaclassimpl.invokemissingmethod(metaclassimpl.java:933) @ groovy.lang.metaclassimpl.invokepropertyormissing(metaclassimpl.java:1256) @ groovy.lang.metaclassimpl.invokemethod(metaclassimpl.java:1209) @ groovy.lang.expandometaclass.invokemethod(expandometaclass.java:1110) @ groovy.lang.metaclassimpl.invokemethod(metaclassimpl.java:1016) @ groovy.lang.metaclassimpl.invokemethod(metaclassimpl.java:1111) @ groovy.lang.expandometaclass.invokemethod(expandometaclass.java:1110) @ groovy.lang.metaclassimpl.invokemethod(metaclassimpl.java:1016) @ org.codehaus.groovy.runtime.callsite.pogometaclasssite.callcurrent(pogometaclasssite.java:66) @ org.codehaus.groovy.runtime.callsite.abstractcallsite.callcurrent(abstractcallsite.java:141) @ gsp_gradlegrailsapp_layoutsmain_gsp$_run_closure1.docall(gsp_gradlegrailsapp_layoutsmain_gsp.groovy:31) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:57) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:606) @ org.codehaus.groovy.reflection.cachedmethod.invoke(cachedmethod.java:90) @ groovy.lang.metamethod.domethodinvoke(metamethod.java:324) @ groovy.lang.metaclassimpl.invokemethod(metaclassimpl.java:1207) @ groovy.lang.expandometaclass.invokemethod(expandometaclass.java:1110) @ groovy.lang.metaclassimpl.invokemethod(metaclassimpl.java:1016) @ groovy.lang.closure.call(closure.java:423) @ groovy.lang.closure.call(closure.java:417) @ org.codehaus.groovy.grails.web.taglib.groovypagetagbody.executeclosure(groovypagetagbody.java:206) @ org.codehaus.groovy.grails.web.taglib.groovypagetagbody.captureclosureoutput(groovypagetagbody.java:108) @ org.codehaus.groovy.grails.web.taglib.groovypagetagbody.call(groovypagetagbody.java:219) @ org.codehaus.groovy.grails.plugins.web.taglib.sitemeshtaglib.capturetagcontent(sitemeshtaglib.groovy:49) @ org.codehaus.groovy.grails.plugins.web.taglib.sitemeshtaglib.capturetagcontent(sitemeshtaglib.groovy) @ org.codehaus.groovy.grails.plugins.web.taglib.sitemeshtaglib$_closure1.docall(sitemeshtaglib.groovy:125) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:57) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:606) @ org.codehaus.groovy.reflection.cachedmethod.invoke(cachedmethod.java:90) @ groovy.lang.metamethod.domethodinvoke(metamethod.java:324) @ groovy.lang.metaclassimpl.invokemethod(metaclassimpl.java:1207) @ groovy.lang.expandometaclass.invokemethod(expandometaclass.java:1110) @ groovy.lang.metaclassimpl.invokemethod(metaclassimpl.java:1016) @ groovy.lang.closure.call(closure.java:423) @ org.codehaus.groovy.grails.web.pages.groovypage.invoketaglibclosure(groovypage.java:501) @ org.codehaus.groovy.grails.web.pages.groovypage.invoketag(groovypage.java:419) @ org.codehaus.groovy.grails.web.pages.groovypage$invoketag$4.callcurrent(unknown source) @ gsp_gradlegrailsapp_layoutsmain_gsp.run(gsp_gradlegrailsapp_layoutsmain_gsp.groovy:44) @ org.codehaus.groovy.grails.web.pages.groovypagewritable.dowriteto(groovypagewritable.java:217) @ org.codehaus.groovy.grails.web.pages.groovypagewritable.writeto(groovypagewritable.java:128) @ org.codehaus.groovy.grails.web.servlet.view.groovypageview.rendertemplate(groovypageview.java:71) ... 40 more

edited include main.gsp listing:

<!doctype html> <!--[if lt ie 7 ]> <html lang="en" class="no-js ie6"> <![endif]--> <!--[if ie 7 ]> <html lang="en" class="no-js ie7"> <![endif]--> <!--[if ie 8 ]> <html lang="en" class="no-js ie8"> <![endif]--> <!--[if ie 9 ]> <html lang="en" class="no-js ie9"> <![endif]--> <!--[if (gt ie 9)|!(ie)]><!--> <html lang="en" class="no-js"><!--<![endif]--> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge,chrome=1"> <title><g:layouttitle default="grails"/></title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="shortcut icon" href="${assetpath(src: 'favicon.ico')}" type="image/x-icon"> <link rel="apple-touch-icon" href="${assetpath(src: 'apple-touch-icon.png')}"> <link rel="apple-touch-icon" sizes="114x114" href="${assetpath(src: 'apple-touch-icon-retina.png')}"> <asset:stylesheet src="application.css"/> <asset:javascript src="application.js"/> <g:layouthead/> </head> <body> <div id="grailslogo" role="banner"><a href="http://grails.org"><asset:image src="grails_logo.png" alt="grails"/></a></div> <g:layoutbody/> <div class="footer" role="contentinfo"></div> <div id="spinner" class="spinner" style="display:none;"><g:message code="spinner.alt" default="loading&hellip;"/></div> </body> </html>

ahhh, found it. issue project beingness built gradle grails plugin when deploying. there 1 liner in docs (gradle grails plugin):

using grails gradle plugin bypasses normal grails application build framework in favor of gradle. consequence of buildconfig.groovy no longer consulted repository or dependency information.

therefore plugins beingness included buildconfig.groovy beingness ignored , beingness built using plugins defined in build.gradle (which did not include asset pipeline plugin). war file beingness created 'grails run-war' different created 'gradle war'. unzipping 2 war files showed difference in structure. moving dependencies buildconfig.groovy build.gradle meant war file built correctly.

thanks @joshuamoore initial hint, that's set me on right track.

tomcat grails asset-pipeline

No comments:

Post a Comment