Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grails 2.4.4 unable to create codecLookup bean

I'm upgrading a 2.3 app to 2.4.4 and I'm getting a weird error at startup:

Caused by BeanCreationException: Error creating bean with name 'codecLookup': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: [Assertion failed] - this String argument must have text; it must not be null, empty, or blank
->>  788 | callContextInitialized in org.eclipse.jetty.server.handler.ContextHandler

Has anyone seen this before or can give me any pointers as to what may be causing it?


1 Answers

I got to the bottom of this. I had an abstract base codec defined in grails-app/utils along with a couple of sub classes i.e

grails-app/utils/
                BaseCodec.groovy
                MyCodec.groovy

abstract class BaseCodec {
...
}

class MyCodec extends BaseCodec {
...
}

In 2.3+ this worked however in 2.4 grails doesn't like the abstract class in utils so I moved it to src/groovy:

src/groovy/BaseCodec.groovy
grails-app/utils/MyCodec.groovy

This resolved the error. I would expect that from now all abstract 'grails managed' classes (codecs, services, domains etc) should probably go in src/groovy


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!