Nashorn exception when using HibernateValidator's ScriptAssert on Java8 - java-8

We are in the process of switching from Java 7 to Java 8 ( about time I think :-)) and we are getting issues where we used HibernateValidator's ScriptAssert. Looks like Nashorn Javascript engine is not initialized properly
The ScriptAssert is used as follows
#ScriptAssert(
lang = "javascript",
script = "_this.owner != null && _this.owner.id != null"
+ " && _this.owner.id.matches('^[0-9A-F]{8}-[0-9A-F]{4}-[1-5][0-9A-
F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$')"
)
What we are getting is an exception like below, This happens on JDK1.8.0_131 on Linux.
Any help would be appreciated. Following is the stack trace.
java.lang.NoSuchMethodError:
java.lang.invoke.MethodHandle.invokeExact(Ljava/lang/Object;Ljava/lang/Object;)V
at jdk.nashorn.internal.runtime.AccessorProperty.invokeSetter(AccessorProperty.java:462)
~[nashorn.jar:?]
at jdk.nashorn.internal.runtime.AccessorProperty.setValue(AccessorProperty.java:485)
~[nashorn.jar:?]
at jdk.nashorn.internal.runtime.ScriptObject.erasePropertyValue(ScriptObject.java:916)
~[nashorn.jar:?]
at jdk.nashorn.internal.runtime.ScriptObject.deleteOwnProperty(ScriptObject.java:928)
~[nashorn.jar:?]
at jdk.nashorn.internal.runtime.ScriptFunction.createBuiltin(ScriptFunction.java:324)
~[nashorn.jar:?]
at jdk.nashorn.internal.runtime.ScriptFunction.createBuiltin(ScriptFunction.java:339)
~[nashorn.jar:?]
at jdk.nashorn.internal.runtime.ScriptFunction.createBuiltin(ScriptFunction.java:350)
~[nashorn.jar:?]
at jdk.nashorn.internal.objects.NativeFunction$Prototype.(Unknown
Source) ~[nashorn.jar:?]
at jdk.nashorn.internal.objects.NativeFunction$Constructor.(Unknown
Source) ~[nashorn.jar:?]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
~[?:1.8.0_131]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
~[?:1.8.0_131]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
~[?:1.8.0_131]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
~[?:1.8.0_131]
at java.lang.Class.newInstance(Class.java:442) ~[?:1.8.0_131]
at jdk.nashorn.internal.objects.Global.initConstructor(Global.java:2549)
~[nashorn.jar:?]
at jdk.nashorn.internal.objects.Global.initFunctionAndObject(Global.java:2618)
~[nashorn.jar:?]
at jdk.nashorn.internal.objects.Global.init(Global.java:2257) ~[nashorn.jar:?]
at jdk.nashorn.internal.objects.Global.initBuiltinObjects(Global.java:1094)
~[nashorn.jar:?]
at jdk.nashorn.internal.runtime.Context.initGlobal(Context.java:1150)
~[nashorn.jar:?]
at jdk.nashorn.api.scripting.NashornScriptEngine.createNashornGlobal(NashornScriptEngine.java:360)
~[nashorn.jar:?]
at jdk.nashorn.api.scripting.NashornScriptEngine.(NashornScriptEngine.java:143)
~[nashorn.jar:?]
at jdk.nashorn.api.scripting.NashornScriptEngineFactory.getScriptEngine(NashornScriptEngineFactory.java:148)
~[nashorn.jar:?]
at javax.script.ScriptEngineManager.getEngineByName(ScriptEngineManager.java:238)
~[?:1.8.0_131]
at org.hibernate.validator.internal.util.scriptengine.ScriptEvaluatorFactory.createNewScriptEvaluator(ScriptEvaluatorFactory.java:87)
~[hibernate-validator-5.4.1.Final.jar:5.4.1.Final]
at org.hibernate.validator.internal.util.scriptengine.ScriptEvaluatorFactory.getScriptEvaluatorByLanguageName(ScriptEvaluatorFactory.java:70)
~[hibernate-validator-5.4.1.Final.jar:5.4.1.Final]
at org.hibernate.validator.internal.constraintvalidators.hv.ScriptAssertContext.getScriptEvaluator(ScriptAssertContext.java:60)
~[hibernate-validator-5.4.1.Final.jar:5.4.1.Final]
at org.hibernate.validator.internal.constraintvalidators.hv.ScriptAssertContext.(ScriptAssertContext.java:34)
~[hibernate-validator-5.4.1.Final.jar:5.4.1.Final]
at org.hibernate.validator.internal.constraintvalidators.hv.ScriptAssertValidator.initialize(ScriptAssertValidator.java:43)
~[hibernate-validator-5.4.1.Final.jar:5.4.1.Final]
at org.hibernate.validator.internal.constraintvalidators.hv.ScriptAssertValidator.initialize(ScriptAssertValidator.java:28)
~[hibernate-validator-5.4.1.Final.jar:5.4.1.Final]
at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintValidatorManager.initializeValidator(ConstraintValidatorManager.java:225)
~[hibernate-validator-5.4.1.Final.jar:5.4.1.Final]
at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintValidatorManager.createAndInitializeValidator(ConstraintValidatorManager.java:151)
~[hibernate-validator-5.4.1.Final.jar:5.4.1.Final]
at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintValidatorManager.getInitializedValidator(ConstraintValidatorManager.java:109)
~[hibernate-validator-5.4.1.Final.jar:5.4.1.Final]
at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.getConstraintValidatorNoUnwrapping(ConstraintTree.java:301)
~[hibernate-validator-5.4.1.Final.jar:5.4.1.Final]
at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.getConstraintValidatorInstanceForAutomaticUnwrapping(ConstraintTree.java:242)
~[hibernate-validator-5.4.1.Final.jar:5.4.1.Final]
at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.getInitializedConstraintValidator(ConstraintTree.java:163)
~[hibernate-validator-5.4.1.Final.jar:5.4.1.Final]
at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateConstraints(ConstraintTree.java:116)
~[hibernate-validator-5.4.1.Final.jar:5.4.1.Final]
at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateConstraints(ConstraintTree.java:87)
~[hibernate-validator-5.4.1.Final.jar:5.4.1.Final]
at org.hibernate.validator.internal.metadata.core.MetaConstraint.validateConstraint(MetaConstraint.java:73)
~[hibernate-validator-5.4.1.Final.jar:5.4.1.Final]
at org.hibernate.validator.internal.engine.ValidatorImpl.validateMetaConstraint(ValidatorImpl.java:616)
~[hibernate-validator-5.4.1.Final.jar:5.4.1.Final]
at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:581)
~[hibernate-validator-5.4.1.Final.jar:5.4.1.Final]
at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForNonDefaultGroup(ValidatorImpl.java:543)
~[hibernate-validator-5.4.1.Final.jar:5.4.1.Final]
at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:457)
~[hibernate-validator-5.4.1.Final.jar:5.4.1.Final]
at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:410)
~[hibernate-validator-5.4.1.Final.jar:5.4.1.Final]
at org.hibernate.validator.internal.engine.ValidatorImpl.validate(ValidatorImpl.java:207)
~[hibernate-validator-5.4.1.Final.jar:5.4.1.Final]
at org.springframework.validation.beanvalidation.SpringValidatorAdapter.validate(SpringValidatorAdapter.java:108)
~[spring-context-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.validation.DataBinder.validate(DataBinder.java:781)
~[spring-context-4.1.6.RELEASE.jar:4.1.6.RELEASE]

Related

Upgrade Spring Web MVC 4.1.6.RELEASE to 5.2.21.RELEASE -> NoClassDefFoundError: .../web/servlet/mvc/annotation/AnnotationMethodHandlerAdapter

I am upgrading my Spring project 4.1.6 to 5.2.21. But now when I run my Tomcat 8.5.65 I catch this message error:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'configPersistence': Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/web/servlet/mvc/annotation/AnnotationMethodHandlerAdapter
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:602) ~[spring-beans-5.2.21.RELEASE.jar:5.2.21.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) ~[spring-beans-5.2.21.RELEASE.jar:5.2.21.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) ~[spring-beans-5.2.21.RELEASE.jar:5.2.21.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.2.21.RELEASE.jar:5.2.21.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) ~[spring-beans-5.2.21.RELEASE.jar:5.2.21.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.21.RELEASE.jar:5.2.21.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:409) ~[spring-beans-5.2.21.RELEASE.jar:5.2.21.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1341) ~[spring-beans-5.2.21.RELEASE.jar:5.2.21.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1181) ~[spring-beans-5.2.21.RELEASE.jar:5.2.21.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:556) ~[spring-beans-5.2.21.RELEASE.jar:5.2.21.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) ~[spring-beans-5.2.21.RELEASE.jar:5.2.21.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) ~[spring-beans-5.2.21.RELEASE.jar:5.2.21.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.2.21.RELEASE.jar:5.2.21.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) ~[spring-beans-5.2.21.RELEASE.jar:5.2.21.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.21.RELEASE.jar:5.2.21.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1109) ~[spring-context-5.2.21.RELEASE.jar:5.2.21.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:869) ~[spring-context-5.2.21.RELEASE.jar:5.2.21.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551) ~[spring-context-5.2.21.RELEASE.jar:5.2.21.RELEASE]
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:401) ~[spring-web-5.2.21.RELEASE.jar:5.2.21.RELEASE]
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:292) ~[spring-web-5.2.21.RELEASE.jar:5.2.21.RELEASE]
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:103) ~[spring-web-5.2.21.RELEASE.jar:5.2.21.RELEASE]
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4703) ~[catalina.jar:8.5.65]
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5168) ~[catalina.jar:8.5.65]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[catalina.jar:8.5.65]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:743) ~[catalina.jar:8.5.65]
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719) ~[catalina.jar:8.5.65]
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:705) ~[catalina.jar:8.5.65]
at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1767) ~[catalina.jar:8.5.65]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_301]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_301]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_301]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_301]
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:286) ~[tomcat-coyote.jar:8.5.65]
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) ~[?:1.8.0_301]
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) ~[?:1.8.0_301]
at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:483) ~[catalina.jar:8.5.65]
at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:431) ~[catalina.jar:8.5.65]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_301]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_301]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_301]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_301]
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:286) ~[tomcat-coyote.jar:8.5.65]
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) ~[?:1.8.0_301]
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) ~[?:1.8.0_301]
at com.sun.jmx.remote.security.MBeanServerAccessController.invoke(MBeanServerAccessController.java:468) ~[?:1.8.0_301]
at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468) ~[?:1.8.0_301]
at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76) ~[?:1.8.0_301]
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309) ~[?:1.8.0_301]
at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_301]
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1408) ~[?:1.8.0_301]
at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829) ~[?:1.8.0_301]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_301]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_301]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_301]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_301]
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357) ~[?:1.8.0_301]
at sun.rmi.transport.Transport$1.run(Transport.java:200) ~[?:1.8.0_301]
at sun.rmi.transport.Transport$1.run(Transport.java:197) ~[?:1.8.0_301]
at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_301]
at sun.rmi.transport.Transport.serviceCall(Transport.java:196) ~[?:1.8.0_301]
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573) ~[?:1.8.0_301]
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:834) ~[?:1.8.0_301]
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688) ~[?:1.8.0_301]
at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_301]
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687) [?:1.8.0_301]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_301]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_301]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_301]
Caused by: java.lang.NoClassDefFoundError: org/springframework/web/servlet/mvc/annotation/AnnotationMethodHandlerAdapter
at org.springframework.hateoas.config.HypermediaSupportBeanDefinitionRegistrar$Jackson2ModuleRegisteringBeanPostProcessor.postProcessBeforeInitialization(HypermediaSupportBeanDefinitionRegistrar.java:244) ~[spring-hateoas-0.17.0.RELEASE.jar:?]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:415) ~[spring-beans-5.2.21.RELEASE.jar:5.2.21.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1791) ~[spring-beans-5.2.21.RELEASE.jar:5.2.21.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594) ~[spring-beans-5.2.21.RELEASE.jar:5.2.21.RELEASE]
... 67 more
Caused by: java.lang.ClassNotFoundException: org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1372) ~[catalina.jar:8.5.65]
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1195) ~[catalina.jar:8.5.65]
at org.springframework.hateoas.config.HypermediaSupportBeanDefinitionRegistrar$Jackson2ModuleRegisteringBeanPostProcessor.postProcessBeforeInitialization(HypermediaSupportBeanDefinitionRegistrar.java:244) ~[spring-hateoas-0.17.0.RELEASE.jar:?]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:415) ~[spring-beans-5.2.21.RELEASE.jar:5.2.21.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1791) ~[spring-beans-5.2.21.RELEASE.jar:5.2.21.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594) ~[spring-beans-5.2.21.RELEASE.jar:5.2.21.RELEASE]
... 67 more
Any ideas?
Thanks in advance!
The version of the hateoas you are using is: hateoas-0.17.0.RELEASE
Most probably upgrading Spring HATEOAS dependency should resolve your issue.
<dependency>
<groupId>org.springframework.hateoas</groupId>
<artifactId>spring-hateoas</artifactId>
<version>1.1.0.RELEASE</version>
</dependency>
Ref - https://github.com/springfox/springfox/issues/2303
FYI
If possible upgrade your spring version to 5.3.x and hateoas accordingly
5.3.x is the final feature branch of the 5th generation and the latest production line (GA as of October 2020), with long-term support
provided on JDK 8, JDK 11, JDK 17.
5.2.x is the previous production line (GA as of September 2019), to be actively supported until the end of 2021.
JDK Version Range
Spring Framework 6.0.x: JDK 17-21 (expected)
Spring Framework 5.3.x: JDK 8-19 (expected)
Spring Framework 5.2.x: JDK 8-15

