Spring Boot 2.1: Classpath resource [keystore.p12] cant be resolved to URL because it doesn't exist - spring-boot

I am new to spring boot and development in all. Using Spring Boot 2 with kotlin and gradle. The classpath error comes when I try attaching ssl certificate.
Solution on Spring Boot 1.4 : class path resource [] cannot be resolved to URL because it does not exist doesn't work.
Meanwhile, I tried replicating the solution and removed implementation of starter-data-jpa and used starter-jdbc. But nothing seems to works. The other solution also throws same error.
> Error starting ApplicationContext. To display the conditions report
> re-run your application with 'debug' enabled. 2019-01-16 23:20:19.511
> ERROR 9589 --- [ main] o.s.boot.SpringApplication
> : Application run failed
>
> org.springframework.context.ApplicationContextException: Unable to
> start web server; nested exception is
> org.springframework.boot.web.server.WebServerException: Could not load
> key store: class path resource [keystore.p12] cannot be resolved to
> URL because it does not exist at
> org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:157)
> ~[spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE] at
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:540)
> ~[spring-context-5.1.4.RELEASE.jar:5.1.4.RELEASE] at
> org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142)
> ~[spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE] at
> org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)
> [spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE] at
> org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
> [spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE] at
> org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
> [spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE] at
> org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)
> [spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE] at
> org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)
> [spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE] at
> com.example.demo.DemoApplicationKt.main(DemoApplication.kt:16)
> [classes/:na] Caused by:
> org.springframework.boot.web.server.WebServerException: Could not load
> key store: class path resource [keystore.p12] cannot be resolved to
> URL because it does not exist at
> org.springframework.boot.web.embedded.tomcat.SslConnectorCustomizer.configureSslKeyStore(SslConnectorCustomizer.java:136)
> ~[spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE] at
> org.springframework.boot.web.embedded.tomcat.SslConnectorCustomizer.configureSsl(SslConnectorCustomizer.java:92)
> ~[spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE] at
> org.springframework.boot.web.embedded.tomcat.SslConnectorCustomizer.customize(SslConnectorCustomizer.java:58)
> ~[spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE] at
> org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.customizeSsl(TomcatServletWebServerFactory.java:317)
> ~[spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE] at
> org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.customizeConnector(TomcatServletWebServerFactory.java:300)
> ~[spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE] at
> org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:166)
> ~[spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE] at
> org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:181)
> ~[spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE] at
> org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:154)
> ~[spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE] ... 8 common frames
> omitted Caused by: java.io.FileNotFoundException: class path resource
> [keystore.p12] cannot be resolved to URL because it does not exist at
> org.springframework.util.ResourceUtils.getURL(ResourceUtils.java:137)
> ~[spring-core-5.1.4.RELEASE.jar:5.1.4.RELEASE] at
> org.springframework.boot.web.embedded.tomcat.SslConnectorCustomizer.configureSslKeyStore(SslConnectorCustomizer.java:133)
> ~[spring-boot-2.1.2.RELEASE.jar:2.1.2.RELEASE] ... 15 common frames
> omitted
Application.property file
#spring.data.jpa.repositories.enabled=false
# Tell Spring Security (if used) to require requests over HTTPS
security.require-ssl=true
# The format used for the keystore
server.ssl.key-store-type=PKCS12
# The path to the keystore containing the certificate
server.ssl.key-store=./keystore.p12
# The password used to generate the certificate
server.ssl.key-store-password=
# The alias mapped to the certificate
server.ssl.key-alias=tomcat
I have used ./keystore as classpath is not working. Using ./ solves it. But when I make jar location changes and it stops working. I cant put keystore.p12 at same location as of jar in build/libs/. But I would love a classpath solution in Kotlin.

Related

Unable to start Spring boot application after adding Spring boot CompletableFuture feature

