gorm


Method on class [] was used outside of a Grails application. If running in the context of a test using the mocking API or bootstrap Grails Correctly


PROBLEM
I know there is already a question in regards to this but I think that the issue that causes might be different based on what they are saying. I have the following setup:
grails version: 2.3.4
Hibernate plugin: runtime ":hibernate:3.6.10.6"
My Bootstrap is empty
My Controller and Service tests are commented
This grails application has multiple data sources (I am not sure if this fact has anything to do with it) and it occurs after a call against a Domain object from the second datasource which has been reversed engineered with the grails reverse engineer plugin (have done that on a separate project and then imported to my project.
This is the GORM call that causes the problem from both the Controller and the Service layers
def campusAttributes = CampusAttribute.findAllByNameLike("%Next Option%")
I have found some other complains about this and it seems to be an issue with Maven and the grails hibernate plugin version but in that scenario the issue was very particular to grails 2.3.1 and a specific hibernate plugin version.
All I did was a grails run-app (did not build the app with maven neither have any mocking)
Thanks in advance
I had the same problem upgrading a grails project from 2.2.4 to 2.3.6. I've upgraded the hibernate plugin from 3.6.10 to 3.6.10.8 and the error was gone.
I add the same error after upgrading from grails 2.3.0 to 2.3.5.
What solved it in my case was to modify plugin dependencies in BuildConfig.groovy, for hibernate and tomcat to set to required level for 2.3.5 :
* new tomcat : build ':tomcat:7.0.50' (old :build ":tomcat:7.0.42).
* new Hibernate : runtime ':hibernate:3.6.10.7' (old : runtime ":hibernate:3.6.10.1").
I have the same problem when I had moved a Domain class's package For example it was originally
com.a.DomainClass
but I moved it to
com.b.DomainClass
And I had not cleaned the project

Related Links

Grails 3 (unsaved) instance issue while fetching from database (GORM)
Can't use get() in domain using Grails3
GORM findAll + cannot pass dynamic List as named parameter
How to display database records in grails
Configure Grails 3.0.9 for Oracle 12c with identity PK?
Adding condition to findAll and findAllBy methods
Neo4j and Mongodb as datasource in Grails
GORM (varchar .save(), non DATE): ORA-01861: literal does not match format string
GORM addTo methods not found in Spock test
spring-boot property exception while externalizing datasource properties and using actuator
Mapping hasMany relation and saving the related data
Method on class [] was used outside of a Grails application. If running in the context of a test using the mocking API or bootstrap Grails Correctly
What happens when two app servers in cluster start LiquiBase update (via Grails)?
use of mappedBy in Many to Many relationship in Grails
Domain class auto validation in grails
Grails Detached Criteria Query and “group by” and “having” clause

Categories

HOME
pandas
winforms
wso2
cvs
tizen-web-app
rdf
twitter-bootstrap-4
google-project-tango
windows-server
enterprise-library-5
onelogin
constraint-programming
wheelnav.js
fortumo
flask-wtforms
dynamics-crm-online
aurigma
invantive-sql
reactcsstransitiongroup
django-cms
web-sql
captiveportal
buildbot
poltergeist
user-interaction
internet-explorer-9
bootstrap-material-design
uninstall
nhapi
spring-mybatis
publish
gsmcomm
azure-sql-database
language-concepts
overriding
io-redirection
retina-display
vao
unixodbc
netcdf4
outlook-2013
theming
datastax-startup
domain-model
brightcove
darcs
directory-structure
crypt
android-cursor
jspdf-autotable
lync-client-sdk
time-and-attendance
heidisql
slicknav
url-masking
underscore.js-templating
plottable.js
player
websitepanel
connect-by
superstack
pagerank
design-by-contract
independentsoft
iad
ora-00900
fouc
libressl
php-ci
ios9.1
composite
camanjs
project-planning
android-radiobutton
eol
expected-exception
centos5
ftps
qt-faststart
padarn
ember-app-kit
factory-method
free-variable
anonymous-methods
regsvr32
postgresql-performance
dotnethighcharts
jquery-ui-layout
netdna-api
gwt-ext
pyinotify
floating
dentrix
jquery-ui-droppable
nsviewanimation
privilege
paul-graham

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App