Skip to content
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

Spring Boot 2 projects throw NoSuchMethodException for __resetCache #221

Closed
Artur- opened this issue Dec 19, 2017 · 2 comments
Closed

Spring Boot 2 projects throw NoSuchMethodException for __resetCache #221

Artur- opened this issue Dec 19, 2017 · 2 comments

Comments

@Artur-
Copy link
Contributor

Artur- commented Dec 19, 2017

Seemingly when you make any change to an entity class in a Spring Boot 2.0.0.M7 project, you get

HOTSWAP AGENT: 16:15:01.358 ERROR (org.hotswap.agent.plugin.hibernate.HibernatePlugin) - Error refreshing BeanMetaDataManagerCache/AnnotatedMetaDataProvider cache.
java.lang.NoSuchMethodException: org.hibernate.validator.internal.metadata.provider.AnnotationMetaDataProvider.__resetCache()
	at java.lang.Class.getDeclaredMethod(Class.java:2130)
	at org.hotswap.agent.plugin.hibernate.HibernatePlugin$1.executeCommand(HibernatePlugin.java:84)
	at org.hotswap.agent.command.impl.CommandExecutor.run(CommandExecutor.java:25)

2017-12-19 16:15:01.358  INFO 45220 --- [      Thread-30] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [
	name: default
	...]
@Artur-
Copy link
Contributor Author

Artur- commented Dec 19, 2017

Caused by

HOTSWAP AGENT: 16:28:05.502 ERROR (org.hotswap.agent.annotation.handler.PluginClassFileTransformer) - InvocationTargetException in transform method on plugin 'class org.hotswap.agent.plugin.hibernate.HibernatePlugin' class 'org/hibernate/validator/internal/metadata/provider/AnnotationMetaDataProvider'.
java.lang.reflect.InvocationTargetException
	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.hotswap.agent.annotation.handler.PluginClassFileTransformer.transform(PluginClassFileTransformer.java:193)
	at org.hotswap.agent.annotation.handler.PluginClassFileTransformer.transform(PluginClassFileTransformer.java:89)
	at org.hotswap.agent.util.HotswapTransformer.transform(HotswapTransformer.java:184)
	at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
	at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:428)
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at org.hibernate.validator.internal.metadata.BeanMetaDataManager.<init>(BeanMetaDataManager.java:145)
	at org.hibernate.validator.internal.engine.ValidatorFactoryImpl.lambda$createValidator$0(ValidatorFactoryImpl.java:432)
	at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
	at org.hibernate.validator.internal.engine.ValidatorFactoryImpl.createValidator(ValidatorFactoryImpl.java:423)
	at org.hibernate.validator.internal.engine.ValidatorFactoryImpl.getValidator(ValidatorFactoryImpl.java:315)
	at org.springframework.validation.beanvalidation.LocalValidatorFactoryBean.afterPropertiesSet(LocalValidatorFactoryBean.java:305)
	at org.springframework.boot.context.properties.ValidatedLocalValidatorFactoryBean.<init>(ValidatedLocalValidatorFactoryBean.java:36)
	at org.springframework.boot.context.properties.ConfigurationPropertiesBinderBuilder.determineValidator(ConfigurationPropertiesBinderBuilder.java:150)
	at org.springframework.boot.context.properties.ConfigurationPropertiesBinderBuilder.build(ConfigurationPropertiesBinderBuilder.java:137)
	at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.getBinder(ConfigurationPropertiesBindingPostProcessor.java:196)
	at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.postProcessBeforeInitialization(ConfigurationPropertiesBindingPostProcessor.java:167)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:423)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1702)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:583)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:502)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:312)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:310)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java)
	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:251)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1135)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1062)
	at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:815)
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:721)
	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:470)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1250)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1099)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:502)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:312)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:310)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:516)
	at org.springframework.boot.web.server.WebServerFactoryCustomizerBeanPostProcessor.getWebServerFactoryCustomizerBeans(WebServerFactoryCustomizerBeanPostProcessor.java:126)
	at org.springframework.boot.web.server.WebServerFactoryCustomizerBeanPostProcessor.getCustomizers(WebServerFactoryCustomizerBeanPostProcessor.java:116)
	at org.springframework.boot.web.server.WebServerFactoryCustomizerBeanPostProcessor.postProcessBeforeInitialization(WebServerFactoryCustomizerBeanPostProcessor.java:76)
	at org.springframework.boot.web.server.WebServerFactoryCustomizerBeanPostProcessor.postProcessBeforeInitialization(WebServerFactoryCustomizerBeanPostProcessor.java:64)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:423)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1702)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:583)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:502)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:312)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:310)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:205)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.getWebServerFactory(ServletWebServerApplicationContext.java:212)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:176)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:150)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:138)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:751)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:387)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:327)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1245)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1233)