#Bean(name ="updateBenefitsThreadPoolTaskExecutor")
public Executor getTaskExecutor(){
ThreadPoolTaskExecutor executor=new ThreadPoolTaskExecutor();
executor.setCorePoolSize(16);
executor.setMaxPoolSize(16);
executor.setQueueCapacity(32);
executor.setThreadNamePrefix("userThread-update-benefits");
executor.initialize();
return executor;
}
Error details:-
Exclusions:
org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration
org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
Unconditional classes:
org.springframework.boot.autoconfigure.context.ConfigurationPropertiesAutoConfiguration
org.springframework.boot.actuate.autoconfigure.endpoint.jmx.JmxEndpointAutoConfiguration
org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorAutoConfiguration
org.springframework.boot.actuate.autoconfigure.info.InfoContributorAutoConfiguration
org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration
org.springframework.boot.actuate.autoconfigure.logging.LogFileWebEndpointAutoConfiguration
org.springframework.boot.actuate.autoconfigure.endpoint.EndpointAutoConfiguration
org.springframework.boot.actuate.autoconfigure.web.server.ManagementContextAutoConfiguration
org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration
org.springframework.boot.actuate.autoconfigure.web.mappings.MappingsEndpointAutoConfiguration
org.springframework.boot.actuate.autoconfigure.audit.AuditAutoConfiguration
org.springframework.boot.autoconfigure.info.ProjectInfoAutoConfiguration
10:52:58 DEBUG o.s.b.d.LoggingFailureAnalysisReporter Application failed to start due to an exception
java.lang.NoSuchMethodError: org.springframework.scheduling.annotation.AnnotationAsyncExecutionInterceptor.configure(Ljava/util/function/Supplier;Ljava/util/function/Supplier;)V
at org.springframework.scheduling.annotation.AsyncAnnotationAdvisor.buildAdvice(AsyncAnnotationAdvisor.java:154)
at org.springframework.scheduling.annotation.AsyncAnnotationAdvisor.(AsyncAnnotationAdvisor.java:107)
at org.springframework.scheduling.annotation.AsyncAnnotationBeanPostProcessor.setBeanFactory(AsyncAnnotationBeanPostProcessor.java:149)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeAwareMethods(AbstractAutowireCapableBeanFactory.java:1784)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1749)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:204)
at org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate.java:228)
at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:721)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:534)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)
at com.glic.api.ga.SeedSpringBootApiApplication.main(SeedSpringBootApiApplication.java:17)
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.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
10:52:58 ERROR o.s.b.d.LoggingFailureAnalysisReporter
APPLICATION FAILED TO START
Description:
An attempt was made to call the method org.springframework.scheduling.annotation.AnnotationAsyncExecutionInterceptor.configure(Ljava/util/function/Supplier;Ljava/util/function/Supplier;)V but it does not exist. Its class, org.springframework.scheduling.annotation.AnnotationAsyncExecutionInterceptor, is available from the following locations:
jar:file:/C:/Users/cyscpxv/.m2/repository/org/springframework/spring-context/5.1.5.RELEASE/spring-context-5.1.5.RELEASE.jar!/org/springframework/scheduling/annotation/AnnotationAsyncExecutionInterceptor.class
It was loaded from the following location:
file:/C:/Users/cyscpxv/.m2/repository/org/springframework/spring-context/5.1.5.RELEASE/spring-context-5.1.5.RELEASE.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of org.springframework.scheduling.annotation.AnnotationAsyncExecutionInterceptor

Error creating bean with name springSecurityFilterChain No configuration setting found for key security when starting Para with LDAP config

