Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 251851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:37:45+00:00 2026-05-11T21:37:45+00:00

I am maintaining a Grails application that I did not write(I have no experience

  • 0

I am maintaining a Grails application that I did not write(I have no experience with Groovy/Grails, actually :)) and it currently has a bug on one of the environments it’s deployed on, but not others.

In order to debug this, I want to jump into the grails shell on the affected server, run the command that I suspect is error-prone, and see what results I get back to see where to go with my debugging next.

The application is put into a war file with the grails prod war command, scp’d to the server to be deployed on, and extracted with jar -xvf /path/to/war.

When I am in the grails shell, I am unable to access any of the classes defined in the domain.

This is what I try:

`

]$ ~/grails-1.0.4/bin/grails shell

Welcome to Grails 1.0.4 - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: /home/me/grails-1.0.4        

Base Directory: /var/home/me/skills_test/WEB-INF
Running script /home/me/grails-1.0.4/scripts/Shell.groovy
Environment set to development
     [copy] Copying 1 file to /home/me/.grails/1.0.4/projects/WEB-INF
     [copy] Copying 1 file to /home/me/.grails/1.0.4/projects/WEB-INF
Jun 11, 2009 2:35:19 PM java.util.prefs.FileSystemPreferences$7 run
WARNING: Prefs file removed in background /home/me/.java/.userPrefs/org/codehaus    /groovy/tools/shell/prefs.xml
Groovy Shell (1.5.6, JVM: 10.0-b22)
Type 'help' or '\h' for help.
        ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
groovy:000> new User()
ERROR org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed,     groovysh_evaluate: 2: unable to resolve class User 
 @ line 2, column 1.
1 error

        at Shell_groovy$_run_closure2.doCall (Shell_groovy:71)
        at org.codehaus.gant.GantMetaClass.invokeMethod (GantMetaClass.java:79)
        at org.codehaus.gant.GantMetaClass.invokeMethod (GantMetaClass.java:94)
        at Shell_groovy$_run_closure2.doCall (Shell_groovy)
        at org.codehaus.gant.GantMetaClass.invokeMethod (GantMetaClass.java:79)
        at org.codehaus.gant.GantMetaClass.invokeMethod (GantMetaClass.java:79)
        at org.codehaus.gant.GantMetaClass.invokeMethod (GantMetaClass.java:94)
        at Shell_groovy$_run_closure1.doCall (Shell_groovy:37)
        at org.codehaus.gant.GantMetaClass.invokeMethod (GantMetaClass.java:79)
        at org.codehaus.gant.GantMetaClass.invokeMethod (GantMetaClass.java:94)
        at Shell_groovy$_run_closure1.doCall (Shell_groovy)
        at org.codehaus.gant.GantMetaClass.invokeMethod (GantMetaClass.java:79)
        at org.codehaus.gant.GantMetaClass.invokeMethod (GantMetaClass.java:79)
        at gant.Gant.dispatch (Gant.groovy:271)
        at gant.Gant.this$2$dispatch (Gant.groovy)
        at gant.Gant.invokeMethod (Gant.groovy)
        at gant.Gant.processTargets (Gant.groovy:436)
        at gant.Gant.processArgs (Gant.groovy:372)
groovy:000> import User
ERROR org.codehaus.groovy.tools.shell.CommandException: Invalid import definition:     'import User'; reason: startup failed, script1244745379552.groovy: 1: unable to resolve     class User
 @ line 1, column 1.
1 error

        at Shell_groovy$_run_closure2.doCall (Shell_groovy:71)
        at org.codehaus.gant.GantMetaClass.invokeMethod (GantMetaClass.java:79)
        at org.codehaus.gant.GantMetaClass.invokeMethod (GantMetaClass.java:94)
        at Shell_groovy$_run_closure2.doCall (Shell_groovy)
        at org.codehaus.gant.GantMetaClass.invokeMethod (GantMetaClass.java:79)
        at org.codehaus.gant.GantMetaClass.invokeMethod (GantMetaClass.java:79)
        at org.codehaus.gant.GantMetaClass.invokeMethod (GantMetaClass.java:94)
        at Shell_groovy$_run_closure1.doCall (Shell_groovy:37)
        at org.codehaus.gant.GantMetaClass.invokeMethod (GantMetaClass.java:79)
        at org.codehaus.gant.GantMetaClass.invokeMethod (GantMetaClass.java:94)
        at Shell_groovy$_run_closure1.doCall (Shell_groovy)
        at org.codehaus.gant.GantMetaClass.invokeMethod (GantMetaClass.java:79)
        at org.codehaus.gant.GantMetaClass.invokeMethod (GantMetaClass.java:79)
        at gant.Gant.dispatch (Gant.groovy:271)
        at gant.Gant.this$2$dispatch (Gant.groovy)
        at gant.Gant.invokeMethod (Gant.groovy)
        at gant.Gant.processTargets (Gant.groovy:436)
        at gant.Gant.processArgs (Gant.groovy:372)
groovy:000> 

`

as you can see, I can’t access the “User” class(which lives in the domain directory – those are Grails’ equivalent of ‘models’, right?) and can’t import it either.

The examples of grails shell usage I’ve seen have all been able to access all classes in the application just fine without importing… what have I done wrong?

Is it because I’m running the grails shell against an extracted WAR file? How can I get around this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T21:37:45+00:00Added an answer on May 11, 2026 at 9:37 pm

    The issue was in fact that it was working from an extracted WAR file – I think it needs to have the source .java files present to work properly. I copied the original source files to the server I was having issues on, edited the configuration to point to the correct data sources, and was able to get into the shell fine.

    Some reason you can’t get into the shell in the directory with the extracted WAR file, but I will accept that for now because I’ve found a workaround.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 163k
  • Answers 163k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The answer to your question (title) is to replace document.getElementById('about').href… May 12, 2026 at 12:11 pm
  • Editorial Team
    Editorial Team added an answer Use write.csv May 12, 2026 at 12:11 pm
  • Editorial Team
    Editorial Team added an answer An empty tag is not going to have any child… May 12, 2026 at 12:11 pm

Related Questions

I am maintaining a few web applications. The development and qa environments use invalid/outdated
I am maintaining a public website (no authorization required) that uses web services over
I am maintaining a data warehouse with multiple sources of data about a class
I am maintaining a carbon C++ application on OS X. There is a spin

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.