gregs

Deploying grails webapp to Jetty – resolving a few issues…

by gregs on Mar.23, 2010, under grails, jetty

So you have deployed your app and can access the start page of your grails app. If you are like me deploying your app to a Debian\Jetty type of configuration you might come across the following error:

CODE:
  1. java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config

When trying to access a controller from the default start page. I traced this to a missing dependency in grails (I use SpringSource Tool Suite for development so that maybe the root cause). By opening and editing your /project/grails-app/conf/(default package)/BuildConfig.groovy, add the following under grails.project.dependency.resolution.

CODE:
  1. grails.project.dependency.resolution = {
  2.     ...
  3.     dependencies {
  4.         // specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.
  5.     runtime "javax.servlet:jstl:1.1.2"
  6.         // runtime 'mysql:mysql-connector-java:5.1.5'
  7.     }
  8. }

Build your war and re-deploy. Still getting an error?? I was. For jetty there was still an issue with calling the controller. After spending some time exploring, it looks like Jetty support was removed from Grails 1.2. I stumbled across a post mentioning installing the grails Jetty plugin with:

CODE:
  1. . grails install-plugin jetty

After running this, and re-building my war file and re-deploying it one final time, bingo it all worked.


Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!