I'm trying the product Para and Scoold.
When I launch Para (https://github.com/Erudika/para) with the default configuration, it works fine.
When I add the configuration for LDAP and I launch Para, then I get the exception below.
Is there a missing configuration among the LDAP settings?
This is the default configuration
# the name of the root app
para.app_name = "Para"
# or set it to 'production'
para.env = "embedded"
# if true, users can be created without verifying their emails
para.security.allow_unverified_emails = false
# if hosting multiple apps on Para, set this to false
para.clients_can_access_root_app = true
# if false caching is disabled
para.cache_enabled = true
# root app secret, used for token generation, should be a random string
para.app_secret_key = "b8db69a25553f2ce134909f164665263"
# enable API request signature verification
para.security.api_security = true
# the node number from 1 to 1024, used for distributed ID generation
para.worker_id = 1
This is the LDAP configuration added to the default one
#URL of the LDAP server, including scheme and port.
para.security.ldap.server_url = ldap://pippo.pluto.local:389
#The base DN, aka domain.
para.security.ldap.base_dn = ou=pippo,dc=pippo,dc=local
#The initial bind DN for a user with search privileges. The value of this property cannot contain whitespaces. Those will automatically be escaped with %20. Usually this value is left blank
para.security.ldap.bind_dn =cn=pippo,ou=Admin
#The password for a user with search privileges. Usually this value is left blank.
para.security.ldap.bind_pass = pippi
This is the exception
2020-01-15 15:46:34,103 [INFO ] com.erudika.para.Para - --- Para.initialize() [embedded] ---
2020-01-15 15:46:34,103 [INFO ] c.erudika.para.core.utils.CoreUtils - Loaded new DAO, Search and Cache implementations - MockDAO, MockSearch and CaffeineCache.
2020-01-15 15:46:34,135 [WARN ] com.erudika.para.utils.HealthUtils - Server is unhealthy - root app not found. Open /v1/_setup in the browser to initialize Para.
2020-01-15 15:46:34,150 [INFO ] com.erudika.para.Para - Instance #1 initialized.
2020-01-15 15:46:34,900 [INFO ] com.erudika.para.ParaServer - Starting ParaServer on pippoLAB1 with PID 13012 (C:\Program Files\Para\para-jar-1.34.2.jar started by pippoLAB1$ in C:\Program Files\Para)
2020-01-15 15:46:34,900 [INFO ] com.erudika.para.ParaServer - The following profiles are active: embedded
2020-01-15 15:46:35,713 [INFO ] com.erudika.para.ParaServer - Listening on port 8090...
2020-01-15 15:46:37,228 [WARN ] o.e.jetty.webapp.WebAppContext - Failed startup of context o.s.b.w.e.j.JettyEmbeddedWebAppContext#3b07a0d6{/,[file:///C:/Windows/Temp/jetty-docbase.9117481678924898909.8090/],UNAVAILABLE}
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'springSecurityFilterChain' defined in class path resource [org/springframework/security/config/annotation/web/configuration/WebSecurityConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.servlet.Filter]: Factory method 'springSecurityFilterChain' threw exception; nested exception is com.typesafe.config.ConfigException$Missing: empty config: No configuration setting found for key 'security'
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:645)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:475)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1338)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1177)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:557)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:207)
at org.springframework.boot.web.servlet.ServletContextInitializerBeans.getOrderedBeansOfType(ServletContextInitializerBeans.java:211)
at org.springframework.boot.web.servlet.ServletContextInitializerBeans.addAsRegistrationBean(ServletContextInitializerBeans.java:174)
at org.springframework.boot.web.servlet.ServletContextInitializerBeans.addAsRegistrationBean(ServletContextInitializerBeans.java:169)
at org.springframework.boot.web.servlet.ServletContextInitializerBeans.addAdaptableBeans(ServletContextInitializerBeans.java:154)
at org.springframework.boot.web.servlet.ServletContextInitializerBeans.<init>(ServletContextInitializerBeans.java:86)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.getServletContextInitializerBeans(ServletWebServerApplicationContext.java:253)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.selfInitialize(ServletWebServerApplicationContext.java:227)
at org.springframework.boot.web.embedded.jetty.ServletContextInitializerConfiguration.callInitializers(ServletContextInitializerConfiguration.java:65)
at org.springframework.boot.web.embedded.jetty.ServletContextInitializerConfiguration.configure(ServletContextInitializerConfiguration.java:54)
at org.eclipse.jetty.webapp.WebAppContext.configure(WebAppContext.java:498)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1402)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:821)
at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:276)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:524)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:117)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:106)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169)
at org.eclipse.jetty.server.Server.start(Server.java:407)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:106)
at org.eclipse.jetty.server.Server.doStart(Server.java:371)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72)
at org.springframework.boot.web.embedded.jetty.JettyWebServer.initialize(JettyWebServer.java:108)
at org.springframework.boot.web.embedded.jetty.JettyWebServer.<init>(JettyWebServer.java:86)
at org.springframework.boot.web.embedded.jetty.JettyServletWebServerFactory.getJettyWebServer(JettyServletWebServerFactory.java:401)
at org.springframework.boot.web.embedded.jetty.JettyServletWebServerFactory.getWebServer(JettyServletWebServerFactory.java:155)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:180)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:153)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:544)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
at com.erudika.para.ParaServer.runAsJAR(ParaServer.java:447)
at com.erudika.para.ParaServer.main(ParaServer.java:455)
at com.erudika.para.Run.main(Run.java:26)
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.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:51)
at org.springframework.boot.loader.PropertiesLauncher.main(PropertiesLauncher.java:597)
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.servlet.Filter]: Factory method 'springSecurityFilterChain' threw exception; nested exception is com.typesafe.config.ConfigException$Missing: empty config: No configuration setting found for key 'security'
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:640)
... 56 common frames omitted
Caused by: com.typesafe.config.ConfigException$Missing: empty config: No configuration setting found for key 'security'
at com.typesafe.config.impl.SimpleConfig.findKeyOrNull(SimpleConfig.java:156)
at com.typesafe.config.impl.SimpleConfig.findKey(SimpleConfig.java:149)
at com.typesafe.config.impl.SimpleConfig.findOrNull(SimpleConfig.java:176)
at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:188)
at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:193)
at com.typesafe.config.impl.SimpleConfig.getObject(SimpleConfig.java:268)
at com.typesafe.config.impl.SimpleConfig.getObject(SimpleConfig.java:41)
at com.erudika.para.security.SecurityConfig.configure(SecurityConfig.java:157)
at org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter.getHttp(WebSecurityConfigurerAdapter.java:231)
at org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter.init(WebSecurityConfigurerAdapter.java:322)
at org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter.init(WebSecurityConfigurerAdapter.java:92)
at com.erudika.para.security.SecurityConfig$$EnhancerBySpringCGLIB$$a857a999.init(<generated>)
at org.springframework.security.config.annotation.AbstractConfiguredSecurityBuilder.init(AbstractConfiguredSecurityBuilder.java:370)
at org.springframework.security.config.annotation.AbstractConfiguredSecurityBuilder.doBuild(AbstractConfiguredSecurityBuilder.java:324)
at org.springframework.security.config.annotation.AbstractSecurityBuilder.build(AbstractSecurityBuilder.java:41)
at org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration.springSecurityFilterChain(WebSecurityConfiguration.java:104)
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.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
... 57 common frames omitted
2020-01-15 15:46:37,244 [WARN ] o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Jetty web server
2020-01-15 15:46:37,244 [INFO ] com.erudika.para.Para - --- Para.destroy() ---
2020-01-15 15:46:37,260 [ERROR] o.s.boot.SpringApplication - Application run failed
org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Jetty web server
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:156)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:544)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
at com.erudika.para.ParaServer.runAsJAR(ParaServer.java:447)
at com.erudika.para.ParaServer.main(ParaServer.java:455)
at com.erudika.para.Run.main(Run.java:26)
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.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:51)
at org.springframework.boot.loader.PropertiesLauncher.main(PropertiesLauncher.java:597)
Caused by: org.springframework.boot.web.server.WebServerException: Unable to start embedded Jetty web server
at org.springframework.boot.web.embedded.jetty.JettyWebServer.initialize(JettyWebServer.java:114)
at org.springframework.boot.web.embedded.jetty.JettyWebServer.<init>(JettyWebServer.java:86)
at org.springframework.boot.web.embedded.jetty.JettyServletWebServerFactory.getJettyWebServer(JettyServletWebServerFactory.java:401)
at org.springframework.boot.web.embedded.jetty.JettyServletWebServerFactory.getWebServer(JettyServletWebServerFactory.java:155)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:180)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:153)
... 16 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'springSecurityFilterChain' defined in class path resource [org/springframework/security/config/annotation/web/configuration/WebSecurityConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.servlet.Filter]: Factory method 'springSecurityFilterChain' threw exception; nested exception is com.typesafe.config.ConfigException$Missing: empty config: No configuration setting found for key 'security'
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:645)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:475)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1338)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1177)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:557)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:207)
at org.springframework.boot.web.servlet.ServletContextInitializerBeans.getOrderedBeansOfType(ServletContextInitializerBeans.java:211)
at org.springframework.boot.web.servlet.ServletContextInitializerBeans.addAsRegistrationBean(ServletContextInitializerBeans.java:174)
at org.springframework.boot.web.servlet.ServletContextInitializerBeans.addAsRegistrationBean(ServletContextInitializerBeans.java:169)
at org.springframework.boot.web.servlet.ServletContextInitializerBeans.addAdaptableBeans(ServletContextInitializerBeans.java:154)
at org.springframework.boot.web.servlet.ServletContextInitializerBeans.<init>(ServletContextInitializerBeans.java:86)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.getServletContextInitializerBeans(ServletWebServerApplicationContext.java:253)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.selfInitialize(ServletWebServerApplicationContext.java:227)
at org.springframework.boot.web.embedded.jetty.ServletContextInitializerConfiguration.callInitializers(ServletContextInitializerConfiguration.java:65)
at org.springframework.boot.web.embedded.jetty.ServletContextInitializerConfiguration.configure(ServletContextInitializerConfiguration.java:54)
at org.eclipse.jetty.webapp.WebAppContext.configure(WebAppContext.java:498)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1402)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:821)
at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:276)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:524)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:117)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:106)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169)
at org.eclipse.jetty.server.Server.start(Server.java:407)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:106)
at org.eclipse.jetty.server.Server.doStart(Server.java:371)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72)
at org.springframework.boot.web.embedded.jetty.JettyWebServer.initialize(JettyWebServer.java:108)
... 21 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.servlet.Filter]: Factory method 'springSecurityFilterChain' threw exception; nested exception is com.typesafe.config.ConfigException$Missing: empty config: No configuration setting found for key 'security'
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:640)
... 56 common frames omitted
Caused by: com.typesafe.config.ConfigException$Missing: empty config: No configuration setting found for key 'security'
at com.typesafe.config.impl.SimpleConfig.findKeyOrNull(SimpleConfig.java:156)
at com.typesafe.config.impl.SimpleConfig.findKey(SimpleConfig.java:149)
at com.typesafe.config.impl.SimpleConfig.findOrNull(SimpleConfig.java:176)
at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:188)
at com.typesafe.config.impl.SimpleConfig.find(SimpleConfig.java:193)
at com.typesafe.config.impl.SimpleConfig.getObject(SimpleConfig.java:268)
at com.typesafe.config.impl.SimpleConfig.getObject(SimpleConfig.java:41)
at com.erudika.para.security.SecurityConfig.configure(SecurityConfig.java:157)
at org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter.getHttp(WebSecurityConfigurerAdapter.java:231)
at org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter.init(WebSecurityConfigurerAdapter.java:322)
at org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter.init(WebSecurityConfigurerAdapter.java:92)
at com.erudika.para.security.SecurityConfig$$EnhancerBySpringCGLIB$$a857a999.init(<generated>)
at org.springframework.security.config.annotation.AbstractConfiguredSecurityBuilder.init(AbstractConfiguredSecurityBuilder.java:370)
at org.springframework.security.config.annotation.AbstractConfiguredSecurityBuilder.doBuild(AbstractConfiguredSecurityBuilder.java:324)
at org.springframework.security.config.annotation.AbstractSecurityBuilder.build(AbstractSecurityBuilder.java:41)
at org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration.springSecurityFilterChain(WebSecurityConfiguration.java:104)
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.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
... 57 common frames omitted
You have a configuration problem.
1. Configuration values should be in quotes, e.g.:
para.security.ldap.server_url = "ldap://pippo.pluto.local:389"
LDAP configuration properties belong in the configuration file for Scoold.
Para is not initialized, open GET /v1/_setup in your browser.
The steps to run both Para and Scoold locally are these:
run Para locally on port 8080 and initialize it with GET localhost:8080/v1/_setup
Save the access keys for the root Para app somewhere safe, you'll need them to configure Para CLI tool below
Create a new directory for Scoold containing its own dedicated application.conf and configure it to connect to Para on port 8080
Start Scoold with java -jar -Dserver.port=8000 -Dconfig.file=./application.conf scoold.jar OR mvn spring-boot:run
Open http://localhost:8000 in your browser
Use the Para CLI tool to create a separate app for Scoold:
$ npm install -g para-cli
# run setup and enter the keys for the root app and endpoint 'http://localhost:8080'
$ para-cli setup
$ para-cli ping
$ para-cli new-app "scoold" --name "Scoold"
Finally, add the LDAP configuration to scoold_folder/application.conf and restart Scoold.

