Error on Tomcat Deployment -java.lang.NoSuchMethodError: org.apache.commons.lang.StringUtils.defaultIfBlank

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Error on Tomcat Deployment -java.lang.NoSuchMethodError: org.apache.commons.lang.StringUtils.defaultIfBlank

neos
This post was updated on .
Hi,

I have my application code running perfectly on "run-app". However, when I try to deploy the war (created using "grails prod war") on a tomcat server outside of run-app (both on my local machine as well as on AWS), I get the following error. Has anyone else come across something like this?

java.lang.NoSuchMethodError: org.apache.commons.lang.StringUtils.defaultIfBlank(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
        at org.codehaus.groovy.grails.commons.env.GrailsEnvironment$GrailsConfigPropertySource.<init>(GrailsEnvironment.java:57)
        at org.codehaus.groovy.grails.commons.env.GrailsEnvironment.<init>(GrailsEnvironment.java:40)
        at org.codehaus.groovy.grails.commons.spring.GrailsWebApplicationContext.createEnvironment(GrailsWebApplicationContext.java:180)
        at org.springframework.context.support.AbstractApplicationContext.getEnvironment(AbstractApplicationContext.java:288)
        at org.codehaus.groovy.grails.commons.spring.GrailsWebApplicationContext.getEnvironment(GrailsWebApplicationContext.java:185)
        at org.codehaus.groovy.grails.commons.spring.GrailsWebApplicationContext.getEnvironment(GrailsWebApplicationContext.java:50)
        at org.springframework.context.support.AbstractApplicationContext.setParent(AbstractApplicationContext.java:402)
        at org.springframework.context.support.GenericApplicationContext.setParent(GenericApplicationContext.java:148)
        at org.springframework.context.support.GenericApplicationContext.<init>(GenericApplicationContext.java:137)
        at org.codehaus.groovy.grails.commons.spring.GrailsApplicationContext.<init>(GrailsApplicationContext.java:56)
        at org.codehaus.groovy.grails.commons.spring.GrailsWebApplicationContext.<init>(GrailsWebApplicationContext.java:71)
        at org.codehaus.groovy.grails.commons.spring.WebRuntimeSpringConfiguration.createApplicationContext(WebRuntimeSpringConfiguration.java:49)
        at org.codehaus.groovy.grails.commons.spring.DefaultRuntimeSpringConfiguration.initialiseApplicationContext(DefaultRuntimeSpringConfiguration.java:126)
        at org.codehaus.groovy.grails.commons.spring.WebRuntimeSpringConfiguration.setServletContext(WebRuntimeSpringConfiguration.java:67)
        at org.codehaus.groovy.grails.commons.spring.GrailsRuntimeConfigurator.configure(GrailsRuntimeConfigurator.java:140)
        at org.codehaus.groovy.grails.commons.spring.GrailsRuntimeConfigurator.configure(GrailsRuntimeConfigurator.java:127)
        at org.codehaus.groovy.grails.web.context.GrailsConfigUtils.configureWebApplicationContext(GrailsConfigUtils.java:122)
        at org.codehaus.groovy.grails.web.context.GrailsContextLoader.initWebApplicationContext(GrailsContextLoader.java:108)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4973)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5467)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1256)
        at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:692)
        at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:217)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:213)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:610)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:744)

Trying to figure out where the issue is coming from, I created a a barebones application and started adding to it. It seems like it's root cause lies in a plugin. Below are the plugins I've in the barebones application, when I could replicate the issue.
       build ":tomcat:7.0.50"

        // plugins for the compile step
        compile ":scaffolding:2.0.1"
        compile ':cache:1.1.1'

        compile ":spring-security-core:2.0-RC2"         // For Security
        compile ":searchable:0.6.5"                     // For Search
        compile ":burning-image:0.5.1"                  // For Photos - Thumbnail generation

        // plugins needed at runtime but not for compilation
        runtime ":hibernate:3.6.10.7" // or ":hibernate4:4.1.11.6"
        runtime ":database-migration:1.3.8"
        runtime ":jquery:1.10.2.2"
        runtime ":resources:1.2.1"

        runtime ":foundation:5.1.1"                     // For Front-end CSS framework
        runtime ":aws-sdk:1.7.4"                        // For Photos - Upload to S3

Thanks in Advance,
Sid.