I'm trying to implement this tutorial:
https://www.baeldung.com/rest-api-spring-oauth2-angular
My implementation: Github
I updated the package dependencies to latest version. But when I start the project I get exception:
13:34:43.343 [main] INFO EngineApplication[logStarting:55] - Starting EngineApplication v1.0 on ws-11820 with PID 56180 (C:\Users\plte1219\Desktop\CJM\media_auth\target\engine-1.0.jar started by plte1219 in C:\Users\plte1219\Desktop\CJM\media_auth)
13:34:43.347 [main] INFO EngineApplication[logStartupProfileInfo:655] - The following profiles are active: local
13:34:46.239 [main] INFO RepositoryConfigurationDelegate[registerRepositoriesIn:127] - Bootstrapping Spring Data JPA repositories in DEFAULT mode.
13:34:46.289 [main] INFO RepositoryConfigurationDelegate[registerRepositoriesIn:187] - Finished Spring Data repository scanning in 7ms. Found 0 JPA repository interfaces.
13:34:46.299 [main] INFO RepositoryConfigurationDelegate[registerRepositoriesIn:127] - Bootstrapping Spring Data JPA repositories in DEFAULT mode.
13:34:46.301 [main] INFO RepositoryConfigurationDelegate[registerRepositoriesIn:187] - Finished Spring Data repository scanning in 1ms. Found 0 JPA repository interfaces.
13:34:48.008 [main] INFO PostProcessorRegistrationDelegate$BeanPostProcessorChecker[postProcessAfterInitialization:335] - Bean 'contextProductionDatasource' of type [org.engine.context.ContextProductionDatasource$$EnhancerBySpringCGLIB$$80cefca2] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
13:34:48.192 [main] INFO PostProcessorRegistrationDelegate$BeanPostProcessorChecker[postProcessAfterInitialization:335] - Bean 'contextWarehouseDatasource' of type [org.engine.context.ContextWarehouseDatasource$$EnhancerBySpringCGLIB$$f848a010] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
13:34:49.537 [main] INFO TomcatWebServer[initialize:108] - Tomcat initialized with port(s): 8080 (http)
13:34:49.551 [main] INFO Http11NioProtocol[log:173] - Initializing ProtocolHandler ["http-nio-8080"]
13:34:49.552 [main] INFO StandardService[log:173] - Starting service [Tomcat]
13:34:49.552 [main] INFO StandardEngine[log:173] - Starting Servlet engine: [Apache Tomcat/9.0.36]
13:34:49.693 [main] INFO [/engine][log:173] - Initializing Spring embedded WebApplicationContext
13:34:49.693 [main] INFO ServletWebServerApplicationContext[prepareWebApplicationContext:285] - Root WebApplicationContext: initialization completed in 6128 ms
13:34:50.508 [main] INFO LogHelper[logPersistenceUnitInformation:31] - HHH000204: Processing PersistenceUnitInfo [name: DS1]
13:34:51.231 [main] INFO Version[logVersion:44] - HHH000412: Hibernate ORM core version 5.4.18.Final
13:34:51.979 [main] INFO Version[<clinit>:49] - HCANN000001: Hibernate Commons Annotations {5.1.0.Final}
13:34:53.126 [main] INFO HikariDataSource[getConnection:110] - PRODUCTION_HIKARICP_CONNECTION_POOL - Starting...
13:34:53.427 [main] INFO HikariDataSource[getConnection:123] - PRODUCTION_HIKARICP_CONNECTION_POOL - Start completed.
13:34:53.565 [main] INFO Dialect[<init>:172] - HHH000400: Using dialect: org.hibernate.dialect.MariaDB103Dialect
13:34:55.995 [main] INFO JtaPlatformInitiator[initiateService:52] - HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
13:34:57.676 [main] INFO LocalContainerEntityManagerFactoryBean[buildNativeEntityManagerFactory:416] - Initialized JPA EntityManagerFactory for persistence unit 'DS1'
13:34:57.698 [main] INFO LogHelper[logPersistenceUnitInformation:31] - HHH000204: Processing PersistenceUnitInfo [name: DS2]
13:34:58.075 [main] INFO HikariDataSource[getConnection:110] - WAREHOUSE_HIKARICP_CONNECTION_POOL - Starting...
13:34:58.081 [main] INFO HikariDataSource[getConnection:123] - WAREHOUSE_HIKARICP_CONNECTION_POOL - Start completed.
13:34:58.082 [main] INFO Dialect[<init>:172] - HHH000400: Using dialect: org.hibernate.dialect.MariaDB103Dialect
13:34:58.432 [main] INFO JtaPlatformInitiator[initiateService:52] - HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
13:34:58.433 [main] INFO LocalContainerEntityManagerFactoryBean[buildNativeEntityManagerFactory:416] - Initialized JPA EntityManagerFactory for persistence unit 'DS2'
13:34:58.879 [main] WARN JpaBaseConfiguration$JpaWebConfiguration[openEntityManagerInViewInterceptor:220] - spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
13:34:59.216 [main] INFO ThreadPoolTaskExecutor[initialize:181] - Initializing ExecutorService 'applicationTaskExecutor'
13:35:00.069 [main] WARN FreeMarkerAutoConfiguration[checkTemplateLocationExists:67] - Cannot find template location(s): [classpath:/templates/] (please add some templates, check your FreeMarker configuration, or set spring.freemarker.checkTemplateLocation=false)
13:35:01.188 [main] INFO Http11NioProtocol[log:173] - Starting ProtocolHandler ["http-nio-8080"]
13:35:01.423 [main] WARN i18n[registerProviders:150] - RESTEASY002145: NoClassDefFoundError: Unable to load builtin provider org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider from jar:file:/C:/Users/plte1219/Desktop/CJM/media_auth/target/engine-1.0.jar!/BOOT-INF/lib/resteasy-jackson2-provider-4.5.5.Final.jar!/META-INF/services/javax.ws.rs.ext.Providers
java.lang.NoClassDefFoundError: org/jboss/resteasy/core/messagebody/AsyncBufferedMessageBodyWriter
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151)
at java.base/java.net.URLClassLoader.defineClass(URLClassLoader.java:514)
at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:422)
at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:416)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:691)
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:415)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:151)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:427)
at org.springframework.boot.web.embedded.tomcat.TomcatEmbeddedWebappClassLoader.loadFromParent(TomcatEmbeddedWebappClassLoader.java:114)
at org.springframework.boot.web.embedded.tomcat.TomcatEmbeddedWebappClassLoader.doLoadClass(TomcatEmbeddedWebappClassLoader.java:87)
at org.springframework.boot.web.embedded.tomcat.TomcatEmbeddedWebappClassLoader.loadClass(TomcatEmbeddedWebappClassLoader.java:70)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1188)
at org.jboss.resteasy.plugins.providers.RegisterBuiltin.registerProviders(RegisterBuiltin.java:132)
at org.jboss.resteasy.plugins.providers.RegisterBuiltin.register(RegisterBuiltin.java:52)
at org.jboss.resteasy.spi.ResteasyDeployment.startInternal(ResteasyDeployment.java:266)
at org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:92)
at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.init(ServletContainerDispatcher.java:119)
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(HttpServletDispatcher.java:36)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1134)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:986)
at org.springframework.boot.web.embedded.tomcat.TomcatEmbeddedContext.load(TomcatEmbeddedContext.java:82)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1624)
at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658)
at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:274)
at java.base/java.util.TreeMap$ValueSpliterator.forEachRemaining(TreeMap.java:2905)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
at org.springframework.boot.web.embedded.tomcat.TomcatEmbeddedContext.lambda$deferredLoadOnStartup$0(TomcatEmbeddedContext.java:65)
at org.springframework.boot.web.embedded.tomcat.TomcatEmbeddedContext.doWithThreadContextClassLoader(TomcatEmbeddedContext.java:106)
at org.springframework.boot.web.embedded.tomcat.TomcatEmbeddedContext.deferredLoadOnStartup(TomcatEmbeddedContext.java:64)
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.performDeferredLoadOnStartup(TomcatWebServer.java:305)
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.start(TomcatWebServer.java:216)
at org.springframework.boot.web.servlet.context.WebServerStartStopLifecycle.start(WebServerStartStopLifecycle.java:43)
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:182)
at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:53)
at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:360)
at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:158)
at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:122)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:895)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:554)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
at org.engine.EngineApplication.main(EngineApplication.java:25)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:109)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88)
Caused by: java.lang.ClassNotFoundException: org.jboss.resteasy.core.messagebody.AsyncBufferedMessageBodyWriter
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:435)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:151)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 66 common frames omitted
Do you know how I can fix this issue?
I had the same error. I updated resteasy-jackson2-provider and that caused the problem.
Turned out I had to also update resteasy-client to the same version, not sure if it applies to your case, but I got rid of this error this way. In my case I updated to the latest (at the moment) 4.5.8.Final
Related
I've been searching around and potentially the closest I've found something is this Stack Overflow thread, but it still doesn't answer my question. Even with the latest copy of spring (as of writing) frameworks (2.7.2), and hibernate (6.1.2.Final), and hibernate-entitymanager (5.6.10.Final), I'm still having troubles. My full error stack is as follows:
INFO <PID> --- [main] com.lms.controller.SpringBootController : Starting SpringBootController using Java 17.0.4 on <OS> with PID <PID> <FILEPATH> started by <USER> in <FILEPATH>)
INFO <PID> --- [main] com.lms.controller.SpringBootController : No active profile set, falling back to 1 default profile: "default"
INFO <PID> --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
INFO <PID> --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 28 ms. Found 2 JPA repository interfaces.
INFO <PID> --- [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
INFO <PID> --- [main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
INFO <PID> --- [main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.0.22]
INFO <PID> --- [main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
INFO <PID> --- [main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 944 ms
INFO <PID> --- [main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]
INFO <PID> --- [main] org.hibernate.Version : HHH000412: Hibernate ORM core version 6.1.2.Final
WARN <PID> --- [main] org.hibernate.orm.deprecation : HHH90000021: Encountered deprecated setting [javax.persistence.sharedCache.mode], use [jakarta.persistence.sharedCache.mode] instead
INFO <PID> --- [main] SQL dialect : HHH000400: Using dialect: org.hibernate.dialect.PostgreSQLDialect
ERROR <PID> --- [main] j.LocalContainerEntityManagerFactoryBean : Failed to initialize JPA EntityManagerFactory: Could not determine recommended JdbcType for `com.lms.entity.Role`
WARN <PID> --- [main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Could not determine recommended JdbcType for `com.lms.entity.Role`
INFO <PID> --- [main] com.lms.controller.SpringBootController : Starting SpringBootController using Java 17.0.4 on <OS> with PID <PID> <FILEPATH> started by <USER> in <FILEPATH>)
INFO <PID> --- [main] com.lms.controller.SpringBootController : No active profile set, falling back to 1 default profile: "default"
INFO <PID> --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
INFO <PID> --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 28 ms. Found 2 JPA repository interfaces.
INFO <PID> --- [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
INFO <PID> --- [main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
INFO <PID> --- [main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.0.22]
INFO <PID> --- [main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
INFO <PID> --- [main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 944 ms
INFO <PID> --- [main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]
INFO <PID> --- [main] org.hibernate.Version : HHH000412: Hibernate ORM core version 6.1.2.Final
WARN <PID> --- [main] org.hibernate.orm.deprecation : HHH90000021: Encountered deprecated setting [javax.persistence.sharedCache.mode], use [jakarta.persistence.sharedCache.mode] instead
INFO <PID> --- [main] SQL dialect : HHH000400: Using dialect: org.hibernate.dialect.PostgreSQLDialect
ERROR <PID> --- [main] j.LocalContainerEntityManagerFactoryBean : Failed to initialize JPA EntityManagerFactory: Could not determine recommended JdbcType for `com.lms.entity.Role`
WARN <PID> --- [main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Could not determine recommended JdbcType for `com.lms.entity.Role`
INFO <PID> --- [main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
INFO <PID> --- [main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
ERROR <PID> --- [main] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Could not determine recommended JdbcType for `com.lms.entity.Role`
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1753) ~[spring-beans-6.0.0-M5.jar:6.0.0-M5]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:604) ~[spring-beans-6.0.0-M5.jar:6.0.0-M5]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:526) ~[spring-beans-6.0.0-M5.jar:6.0.0-M5]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[spring-beans-6.0.0-M5.jar:6.0.0-M5]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.0.0-M5.jar:6.0.0-M5]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[spring-beans-6.0.0-M5.jar:6.0.0-M5]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[spring-beans-6.0.0-M5.jar:6.0.0-M5]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1141) ~[spring-context-6.0.0-M5.jar:6.0.0-M5]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:916) ~[spring-context-6.0.0-M5.jar:6.0.0-M5]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:592) ~[spring-context-6.0.0-M5.jar:6.0.0-M5]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.0.0-M4.jar:3.0.0-M4]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:731) ~[spring-boot-3.0.0-M4.jar:3.0.0-M4]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:430) ~[spring-boot-3.0.0-M4.jar:3.0.0-M4]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:312) ~[spring-boot-3.0.0-M4.jar:3.0.0-M4]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1303) ~[spring-boot-3.0.0-M4.jar:3.0.0-M4]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1292) ~[spring-boot-3.0.0-M4.jar:3.0.0-M4]
at com.lms.controller.SpringBootController.main(SpringBootController.java:30) ~[classes/:na]
Caused by: org.hibernate.type.descriptor.java.spi.JdbcTypeRecommendationException: Could not determine recommended JdbcType for `com.lms.entity.Role`
at org.hibernate.type.descriptor.java.spi.UnknownBasicJavaType.getRecommendedJdbcType(UnknownBasicJavaType.java:37) ~[hibernate-core-6.1.2.Final.jar:6.1.2.Final]
at org.hibernate.type.descriptor.java.spi.BasicCollectionJavaType.getRecommendedJdbcType(BasicCollectionJavaType.java:70) ~[hibernate-core-6.1.2.Final.jar:6.1.2.Final]
at org.hibernate.boot.model.process.internal.InferredBasicValueResolver.from(InferredBasicValueResolver.java:222) ~[hibernate-core-6.1.2.Final.jar:6.1.2.Final]
at org.hibernate.mapping.BasicValue.buildResolution(BasicValue.java:507) ~[hibernate-core-6.1.2.Final.jar:6.1.2.Final]
at org.hibernate.mapping.BasicValue.resolve(BasicValue.java:315) ~[hibernate-core-6.1.2.Final.jar:6.1.2.Final]
at org.hibernate.mapping.BasicValue.resolve(BasicValue.java:305) ~[hibernate-core-6.1.2.Final.jar:6.1.2.Final]
at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.lambda$processValueResolvers$4(InFlightMetadataCollectorImpl.java:1766) ~[hibernate-core-6.1.2.Final.jar:6.1.2.Final]
at java.base/java.util.ArrayList.removeIf(ArrayList.java:1682) ~[na:na]
at java.base/java.util.ArrayList.removeIf(ArrayList.java:1660) ~[na:na]
at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.processValueResolvers(InFlightMetadataCollectorImpl.java:1765) ~[hibernate-core-6.1.2.Final.jar:6.1.2.Final]
at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.processSecondPasses(InFlightMetadataCollectorImpl.java:1751) ~[hibernate-core-6.1.2.Final.jar:6.1.2.Final]
at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:300) ~[hibernate-core-6.1.2.Final.jar:6.1.2.Final]
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:1350) ~[hibernate-core-6.1.2.Final.jar:6.1.2.Final]
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1421) ~[hibernate-core-6.1.2.Final.jar:6.1.2.Final]
at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:57) ~[spring-orm-6.0.0-M5.jar:6.0.0-M5]
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:362) ~[spring-orm-6.0.0-M5.jar:6.0.0-M5]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:409) ~[spring-orm-6.0.0-M5.jar:6.0.0-M5]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:396) ~[spring-orm-6.0.0-M5.jar:6.0.0-M5]
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:338) ~[spring-orm-6.0.0-M5.jar:6.0.0-M5]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1799) ~[spring-beans-6.0.0-M5.jar:6.0.0-M5]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1749) ~[spring-beans-6.0.0-M5.jar:6.0.0-M5]
... 16 common frames omitted
Here's my Role.java file:
package com.lms.entity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Enumerated;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import jakarta.persistence.EnumType;
#Entity
#Table(name = "roles")
public class Role {
#Id
#Column(name = "roleID", nullable = false)
#GeneratedValue(strategy = GenerationType.IDENTITY)
private int roleID;
#Enumerated(EnumType.STRING)
#Column(name = "roleName", nullable = false)
private RoleEnum roleName;
public int getRoleID(){
return this.roleID;
}
public void setRoleID(int roleid){
this.roleID = roleid;
}
public RoleEnum getRoleName(){
return this.roleName;
}
public void setRoleName(RoleEnum rolename){
this.roleName = rolename;
}
#Override
public String toString(){
return "The role's id is: " + this.roleID + "\nThe role's name is: " + this.roleName.toString();
}
}
Even if my Role.java contains only the roleID value, I get the same error which isn't thrown on my other Entity classes which are basically the same thing. The only unique thing about this class is the RoleEnum type which is based on this Enum class: RoleEnum.java
public enum RoleEnum {
SUPER_ADMIN,
FORUM_ADMIN,
ACCOUNTANT,
LIBRARIAN,
NORMAL_USER,
FORUM_USER
}
I came across this error when I was trying to replicate this person's guide of implementing a JWT in Java Spring and works, but they are using 2.2.11.RELEASE instead of 3.0.0-M4 which is what I'm using.
My likely candidates are there is something funky with jakarta.* instead of javax.* which I don't fully understand the differences between. The other candidate I'm thinking could be problematic is that something with EntityManager is causing a problem, but I can't find anything about it. My error is Could not determine recommended JdbcType for com.lms.entity.Role, is there something I can do to fix this?
I had a similar error. Not really a dependency issue.
org.hibernate.type.descriptor.java.spi.JdbcTypeRecommendationException: Could not determine recommended JdbcType for com.payment.Payment
In my case, I found that Payment entity has a relationship with other entities, and was in fact used elsewhere.
The Error was fixed by removing this instances of the entity used in other entities, hence not "confusing" Hibernate on how to create Payment entity.
I had the same problem, I solve it by adding the #ManyToOne annotation.
I guess in your case it would be in the RoleEnum field.
Well at least that's how it worked for me.
This error has many causes, but in your case seems to be a relation between Role entity and another one that is using it in a relation. The most common reason for this error is reference this entity in another, and do not set the proper annotations.
In my case, I had the entity MealFood (which the error log was pointing to), and it was used in Meal entity. (One to Many starting from MealFood). The problem was that I hadn't mapped it properly in the Meal entity, so hibernate didn't know exactly what to do with it.
Please check if, as mentioned in jayson mulwa answer, the Role entity is used in another class, and add the proper annotations.
Hope it helps.
I am running a SpringBoot-Application on my Strato V-Server (https://www.strato.de/server/linux-vserver/ => V-Server Linux V10 with 8GB RAM).
Whenn I start the Application I directly get the error mentioned in the Title.
I have two task executors:
#Configuration
public class AsynchronousSpringEventsConfig {
#Bean(name = "applicationEventMulticaster")
public ApplicationEventMulticaster simpleApplicationEventMulticaster() {
SimpleApplicationEventMulticaster eventMulticaster =
new SimpleApplicationEventMulticaster();
ThreadPoolTaskExecutor threadPoolTaskExecutor
= new ThreadPoolTaskExecutor();
threadPoolTaskExecutor.setThreadNamePrefix(
"AsyncThreadPoolTaskExecutor");
threadPoolTaskExecutor.setCorePoolSize(25);
threadPoolTaskExecutor.setMaxPoolSize(50);
threadPoolTaskExecutor.afterPropertiesSet();
eventMulticaster.setTaskExecutor(threadPoolTaskExecutor);
return eventMulticaster;
}
}
and:
#Bean(name = "gaxThreadPoolTaskExecutor")
public ThreadPoolTaskExecutor threadPoolTaskExecutor() {
ThreadPoolTaskExecutor threadPoolTaskExecutor
= new ThreadPoolTaskExecutor();
threadPoolTaskExecutor.setMaxPoolSize(10);
threadPoolTaskExecutor.setCorePoolSize(5);
threadPoolTaskExecutor.setThreadNamePrefix(
"MainThreadPoolTaskExecutor");
return threadPoolTaskExecutor;
}
when I remove the CorePoolSize and the MaxPoolSize from both everthings running fine. But I originally wanted to have the MaxPoolSize for the first one set to 100 and for the second as it is above.
Has somebody an idea how to fix it? Do you need more Information?
EDIT
I am running the following java version on the server:
openjdk version "1.8.0_265"
OpenJDK Runtime Environment (build 1.8.0_265-8u265-b01-0ubuntu2~18.04-b01)
OpenJDK 64-Bit Server VM (build 25.265-b01, mixed mode)
and the following command I use to start the spring application:
/usr/bin/java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=6006 -Xms4096m -Xmx4096m -Dcom.sun.management.jmxremote.port=3333 -Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false -jar gaxify.jar
The Log/Stacktrace when the error occurs:
2021-01-03 13:48:17,959 INFO org.springframework.boot.StartupInfoLogger [main] Starting Application v1.0-SNAPSHOT on stratoserver.net with PID 4828 (/home/gaxify/gaxify.jar started by root in /home/gaxify)
2021-01-03 13:48:18,016 INFO org.springframework.boot.SpringApplication [main] No active profile set, falling back to default profiles: default
2021-01-03 13:48:19,827 INFO org.springframework.data.repository.config.RepositoryConfigurationDelegate [main] Bootstrapping Spring Data repositories in DEFAULT mode.
2021-01-03 13:48:20,020 INFO org.springframework.data.repository.config.RepositoryConfigurationDelegate [main] Finished Spring Data repository scanning in 179ms. Found 9 repository interfaces.
2021-01-03 13:48:20,796 INFO org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker [main] Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-01-03 13:48:20,862 INFO org.springframework.scheduling.concurrent.ExecutorConfigurationSupport [main] Initializing ExecutorService
2021-01-03 13:48:21,411 INFO org.springframework.boot.web.embedded.tomcat.TomcatWebServer [main] Tomcat initialized with port(s): 8080 (http)
2021-01-03 13:48:21,428 INFO org.apache.juli.logging.DirectJDKLog [main] Initializing ProtocolHandler ["http-nio-8080"]
2021-01-03 13:48:21,429 INFO org.apache.juli.logging.DirectJDKLog [main] Starting service [Tomcat]
2021-01-03 13:48:21,430 INFO org.apache.juli.logging.DirectJDKLog [main] Starting Servlet engine: [Apache Tomcat/9.0.27]
2021-01-03 13:48:21,531 INFO org.apache.juli.logging.DirectJDKLog [main] Initializing Spring embedded WebApplicationContext
2021-01-03 13:48:21,532 INFO org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext [main] Root WebApplicationContext: initialization completed in 3411 ms
2021-01-03 13:48:21,955 INFO com.zaxxer.hikari.HikariDataSource [main] HikariPool-1 - Starting...
2021-01-03 13:48:22,252 INFO com.zaxxer.hikari.HikariDataSource [main] HikariPool-1 - Start completed.
2021-01-03 13:48:23,224 INFO liquibase.logging.core.Slf4jLogger [main] SELECT COUNT(*) FROM public.databasechangeloglock
2021-01-03 13:48:23,226 INFO liquibase.logging.core.Slf4jLogger [main] SELECT COUNT(*) FROM public.databasechangeloglock
2021-01-03 13:48:23,228 INFO liquibase.logging.core.Slf4jLogger [main] SELECT LOCKED FROM public.databasechangeloglock WHERE ID=1
2021-01-03 13:48:23,244 INFO liquibase.logging.core.Slf4jLogger [main] Changelog-Protokoll erfolgreich gesperrt.
2021-01-03 13:48:24,449 INFO liquibase.logging.core.Slf4jLogger [main] SELECT MD5SUM FROM public.databasechangelog WHERE MD5SUM IS NOT NULL LIMIT 1
2021-01-03 13:48:24,452 INFO liquibase.logging.core.Slf4jLogger [main] SELECT COUNT(*) FROM public.databasechangelog
2021-01-03 13:48:24,453 INFO liquibase.logging.core.Slf4jLogger [main] Reading from public.databasechangelog
2021-01-03 13:48:24,454 INFO liquibase.logging.core.Slf4jLogger [main] SELECT * FROM public.databasechangelog ORDER BY DATEEXECUTED ASC, ORDEREXECUTED ASC
2021-01-03 13:48:24,547 INFO liquibase.logging.core.Slf4jLogger [main] Successfully released change log lock
2021-01-03 13:48:24,549 INFO com.zaxxer.hikari.HikariDataSource [main] HikariPool-1 - Shutdown initiated...
2021-01-03 13:48:24,583 INFO com.zaxxer.hikari.HikariDataSource [main] HikariPool-1 - Shutdown completed.
2021-01-03 13:48:24,653 INFO com.zaxxer.hikari.HikariDataSource [main] HikariPool-2 - Starting...
2021-01-03 13:48:24,695 INFO com.zaxxer.hikari.HikariDataSource [main] HikariPool-2 - Start completed.
2021-01-03 13:48:24,746 INFO org.hibernate.jpa.internal.util.LogHelper [main] HHH000204: Processing PersistenceUnitInfo [name: default]
2021-01-03 13:48:24,849 INFO org.hibernate.Version [main] HHH000412: Hibernate Core {5.4.6.Final}
2021-01-03 13:48:25,141 INFO org.hibernate.annotations.common.reflection.java.JavaReflectionManager [main] HCANN000001: Hibernate Commons Annotations {5.1.0.Final}
2021-01-03 13:48:25,337 INFO org.hibernate.dialect.Dialect [main] HHH000400: Using dialect: org.hibernate.dialect.PostgreSQL95Dialect
2021-01-03 13:48:26,032 WARN org.hibernate.id.UUIDHexGenerator [main] HHH000409: Using org.hibernate.id.UUIDHexGenerator which does not generate IETF RFC 4122 compliant UUID values; consider using org.hibernate.id.UUIDGenerator instead
2021-01-03 13:48:27,306 INFO org.hibernate.engine.transaction.jta.platform.internal.JtaPlatformInitiator [main] HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2021-01-03 13:48:27,317 INFO org.springframework.orm.jpa.AbstractEntityManagerFactoryBean [main] Initialized JPA EntityManagerFactory for persistence unit 'default'
2021-01-03 13:48:28,158 INFO org.springframework.scheduling.concurrent.ExecutorConfigurationSupport [main] Initializing ExecutorService 'gaxThreadPoolTaskExecutor'
2021-01-03 13:48:28,324 INFO org.springframework.scheduling.concurrent.ExecutorConfigurationSupport [main] Initializing ExecutorService 'threadPoolTaskScheduler'
2021-01-03 13:48:28,411 WARN org.springframework.boot.autoconfigure.orm.jpa.JpaBaseConfiguration$JpaWebConfiguration [main] spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2021-01-03 13:48:28,485 INFO de.gaxify.backend.task.StartGaxTask [MainThreadPoolTaskExecutor1] ########## Schedule Token Task
2021-01-03 13:48:28,486 INFO org.springframework.scheduling.concurrent.ExecutorConfigurationSupport [MainThreadPoolTaskExecutor1] Initializing ExecutorService
2021-01-03 13:48:28,498 INFO de.gaxify.backend.task.StartGaxTask [MainThreadPoolTaskExecutor1] ########## Schedule CSV Task
2021-01-03 13:48:28,498 INFO org.springframework.scheduling.concurrent.ExecutorConfigurationSupport [MainThreadPoolTaskExecutor1] Initializing ExecutorService
2021-01-03 13:48:28,499 INFO de.gaxify.backend.rest.token.TokenTask [ThreadPoolTaskScheduler-1] #############running token task
2021-01-03 13:48:28,507 INFO de.gaxify.backend.task.StartGaxTask [MainThreadPoolTaskExecutor1] ########## Schedule Trade Task
2021-01-03 13:48:28,507 INFO org.springframework.scheduling.concurrent.ExecutorConfigurationSupport [MainThreadPoolTaskExecutor1] Initializing ExecutorService
2021-01-03 13:48:28,521 INFO de.gaxify.backend.task.StartGaxTask [MainThreadPoolTaskExecutor1] ########## Schedule Report Task
2021-01-03 13:48:28,522 INFO org.springframework.scheduling.concurrent.ExecutorConfigurationSupport [MainThreadPoolTaskExecutor1] Initializing ExecutorService
2021-01-03 13:48:29,636 INFO de.gaxify.backend.rest.token.TokenTask [ThreadPoolTaskScheduler-1] Token for Company 'Schuhhaus Fischer' is 'bearer 88991645-28a0-4d56-a671-a611fa073f9f'
2021-01-03 13:48:29,984 INFO org.springframework.security.web.DefaultSecurityFilterChain [main] Creating filter chain: any request, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter#289778cd, org.springframework.security.web.context.SecurityContextPersistenceFilter#4f824872, org.springframework.security.web.header.HeaderWriterFilter#26f7cdf8, org.springframework.security.web.csrf.CsrfFilter#6c03fb16, org.springframework.security.web.authentication.logout.LogoutFilter#50acf55d, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#61f80d55, org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter#363f0ba0, org.springframework.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter#7495699f, org.springframework.security.web.authentication.www.BasicAuthenticationFilter#11e33bac, org.springframework.security.web.savedrequest.RequestCacheAwareFilter#29629fbb, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter#35dd9ed3, org.springframework.security.web.authentication.AnonymousAuthenticationFilter#7c2312fa, org.springframework.security.web.session.SessionManagementFilter#23202c31, org.springframework.security.web.access.ExceptionTranslationFilter#3e7545e8, org.springframework.security.web.access.intercept.FilterSecurityInterceptor#6401d0a0]
2021-01-03 13:48:30,044 INFO org.springframework.boot.actuate.endpoint.web.EndpointLinksResolver [main] Exposing 2 endpoint(s) beneath base path '/actuator'
2021-01-03 13:48:30,112 INFO org.apache.juli.logging.DirectJDKLog [main] Starting ProtocolHandler ["http-nio-8080"]
2021-01-03 13:48:30,158 INFO org.springframework.boot.web.embedded.tomcat.TomcatWebServer [main] Tomcat started on port(s): 8080 (http) with context path ''
2021-01-03 13:48:30,161 INFO org.springframework.boot.StartupInfoLogger [main] Started Application in 13.24 seconds (JVM running for 14.0)
2021-01-03 13:48:30,180 ERROR org.springframework.boot.SpringApplication [main] Application run failed
java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Thread.java:717)
at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:957)
at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1367)
at org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor.execute(ThreadPoolTaskExecutor.java:314)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:136)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:403)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:360)
at org.springframework.boot.context.event.EventPublishingRunListener.running(EventPublishingRunListener.java:103)
at org.springframework.boot.SpringApplicationRunListeners.running(SpringApplicationRunListeners.java:77)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:330)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215)
at de.gaxify.Application.main(Application.java:34)
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.JarLauncher.main(JarLauncher.java:52)
2021-01-03 13:48:30,182 WARN org.springframework.context.support.AbstractApplicationContext [main] Exception thrown from ApplicationListener handling ContextClosedEvent
java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Thread.java:717)
at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:957)
at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1367)
at org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor.execute(ThreadPoolTaskExecutor.java:314)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:136)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:403)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:360)
at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1012)
at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:978)
at org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:803)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:333)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215)
at de.gaxify.Application.main(Application.java:34)
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.JarLauncher.main(JarLauncher.java:52)
2021-01-03 13:48:30,187 INFO org.springframework.scheduling.concurrent.ExecutorConfigurationSupport [main] Shutting down ExecutorService 'threadPoolTaskScheduler'
2021-01-03 13:48:30,187 INFO org.springframework.scheduling.concurrent.ExecutorConfigurationSupport [main] Shutting down ExecutorService 'gaxThreadPoolTaskExecutor'
2021-01-03 13:48:30,190 INFO org.springframework.orm.jpa.AbstractEntityManagerFactoryBean [main] Closing JPA EntityManagerFactory for persistence unit 'default'
2021-01-03 13:48:30,202 INFO com.zaxxer.hikari.HikariDataSource [main] HikariPool-2 - Shutdown initiated...
2021-01-03 13:48:30,237 INFO com.zaxxer.hikari.HikariDataSource [main] HikariPool-2 - Shutdown completed.
2021-01-03 13:48:30,240 INFO org.apache.juli.logging.DirectJDKLog [main] Pausing ProtocolHandler ["http-nio-8080"]
2021-01-03 13:48:30,246 INFO org.apache.juli.logging.DirectJDKLog [main] Stopping service [Tomcat]
2021-01-03 13:48:30,251 INFO org.apache.juli.logging.DirectJDKLog [main] Stopping ProtocolHandler ["http-nio-8080"]
2021-01-03 13:48:30,279 INFO org.apache.juli.logging.DirectJDKLog [main] Destroying ProtocolHandler ["http-nio-8080"]
2021-01-03 13:48:32,980 INFO de.gaxify.backend.trade.TradeTask [ThreadPoolTaskScheduler-1] Trade status for Company 'Schuhhaus Fischer': 200
2021-01-03 13:48:33,041 ERROR org.springframework.scheduling.support.TaskUtils$LoggingErrorHandler [ThreadPoolTaskScheduler-1] Unexpected error occurred in scheduled task
org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'spring.liquibase-org.springframework.boot.autoconfigure.liquibase.LiquibaseProperties': Could not bind properties to 'LiquibaseProperties' : prefix=spring.liquibase, ignoreInvalidFields=false, ignoreUnknownFields=false; nested exception is java.lang.IllegalStateException: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext#10bdf5e5 has been closed already
at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.bind(ConfigurationPropertiesBindingPostProcessor.java:110)
at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.postProcessBeforeInitialization(ConfigurationPropertiesBindingPostProcessor.java:96)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:416)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1795)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:595)
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:202)
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1287)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1207)
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:874)
at org.springframework.beans.factory.support.ConstructorResolver.resolvePreparedArguments(ConstructorResolver.java:821)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:151)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1358)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1193)
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:202)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:400)
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:202)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:310)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:617)
at org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors(BeanFactoryUtils.java:378)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.detectPersistenceExceptionTranslators(PersistenceExceptionTranslationInterceptor.java:168)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:150)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:149)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:93)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
at com.sun.proxy.$Proxy161.getTradeByOrderId(Unknown Source)
at de.gaxify.backend.database.services.GaxifyTradeService.getTradeByOrderId(GaxifyTradeService.java:48)
at de.gaxify.backend.trade.TradeProcessor.processTrades(TradeProcessor.java:52)
at de.gaxify.backend.trade.TradeTask.processTrade(TradeTask.java:62)
at de.gaxify.backend.trade.TradeTask.run(TradeTask.java:54)
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext#10bdf5e5 has been closed already
at org.springframework.context.support.AbstractApplicationContext.assertBeanFactoryActive(AbstractApplicationContext.java:1092)
at org.springframework.context.support.AbstractApplicationContext.getBeanProvider(AbstractApplicationContext.java:1137)
at org.springframework.boot.context.properties.ConfigurationPropertiesBinder.getBindHandlerAdvisors(ConfigurationPropertiesBinder.java:147)
at org.springframework.boot.context.properties.ConfigurationPropertiesBinder.getBindHandler(ConfigurationPropertiesBinder.java:119)
at org.springframework.boot.context.properties.ConfigurationPropertiesBinder.bind(ConfigurationPropertiesBinder.java:88)
at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.bind(ConfigurationPropertiesBindingPostProcessor.java:107)
... 57 common frames omitted
My issue is quite similar to this one and it's kinda straightforward: copy paste service from maven to gradle project makes starters non operational.
Here is the project I've used as an example and it starts like a charm:
Spring-Boot: (v2.2.5.RELEASE)
Camunda BPM: (v7.12.0)
Camunda BPM Spring Boot Starter: (v3.4.1)
INFO 227460 --- [main] com.camunda.demo.springboot.Application : Starting Application on archbox with PID 227460 (/home/user/ide/IdeaProjects/camunda-spring-boot-amqp-microservice-cloud-example/target/classes started by user in /home/user/ide/IdeaProjects/camunda-spring-boot-amqp-microservice-cloud-example)
INFO 227460 --- [main] com.camunda.demo.springboot.Application : No active profile set, falling back to default profiles: default
INFO 227460 --- [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
INFO 227460 --- [main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
INFO 227460 --- [main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.31]
INFO 227460 --- [main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
INFO 227460 --- [main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1095 ms
INFO 227460 --- [main] .c.b.s.b.s.r.CamundaJerseyResourceConfig : Configuring camunda rest api.
INFO 227460 --- [main] .c.b.s.b.s.r.CamundaJerseyResourceConfig : Finished configuring camunda rest api.
INFO 227460 --- [main] org.camunda.bpm.spring.boot : STARTER-SB040 Setting up jobExecutor with corePoolSize=3, maxPoolSize:10
INFO 227460 --- [main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'camundaTaskExecutor'
INFO 227460 --- [main] org.camunda.bpm.engine.cfg : ENGINE-12003 Plugin 'CompositeProcessEnginePlugin[genericPropertiesConfiguration, camundaEngineHistoryConfiguration, camundaIdGeneratorConfiguration, camundaProcessEngineConfiguration, camundaDatasourceConfiguration, camundaJobConfiguration, camundaHistoryConfiguration, camundaMetricsConfiguration, camundaAuthorizationConfiguration, failedJobConfiguration, SendEventListenerPlugin, disableDeploymentResourcePattern, eventPublisherPlugin]' activated on process engine 'default'
INFO 227460 --- [main] org.camunda.bpm.spring.boot : STARTER-SB020 ProcessApplication enabled: autoDeployment via springConfiguration#deploymentResourcePattern is disabled
INFO 227460 --- [main] o.c.b.s.b.s.event.EventPublisherPlugin : EVENTING-001: Initialized Camunda Spring Boot Eventing Engine Plugin.
INFO 227460 --- [main] o.c.b.s.b.s.event.EventPublisherPlugin : EVENTING-003: Task events will be published as Spring Events.
INFO 227460 --- [main] o.c.b.s.b.s.event.EventPublisherPlugin : EVENTING-005: Execution events will be published as Spring Events.
INFO 227460 --- [main] o.c.b.s.b.s.event.EventPublisherPlugin : EVENTING-007: History events will be published as Spring events.
INFO 227460 --- [main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
INFO 227460 --- [main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
INFO 227460 --- [main] org.camunda.bpm.engine : ENGINE-00001 Process Engine default created.
INFO 227460 --- [main] o.c.b.s.b.s.w.f.LazyInitRegistration : lazy initialized org.camunda.bpm.spring.boot.starter.webapp.filter.LazyProcessEnginesFilter#69364b2d
INFO 227460 --- [main] o.c.b.s.b.s.w.f.LazyInitRegistration : lazy initialized org.camunda.bpm.spring.boot.starter.webapp.filter.LazySecurityFilter#52f6900a
However project I've copied from part of sources gives following:
Spring-Boot: (v2.1.3.RELEASE)
Camunda BPM: (v7.12.0)
Camunda BPM Spring Boot Starter: (v3.4.1)
INFO 227891 --- [main] com.test.camundatest.Application : Starting Application on archbox with PID 227891 (/home/user/ide/IdeaProjects/gradle-camunda-service/build/classes/java/main started by user in /home/user/ide/IdeaProjects/gradle-camunda-service)
INFO 227891 --- [main] com.test.camundatest.Application : No active profile set, falling back to default profiles: default
INFO 227891 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
INFO 227891 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
INFO 227891 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 14ms. Found 0 repository interfaces.
INFO 227891 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
INFO 227891 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
INFO 227891 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 3ms. Found 0 repository interfaces.
INFO 227891 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$d980ca4f] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
INFO 227891 --- [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
INFO 227891 --- [main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
INFO 227891 --- [main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.16]
INFO 227891 --- [main] o.a.catalina.core.AprLifecycleListener : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib]
INFO 227891 --- [main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
INFO 227891 --- [main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1883 ms
ERROR 227891 --- [main] o.s.b.web.embedded.tomcat.TomcatStarter : Error starting Tomcat context. Exception: org.springframework.beans.factory.BeanCreationException. Message: Error creating bean with name 'servletEndpointRegistrar' defined in class path resource [org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration$WebMvcServletEndpointManagementContextConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.endpoint.web.ServletEndpointRegistrar]: Factory method 'servletEndpointRegistrar' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'healthEndpoint' defined in class path resource [org/springframework/boot/actuate/autoconfigure/health/HealthEndpointConfiguration.class]: Unsatisfied dependency expressed through method 'healthEndpoint' parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'healthIndicatorRegistry' defined in class path resource [org/springframework/boot/actuate/autoconfigure/health/HealthIndicatorAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.health.HealthIndicatorRegistry]: Factory method 'healthIndicatorRegistry' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.camunda.bpm.engine.spring.SpringProcessEngineServicesConfiguration': Unsatisfied dependency expressed through field 'processEngine'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.camunda.bpm.spring.boot.starter.CamundaBpmAutoConfiguration$ProcessEngineConfigurationImplDependingConfiguration': Unsatisfied dependency expressed through field 'processEngineConfigurationImpl'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {#org.springframework.beans.factory.annotation.Autowired(required=true)}
INFO 227891 --- [main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
WARN 227891 --- [main] ConfigServletWebServerApplicationContext : 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 Tomcat
INFO 227891 --- [main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-06-06 10:21:45.754 ERROR 227891 --- [main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
Field processEngineConfigurationImpl in org.camunda.bpm.spring.boot.starter.CamundaBpmAutoConfiguration$ProcessEngineConfigurationImplDependingConfiguration required a bean of type 'org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl' that could not be found.
The following candidates were found but could not be injected:
- Bean method 'processEngineConfigurationImpl' in 'CamundaBpmConfiguration' not loaded because #ConditionalOnMissingBean (types: org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl; SearchStrategy: all) found beans of type 'org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl' processEngineConfiguration
Action:
Consider revisiting the entries above or defining a bean of type 'org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl' in your configuration.
What should I add / change in configs to make my "gradle" service work like "maven" one?
Surprisingly there's key difference in the way that two given projects retrieving connection and data source details.
For instance it's enough for me to put this into maven project properties to point camunda engine to my db (rest left "as-is"):
spring.datasource.url=${POSTGRES_ADDRESS:jdbc:postgresql://localhost:5432/myservice}
spring.datasource.username=${POSTGRES_USER:postgres}
spring.datasource.password=${POSTGRES_PASSWORD:12345}
spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults=false
while same config just doesn't work for gradle completely, obscurely complaining about processEngineConfigurationImpl bean absence when all what engine needs is database connection details.
So that's what I figured:
#Configuration
#ImportResource({"classpath:config.xml"})
public class Config {
#Value("${spring.datasource.url}")
private String url;
#Value("${spring.datasource.username}")
private String username;
#Value("${spring.datasource.password}")
private String password;
#Bean
public DataSource dataSource() {
BasicDataSource dataSource = new BasicDataSource();
dataSource.setDriverClassName("org.postgresql.Driver");
dataSource.setUrl(url);
dataSource.setUsername(username);
dataSource.setPassword(password);
return dataSource;
}
#Bean
public PlatformTransactionManager transactionManager() {
return new DataSourceTransactionManager(dataSource());
}
#Bean
public ProcessEngineConfigurationImpl processEngineConfiguration() throws IOException {
SpringProcessEngineConfiguration config = new SpringProcessEngineConfiguration();
config.setDataSource(dataSource());
config.setTransactionManager(transactionManager());
config.setDatabaseSchemaUpdate("true");
config.setJobExecutorActivate(true);
config.setAuthorizationEnabled(true);
config.setDefaultSerializationFormat("application/json");
PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
config.setDeploymentResources(resolver.getResources("classpath:/bpmn/*.bpmn"));
List<ProcessEnginePlugin> processEnginePlugins = new ArrayList<>();
config.setProcessEnginePlugins(processEnginePlugins);
return config;
}
}
And it works:
Spring-Boot: (v2.1.3.RELEASE)
Camunda BPM: (v7.13.0)
Camunda BPM Spring Boot Starter: (v7.13.0)
INFO 378753 --- [main] com.myname.myservice.Application : Starting Application on pc with PID 378753 (/home/user/IdeaProjects/myservice/build/classes/java/main started by user in /home/user/IdeaProjects/myservice)
INFO 378753 --- [main] com.myname.myservice.Application : No active profile set, falling back to default profiles: default
INFO 378753 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
INFO 378753 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
INFO 378753 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 7ms. Found 0 repository interfaces.
INFO 378753 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
INFO 378753 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
INFO 378753 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 7ms. Found 0 repository interfaces.
INFO 378753 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.kafka.annotation.KafkaBootstrapConfiguration' of type [org.springframework.kafka.annotation.KafkaBootstrapConfiguration$$EnhancerBySpringCGLIB$$f04798b1] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
INFO 378753 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$1c95872e] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
INFO 378753 --- [main] o.f.c.internal.license.VersionPrinter : Flyway Community Edition 5.2.4 by Boxfuse
INFO 378753 --- [main] o.f.c.internal.database.DatabaseFactory : Database: jdbc:postgresql://localhost:5432/myservice (PostgreSQL 12.1)
WARN 378753 --- [main] o.f.c.internal.database.base.Database : Flyway upgrade recommended: PostgreSQL 12.1 is newer than this version of Flyway and support has not been tested.
INFO 378753 --- [main] o.f.core.internal.command.DbValidate : Successfully validated 2 migrations (execution time 00:00.010s)
INFO 378753 --- [main] o.f.core.internal.command.DbMigrate : Current version of schema "public": 1
INFO 378753 --- [main] o.f.core.internal.command.DbMigrate : Schema "public" is up to date. No migration necessary.
INFO 378753 --- [main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [
name: default
...]
INFO 378753 --- [main] org.hibernate.Version : HHH000412: Hibernate Core {5.3.7.Final}
INFO 378753 --- [main] org.hibernate.cfg.Environment : HHH000206: hibernate.properties not found
INFO 378753 --- [main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.0.4.Final}
INFO 378753 --- [main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.PostgreSQL95Dialect
INFO 378753 --- [main] o.h.e.j.e.i.LobCreatorBuilderImpl : HHH000422: Disabling contextual LOB creation as connection was null
INFO 378753 --- [main] org.hibernate.type.BasicTypeRegistry : HHH000270: Type registration [java.util.UUID] overrides previous : org.hibernate.type.UUIDBinaryType#642c6461
INFO 378753 --- [main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
INFO 378753 --- [main] org.camunda.feel.FeelEngine : Engine created. [value-mapper: CompositeValueMapper(List(org.camunda.feel.impl.JavaValueMapper#a047bdb)), function-provider: org.camunda.bpm.dmn.feel.impl.scala.function.CustomFunctionTransformer#173b1af1, configuration: Configuration(false)]
INFO 378753 --- [main] org.camunda.bpm.engine : ENGINE-00001 Process Engine default created.
INFO 378753 --- [main] org.camunda.bpm.engine.jobexecutor : ENGINE-14014 Starting up the JobExecutor[org.camunda.bpm.engine.impl.jobexecutor.DefaultJobExecutor].
INFO 378753 --- [ultJobExecutor]] org.camunda.bpm.engine.jobexecutor : ENGINE-14018 JobExecutor[org.camunda.bpm.engine.impl.jobexecutor.DefaultJobExecutor] starting to acquire jobs
INFO 378753 --- [main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'asyncExecutor'
INFO 378753 --- [main] i.micrometer.influx.InfluxMeterRegistry : publishing metrics to influx every 1m
INFO 378753 --- [main] org.camunda.bpm.spring.boot : STARTER-SB040 Setting up jobExecutor with corePoolSize=3, maxPoolSize:10
INFO 378753 --- [main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'camundaTaskExecutor'
INFO 378753 --- [main] o.s.s.c.ThreadPoolTaskScheduler : Initializing ExecutorService 'taskScheduler'
INFO 378753 --- [main] n.d.b.g.s.s.GrpcServerLifecycle : gRPC Server started, listening on address: *, port: 8081
INFO 378753 --- [main] org.camunda.bpm.container : ENGINE-08024 Found processes.xml file at file:/home/user/IdeaProjects/myservice/build/resources/main/META-INF/processes.xml
INFO 378753 --- [main] org.camunda.bpm.container : ENGINE-08023 Deployment summary for process archive 'application':
As a sidenote - for unknown reason sql dialect is very important for bpm so this one is mandatory to set like this:
spring.jpa.database-platform = org.hibernate.dialect.PostgreSQL95Dialect
and not to forget to please flyway if used:
spring.flyway.baseline-on-migrate = true
I am creating a security service using spring JPA annotation based.
in the datasource configuration of application.properties I have following configurations
spring.jpa.generate-ddl=true
spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto= update.
I am getting the following errors
objc[22745]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/bin/java (0x10c8dc4c0) and /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/libinstrument.dylib (0x10c9a44e0). One of the two will be used. Which one is undefined.
HOTSWAP AGENT: 15:32:22.999 INFO (org.hotswap.agent.HotswapAgent) - Loading Hotswap agent {1.1.0-SNAPSHOT} - unlimited runtime class redefinition.
HOTSWAP AGENT: 15:32:23.616 INFO (org.hotswap.agent.config.PluginRegistry) - Plugin 'org.hotswap.agent.plugin.hotswapper.HotswapperPlugin' initialized in ClassLoader 'sun.misc.Launcher$AppClassLoader#18b4aac2'.
HOTSWAP AGENT: 15:32:23.757 INFO (org.hotswap.agent.config.PluginRegistry) - Discovered plugins: [Hotswapper, WatchResources, AnonymousClassPatch, ClassInitPlugin, Hibernate, Hibernate3JPA, Hibernate3, Spring, Jersey1, Jersey2, Jetty, Tomcat, ZK, Logback, Log4j2, MyFaces, Mojarra, Seam, ELResolver, WildFlyELResolver, OsgiEquinox, Owb, Proxy, WebObjects, Weld, JBossModules, ResteasyRegistry, Deltaspike, JavaBeans, GlassFish]
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v1.5.9.RELEASE)
HOTSWAP AGENT: 15:32:24.543 INFO (org.hotswap.agent.config.PluginRegistry) - Plugin 'org.hotswap.agent.plugin.spring.SpringPlugin' initialized in ClassLoader 'sun.misc.Launcher$AppClassLoader#18b4aac2'.
HOTSWAP AGENT: 15:32:24.544 INFO (org.hotswap.agent.plugin.spring.SpringPlugin) - Spring plugin initialized - Spring core version '4.3.13.RELEASE'
2018-01-07 15:32:24.598 INFO 22745 --- [ main] .s.SpringSecurityWithDatabaseApplication : Starting SpringSecurityWithDatabaseApplication on C02V7092HTD6 with PID 22745 (/Users/yvxm035/personal-workspace/SpringSecurityWithDatabase/target/classes started by yvxm035 in /Users/yvxm035/personal-workspace/SpringSecurityWithDatabase)
2018-01-07 15:32:24.600 INFO 22745 --- [ main] .s.SpringSecurityWithDatabaseApplication : No active profile set, falling back to default profiles: default
2018-01-07 15:32:24.642 INFO 22745 --- [ main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#c86b9e3: startup date [Sun Jan 07 15:32:24 CST 2018]; root of context hierarchy
HOTSWAP AGENT: 15:32:24.759 INFO (org.hotswap.agent.plugin.spring.SpringPlugin) - Registering basePackage com.security.services
HOTSWAP AGENT: 15:32:25.268 INFO (org.hotswap.agent.config.PluginRegistry) - Plugin 'org.hotswap.agent.plugin.hotswapper.HotswapperPlugin' initialized in ClassLoader 'javax.management.remote.rmi.NoCallStackClassLoader#2f943d71'.
HOTSWAP AGENT: 15:32:25.318 INFO (org.hotswap.agent.config.PluginRegistry) - Plugin 'org.hotswap.agent.plugin.hotswapper.HotswapperPlugin' initialized in ClassLoader 'javax.management.remote.rmi.NoCallStackClassLoader#3dfc5fb8'.
HOTSWAP AGENT: 15:32:25.923 INFO (org.hotswap.agent.config.PluginRegistry) - Plugin 'org.hotswap.agent.plugin.hibernate.HibernatePlugin' initialized in ClassLoader 'sun.misc.Launcher$AppClassLoader#18b4aac2'.
2018-01-07 15:32:26.249 INFO 22745 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 8084 (http)
2018-01-07 15:32:26.260 INFO 22745 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2018-01-07 15:32:26.261 INFO 22745 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.23
HOTSWAP AGENT: 15:32:26.396 INFO (org.hotswap.agent.config.PluginRegistry) - Plugin 'org.hotswap.agent.plugin.hotswapper.HotswapperPlugin' initialized in ClassLoader 'TomcatEmbeddedWebappClassLoader
context: ROOT
delegate: true
----------> Parent Classloader:
sun.misc.Launcher$AppClassLoader#18b4aac2
'.
HOTSWAP AGENT: 15:32:26.396 INFO (org.hotswap.agent.config.PluginRegistry) - Plugin 'org.hotswap.agent.plugin.tomcat.TomcatPlugin' initialized in ClassLoader 'TomcatEmbeddedWebappClassLoader
context: ROOT
delegate: true
----------> Parent Classloader:
sun.misc.Launcher$AppClassLoader#18b4aac2
'.
HOTSWAP AGENT: 15:32:26.397 INFO (org.hotswap.agent.plugin.tomcat.TomcatPlugin) - Tomcat plugin initialized - Tomcat version '8.5.23.0'
2018-01-07 15:32:26.415 INFO 22745 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2018-01-07 15:32:26.416 INFO 22745 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1777 ms
2018-01-07 15:32:26.603 INFO 22745 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Mapping servlet: 'dispatcherServlet' to [/]
2018-01-07 15:32:26.608 INFO 22745 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
2018-01-07 15:32:26.608 INFO 22745 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2018-01-07 15:32:26.608 INFO 22745 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2018-01-07 15:32:26.608 INFO 22745 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*]
2018-01-07 15:32:27.177 INFO 22745 --- [ main] j.LocalContainerEntityManagerFactoryBean : Building JPA container EntityManagerFactory for persistence unit 'default'
2018-01-07 15:32:27.191 INFO 22745 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [
name: default
...]
2018-01-07 15:32:27.345 INFO 22745 --- [ main] org.hibernate.Version : HHH000412: Hibernate Core {5.0.12.Final}
2018-01-07 15:32:27.346 INFO 22745 --- [ main] org.hibernate.cfg.Environment : HHH000206: hibernate.properties not found
2018-01-07 15:32:27.348 INFO 22745 --- [ main] org.hibernate.cfg.Environment : HHH000021: Bytecode provider name : javassist
2018-01-07 15:32:27.403 INFO 22745 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
2018-01-07 15:32:27.550 INFO 22745 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.PostgreSQLDialect
2018-01-07 15:32:27.791 INFO 22745 --- [ main] o.h.e.j.e.i.LobCreatorBuilderImpl : HHH000424: Disabling contextual LOB creation as createClob() method threw error : java.lang.reflect.InvocationTargetException
2018-01-07 15:32:27.792 INFO 22745 --- [ main] org.hibernate.type.BasicTypeRegistry : HHH000270: Type registration [java.util.UUID] overrides previous : org.hibernate.type.UUIDBinaryType#4be0a27d
2018-01-07 15:32:28.273 INFO 22745 --- [ main] org.hibernate.tool.hbm2ddl.SchemaUpdate : HHH000228: Running hbm2ddl schema update
2018-01-07 15:32:28.340 WARN 22745 --- [ main] o.h.engine.jdbc.spi.SqlExceptionHelper : SQL Error: 0, SQLState: 42703
2018-01-07 15:32:28.341 ERROR 22745 --- [ main] o.h.engine.jdbc.spi.SqlExceptionHelper : ERROR: column t1.tgconstrname does not exist
Position: 113
2018-01-07 15:32:28.344 WARN 22745 --- [ main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory
2018-01-07 15:32:28.347 INFO 22745 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2018-01-07 15:32:28.360 INFO 22745 --- [ main] utoConfigurationReportLoggingInitializer :
Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2018-01-07 15:32:28.368 ERROR 22745 --- [ main] o.s.boot.SpringApplication : Application startup failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1628) ~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555) ~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) ~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1080) ~[spring-context-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:857) ~[spring-context-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543) ~[spring-context-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.5.9.RELEASE.jar:1.5.9.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693) [spring-boot-1.5.9.RELEASE.jar:1.5.9.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360) [spring-boot-1.5.9.RELEASE.jar:1.5.9.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) [spring-boot-1.5.9.RELEASE.jar:1.5.9.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118) [spring-boot-1.5.9.RELEASE.jar:1.5.9.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107) [spring-boot-1.5.9.RELEASE.jar:1.5.9.RELEASE]
at com.security.services.SpringSecurityWithDatabaseApplication.main(SpringSecurityWithDatabaseApplication.java:10) [classes/:na]
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.persistenceException(EntityManagerFactoryBuilderImpl.java:954) ~[hibernate-entitymanager-5.0.12.Final.jar:5.0.12.Final]
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:882) ~[hibernate-entitymanager-5.0.12.Final.jar:5.0.12.Final]
at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider._createContainerEntityManagerFactorySpringHibernateJpaPersistenceProvider(SpringHibernateJpaPersistenceProvider.java:60) ~[spring-orm-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java) ~[spring-orm-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:360) ~[spring-orm-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:382) ~[spring-orm-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:371) ~[spring-orm-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:336) ~[spring-orm-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1687) ~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1624) ~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
... 16 common frames omitted
Caused by: org.hibernate.exception.SQLGrammarException: Error accessing column metadata: users
at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:106) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:109) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:95) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
at org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl.convertSQLException(InformationExtractorJdbcDatabaseMetaDataImpl.java:99) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
at org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl.getForeignKeys(InformationExtractorJdbcDatabaseMetaDataImpl.java:679) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
at org.hibernate.tool.schema.extract.internal.TableInformationImpl.foreignKeys(TableInformationImpl.java:88) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
at org.hibernate.tool.schema.extract.internal.TableInformationImpl.getForeignKey(TableInformationImpl.java:99) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
at org.hibernate.tool.schema.internal.SchemaMigratorImpl.findMatchingForeignKey(SchemaMigratorImpl.java:398) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
at org.hibernate.tool.schema.internal.SchemaMigratorImpl.applyForeignKeys(SchemaMigratorImpl.java:376) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
at org.hibernate.tool.schema.internal.SchemaMigratorImpl.doMigrationToTargets(SchemaMigratorImpl.java:214) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
at org.hibernate.tool.schema.internal.SchemaMigratorImpl.doMigration(SchemaMigratorImpl.java:60) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:134) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:101) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:472) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:444) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:879) ~[hibernate-entitymanager-5.0.12.Final.jar:5.0.12.Final]
... 24 common frames omitted
Caused by: org.postgresql.util.PSQLException: ERROR: column t1.tgconstrname does not exist
Position: 113
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2198) ~[postgresql-9.3-1102-jdbc41.jar:na]
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1927) ~[postgresql-9.3-1102-jdbc41.jar:na]
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255) ~[postgresql-9.3-1102-jdbc41.jar:na]
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:561) ~[postgresql-9.3-1102-jdbc41.jar:na]
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:405) ~[postgresql-9.3-1102-jdbc41.jar:na]
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:285) ~[postgresql-9.3-1102-jdbc41.jar:na]
at org.postgresql.jdbc2.AbstractJdbc2DatabaseMetaData.getImportedExportedKeys(AbstractJdbc2DatabaseMetaData.java:3580) ~[postgresql-9.3-1102-jdbc41.jar:na]
at org.postgresql.jdbc2.AbstractJdbc2DatabaseMetaData.getImportedKeys(AbstractJdbc2DatabaseMetaData.java:3775) ~[postgresql-9.3-1102-jdbc41.jar:na]
at org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl.getForeignKeys(InformationExtractorJdbcDatabaseMetaDataImpl.java:628) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
... 35 common frames omitted
I made sure that I dont have user table as it is a keyword in postgres sql.
And it is working fine and creating the schema when I am using
spring.jpa.hibernate.ddl-auto= create-drop.
But I am not using create-drop as the schema and data will be dropped as soon as the application is stopped and restarted which would be not desired in production.
Please help where I am missing it. I can add more details about the schema I am using and Entities I have in the application. Any help or source of information is appreciated.
Do I have to add any special dependencies while using postgres? I have the PostgresSQl driver dependency in the POM.
Faced the same problem.
Check your version of postgresql driver in POM file.
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.4.1212.jre7</version>
</dependency>
This version is working for me.
Finally after multiple trials and searching for the solution. I found spring.jpa.hibernate.ddl-auto= validate does the trick. Instead of spring.jpa.hibernate.ddl-auto= update. Now my schema is working in prod and staging without destroying the schema and recreating for start and stop of the application. Any correction or suggestion on the solution is still appreciated.
I was looking how I can query some XML files with Solr and thus I went and changed the schema.xml file located under the collection1 directory.
Then I launched a query, which I knew it should return 1 result but in vain.
So I figured I might have to re-load the CORE (the idea was taken from CoreAdmin -Solr Wiki). So I did, but for some reason I wasn't able to. Thats said, I decided to restart the service (sorl/example java -jar start.jar) and now I am getting this error:
HTTP ERROR 503
Problem accessing /solr/. Reason:
Server is shutting down or failed to initialize
Powered by Jetty://
This is the command prompt output which shows that server is running??
0 [main] INFO org.eclipse.jetty.server.Server û jetty-8.1.10.v20130312
75 [main] INFO org.eclipse.jetty.deploy.providers.ScanningAppProvider û Depl
oyment monitor C:\Users\kapel_000\Desktop\solr-4.10.2\example\contexts at interv
al 0
83 [main] INFO org.eclipse.jetty.deploy.DeploymentManager û Deployable added
: C:\Users\kapel_000\Desktop\solr-4.10.2\example\contexts\solr-jetty-context.xml
1916 [main] INFO org.eclipse.jetty.webapp.StandardDescriptorProcessor û NO JSP
Support for /solr, did not find org.apache.jasper.servlet.JspServlet
2066 [main] INFO org.apache.solr.servlet.SolrDispatchFilter û SolrDispatchFilt
er.init()
2083 [main] INFO org.apache.solr.core.SolrResourceLoader û JNDI not configured
for solr (NoInitialContextEx)
2083 [main] INFO org.apache.solr.core.SolrResourceLoader û solr home defaulted
to 'solr/' (could not find system property or JNDI)
2084 [main] INFO org.apache.solr.core.SolrResourceLoader û new SolrResourceLoa
der for directory: 'solr/'
2248 [main] INFO org.apache.solr.core.ConfigSolr û Loading container configura
tion from C:\Users\kapel_000\Desktop\solr-4.10.2\example\solr\solr.xml
2323 [main] INFO org.apache.solr.core.CoresLocator û Config-defined core root
directory: C:\Users\kapel_000\Desktop\solr-4.10.2\example\solr
2334 [main] INFO org.apache.solr.core.CoreContainer û New CoreContainer 307272
05
2335 [main] INFO org.apache.solr.core.CoreContainer û Loading cores into CoreC
ontainer [instanceDir=solr/]
2351 [main] INFO org.apache.solr.handler.component.HttpShardHandlerFactory û S
etting socketTimeout to: 0
2352 [main] INFO org.apache.solr.handler.component.HttpShardHandlerFactory û S
etting urlScheme to: null
2359 [main] INFO org.apache.solr.handler.component.HttpShardHandlerFactory û S
etting connTimeout to: 0
2360 [main] INFO org.apache.solr.handler.component.HttpShardHandlerFactory û S
etting maxConnectionsPerHost to: 20
2362 [main] INFO org.apache.solr.handler.component.HttpShardHandlerFactory û S
etting corePoolSize to: 0
2363 [main] INFO org.apache.solr.handler.component.HttpShardHandlerFactory û S
etting maximumPoolSize to: 2147483647
2363 [main] INFO org.apache.solr.handler.component.HttpShardHandlerFactory û S
etting maxThreadIdleTime to: 5
2364 [main] INFO org.apache.solr.handler.component.HttpShardHandlerFactory û S
etting sizeOfQueue to: -1
2365 [main] INFO org.apache.solr.handler.component.HttpShardHandlerFactory û S
etting fairnessPolicy to: false
2596 [main] INFO org.apache.solr.update.UpdateShardHandler û Creating UpdateSh
ardHandler HTTP client with params: socketTimeout=0&connTimeout=0&retry=false
2599 [main] INFO org.apache.solr.logging.LogWatcher û SLF4J impl is org.slf4j.
impl.Log4jLoggerFactory
2601 [main] INFO org.apache.solr.logging.LogWatcher û Registering Log Listener
[Log4j (org.slf4j.impl.Log4jLoggerFactory)]
2603 [main] INFO org.apache.solr.core.CoreContainer û Host Name:
7194 [main] INFO org.apache.solr.core.CoresLocator û Looking for core definiti
ons underneath C:\Users\kapel_000\Desktop\solr-4.10.2\example\solr
7213 [main] INFO org.apache.solr.core.CoresLocator û Found core collection1 in
C:\Users\kapel_000\Desktop\solr-4.10.2\example\solr\collection1\
7215 [main] INFO org.apache.solr.core.CoresLocator û Found core collection1 in
C:\Users\kapel_000\Desktop\solr-4.10.2\example\solr\collection5\
7216 [main] INFO org.apache.solr.core.CoresLocator û Found 2 core definitions
7220 [main] ERROR org.apache.solr.servlet.SolrDispatchFilter û Could not start
Solr. Check solr/home property and the logs
7270 [main] ERROR org.apache.solr.core.SolrCore û null:org.apache.solr.common.S
olrException: Found multiple cores with the name [collection1], with instancedir
s [C:\Users\kapel_000\Desktop\solr-4.10.2\example\solr\collection1\] and [C:\Use
rs\kapel_000\Desktop\solr-4.10.2\example\solr\collection5\]
at org.apache.solr.core.CoreContainer.checkForDuplicateCoreNames(CoreCon
tainer.java:297)
at org.apache.solr.core.CoreContainer.load(CoreContainer.java:241)
at org.apache.solr.servlet.SolrDispatchFilter.createCoreContainer(SolrDi
spatchFilter.java:189)
at org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.ja
va:136)
at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:119)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLife
Cycle.java:64)
at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.ja
va:719)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletC
ontextHandler.java:265)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.jav
a:1252)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandle
r.java:710)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494
)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLife
Cycle.java:64)
at org.eclipse.jetty.deploy.bindings.StandardStarter.processBinding(Stan
dardStarter.java:39)
at org.eclipse.jetty.deploy.AppLifeCycle.runBindings(AppLifeCycle.java:1
86)
at org.eclipse.jetty.deploy.DeploymentManager.requestAppGoal(DeploymentM
anager.java:494)
at org.eclipse.jetty.deploy.DeploymentManager.addApp(DeploymentManager.j
ava:141)
at org.eclipse.jetty.deploy.providers.ScanningAppProvider.fileAdded(Scan
ningAppProvider.java:145)
at org.eclipse.jetty.deploy.providers.ScanningAppProvider$1.fileAdded(Sc
anningAppProvider.java:56)
at org.eclipse.jetty.util.Scanner.reportAddition(Scanner.java:609)
at org.eclipse.jetty.util.Scanner.reportDifferences(Scanner.java:540)
at org.eclipse.jetty.util.Scanner.scan(Scanner.java:403)
at org.eclipse.jetty.util.Scanner.doStart(Scanner.java:337)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLife
Cycle.java:64)
at org.eclipse.jetty.deploy.providers.ScanningAppProvider.doStart(Scanni
ngAppProvider.java:121)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLife
Cycle.java:64)
at org.eclipse.jetty.deploy.DeploymentManager.startAppProvider(Deploymen
tManager.java:555)
at org.eclipse.jetty.deploy.DeploymentManager.doStart(DeploymentManager.
java:230)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLife
Cycle.java:64)
at org.eclipse.jetty.util.component.AggregateLifeCycle.doStart(Aggregate
LifeCycle.java:81)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHand
ler.java:58)
at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrappe
r.java:96)
at org.eclipse.jetty.server.Server.doStart(Server.java:280)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLife
Cycle.java:64)
at org.eclipse.jetty.xml.XmlConfiguration$1.run(XmlConfiguration.java:12
59)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:118
2)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.jetty.start.Main.invokeMain(Main.java:473)
at org.eclipse.jetty.start.Main.start(Main.java:615)
at org.eclipse.jetty.start.Main.main(Main.java:96)
7276 [main] INFO org.apache.solr.servlet.SolrDispatchFilter û SolrDispatchFilt
er.init() done
7302 [main] INFO org.eclipse.jetty.server.AbstractConnector û Started SocketCo
nnector#0.0.0.0:8983
Does any of this make any sense? Did I messed up badly (more than once?) or is it something simle I am not aware of?
Here's your error:
7270 [main] ERROR org.apache.solr.core.SolrCore û
null:org.apache.solr.common.S olrException: Found multiple cores with
the name [collection1], with instancedirs
[C:\Users\kapel_000\Desktop\solr-4.10.2\example\solr\collection1] and
[C:\Users\kapel_000\Desktop\solr-4.10.2\example\solr\collection5]
Check your config, you've got the core collection1 configured twice. Once pointing to example\solr\collection1 and once to example\solr\collection5
HTTP ERROR 503
Problem accessing /solr/. Reason:
Server is shutting down or failed to initialize