-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IllegalArgumentException after reloading classes. #36
Comments
Aha! thanks for pointing this out. |
I think the reason for this is simply because two different classloaders/classes are involved (one for the old version of the class, one for the new version). |
Fixed. We had a class cache somewhere which was not emptied on hot reload. |
* org_elastic/master: (28 commits) 0.4 release Add MapperTransformer Use AbstractFieldMapper#getFieldValue() Some refactoring; Mapper prefix folded into AbstractFieldMapper feliperazeek#32 Added a transformer which uses a mapper Make sure the user has not requested unknown fields Minor restructuring Made AFM#addField() non-static so we can access meta directly Log json for index operation Fix for feliperazeek#36 (Class references not cleaned up on hot reload) Fix for feliperazeek#38 (@onetomany causes "Type not allowed" exception) Fix for feliperazeek#34 (cannot parse indexed date on record retrieval) Upgrade to ES 0.18.5 Fix for feliperazeek#37 (do not index @transient fields) Fixed elasticSearch tag path (fixes bug in _at least_ 1.2.4-RC3) Fixed route indentation to make file more readable Add support for Float conversion to ReflectionUtil Releasing 0.3 setQuery(QueryBuilder) is available from es-0.17.0 (See ES issue 994) Log type mapping ... Conflicts: conf/routes
After "hot reloading" classes of play application (e.g. changing source code while application is running) elasticsearch fails.
It happens when you just want to make a simple query. BUT, if you run application/test without code changes (even several times one after another), elastic search works well.
java.lang.IllegalArgumentException: Can not set java.util.List field models.Article.editions to models.Article
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:146)
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:150)
at sun.reflect.UnsafeFieldAccessorImpl.ensureObj(UnsafeFieldAccessorImpl.java:37)
at sun.reflect.UnsafeObjectFieldAccessorImpl.get(UnsafeObjectFieldAccessorImpl.java:18)
at java.lang.reflect.Field.get(Field.java:358)
at play.modules.elasticsearch.util.ReflectionUtil.getFieldValue(ReflectionUtil.java:115)
at play.modules.elasticsearch.mapping.impl.CollectionFieldMapper.addToDocument(CollectionFieldMapper.java:77)
at play.modules.elasticsearch.mapping.impl.PlayModelMapper.addModel(PlayModelMapper.java:130)
at play.modules.elasticsearch.mapping.impl.PlayModelMapper.addModel(PlayModelMapper.java:26)
at play.modules.elasticsearch.adapter.ElasticSearchAdapter.indexModel(ElasticSearchAdapter.java:147)
at play.modules.elasticsearch.ElasticSearchIndexAction.invoke(ElasticSearchIndexAction.java:53)
at play.modules.elasticsearch.ElasticSearchIndexer.doJob(ElasticSearchIndexer.java:54)
at play.jobs.Job.doJobWithResult(Job.java:50)
at play.jobs.Job.call(Job.java:146)
at play.jobs.Job$1.call(Job.java:66)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
The text was updated successfully, but these errors were encountered: