Purpose: Leverage spring-boot Data Initialize allows you to create a simple database and load it with data.
Problem: Getting an error while starting spring.
org.hibernate.tool.hbm2ddl.SchemaExport : Column "FIRSTNAME" not found; SQL statement
More spring-boot startup:
2015-03-06 17:32:30.919 INFO 3688
2015-03-06 17:32:30.926 INFO 3688
2015-03-06 17:32:31.024 INFO 3688
2015-03-06 17:32:31.034 INFO 3688
name: default
...]
2015-03-06 17:32:31.114 INFO 3688
2015-03-06 17:32:31.119 INFO 3688
2015-03-06 17:32:31.120 INFO 3688
2015-03-06 17:32:31.373 INFO 3688
2015-03-06 17:32:31.427 INFO 3688
2015-03-06 17:32:31.545 INFO 3688
2015-03-06 17:32:31.848 INFO 3688
2015-03-06 17:32:31.853 ERROR 3688
2015-03-06 17:32:31.853 ERROR 3688
insert into customer (firstname, lastname) values ('James', 'Last') [42122-176]
2015-03-06 17:32:31.856 INFO 3688
schema.sql found in / resources
drop table customer if exists;
create table customer (
id bigint auto_increment,
firstname varchar(80) null,
lastname varchar(80) null
);
import.sql found in / resources
insert into customer (firstname, lastname) values ('James', 'Last');
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.1.8.RELEASE</version>
</parent>
<artifactId>TestApp</artifactId>
<packaging>war</packaging>
<name>Spring Boot Web JSP Sample</name>
<description>Spring Boot Web JSP Sample</description>
<url>http://projects.spring.io/spring-boot/</url>
<organization>
<name>Pivotal Software, Inc.</name>
<url>http://www.spring.io</url>
</organization>
<properties>
<main.basedir>${basedir}/../..</main.basedir>
<m2eclipse.wtp.contextRoot>/</m2eclipse.wtp.contextRoot>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<useSystemClassLoader>false</useSystemClassLoader>
</configuration>
</plugin>
</plugins>
</build>
</project>
source
share