Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backend-Start in Docker fails #379

Open
MrSebastian opened this issue Oct 16, 2024 · 0 comments
Open

Backend-Start in Docker fails #379

MrSebastian opened this issue Oct 16, 2024 · 0 comments
Labels
bug Something isn't working high

Comments

@MrSebastian
Copy link
Member

Describe the bug
After start of the container it fails:

log
2024-10-16 19:40:19 2024.10.16 17:40:19.414 | praktikumsplaner-backend | TraceId:  | SpanId: ] | ERROR | [main] | SpringApplication | [SpringApplication.java : 859] - Application run failed
2024-10-16 19:40:19 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] due to: Unable to resolve name [org.hibernate.dialect.PostgreSQL95Dialect] as strategy [org.hibernate.dialect.Dialect]
2024-10-16 19:40:19     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1806)
2024-10-16 19:40:19     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:600)
2024-10-16 19:40:19     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522)
2024-10-16 19:40:19     at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:337)
2024-10-16 19:40:19     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
2024-10-16 19:40:19     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:335)
2024-10-16 19:40:19     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:205)
2024-10-16 19:40:19     at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:954)
2024-10-16 19:40:19     at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:625)
2024-10-16 19:40:19     at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146)
2024-10-16 19:40:19     at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754)
2024-10-16 19:40:19     at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:456)
2024-10-16 19:40:19     at org.springframework.boot.SpringApplication.run(SpringApplication.java:335)
2024-10-16 19:40:19     at org.springframework.boot.SpringApplication.run(SpringApplication.java:1363)
2024-10-16 19:40:19     at org.springframework.boot.SpringApplication.run(SpringApplication.java:1352)
2024-10-16 19:40:19     at de.muenchen.oss.praktikumsplaner.MicroServiceApplication.main(MicroServiceApplication.java:39)
2024-10-16 19:40:19     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2024-10-16 19:40:19     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
2024-10-16 19:40:19     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2024-10-16 19:40:19     at java.base/java.lang.reflect.Method.invoke(Method.java:569)
2024-10-16 19:40:19     at org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:102)
2024-10-16 19:40:19     at org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:64)
2024-10-16 19:40:19     at org.springframework.boot.loader.launch.JarLauncher.main(JarLauncher.java:40)
2024-10-16 19:40:19 Caused by: org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] due to: Unable to resolve name [org.hibernate.dialect.PostgreSQL95Dialect] as strategy [org.hibernate.dialect.Dialect]
2024-10-16 19:40:19     at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:276)
2024-10-16 19:40:19     at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:238)
2024-10-16 19:40:19     at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:215)
2024-10-16 19:40:19     at org.hibernate.boot.model.relational.Database.<init>(Database.java:45)
2024-10-16 19:40:19     at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.getDatabase(InFlightMetadataCollectorImpl.java:221)
2024-10-16 19:40:19     at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.<init>(InFlightMetadataCollectorImpl.java:189)
2024-10-16 19:40:19     at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:171)
2024-10-16 19:40:19     at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:1431)
2024-10-16 19:40:19     at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1502)
2024-10-16 19:40:19     at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:75)
2024-10-16 19:40:19     at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:390)
2024-10-16 19:40:19     at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:409)
2024-10-16 19:40:19     at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:396)
2024-10-16 19:40:19     at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:366)
2024-10-16 19:40:19     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1853)
2024-10-16 19:40:19     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1802)
2024-10-16 19:40:19     ... 22 common frames omitted
2024-10-16 19:40:19 Caused by: org.hibernate.boot.registry.selector.spi.StrategySelectionException: Unable to resolve name [org.hibernate.dialect.PostgreSQL95Dialect] as strategy [org.hibernate.dialect.Dialect]
2024-10-16 19:40:19     at org.hibernate.boot.registry.selector.internal.StrategySelectorImpl.selectStrategyImplementor(StrategySelectorImpl.java:154)
2024-10-16 19:40:19     at org.hibernate.boot.registry.selector.internal.StrategySelectorImpl.resolveStrategy(StrategySelectorImpl.java:236)
2024-10-16 19:40:19     at org.hibernate.boot.registry.selector.internal.StrategySelectorImpl.resolveStrategy(StrategySelectorImpl.java:189)
2024-10-16 19:40:19     at org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.constructDialect(DialectFactoryImpl.java:123)
2024-10-16 19:40:19     at org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.buildDialect(DialectFactoryImpl.java:88)
2024-10-16 19:40:19     at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.getJdbcEnvironmentWithDefaults(JdbcEnvironmentInitiator.java:153)
2024-10-16 19:40:19     at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.getJdbcEnvironmentUsingJdbcMetadata(JdbcEnvironmentInitiator.java:364)
2024-10-16 19:40:19     at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:124)
2024-10-16 19:40:19     at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:78)
2024-10-16 19:40:19     at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:130)
2024-10-16 19:40:19     at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:263)
2024-10-16 19:40:19     ... 37 common frames omitted
2024-10-16 19:40:19 Caused by: org.hibernate.boot.registry.classloading.spi.ClassLoadingException: Unable to load class [org.hibernate.dialect.PostgreSQL95Dialect]
2024-10-16 19:40:19     at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.classForName(ClassLoaderServiceImpl.java:126)
2024-10-16 19:40:19     at org.hibernate.boot.registry.selector.internal.StrategySelectorImpl.selectStrategyImplementor(StrategySelectorImpl.java:150)
2024-10-16 19:40:19     ... 47 common frames omitted
2024-10-16 19:40:19 Caused by: java.lang.ClassNotFoundException: Could not load requested class : org.hibernate.dialect.PostgreSQL95Dialect
2024-10-16 19:40:19     at org.hibernate.boot.registry.classloading.internal.AggregatedClassLoader.findClass(AggregatedClassLoader.java:216)
2024-10-16 19:40:19     at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:592)
2024-10-16 19:40:19     at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
2024-10-16 19:40:19     at java.base/java.lang.Class.forName0(Native Method)
2024-10-16 19:40:19     at java.base/java.lang.Class.forName(Class.java:467)
2024-10-16 19:40:19     at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.classForName(ClassLoaderServiceImpl.java:123)
2024-10-16 19:40:19     ... 48 common frames omitted
2024-10-16 19:40:19 Caused by: java.lang.Throwable: null
2024-10-16 19:40:19     at org.hibernate.boot.registry.classloading.internal.AggregatedClassLoader.findClass(AggregatedClassLoader.java:209)
2024-10-16 19:40:19     ... 53 common frames omitted
2024-10-16 19:40:19     Suppressed: java.lang.ClassNotFoundException: org.hibernate.dialect.PostgreSQL95Dialect
2024-10-16 19:40:19             at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
2024-10-16 19:40:19             at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:592)
2024-10-16 19:40:19             at org.springframework.boot.loader.net.protocol.jar.JarUrlClassLoader.loadClass(JarUrlClassLoader.java:107)
2024-10-16 19:40:19             at org.springframework.boot.loader.launch.LaunchedClassLoader.loadClass(LaunchedClassLoader.java:91)
2024-10-16 19:40:19             at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
2024-10-16 19:40:19             at org.hibernate.boot.registry.classloading.internal.AggregatedClassLoader.findClass(AggregatedClassLoader.java:206)
2024-10-16 19:40:19             ... 53 common frames omitted
2024-10-16 19:40:19     Suppressed: java.lang.ClassNotFoundException: org.hibernate.dialect.PostgreSQL95Dialect
2024-10-16 19:40:19             at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
2024-10-16 19:40:19             at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:592)
2024-10-16 19:40:19             at org.springframework.boot.loader.net.protocol.jar.JarUrlClassLoader.loadClass(JarUrlClassLoader.java:107)
2024-10-16 19:40:19             at org.springframework.boot.loader.launch.LaunchedClassLoader.loadClass(LaunchedClassLoader.java:91)
2024-10-16 19:40:19             at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
2024-10-16 19:40:19             at org.hibernate.boot.registry.classloading.internal.AggregatedClassLoader.findClass(AggregatedClassLoader.java:206)
2024-10-16 19:40:19             ... 53 common frames omitted
2024-10-16 19:40:19     Suppressed: java.lang.ClassNotFoundException: org.hibernate.dialect.PostgreSQL95Dialect
2024-10-16 19:40:19             at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
2024-10-16 19:40:19             at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
2024-10-16 19:40:19             at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
2024-10-16 19:40:19             at org.hibernate.boot.registry.classloading.internal.AggregatedClassLoader.findClass(AggregatedClassLoader.java:206)
2024-10-16 19:40:19             ... 53 common frames omitted

To Reproduce
Steps to reproduce the behavior:

  1. checkout dev (0b188ec)
  2. run docker compose up

Expected behavior
App starts succesfull

@MrSebastian MrSebastian added bug Something isn't working high labels Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working high
Projects
None yet
Development

No branches or pull requests

1 participant