spring-loaded icon indicating copy to clipboard operation
spring-loaded copied to clipboard

IllegalArgumentException in SpringPlugin with 1.2.1.BUILD-SNAPSHOT

Open zyro23 opened this issue 10 years ago • 10 comments

seeing stacktraces like the onw below (currently with springloaded-1.2.1.BUILD-20140606.193800-13):

java.lang.IllegalArgumentException: Can not set final java.util.Map field org.springframework.core.LocalVariableTableParameterNameDiscoverer.parameterNamesCache to org.springframework.core.LocalVariableTableParameterNameDiscoverer
    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.UnsafeQualifiedObjectFieldAccessorImpl.get(UnsafeQualifiedObjectFieldAccessorImpl.java:20)
    at java.lang.reflect.Field.get(Field.java:358)
    at org.springsource.loaded.agent.SpringPlugin.clearLocalVariableTableParameterNameDiscovererCache(SpringPlugin.java:177)
    at org.springsource.loaded.agent.SpringPlugin.reloadEvent(SpringPlugin.java:152)
    at org.springsource.loaded.TypeRegistry.fireReloadEvent(TypeRegistry.java:1794)
    at org.springsource.loaded.ReloadableType.loadNewVersion(ReloadableType.java:417)
    at org.springsource.loaded.TypeRegistry.loadNewVersion(TypeRegistry.java:845)
    at org.springsource.loaded.agent.ReloadableFileChangeListener.fileChanged(ReloadableFileChangeListener.java:51)
    at org.springsource.loaded.agent.Watcher.determineChangesSince(FileSystemWatcher.java:235)
    at org.springsource.loaded.agent.Watcher.run(FileSystemWatcher.java:219)
    at java.lang.Thread.run(Thread.java:662)

thanks, zyro

zyro23 avatar Jul 09 '14 14:07 zyro23

Hitting this too with springloaded-1.2.1.RELEASE

Hartimer avatar Oct 30 '14 21:10 Hartimer

I encountered the same issue too. Manage to resolve that by using older version: springloaded-1.1.5.BUILD-20140219.195134-2.jar. Hope this help!!

jiajiunnwong avatar Nov 06 '14 20:11 jiajiunnwong

For those of you wondering how to apply @jiajiunnwong's suggestion to a Grails project, just set GRAILS_OPTS environment variable so that it overrides the version of springloaded as follows.

GRAILS_OPTS="-javaagent:/path/to/springloaded-1.1.5.RELEASE.jar" grails -reloading -https run-app

On a side note, I still don't understand why this exception gets thrown in the first place.

radarsh avatar Dec 19 '14 17:12 radarsh

I also observe this bug with springloaded 1.2.3.RELEASE. Will it be fixed?

akhikhl avatar May 17 '15 13:05 akhikhl

still got the issue with springloaded-1.2.4.RELEASE

clouddistortion avatar Oct 07 '15 16:10 clouddistortion

I put in a guard to catch this and the exception is simply logged. Whether it is a real issue or 'harmless' would be determined by checking if your request mappings are being reloaded properly. if it isn't working having a simple test case that shows the problem would be really helpful. Initially just knowing the version of Spring would help as the Spring plugin may just be out of step with the version in use here. If you are happy with jumping back to an old version of spring loaded then I guess this is harmless for you since that old version won't be tidying up the request mapping state either.

aclement avatar Oct 07 '15 22:10 aclement

Hi, I have the same problem with spring version 4.1.4.RELEASE and both with springloaded-1.2.3.RELEASE, and springloaded-1.2.4.RELEASE

DavidGangel avatar Oct 16 '15 15:10 DavidGangel

+1

I am also getting this error with the latest springloaded 1.24

tzvetkovg avatar Oct 30 '15 10:10 tzvetkovg

+1 me too for spring-loaded 1.2.4

tombueng avatar Dec 01 '15 12:12 tombueng

With ver. 1.2.5.RELEASE, same problem with a different error log, and the changed class is still unusable:

Feb 05, 2016 11:34:12 AM org.springsource.loaded.agent.SpringPlugin clearLocalVariableTableParameterNameDiscovererCache
SEVERE: Unexpected IllegalArgumentException trying to access parameterNamesCache field on LocalVariableTableParameterNameDiscoverer class

sunildmonte avatar Feb 05 '16 06:02 sunildmonte