IllegalArgumentException with Play's auto-reload feature
See original GitHub issueHi guys!
I am working on project based on Play framework. I integrated JOOQ with SimpleFlatMapper.
And there is a problem when auto-reload feature is enabled. Just after application start SimpleFlatMapper is working properly but after any changes to mapper creation chain I am getting this exception:
java.lang.IllegalArgumentException: object is not an instance of declaring class
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.simpleflatmapper.reflect.setter.MethodSetter.set(MethodSetter.java:17)
at org.simpleflatmapper.map.fieldmapper.FieldMapperImpl.mapTo(FieldMapperImpl.java:24)
at org.simpleflatmapper.map.generated.models.AsmMapperFromResultSetToSomeDTOInj8_I7.mapFields(Unknown Source)
at org.simpleflatmapper.map.generated.models.AsmMapperFromResultSetToSomeDTOInj8_I7.mapFields(Unknown Source)
at org.simpleflatmapper.map.mapper.AbstractMapper.map(AbstractMapper.java:27)
at org.simpleflatmapper.map.impl.StaticMapperEnumarable.currentValue(StaticMapperEnumarable.java:30)
After application restart new code starts work correctly.
It happens for example when I add or remove addKeys() call
JdbcMapperFactory.newInstance()
.propertyNameMatcherFactory(DefaultPropertyNameMatcherFactory.DEFAULT)
.addKeys("id")
.newMapper(SomeDTO.class).stream(resultSet).collect(Collectors.toList());
Thank you, Aleksey
Issue Analytics
- State:
- Created 6 years ago
- Comments:14 (9 by maintainers)
Top Results From Across the Web
How to resolve 'autoReload feature is required to use this ...
I get “autoReload feature is required to use this plugin. Start your server with strapi develop” Thing is that I started the server...
Read more >[JENKINS-50728] Illegal Argument Exception rebuilding a job ...
Details ; Type: New Feature ; Priority: Minor ; Resolution: Duplicate ; Component/s: rebuild-plugin.
Read more >How to resolve 'autoReload feature is required ... - DigitalOcean
What I have done to resolve - I set the NODE_ENV environment variable to development via Apps -->Settings --> App-Level Environment Variables ...
Read more >KSYStreamer_Android/KSYStreamer.java at master - GitHub
throw new IllegalArgumentException("Context cannot be null!"); } mContext = context. ... autoRestart();. } ... Get if audio low delay feature enabled.
Read more >Commands for the Snowball Edge Client - AWS Documentation
... App. You can download this app from the Apple App Store or the Google Play store. ... autoInstallFreq ] --auto-reboot autoReboot [--endpoint...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
so was able to reproduce it, and figure out the problem, the asm factory failed to generated the asm setter because for some reason - my own stupidity - it try to generate a primitive setter for Integer. so then we have a mix of asm for instantiation and reflection for setter. The asm generation handles the class change with no problem but the reflection points to a method of the previous version.
If you disable asm then you have reflection all the way through so the v1 class is generated. I fixed the asm setter generation so we can have asm all the way too, which work as well - that explains why I could not reproduce the problem with String too.
I don’t know if I’ll be able to release in the next 2 days, might be later this week.
Looks like it’s working correctly now Thank you for the fix and for the explanation about grouping