Unable to start embedded Tomcat Caused by: java.lang.ClassNotFoundException: org.codehaus.stax2.XMLInputFactory2

I am new to microservices & trying to create eureka netflix naming server.Added all dependency whihc are required but still receiving an error saying unable to start embeded tomcat server due to no class def found for org.codehaus.stax2.XMLInputFactory2.
Error :
org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:163) ~[spring-boot-2.6.1.jar:2.6.1]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:577) ~[spring-context-5.3.13.jar:5.3.13]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.6.1.jar:2.6.1]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:730) [spring-boot-2.6.1.jar:2.6.1]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:412) [spring-boot-2.6.1.jar:2.6.1]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:302) [spring-boot-2.6.1.jar:2.6.1]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301) [spring-boot-2.6.1.jar:2.6.1]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1290) [spring-boot-2.6.1.jar:2.6.1]
at com.pavan.microservices.namingserver.NamingServerApplication.main(NamingServerApplication.java:12) [classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_73]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_73]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_73]
at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_73]
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [spring-boot-devtools-2.6.1.jar:2.6.1]
Caused by: org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:142) ~[spring-boot-2.6.1.jar:2.6.1]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.<init>(TomcatWebServer.java:104) ~[spring-boot-2.6.1.jar:2.6.1]
at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getTomcatWebServer(TomcatServletWebServerFactory.java:473) ~[spring-boot-2.6.1.jar:2.6.1]
at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:206) ~[spring-boot-2.6.1.jar:2.6.1]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:182) ~[spring-boot-2.6.1.jar:2.6.1]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:160) ~[spring-boot-2.6.1.jar:2.6.1]
... 13 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'formContentFilter' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.web.servlet.filter.OrderedFormContentFilter]: Factory method 'formContentFilter' threw exception; nested exception is java.lang.NoClassDefFoundError: org/codehaus/stax2/XMLInputFactory2
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658) ~[spring-beans-5.3.13.jar:5.3.13]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:486) ~[spring-beans-5.3.13.jar:5.3.13]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352) ~[spring-beans-5.3.13.jar:5.3.13]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195) ~[spring-beans-5.3.13.jar:5.3.13]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) ~[spring-beans-5.3.13.jar:5.3.13]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.13.jar:5.3.13]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.13.jar:5.3.13]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.13.jar:5.3.13]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.13.jar:5.3.13]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:213) ~[spring-beans-5.3.13.jar:5.3.13]
at org.springframework.boot.web.servlet.ServletContextInitializerBeans.getOrderedBeansOfType(ServletContextInitializerBeans.java:212) ~[spring-boot-2.6.1.jar:2.6.1]
at org.springframework.boot.web.servlet.ServletContextInitializerBeans.addAsRegistrationBean(ServletContextInitializerBeans.java:175) ~[spring-boot-2.6.1.jar:2.6.1]
at org.springframework.boot.web.servlet.ServletContextInitializerBeans.addAsRegistrationBean(ServletContextInitializerBeans.java:170) ~[spring-boot-2.6.1.jar:2.6.1]
at org.springframework.boot.web.servlet.ServletContextInitializerBeans.addAdaptableBeans(ServletContextInitializerBeans.java:155) ~[spring-boot-2.6.1.jar:2.6.1]
at org.springframework.boot.web.servlet.ServletContextInitializerBeans.<init>(ServletContextInitializerBeans.java:87) ~[spring-boot-2.6.1.jar:2.6.1]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.getServletContextInitializerBeans(ServletWebServerApplicationContext.java:260) ~[spring-boot-2.6.1.jar:2.6.1]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.selfInitialize(ServletWebServerApplicationContext.java:234) ~[spring-boot-2.6.1.jar:2.6.1]
at org.springframework.boot.web.embedded.tomcat.TomcatStarter.onStartup(TomcatStarter.java:53) ~[spring-boot-2.6.1.jar:2.6.1]
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5219) ~[tomcat-embed-core-9.0.55.jar:9.0.55]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[tomcat-embed-core-9.0.55.jar:9.0.55]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396) ~[tomcat-embed-core-9.0.55.jar:9.0.55]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386) ~[tomcat-embed-core-9.0.55.jar:9.0.55]
at java.util.concurrent.FutureTask.run(Unknown Source) ~[na:1.8.0_73]
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) ~[tomcat-embed-core-9.0.55.jar:9.0.55]
at java.util.concurrent.AbstractExecutorService.submit(Unknown Source) ~[na:1.8.0_73]
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919) ~[tomcat-embed-core-9.0.55.jar:9.0.55]
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:835) ~[tomcat-embed-core-9.0.55.jar:9.0.55]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[tomcat-embed-core-9.0.55.jar:9.0.55]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396) ~[tomcat-embed-core-9.0.55.jar:9.0.55]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386) ~[tomcat-embed-core-9.0.55.jar:9.0.55]
at java.util.concurrent.FutureTask.run(Unknown Source) ~[na:1.8.0_73]
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) ~[tomcat-embed-core-9.0.55.jar:9.0.55]
at java.util.concurrent.AbstractExecutorService.submit(Unknown Source) ~[na:1.8.0_73]
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919) ~[tomcat-embed-core-9.0.55.jar:9.0.55]
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:263) ~[tomcat-embed-core-9.0.55.jar:9.0.55]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[tomcat-embed-core-9.0.55.jar:9.0.55]
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:432) ~[tomcat-embed-core-9.0.55.jar:9.0.55]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[tomcat-embed-core-9.0.55.jar:9.0.55]
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:927) ~[tomcat-embed-core-9.0.55.jar:9.0.55]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[tomcat-embed-core-9.0.55.jar:9.0.55]
at org.apache.catalina.startup.Tomcat.start(Tomcat.java:486) ~[tomcat-embed-core-9.0.55.jar:9.0.55]
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:123) ~[spring-boot-2.6.1.jar:2.6.1]
... 18 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.web.servlet.filter.OrderedFormContentFilter]: Factory method 'formContentFilter' threw exception; nested exception is java.lang.NoClassDefFoundError: org/codehaus/stax2/XMLInputFactory2
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.3.13.jar:5.3.13]
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653) ~[spring-beans-5.3.13.jar:5.3.13]
... 59 common frames omitted
Caused by: java.lang.NoClassDefFoundError: org/codehaus/stax2/XMLInputFactory2
at java.lang.ClassLoader.defineClass1(Native Method) ~[na:1.8.0_73]
at java.lang.ClassLoader.defineClass(Unknown Source) ~[na:1.8.0_73]
at java.security.SecureClassLoader.defineClass(Unknown Source) ~[na:1.8.0_73]
at java.net.URLClassLoader.defineClass(Unknown Source) ~[na:1.8.0_73]
at java.net.URLClassLoader.access$100(Unknown Source) ~[na:1.8.0_73]
at java.net.URLClassLoader$1.run(Unknown Source) ~[na:1.8.0_73]
at java.net.URLClassLoader$1.run(Unknown Source) ~[na:1.8.0_73]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_73]
at java.net.URLClassLoader.findClass(Unknown Source) ~[na:1.8.0_73]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[na:1.8.0_73]
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) ~[na:1.8.0_73]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[na:1.8.0_73]
at java.lang.Class.forName0(Native Method) ~[na:1.8.0_73]
at java.lang.Class.forName(Unknown Source) ~[na:1.8.0_73]
at org.springframework.boot.devtools.restart.classloader.RestartClassLoader.loadClass(RestartClassLoader.java:145) ~[spring-boot-devtools-2.6.1.jar:2.6.1]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[na:1.8.0_73]
at java.lang.Class.forName0(Native Method) ~[na:1.8.0_73]
at java.lang.Class.forName(Unknown Source) ~[na:1.8.0_73]
at org.springframework.boot.web.embedded.tomcat.TomcatEmbeddedWebappClassLoader.loadFromParent(TomcatEmbeddedWebappClassLoader.java:114) ~[spring-boot-2.6.1.jar:2.6.1]
at org.springframework.boot.web.embedded.tomcat.TomcatEmbeddedWebappClassLoader.doLoadClass(TomcatEmbeddedWebappClassLoader.java:87) ~[spring-boot-2.6.1.jar:2.6.1]
at org.springframework.boot.web.embedded.tomcat.TomcatEmbeddedWebappClassLoader.loadClass(TomcatEmbeddedWebappClassLoader.java:70) ~[spring-boot-2.6.1.jar:2.6.1]
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1215) ~[tomcat-embed-core-9.0.55.jar:9.0.55]
at java.lang.Class.forName0(Native Method) ~[na:1.8.0_73]
at java.lang.Class.forName(Unknown Source) ~[na:1.8.0_73]
at java.util.ServiceLoader$LazyIterator.nextService(Unknown Source) ~[na:1.8.0_73]
at java.util.ServiceLoader$LazyIterator.next(Unknown Source) ~[na:1.8.0_73]
at java.util.ServiceLoader$1.next(Unknown Source) ~[na:1.8.0_73]
at javax.xml.stream.FactoryFinder$1.run(Unknown Source) ~[na:1.8.0_73]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_73]
at javax.xml.stream.FactoryFinder.findServiceProvider(Unknown Source) ~[na:1.8.0_73]
at javax.xml.stream.FactoryFinder.find(Unknown Source) ~[na:1.8.0_73]
at javax.xml.stream.FactoryFinder.find(Unknown Source) ~[na:1.8.0_73]
at javax.xml.stream.XMLInputFactory.newInstance(Unknown Source) ~[na:1.8.0_73]
at org.springframework.util.xml.StaxUtils.createDefensiveInputFactory(StaxUtils.java:77) ~[spring-core-5.3.13.jar:5.3.13]
at org.springframework.util.xml.StaxUtils.createDefensiveInputFactory(StaxUtils.java:67) ~[spring-core-5.3.13.jar:5.3.13]
at org.springframework.http.converter.json.Jackson2ObjectMapperBuilder$XmlObjectMapperInitializer.create(Jackson2ObjectMapperBuilder.java:911) ~[spring-web-5.3.13.jar:5.3.13]
at org.springframework.http.converter.json.Jackson2ObjectMapperBuilder.build(Jackson2ObjectMapperBuilder.java:669) ~[spring-web-5.3.13.jar:5.3.13]
at org.springframework.http.converter.xml.MappingJackson2XmlHttpMessageConverter.<init>(MappingJackson2XmlHttpMessageConverter.java:52) ~[spring-web-5.3.13.jar:5.3.13]
at org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter.<init>(AllEncompassingFormHttpMessageConverter.java:104) ~[spring-web-5.3.13.jar:5.3.13]
at org.springframework.web.filter.FormContentFilter.<init>(FormContentFilter.java:61) ~[spring-web-5.3.13.jar:5.3.13]
at org.springframework.boot.web.servlet.filter.OrderedFormContentFilter.<init>(OrderedFormContentFilter.java:29) ~[spring-boot-2.6.1.jar:2.6.1]
at org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration.formContentFilter(WebMvcAutoConfiguration.java:179) ~[spring-boot-autoconfigure-2.6.1.jar:2.6.1]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_73]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_73]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_73]
at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_73]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.3.13.jar:5.3.13]
... 60 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.codehaus.stax2.XMLInputFactory2
at java.net.URLClassLoader.findClass(Unknown Source) ~[na:1.8.0_73]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[na:1.8.0_73]
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) ~[na:1.8.0_73]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[na:1.8.0_73]
... 107 common frames omitted
NamingServerApplication.java :
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
#EnableEurekaServer
#SpringBootApplication
public class NamingServerApplication {
public static void main(String[] args) {
SpringApplication.run(NamingServerApplication.class, args);
}
}
application.properties :
spring.application.name=naming-server
server.port=8761
eureka.client.register-with-eureka=false
eureka.client.fetch-registry=false
Dependency hasn't been properly installed.
If your project is built with Maven add this to pom.xml
<!--
https://mvnrepository.com/artifact/org.codehaus.woodstox/stax2-api -->
<dependency>
<groupId>org.codehaus.woodstox</groupId>
<artifactId>stax2-api</artifactId>
<version>3.0.1</version>
</dependency>
If it's Gradle project add following to build.gradle
implementation group: 'org.codehaus.woodstox', name: 'stax2-api', version: '3.0.1'