Spring project failed to start: Jwt depency is not imported

I am working within a group project, after working on my local branch ( and every thing were fine) I tried to get the last version of the project and merged it with my local branch. The project is compiling fine, but when starting it: I have
Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'authRestService': Unsatisfied dependency expressed through field 'contextService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'contextServiceImpl': Lookup method resolution failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [fr.project.ui.components.services.core.ContextUiServiceImpl] from ClassLoader [ParallelWebappClassLoader
context: ROOT
delegate: false
----------> Parent Classloader:
java.net.URLClassLoader#12843fce
]
2019-09-11 13:22:07.688 [NS5] [] [DESKTOP-6JB7LEQ] [ERROR] o.s.web.context.ContextLoader.initWebApplicationContext:312 -
[:] [] [/] - Context initialization failed
> Caused by: java.lang.IllegalStateException: Failed to introspect Class [fr.project.ui.components.services.core.ContextServiceImpl] from
> ClassLoader [ParallelWebappClassLoader context: ROOT delegate:
> false
> ----------> Parent Classloader: java.net.URLClassLoader#12843fce ] at
> org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:507)
> at
> org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:404)
> at
> org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:389)
> at
> org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:248)
> ... 72 common frames omitted Caused by:
> java.lang.NoClassDefFoundError: com/auth0/jwt/algorithms/Algorithm at
> java.lang.Class.getDeclaredMethods0(Native Method) at
> java.lang.Class.privateGetDeclaredMethods(Class.java:2701) at
> java.lang.Class.getDeclaredMethods(Class.java:1975) at
> org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:489)
> ... 75 common frames omitted Caused by:
> java.lang.ClassNotFoundException: com.auth0.jwt.algorithms.Algorithm
> at
> org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1308)
> at
> org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1136)
> ... 79 common frames omitted
I added the version 3.3.0 of auth0-jwt on the pom.xml of the project like all the other dependencies.
PS: I tried to delete the depencies for the .m2 repostiroy folder, clear cache reimoprt ..
Nothing seems to work.
My question is: does the error really means that a jwt depency is missing, or it s the project itself who is not able to create the bean due to context issue
When I delete all dependencies and reimport the jwt: is added in the external libraries as a jar and not a librarie
like it is shown at the picture
Thank You

