small medium large xlarge

Back to: All Forums  Grails
Generic-user-small
09 Apr 2010, 23:54
Todd Miller (3 posts)

I’m just working through Chapter 3 of the book, and when I got to adding the code to the BootStrap.groovy, I’d always get an error link:

/TekDays/grails-app/conf/BootStrap.groovy: 4: unable to resolve class TekEvent 
  [groovyc]  @ line 4, column 15.
  [groovyc]    	def event1 = new TekEvent(name: 'Gateway Code Camp',
  [groovyc]                  ^

I had to add “import tekdays.TekEvent” to the beginning to get rid of the error. I’m using grails 1.2.2. Anyone else having this issue? Any ideas on ways to avoid having to add imports to BootStrap?

Shot_1286318967988_pragsmall
28 Apr 2010, 20:07
Andy Platter (1 post)

I had the same issue and the import “fixed” it. Haven’t dug any deeper though.

Generic-user-small
31 May 2010, 16:15
Larry Eisenstein (1 post)

I had the same error in Grails 1.3.1, but I added: import tekdays.*

I got that info from a member on the grails mailing-list/forum.

Generic-user-small
11 Nov 2010, 11:51
Alex Ley (2 posts)

I am still having issues with this. I am trying to run this code with grail 1.35

Groovy:unable to resolve class TekEvent

(I am using the grails plugin for STS)

neither of the import ‘fixes’ work.

Any help would be great.

Generic-user-small
11 Nov 2010, 13:29
Alex Ley (2 posts)

Ok - anyone having this issue with STS, do the following:

delete the tekdays package from domain.

create the class in the default package of domain

refactor - create a new package called tekdays in domain

move the TekEvent.groovy file into the tekdays package in domain

add import tekdays.* to the bootstrap file.

(clean / compile etc)

Generic-user-small
14 Nov 2010, 16:02
Mark Thristan (2 posts)

I am experiencing the same issue. Using Netbeans as IDE, and am running Grails 1.3.5 (on Snow Leopard). Have tried adding:

import tekdays.TekEvent

at the top of the bootstrap file (and .*) but with no results. Checked location of bootstrap file grails-app/conf/Bootstrap.groovy

Here’s the debugger output from Netbeans:

Listening for transport dt_socket at address: 5005 Welcome to Grails 1.3.5 - http://grails.org/ Licensed under Apache Standard License 2.0 Grails home is set to: /usr/share/grails-1.3.5

Base Directory: /Users/markthristan/TekDays Resolving dependencies… Dependencies resolved in 2302ms. Running script /usr/share/grails-1.3.5/scripts/RunApp.groovy Environment set to development [groovyc] Compiling 1 source file to /Users/markthristan/TekDays/target/classes [groovyc] org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: [groovyc] /Users/markthristan/TekDays/grails-app/conf/BootStrap.groovy: 4: unable to resolve class TekEvent [groovyc] @ line 4, column 22. [groovyc] def event1 = new TekEvent(name: ‘Gateway Code Camp’, [groovyc] ^ [groovyc] [groovyc] /Users/markthristan/TekDays/grails-app/conf/BootStrap.groovy: 17: unable to resolve class TekEvent [groovyc] @ line 17, column 22. [groovyc] def event2 = new TekEvent(name: ‘Perl Before Swine’, [groovyc] ^ [groovyc] [groovyc] 2 errors Compilation error: Compilation Failed

Can anyone help me out?

Thanks….

Dklein_tiny_pragsmall
20 Nov 2010, 11:28
Dave Klein (34 posts)

Hi Mark,

It looks like the import statement is failing. Are you sure that the TekEvent class is in the tekdays package. I haven’t used NetBeans very much so I’m not sure if it does something different with packaging on create-domain-class. You can check to see if you have a grails-app/domain/tekdays/TekEvent.groovy file and check to be sure that file has the package declaration: “package tekdays” at the top. If all that checks out, perhaps you can try running it from the command line. If that fails too, then, if you want, you can zip up your project and send it to me at daveklein@usa.net and I will dig in deeper.

Thanks, Dave

Generic-user-small
23 Nov 2010, 22:04
Mark Thristan (2 posts)

Thanks Dave,

Just to let you know, was experiencing difficulty with running app on 8080 also. Switching to 8090 seemed to resolve both this and the bootstrap import issue.

Regards and thanks for the offer of support,

Mark

You must be logged in to comment