Artemis Auto configuration problem when using corda-rpc with Spring boot

Im seeing the following error when trying to use Corda-RPC version 4.7 with Spring boot version 2.4.1
2021-01-07 15:23:14.614 ERROR 3036 --- [ restartedMain] o.s.boot.SpringApplication : Application run failed
java.lang.IllegalStateException: Error processing condition on org.springframework.boot.autoconfigure.jms.artemis.ArtemisEmbeddedServerConfiguration.embeddedActiveMq
at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:60) ~[spring-boot-autoconfigure-2.4.1.jar:2.4.1]
at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:108) ~[spring-context-5.3.2.jar:5.3.2]
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForBeanMethod(ConfigurationClassBeanDefinitionReader.java:193) ~[spring-context-5.3.2.jar:5.3.2]
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:153) ~[spring-context-5.3.2.jar:5.3.2]
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:129) ~[spring-context-5.3.2.jar:5.3.2]
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:348) ~[spring-context-5.3.2.jar:5.3.2]
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:252) ~[spring-context-5.3.2.jar:5.3.2]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:285) ~[spring-context-5.3.2.jar:5.3.2]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:99) ~[spring-context-5.3.2.jar:5.3.2]
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:751) ~[spring-context-5.3.2.jar:5.3.2]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:569) ~[spring-context-5.3.2.jar:5.3.2]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:144) ~[spring-boot-2.4.1.jar:2.4.1]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:767) [spring-boot-2.4.1.jar:2.4.1]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759) [spring-boot-2.4.1.jar:2.4.1]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:426) [spring-boot-2.4.1.jar:2.4.1]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:326) [spring-boot-2.4.1.jar:2.4.1]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1309) [spring-boot-2.4.1.jar:2.4.1]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1298) [spring-boot-2.4.1.jar:2.4.1]
at com.insurance_match.api.ApiApplicationKt.main(ApiApplication.kt:19) [main/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_181]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_181]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_181]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_181]
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [spring-boot-devtools-2.4.1.jar:2.4.1]
Caused by: java.lang.IllegalStateException: Failed to introspect Class [org.springframework.boot.autoconfigure.jms.artemis.ArtemisEmbeddedServerConfiguration] from ClassLoader [sun.misc.Launcher$AppClassLoader#18b4aac2]
at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:481) ~[spring-core-5.3.2.jar:5.3.2]
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:358) ~[spring-core-5.3.2.jar:5.3.2]
at org.springframework.util.ReflectionUtils.getUniqueDeclaredMethods(ReflectionUtils.java:414) ~[spring-core-5.3.2.jar:5.3.2]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.lambda$getTypeForFactoryMethod$2(AbstractAutowireCapableBeanFactory.java:754) ~[spring-beans-5.3.2.jar:5.3.2]
at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660) ~[na:1.8.0_181]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:753) ~[spring-beans-5.3.2.jar:5.3.2]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:692) ~[spring-beans-5.3.2.jar:5.3.2]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:663) ~[spring-beans-5.3.2.jar:5.3.2]
at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1665) ~[spring-beans-5.3.2.jar:5.3.2]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:570) ~[spring-beans-5.3.2.jar:5.3.2]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:542) ~[spring-beans-5.3.2.jar:5.3.2]
at org.springframework.boot.autoconfigure.condition.OnBeanCondition.collectBeanNamesForType(OnBeanCondition.java:238) ~[spring-boot-autoconfigure-2.4.1.jar:2.4.1]
at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getBeanNamesForType(OnBeanCondition.java:231) ~[spring-boot-autoconfigure-2.4.1.jar:2.4.1]
at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getBeanNamesForType(OnBeanCondition.java:221) ~[spring-boot-autoconfigure-2.4.1.jar:2.4.1]
at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchingBeans(OnBeanCondition.java:169) ~[spring-boot-autoconfigure-2.4.1.jar:2.4.1]
at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchOutcome(OnBeanCondition.java:144) ~[spring-boot-autoconfigure-2.4.1.jar:2.4.1]
at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:47) ~[spring-boot-autoconfigure-2.4.1.jar:2.4.1]
... 23 common frames omitted
Caused by: java.lang.NoClassDefFoundError: org/apache/activemq/artemis/jms/server/config/JMSConfiguration
at java.lang.Class.getDeclaredMethods0(Native Method) ~[na:1.8.0_181]
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) ~[na:1.8.0_181]
at java.lang.Class.getDeclaredMethods(Class.java:1975) ~[na:1.8.0_181]
at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:463) ~[spring-core-5.3.2.jar:5.3.2]
... 39 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.apache.activemq.artemis.jms.server.config.JMSConfiguration
at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_181]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_181]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) ~[na:1.8.0_181]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_181]
... 43 common frames omitted
Adding the following exclusion on my Application class fixed the above mentioned problem.
#EnableAutoConfiguration(exclude = [org.springframework.boot.autoconfigure.jms.artemis.ArtemisAutoConfiguration::class])

How to fix JMeter ArrayIndexOutOfBoundsException?

I'm testing http://lifecharger.org/make-the-rest-of-your-life-the-best-of-your-life/ through Jmeter and I'm getting below error.
my JMeter version is 5.1.1
2019-07-08 11:47:04,668 ERROR o.a.j.g.a.ActionRouter: Error processing org.apache.jmeter.gui.action.Start#12ab28e
java.lang.ArrayIndexOutOfBoundsException: 0
at org.apache.jmeter.gui.action.Start.startEngine(Start.java:188) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.gui.action.Start.doAction(Start.java:114) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.gui.action.ActionRouter.performAction(ActionRouter.java:88) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.gui.action.ActionRouter.lambda$actionPerformed$0(ActionRouter.java:70) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
at java.awt.event.InvocationEvent.dispatch(Unknown Source) [?:1.8.0_211]
at java.awt.EventQueue.dispatchEventImpl(Unknown Source) [?:1.8.0_211]
at java.awt.EventQueue.access$500(Unknown Source) [?:1.8.0_211]
at java.awt.EventQueue$3.run(Unknown Source) [?:1.8.0_211]
at java.awt.EventQueue$3.run(Unknown Source) [?:1.8.0_211]
at java.security.AccessController.doPrivileged(Native Method) [?:1.8.0_211]
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) [?:1.8.0_211]
at java.awt.EventQueue.dispatchEvent(Unknown Source) [?:1.8.0_211]
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) [?:1.8.0_211]
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) [?:1.8.0_211]
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) [?:1.8.0_211]
at java.awt.EventDispatchThread.pumpEvents(Unknown Source) [?:1.8.0_211]
at java.awt.EventDispatchThread.pumpEvents(Unknown Source) [?:1.8.0_211]
at java.awt.EventDispatchThread.run(Unknown Source) [?:1.8.0_211]
How to fix this issue?
I'm using jmeter automation testing resource to learn JMeter
Your Test Plan is disabled (gray) and that's causing the exception
You can enable it using Ctrl + T or Right Click on it and Enable