Caused by: org.hotswap.agent.javassist.CannotCompileException: [source error] no such field: configuredBeans
	at org.hotswap.agent.javassist.CtNewMethod.make(CtNewMethod.java:79)
	at org.hotswap.agent.javassist.CtNewMethod.make(CtNewMethod.java:45)
	at org.hotswap.agent.plugin.hibernate.HibernateTransformers.annotationMetaDataProviderRegisterVariable(HibernateTransformers.java:124)
	... 81 more
Caused by: compile error: no such field: configuredBeans
	at org.hotswap.agent.javassist.compiler.MemberResolver.lookupField(MemberResolver.java:313)
	at org.hotswap.agent.javassist.compiler.MemberResolver.lookupFieldByJvmName(MemberResolver.java:299)
	at org.hotswap.agent.javassist.compiler.TypeChecker.fieldAccess(TypeChecker.java:876)
	at org.hotswap.agent.javassist.compiler.TypeChecker.atFieldRead(TypeChecker.java:803)
	at org.hotswap.agent.javassist.compiler.TypeChecker.atExpr(TypeChecker.java:578)
	at org.hotswap.agent.javassist.compiler.ast.Expr.accept(Expr.java:68)
	at org.hotswap.agent.javassist.compiler.TypeChecker.atCallExpr(TypeChecker.java:665)
	at org.hotswap.agent.javassist.compiler.JvstTypeChecker.atCallExpr(JvstTypeChecker.java:157)
	at org.hotswap.agent.javassist.compiler.ast.CallExpr.accept(CallExpr.java:46)
	at org.hotswap.agent.javassist.compiler.CodeGen.doTypeCheck(CodeGen.java:242)
	at org.hotswap.agent.javassist.compiler.CodeGen.atStmnt(CodeGen.java:330)
	at org.hotswap.agent.javassist.compiler.ast.Stmnt.accept(Stmnt.java:50)
	at org.hotswap.agent.javassist.compiler.CodeGen.atStmnt(CodeGen.java:351)
	at org.hotswap.agent.javassist.compiler.ast.Stmnt.accept(Stmnt.java:50)
	at org.hotswap.agent.javassist.compiler.CodeGen.atMethodBody(CodeGen.java:292)
	at org.hotswap.agent.javassist.compiler.CodeGen.atMethodDecl(CodeGen.java:274)
	at org.hotswap.agent.javassist.compiler.ast.MethodDecl.accept(MethodDecl.java:44)
	at org.hotswap.agent.javassist.compiler.Javac.compileMethod(Javac.java:169)
	at org.hotswap.agent.javassist.compiler.Javac.compile(Javac.java:95)
	at org.hotswap.agent.javassist.CtNewMethod.make(CtNewMethod.java:74)
	... 83 more

HOTSWAP AGENT: 16:28:05.544 INFO (org.hotswap.agent.config.PluginRegistry) - Plugin 'org.hotswap.agent.plugin.hibernate.HibernatePlugin' initialized in ClassLoader 'sun.misc.Launcher$AppClassLoader@18b4aac2'.

@Artur-
Copy link
Contributor Author

Artur- commented Dec 19, 2017

Probably related to hibernate/hibernate-validator@158cae4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant