Created new project with Spring boot 2.1.0 RELEASE
and my pom.xml
contains this
..
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<version>${spring.boot.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>eclipselink</artifactId>
<version>2.6.3</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>2.0.1.Final</version>
</dependency>
..
I am configuring it using LocalContainerEntityManagerFactoryBean
and there is no application.properties
file :
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
em.setDataSource(dataSource());
em.setPackagesToScan("com.xxxx.api.model");
em.setPersistenceUnitName("xxxx-pu");
Properties prop = new Properties();
prop.putAll(getVendorProperties());
em.setJpaVendorAdapter(vendorAdapter);
em.setJpaProperties(prop);
return em;
}
protected Map<String, String> getVendorProperties() {
final Map<String, String> ret = new HashMap<>();
ret.put(PersistenceUnitProperties.BATCH_WRITING, BatchWriting.JDBC);
ret.put(PersistenceUnitProperties.WEAVING, "false");
ret.put(PersistenceUnitProperties.LOGGING_LEVEL, "ALL");
ret.put(PersistenceUnitProperties.DDL_GENERATION, PersistenceUnitProperties.DROP_AND_CREATE);
return ret;
}
I have a very simple class Account.java
in com.xxxx.api.model
@Data
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name="ACCOUNT")
public class Account{
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@XmlAttribute
@Basic(optional = false)
@Column(name = "ID", nullable = false)
private Long id;
private String username;
private String password;
}
By using these configuration and classes I am not able to generate the ddl automatically .
The output log looks like this :
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.1.0.RELEASE)
2019-12-27 01:47:19.447 INFO 31168 --- [ main] com.xxxx.api.ApiApplication : Starting ApiApplication on server with PID 31168 (/home/user/NetBeansProjects/xxxx-api/target/classes started by user in /home/user/NetBeansProjects/xxxx-api)
2019-12-27 01:47:19.451 INFO 31168 --- [ main] com.xxxx.api.ApiApplication : No active profile set, falling back to default profiles: default
2019-12-27 01:47:20.211 INFO 31168 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
2019-12-27 01:47:20.233 INFO 31168 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 15ms. Found 0 repository interfaces.
2019-12-27 01:47:20.962 INFO 31168 --- [ main] com.xxxx.api.config.Environment : Env: null
2019-12-27 01:47:20.962 INFO 31168 --- [ main] com.xxxx.api.config.Environment : Level 4:
2019-12-27 01:47:20.962 INFO 31168 --- [ main] com.xxxx.api.config.Environment : Property : development
2019-12-27 01:47:20.965 INFO 31168 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'envConfig' of type [com.xxxx.api.config.Environment] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-12-27 01:47:21.028 INFO 31168 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'dataSource' of type [org.springframework.jdbc.datasource.DriverManagerDataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-12-27 01:47:21.032 INFO 31168 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'JPAConfig' of type [com.xxxx.api.config.JPAConfig$$EnhancerBySpringCGLIB$$9bc8315d] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-12-27 01:47:21.146 INFO 31168 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$7e9c54] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-12-27 01:47:21.712 INFO 31168 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2019-12-27 01:47:21.741 INFO 31168 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2019-12-27 01:47:21.741 INFO 31168 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/9.0.12
2019-12-27 01:47:21.751 INFO 31168 --- [ 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/amd64:/usr/lib64:/lib64:/lib:/usr/lib]
2019-12-27 01:47:21.860 INFO 31168 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2019-12-27 01:47:21.861 INFO 31168 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 2325 ms
2019-12-27 01:47:21.922 INFO 31168 --- [ main] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
2019-12-27 01:47:21.923 INFO 31168 --- [ main] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2019-12-27 01:47:21.924 INFO 31168 --- [ main] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'formContentFilter' to: [/*]
2019-12-27 01:47:21.925 INFO 31168 --- [ main] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*]
2019-12-27 01:47:21.925 INFO 31168 --- [ main] .s.DelegatingFilterProxyRegistrationBean : Mapping filter: 'springSecurityFilterChain' to: [/*]
2019-12-27 01:47:21.926 INFO 31168 --- [ main] o.s.b.w.servlet.ServletRegistrationBean : Servlet dispatcherServlet mapped to [/]
2019-12-27 01:47:23.821 INFO 31168 --- [ main] liquibase.executor.jvm.JdbcExecutor : SELECT COUNT(*) FROM xxxx.DATABASECHANGELOGLOCK
2019-12-27 01:47:23.825 INFO 31168 --- [ main] liquibase.executor.jvm.JdbcExecutor : SELECT COUNT(*) FROM xxxx.DATABASECHANGELOGLOCK
2019-12-27 01:47:23.829 INFO 31168 --- [ main] liquibase.executor.jvm.JdbcExecutor : SELECT `LOCKED` FROM xxxx.DATABASECHANGELOGLOCK WHERE ID=1
2019-12-27 01:47:23.850 INFO 31168 --- [ main] l.lockservice.StandardLockService : Successfully acquired change log lock
2019-12-27 01:47:25.618 INFO 31168 --- [ main] liquibase.executor.jvm.JdbcExecutor : SELECT MD5SUM FROM xxxx.DATABASECHANGELOG WHERE MD5SUM IS NOT NULL LIMIT 1
2019-12-27 01:47:25.619 INFO 31168 --- [ main] liquibase.executor.jvm.JdbcExecutor : SELECT COUNT(*) FROM xxxx.DATABASECHANGELOG
2019-12-27 01:47:25.620 INFO 31168 --- [ main] l.c.StandardChangeLogHistoryService : Reading from xxxx.DATABASECHANGELOG
2019-12-27 01:47:25.621 INFO 31168 --- [ main] liquibase.executor.jvm.JdbcExecutor : SELECT * FROM xxxx.DATABASECHANGELOG ORDER BY DATEEXECUTED ASC, ORDEREXECUTED ASC
2019-12-27 01:47:25.627 INFO 31168 --- [ main] l.lockservice.StandardLockService : Successfully released change log lock
[EL Fine]: server: 2019-12-27 01:47:25.981--Thread(Thread[main,5,main])--Configured server platform: org.eclipse.persistence.platform.server.NoServerPlatform
[EL Finest]: jpa: 2019-12-27 01:47:25.993--ServerSession(1340776217)--Thread(Thread[main,5,main])--Begin predeploying Persistence Unit xxxx-pu; session /file:/home/user/NetBeansProjects/xxxx-api/target/classes/_xxxx-pu; state Initial; factoryCount 0
[EL Finest]: properties: 2019-12-27 01:47:25.994--ServerSession(1340776217)--Thread(Thread[main,5,main])--property=eclipselink.orm.throw.exceptions; default value=true
[EL Finest]: properties: 2019-12-27 01:47:25.995--ServerSession(1340776217)--Thread(Thread[main,5,main])--property=eclipselink.multitenant.tenants-share-emf; value=false
[EL Finest]: properties: 2019-12-27 01:47:25.995--ServerSession(1340776217)--Thread(Thread[main,5,main])--property=eclipselink.multitenant.tenants-share-cache; default value=false
[EL Finer]: metadata: 2019-12-27 01:47:26.01--Thread(Thread[main,5,main])--Searching for mapping file: [META-INF/orm.xml] at root URL: [file:/home/user/NetBeansProjects/xxxx-api/target/classes/].
[EL Finer]: metadata: 2019-12-27 01:47:26.014--Thread(Thread[main,5,main])--Searching for mapping file: [META-INF/eclipselink-orm.xml] at root URL: [file:/home/user/NetBeansProjects/xxxx-api/target/classes/].
[EL Config]: metadata: 2019-12-27 01:47:26.114--ServerSession(1340776217)--Thread(Thread[main,5,main])--The access type for the persistent class [class com.xxxx.api.model.Account] is set to [FIELD].
[EL Config]: metadata: 2019-12-27 01:47:26.136--ServerSession(1340776217)--Thread(Thread[main,5,main])--The alias name for the entity class [class com.xxxx.api.model.Account] is being defaulted to: Account.
[EL Config]: metadata: 2019-12-27 01:47:26.154--ServerSession(1340776217)--Thread(Thread[main,5,main])--The column name for element [password] is being defaulted to: PASSWORD.
[EL Config]: metadata: 2019-12-27 01:47:26.156--ServerSession(1340776217)--Thread(Thread[main,5,main])--The column name for element [username] is being defaulted to: USERNAME.
[EL Finest]: jpa: 2019-12-27 01:47:26.168--ServerSession(1340776217)--Thread(Thread[main,5,main])--End predeploying Persistence Unit xxxx-pu; session /file:/home/user/NetBeansProjects/xxxx-api/target/classes/_xxxx-pu; state Predeployed; factoryCount 1
[EL Finer]: metamodel: 2019-12-27 01:47:26.176--ServerSession(1340776217)--Thread(Thread[main,5,main])--Canonical Metamodel class [com.xxxx.api.model.Account_] not found during initialization.
[EL Finer]: metamodel: 2019-12-27 01:47:26.177--ServerSession(1340776217)--Thread(Thread[main,5,main])--Canonical Metamodel class [com.xxxx.api.model.BaseModel_] not found during initialization.
2019-12-27 01:47:26.177 INFO 31168 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'xxxx-pu'
2019-12-27 01:47:26.533 INFO 31168 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2019-12-27 01:47:27.020 INFO 31168 --- [ main] .s.s.UserDetailsServiceAutoConfiguration :
Using generated security password: eaf18e76-a0bc-4afd-853a-2ee7138da3dc
2019-12-27 01:47:27.212 INFO 31168 --- [ main] o.s.s.web.DefaultSecurityFilterChain : Creating filter chain: any request, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@7ec5d3e1, org.springframework.security.web.context.SecurityContextPersistenceFilter@694dc99b, org.springframework.security.web.header.HeaderWriterFilter@518ed9b4, org.springframework.security.web.csrf.CsrfFilter@31c800a5, org.springframework.security.web.authentication.logout.LogoutFilter@590ab84, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@1f7853af, org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter@342a5b57, org.springframework.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter@3b235623, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@153cf928, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@6d71f296, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@51a73873, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@3ddc5a75, org.springframework.security.web.session.SessionManagementFilter@20e73e41, org.springframework.security.web.access.ExceptionTranslationFilter@4a49ce3a, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@17d25e1d]
2019-12-27 01:47:27.428 INFO 31168 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2019-12-27 01:47:27.433 INFO 31168 --- [ main] com.xxxx.api.ApiApplication : Started ApiApplication in 8.813 seconds (JVM running for 9.538)
If I changed my pom.xml's spring.boot.version
to 2.0.9.RELEASE
it works without any issue and generates the ACCOUNT
table as well.