jmeter 3.3 CSV example throws stackoverflow exception

I download JMeter 3.3 and opened the example CSVSample.jmx in examples folder and executed, I get the below Stackoverflow exception
Test Plan:
017-09-24 16:38:09,452 ERROR o.a.j.JMeter: Uncaught exception:
java.lang.StackOverflowError: null
at jdk.internal.dynalink.support.AbstractCallSiteDescriptor.hashCode(AbstractCallSiteDescriptor.java:142) ~[nashorn.jar:?]
at java.util.concurrent.ConcurrentHashMap.putVal(Unknown Source) ~[?:1.8.0_144]
at java.util.concurrent.ConcurrentHashMap.putIfAbsent(Unknown Source) ~[?:1.8.0_144]
at jdk.nashorn.internal.runtime.linker.NashornCallSiteDescriptor.get(NashornCallSiteDescriptor.java:167) ~[nashorn.jar:?]
at jdk.nashorn.internal.runtime.linker.NashornCallSiteDescriptor.get(NashornCallSiteDescriptor.java:158) ~[nashorn.jar:?]
at jdk.nashorn.internal.runtime.linker.LinkerCallSite.newLinkerCallSite(LinkerCallSite.java:114) ~[nashorn.jar:?]
at jdk.nashorn.internal.runtime.linker.Bootstrap.bootstrap(Bootstrap.java:208) ~[nashorn.jar:?]
at jdk.nashorn.internal.runtime.linker.Bootstrap.createDynamicInvoker(Bootstrap.java:371) ~[nashorn.jar:?]
at jdk.nashorn.internal.runtime.linker.Bootstrap.createDynamicInvoker(Bootstrap.java:345) ~[nashorn.jar:?]
at jdk.nashorn.internal.runtime.linker.InvokeByName.<init>(InvokeByName.java:86) ~[nashorn.jar:?]
at jdk.nashorn.internal.runtime.linker.InvokeByName.<init>(InvokeByName.java:73) ~[nashorn.jar:?]
at jdk.nashorn.internal.objects.Global.<init>(Global.java:96) ~[nashorn.jar:?]
at jdk.nashorn.internal.runtime.Context.newGlobal(Context.java:1111) ~[nashorn.jar:?]
at jdk.nashorn.api.scripting.NashornScriptEngine$2.run(NashornScriptEngine.java:350) ~[nashorn.jar:?]
at jdk.nashorn.api.scripting.NashornScriptEngine$2.run(NashornScriptEngine.java:346) ~[nashorn.jar:?]
at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_144]
at jdk.nashorn.api.scripting.NashornScriptEngine.createNashornGlobal(NashornScriptEngine.java:346) ~[nashorn.jar:?]
at jdk.nashorn.api.scripting.NashornScriptEngine.createGlobalMirror(NashornScriptEngine.java:340) ~[nashorn.jar:?]
at jdk.nashorn.api.scripting.NashornScriptEngine.createBindings(NashornScriptEngine.java:170) ~[nashorn.jar:?]
at org.apache.jmeter.control.IfController$NashornJsEngine.evaluate(IfController.java:123) ~[ApacheJMeter_core.jar:3.3 r1808647]
at org.apache.jmeter.control.IfController.evaluateCondition(IfController.java:185) ~[ApacheJMeter_core.jar:3.3 r1808647]
at org.apache.jmeter.control.IfController.next(IfController.java:239) ~[ApacheJMeter_core.jar:3.3 r1808647]
at org.apache.jmeter.control.GenericController.nextIsAController(GenericController.java:219) ~[ApacheJMeter_core.jar:3.3 r1808647]
at org.apache.jmeter.control.GenericController.next(GenericController.java:173) ~[ApacheJMeter_core.jar:3.3 r1808647]
at org.apache.jmeter.control.WhileController.next(WhileController.java:106) ~[ApacheJMeter_core.jar:3.3 r1808647]
at org.apache.jmeter.control.WhileController.nextIsNull(WhileController.java:82) ~[ApacheJMeter_core.jar:3.3 r1808647]
at org.apache.jmeter.control.GenericController.next(GenericController.java:168) ~[ApacheJMeter_core.jar:3.3 r1808647]
at org.apache.jmeter.control.WhileController.next(WhileController.java:106) ~[ApacheJMeter_core.jar:3.3 r1808647]
at org.apache.jmeter.control.GenericController.nextIsAController(GenericController.java:222) ~[ApacheJMeter_core.jar:3.3 r1808647]
at org.apache.jmeter.control.GenericController.next(GenericController.java:173) ~[ApacheJMeter_core.jar:3.3 r1808647]
at org.apache.jmeter.control.WhileController.next(WhileController.java:106) ~[ApacheJMeter_core.jar:3.3 r1808647]
at
This is because While Controller condition uses a function __jexl that has been removed:
${__jexl("${ACTION}" != "")}
Should be:
${__jexl3("${ACTION}" != "")}
Fixed today in jmeter code:
http://svn.apache.org/viewvc?view=revision&revision=1809530

Resources