Another variant of the BeanCreationException

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Another variant of the BeanCreationException

M Stewart
Hello,

Just getting started with Grails and, for the most part, enjoying it. Recently I made some substantial changes to one of my domain classes and figured it would easier to regenerate the views than edit them by hand. So I deleted the view's directory for the domain class and tried running 'grails generate-views.'  I've included the stack trace below. I've had a few other problems but have been able to puzzle them out on my own. This one doesn't seem to give me any useful clues. (I'm not familiar with Spring.) Anyone have an idea what I've got wrong?

Exception output:

     [java] [Game] is a domain class.
     [java] Destroying singletons in factory {org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [grailsApplication,grailsResourceHolder,characterEncodingFilter]; root of BeanFactory hierarchy}
     [java] Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'grailsApplication' defined in class path resource [applicationContext.xml]: Initialization of bean failed; nested exception is java.lang.ArrayIndexOutOfBoundsException: Negative array index [-9] too large for array size 1
     [java] java.lang.ArrayIndexOutOfBoundsException: Negative array index [-9] too large for array size 1
     [java] at org.codehaus.groovy.runtime.DefaultGroovyMethods.normaliseIndex(DefaultGroovyMethods.java:2126)
     [java] at org.codehaus.groovy.runtime.DefaultGroovyMethods.getAt(DefaultGroovyMethods.java:1939)
Reply | Threaded
Open this post in threaded view
|

Re: Another variant of the BeanCreationException

graemer
Can you post the full stack trace in a JIRA issue, the problem is
further down...

Thanks
Graeme

On 6/24/06, M Stewart <[hidden email]> wrote:

>
> Hello,
>
> Just getting started with Grails and, for the most part, enjoying it.
> Recently I made some substantial changes to one of my domain classes and
> figured it would easier to regenerate the views than edit them by hand. So I
> deleted the view's directory for the domain class and tried running 'grails
> generate-views.'  I've included the stack trace below. I've had a few other
> problems but have been able to puzzle them out on my own. This one doesn't
> seem to give me any useful clues. (I'm not familiar with Spring.) Anyone
> have an idea what I've got wrong?
>
> Exception output:
>
>      [java] [Game] is a domain class.
>      [java] Destroying singletons in factory
> {org.springframework.beans.factory.support.DefaultListableBeanFactory
> defining beans
> [grailsApplication,grailsResourceHolder,characterEncodingFilter]; root of
> BeanFactory hierarchy}
>      [java] Exception in thread "main"
> org.springframework.beans.factory.BeanCreationException: Error creating bean
> with name 'grailsApplication' defined in class path resource
> [applicationContext.xml]: Initialization of bean failed; nested exception is
> java.lang.ArrayIndexOutOfBoundsException: Negative array index [-9] too
> large for array size 1
>      [java] java.lang.ArrayIndexOutOfBoundsException: Negative array index
> [-9] too large for array size 1
>      [java]     at
> org.codehaus.groovy.runtime.DefaultGroovyMethods.normaliseIndex(DefaultGroovyMethods.java:2126)
>      [java]     at
> org.codehaus.groovy.runtime.DefaultGroovyMethods.getAt(DefaultGroovyMethods.java:1939)
> --
> View this message in context: http://www.nabble.com/Another-variant-of-the-BeanCreationException-t1838980.html#a5020468
> Sent from the grails - user forum at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: Another variant of the BeanCreationException

M Stewart
graemer wrote
Can you post the full stack trace in a JIRA issue, the problem is
further down...
Ah. I looked further down and noticed a line about constraints. Sure enough I checked the constraints closure for the domain class and discovered a 'matches' that wasn't quoting the regex:

yearOfRelease(matches:[1-3][0-9][0-9][0-9] )

instead of

yearOfRelease(matches:"[1-3][0-9][0-9][0-9]" )

Doh. Sorry. I'm pretty spoiled by Eclipse picking up syntactical errors (the Groovy plugin is pretty erratic at this point; it works on some .groovy files but not others.) If I were to file an issue I guess it might be that Grails try to do more to express the cause of failures in cases like this. That's a small gripe at this stage though.

Thanks very much for the quick response.