ested exception is javax.management.InstanceAlreadyExistsException: com.zaxxer.hikari:name=dataSource,type=HikariDataSource

Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/internals]]
at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:713)
... 25 more
Caused by: org.springframework.jmx.export.UnableToRegisterMBeanException: Unable to register MBean [HikariDataSource (HikariPool-3)] with key 'dataSource'; nested exception is javax.management.InstanceAlreadyExistsException: com.zaxxer.hikari:name=dataSource,type=HikariDataSource
at org.springframework.jmx.export.MBeanExporter.registerBeanNameOrInstance(MBeanExporter.java:625)
at org.springframework.jmx.export.MBeanExporter.lambda$registerBeans$2(MBeanExporter.java:551)
at java.util.HashMap.forEach(HashMap.java:1289)
at org.springframework.jmx.export.MBeanExporter.registerBeans(MBeanExporter.java:551)
at org.springframework.jmx.export.MBeanExporter.afterSingletonsInstantiated(MBeanExporter.java:434)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:860)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:157)
at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:137)
at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:91)
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:171)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5139)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
... 26 more
Caused by: javax.management.InstanceAlreadyExistsException: com.zaxxer.hikari:name=dataSource,type=HikariDataSource
at com.sun.jmx.mbeanserver.Repository.addMBean(Repository.java:437)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerWithRepository(DefaultMBeanServerInterceptor.java:1898)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:966)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:900)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:324)
at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:522)
at org.springframework.jmx.support.MBeanRegistrationSupport.doRegister(MBeanRegistrationSupport.java:137)
at org.springframework.jmx.export.MBeanExporter.registerBeanInstance(MBeanExporter.java:671)
at org.springframework.jmx.export.MBeanExporter.registerBeanNameOrInstance(MBeanExporter.java:615)
... 43 more
We use that configuration, not anything about hikari:
spring.datasource.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver
spring.datasource.url=jdbc:sqlserver://192.xx.0.160:1433;databaseName=DEV_DB_Ux;
There are 2 modules of spring boot those use same data source.
So, because of that it says this but on local there is no problem.
One uses 8080, one uses 8090 ports.
I got this error on tomcat but I dont use hikari anywhere.
What can i do?
You need to override the default RegistrationPolicy (since Spring Boot 2.1.3)
#Configuration
#EnableMBeanExport(registration = RegistrationPolicy.IGNORE_EXISTING)
public class MXBeansConfig {
}

Spring Boot and JBoss As 7.1.1

Versions Spring Boot 1.3.3 version and JBoss AS 7.1.1
I am trying to deploy spring boot application as war in the JBoss AS 7.1.1 , I am using JPA spring boot apis. when the war deploys it fails to successfully deploy and throws error like below.
I anticipate there is some issue with class loading. JBoss comes with JPA2.0 out of the box , but spring boot resolves the dependency to JPA 2.1. Did any one deployed their app on JBOSS with latest Spring boot? please help in resolving this issue.
==== ERROR ======================================
> 01:14:14,945 INFO
> [org.springframework.boot.context.embedded.FilterRegistrationBean]
> (MSC service thread 1-1) Mapping filter: 'hiddenHttpMethodFilter' to:
> [/*] 01:14:14,957 INFO
> [org.springframework.boot.context.embedded.FilterRegistrationBean]
> (MSC service thread 1-1) Mapping filter: 'httpPutFormContentFilter'
> to: [/*] 01:14:14,968 INFO
> [org.springframework.boot.context.embedded.FilterRegistrationBean]
> (MSC service thread 1-1) Mapping filter: 'requestContextFilter' to:
> [/*] 01:14:17,197 INFO
> [org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean]
> (MSC service thread 1-1) Building JPA container EntityManagerFactory
> for persistence unit 'default' 01:14:19,520 WARN
> [org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext]
> (MSC service thread 1-1) Exception encountered during context
> initialization - cancelling r efresh attempt:
> org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'entityManagerFactory' defined in class path
> resource [com/caiso/settlements/api/SettlementsServi ceConfig.class]:
> Invocation of init method failed; nested exception is
> java.lang.NoSuchMethodError:
> javax.persistence.Table.indexes()[Ljavax/persistence/Index;
> 01:14:19,595 ERROR [org.springframework.boot.SpringApplication] (MSC
> service thread 1-1) Application startup failed:
> org.springframework.beans.factory.BeanCreationException: Error
> creating bean with n ame 'entityManagerFactory' defined in class path
> resource [com/caiso/settlements/api/SettlementsServiceConfig.class]:
> Invocation of init method failed; nested exception is
> java.lang.NoSuchMethodError:
> javax.persistence.Table.indexes()[Ljavax/persistence/Index;
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578)
> [spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE]
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
> [spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE]
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
> [spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE]
> at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
> [spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE]
> at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
> [spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE]
> at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
> [spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE]
> at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
> [spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE]
> at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1054)
> [spring-context-4.2.5.RELEASE.jar:4.2.5.RELEASE]
> at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:829)
> [spring-context-4.2.5.RELEASE.jar:4.2.5.RELEASE]
> at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)
> [spring-context-4.2.5.RELEASE.jar:4.2.5.RELEASE]
> at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
> [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
> at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766)
> [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
> at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361)
> [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
> at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
> [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
> at org.springframework.boot.context.web.SpringBootServletInitializer.run(SpringBootServletInitializer.java:149)
> [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
> at org.springframework.boot.context.web.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:129)
> [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
> at org.springframework.boot.context.web.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:85)
> [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE]
> at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:175)
> [spring-web-4.2.5.RELEASE.jar:4.2.5.RELEASE]
> at org.jboss.as.web.deployment.JBossContextConfig.lifecycleEvent(JBossContextConfig.java:148)
> [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
> at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:115)
> [jbossweb-7.0.13.Final.jar:]
> at org.apache.catalina.core.StandardContext.start(StandardContext.java:3845)
> [jbossweb-7.0.13.Final.jar:]
> at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90)
> [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
> at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
> at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> [rt.jar:1.7.0_71]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> [rt.jar:1.7.0_71]
> at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_71] Caused by: java.lang.NoSuchMethodError:
> javax.persistence.Table.indexes()[Ljavax/persistence/Index;
> at org.hibernate.cfg.annotations.EntityBinder.processComplementaryTableDefinitions(EntityBinder.java:973)
> [hibernate-core-4.3.11.Final.jar:4.3.11.Final]
> at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:824)
> [hibernate-core-4.3.11.Final.jar:4.3.11.Final]
> at org.hibernate.cfg.Configuration$MetadataSourceQueue.processAnnotatedClassesQueue(Configuration.java:3845)
> [hibernate-core-4.3.11.Final.jar:4.3.11.Final]
> at org.hibernate.cfg.Configuration$MetadataSourceQueue.processMetadata(Configuration.java:3799)
> [hibernate-core-4.3.11.Final.jar:4.3.11.Final]
> at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1412)
> [hibernate-core-4.3.11.Final.jar:4.3.11.Final]
> at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1846)
> [hibernate-core-4.3.11.Final.jar:4.3.11.Final]
> at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:857)
> [hibernate-entitymanager-4.3.11.Final.jar:4.3.11.Final]
> at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:850)
> [hibernate-entitymanager-4.3.11.Final.jar:4.3.11.Final]
> at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:425)
> [hibernate-core-4.3.11.Final.jar:4.3.11.Final]
> at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:849)
> [hibernate-entitymanager-4.3.11.Final.jar:4.3.11.Final]
> at org.hibernate.jpa.HibernatePersistenceProvider.createContainerEntityManagerFactory(HibernatePersistenceProvider.java:152)
> [hibernate-entitymanager-4.3.11.Final.jar:4.3.11.Final]
> at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:343)
> [spring-orm-4.2.5.RELEASE.jar:4.2.5.RELE ASE]
> at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:319)
> [spring-orm-4.2.5.RELEASE.jar:4.2.5.RELEASE]
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637)
> [spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE]
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
> [spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE]
> ... 26 more
I was able to control the hibernate version and JPA2.0 version by using maven feature of Dependency Management. in the dependency Management section i made sure i include following if we want to use out of the box jpa and hibernate available in the JBoss AS 7.1.1
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.hibernate.common</groupId>
<artifactId>hibernate-commons-annotations</artifactId>
<version>4.0.1.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.0.1.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>4.0.1.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
<version>1.0.1.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.2.0.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>
hibernate-validator-annotation-processor
</artifactId>
<version>4.1.0.Final</version>
</dependency>
</dependencies>
</dependencyManagement>

Resources