先看具体日志:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration': Unsatisfied dependency expressed through constructor parameter ; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.jdbc.DataSourceInitializerInvoker': Invocation of init method failed; nested exception is org.springframework.jdbc.datasource.init.ScriptStatementFailedException: Failed to execute SQL script statement # of URL [jar:file:/home/wlf/springboot-0.0.-SNAPSHOT.jar!/BOOT-INF/classes!/schema.sql]: insert into t_user(user_name, pass_word, role_value) select 'admin', '', 'Admin' from dual where not exists(select user_name, pass_word, role_value from t_user where user_name='admin' and pass_word='' and role_value='Admin'); nested exception is java.sql.SQLException: Field 'id' doesn't have a default value
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:) ~[spring-beans-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:) ~[spring-beans-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$(AbstractBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:) ~[spring-beans-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:) ~[spring-beans-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$(AbstractBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:) ~[spring-beans-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:) ~[spring-context-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:) ~[spring-context-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:) ~[spring-context-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:) ~[spring-boot-2.1..RELEASE.jar!/:2.1..RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:) ~[spring-boot-2.1..RELEASE.jar!/:2.1..RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:) ~[spring-boot-2.1..RELEASE.jar!/:2.1..RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:) ~[spring-boot-2.1..RELEASE.jar!/:2.1..RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:) ~[spring-boot-2.1..RELEASE.jar!/:2.1..RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:) ~[spring-boot-2.1..RELEASE.jar!/:2.1..RELEASE]
at com.crocodile.springboot.SpringbootApplication.main(SpringbootApplication.java:) ~[classes!/:0.0.-SNAPSHOT]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:) ~[na:na]
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:) ~[springboot-0.0.-SNAPSHOT.jar:0.0.-SNAPSHOT]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:) ~[springboot-0.0.-SNAPSHOT.jar:0.0.-SNAPSHOT]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:) ~[springboot-0.0.-SNAPSHOT.jar:0.0.-SNAPSHOT]
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:) ~[springboot-0.0.-SNAPSHOT.jar:0.0.-SNAPSHOT]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.jdbc.DataSourceInitializerInvoker': Invocation of init method failed; nested exception is org.springframework.jdbc.datasource.init.ScriptStatementFailedException: Failed to execute SQL script statement # of URL [jar:file:/home/wlf/springboot-0.0.-SNAPSHOT.jar!/BOOT-INF/classes!/schema.sql]: insert into t_user(user_name, pass_word, role_value) select 'admin', '', 'Admin' from dual where not exists(select user_name, pass_word, role_value from t_user where user_name='admin' and pass_word='' and role_value='Admin'); nested exception is java.sql.SQLException: Field 'id' doesn't have a default value
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$(AbstractBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:) ~[spring-beans-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:) ~[spring-beans-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:) ~[spring-beans-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:) ~[spring-beans-5.1..RELEASE.jar!/:5.1..RELEASE]
... common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.jdbc.DataSourceInitializerInvoker': Invocation of init method failed; nested exception is org.springframework.jdbc.datasource.init.ScriptStatementFailedException: Failed to execute SQL script statement # of URL [jar:file:/home/wlf/springboot-0.0.-SNAPSHOT.jar!/BOOT-INF/classes!/schema.sql]: insert into t_user(user_name, pass_word, role_value) select 'admin', '', 'Admin' from dual where not exists(select user_name, pass_word, role_value from t_user where user_name='admin' and pass_word='' and role_value='Admin'); nested exception is java.sql.SQLException: Field 'id' doesn't have a default value
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$(AbstractBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:) ~[spring-beans-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveNamedBean(DefaultListableBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveBean(DefaultListableBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.boot.autoconfigure.jdbc.DataSourceInitializerPostProcessor.postProcessAfterInitialization(DataSourceInitializerPostProcessor.java:) ~[spring-boot-autoconfigure-2.1..RELEASE.jar!/:2.1..RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar!/:5.1..RELEASE]
... common frames omitted
Caused by: org.springframework.jdbc.datasource.init.ScriptStatementFailedException: Failed to execute SQL script statement # of URL [jar:file:/home/wlf/springboot-0.0.-SNAPSHOT.jar!/BOOT-INF/classes!/schema.sql]: insert into t_user(user_name, pass_word, role_value) select 'admin', '123456, 'Admin' from dual where not exists(select user_name, pass_word, role_value from t_user where user_name='admin' and pass_word='' and role_value='Admin'); nested exception is java.sql.SQLException: Field 'id' doesn't have a default value
at org.springframework.jdbc.datasource.init.ScriptUtils.executeSqlScript(ScriptUtils.java:) ~[spring-jdbc-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.jdbc.datasource.init.ResourceDatabasePopulator.populate(ResourceDatabasePopulator.java:) ~[spring-jdbc-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.jdbc.datasource.init.DatabasePopulatorUtils.execute(DatabasePopulatorUtils.java:) ~[spring-jdbc-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.boot.autoconfigure.jdbc.DataSourceInitializer.runScripts(DataSourceInitializer.java:) ~[spring-boot-autoconfigure-2.1..RELEASE.jar!/:2.1..RELEASE]
at org.springframework.boot.autoconfigure.jdbc.DataSourceInitializer.createSchema(DataSourceInitializer.java:) ~[spring-boot-autoconfigure-2.1..RELEASE.jar!/:2.1..RELEASE]
at org.springframework.boot.autoconfigure.jdbc.DataSourceInitializerInvoker.afterPropertiesSet(DataSourceInitializerInvoker.java:) ~[spring-boot-autoconfigure-2.1..RELEASE.jar!/:2.1..RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar!/:5.1..RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:) ~[spring-beans-5.1..RELEASE.jar!/:5.1..RELEASE]
... common frames omitted
Caused by: java.sql.SQLException: Field 'id' doesn't have a default value
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:) ~[mysql-connector-java-8.0..jar!/:8.0.]
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:) ~[mysql-connector-java-8.0..jar!/:8.0.]
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:) ~[mysql-connector-java-8.0..jar!/:8.0.]
at com.mysql.cj.jdbc.StatementImpl.executeInternal(StatementImpl.java:) ~[mysql-connector-java-8.0..jar!/:8.0.]
at com.mysql.cj.jdbc.StatementImpl.execute(StatementImpl.java:) ~[mysql-connector-java-8.0..jar!/:8.0.]
at com.zaxxer.hikari.pool.ProxyStatement.execute(ProxyStatement.java:) ~[HikariCP-3.2..jar!/:na]
at com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java) ~[HikariCP-3.2..jar!/:na]
at org.springframework.jdbc.datasource.init.ScriptUtils.executeSqlScript(ScriptUtils.java:) ~[spring-jdbc-5.1..RELEASE.jar!/:5.1..RELEASE]
... common frames omitted

  从上述日志中看到,启动Spring boot时先去初始化Spring data JPA,但没有加载到数据源DataSource对象。那为啥数据源会加载失败,其实引发的原因是执行初始化脚本执行失败。先看application.properties文件配置的数据源:

#mysql数据库配置
spring.datasource.url=jdbc:mysql://localhost:3306/test?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
spring.datasource.username=root
spring.datasource.password=
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.initialization-mode=always

  最后一行指定了数据源初始化时必须去执行我的预置脚本schema.sql:

create table if not exists t_user (
id bigint not null auto_increment,
user_name varchar() not null,
pass_word varchar() not null,
role_value varchar() not null,
primary key (id)
); insert into t_user(user_name, pass_word, role_value) select 'admin', '', 'admin' from dual where not exists(select user_name, pass_word, role_value from t_user where user_name='admin' and pass_word='' and role_value='admin');

  重启Spring boot时为防止重复建表用了if not exists、重复插入用了insert into...select from dual where not exists,都是先看有没有,没有了再操作。因为这里的id是自增长的,所以就算我的插入语句不指定id,mysql也会默认自动给id赋一个自增长的值。如果真按以上执行了,那应该不会出现问题才对。但事实很明显,Spring boot不按此套路来。看下我的实体类中主键ID的定义:

@Entity
@Table(name = "T_USER")
public class User implements Serializable {
@Id
@GeneratedValue
   private Long id; private String userName; private String passWord; private String roleValue; ...
}

  以上实例类中我们指定ID是自增长的,可是这个增长不是mysql的自增,而是Spring Data JPA去设置的。我们看下@GeneratedValue究竟给我们设置了怎样的生成策略:

@Target({ElementType.METHOD, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
public @interface GeneratedValue {
GenerationType strategy() default GenerationType.AUTO; String generator() default "";
}

  它默认是GenerationType.AUTO,若想让mysql接手设置自动增长,必须用这个:

   @Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

  生成类型有四种:

  • TABLE:使用一个特定的数据库表来保存主键,也就是你可以自己指定哪张表。
  • SEQUENCE:根据底层数据库的序列来生成主键,当然条件是得数据库支持序列的生成。
  • IDENTITY:主键由数据库自动生成(主要是自动增长型),比如mysql就会设置扩展属性为auto_increment
  • AUTO:主键由程序控制,程序自动生成表,比如在mysql里会自动创建表hibernate_sequence,每次新增都会读取next_val值作为自增长ID。

  我们看下使用AUTO生成的表结构:

mysql> desc t_user;
+------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------+--------------+------+-----+---------+-------+
| id | bigint() | NO | PRI | NULL | |
| pass_word | varchar() | YES | | NULL | |
| role_value | varchar() | YES | | NULL | |
| user_name | varchar() | YES | | NULL | |
+------------+--------------+------+-----+---------+-------+
rows in set (0.00 sec)

  直接insert不带主键默认值必然报错:

mysql> insert into t_user(user_name, pass_word, role_value) values ('wlf', '', 'sales');
ERROR (HY000): Field 'id' doesn't have a default value

  换IDENTITY试试:

mysql> desc t_user;
+------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------+--------------+------+-----+---------+----------------+
| id | bigint() | NO | PRI | NULL | auto_increment |
| user_name | varchar() | NO | | NULL | |
| pass_word | varchar() | NO | | NULL | |
| role_value | varchar() | NO | | NULL | |
+------------+--------------+------+-----+---------+----------------+
rows in set (0.01 sec)

  我们看到mysql的自增长属性带上了,这时再使用不带自增长的id字段入库成功了:

mysql> insert into t_user(user_name, pass_word, role_value) values('aaa', '', 'sales');
Query OK, row affected (0.02 sec)

  另外需要注意,mysql里没有建表前你指定主键生成策略为IDENTITY会加上自增长属性,但如果你开始是AUTO的,后来再改为IDENTITY的,那么你需要手动去mysql里修改约束,自己加上自增长属性,或者drop表重来。

启动Spring boot报错:nested exception is java.sql.SQLException: Field 'id' doesn't have a default value的更多相关文章

  1. Hibernate报错:Caused by: java.sql.SQLException: Field 'ID' doesn't have a default value

    问题一: 报错如下: org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assig ...

  2. Could not get JDBC Connection; nested exception is java.sql.SQLException: ${jdbc.driver}

    在一个SSM分布式项目中一个服务报错: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnec ...

  3. Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: Connectio

    严重: StandardWrapper.Throwableorg.springframework.transaction.CannotCreateTransactionException: Could ...

  4. nested exception is java.sql.SQLException: Cannot convert value '0000-00-00 00:00:00' from column 14 to TIMESTAMP.

    无法将"0000-00-00 00:00:00"转换为TIMESTAMP 2017-05-08 00:56:59 [ERROR] - cn.kee.core.dao.impl.Ge ...

  5. nested exception is java.sql.SQLException: IO 错误

    1.错误描述 (mx.messaging.messages::ErrorMessage)#0 body = (null) clientId = "18CE3B03-9709-9DA8-763 ...

  6. nested exception is java.sql.SQLException: Incorrect string value: '\xE7\x99\xBB\xE9\x99\x86...' for column 'image' at row 1

    HTTP Status 500 - Hibernate operation: could not insert: [cn.itcast.shop.product.vo.Product]; uncate ...

  7. 2016.11.10 Could not get JDBC Connection; nested exception is java.sql.SQLException: No suitable driver

    运行项目rds_web时,出现错误提示:Could not get JDBC Connection; nested exception is java.sql.SQLException: No sui ...

  8. 无法解析db.properties,spring报错:Caused by: java.sql.SQLException: unkow jdbc driver : ${url}

    db.properties中配置了url等jdbc连接属性: driver=org.sqlite.JDBCurl=jdbc:sqlite:D:/xxx/data/sqliteDB/demo.dbuse ...

  9. 解决sqoop导入报错:Caused by: java.sql.SQLException: Protocol violation

    报错信息: -- ::, INFO [main] org.apache.hadoop.mapred.MapTask: Ignoring exception during close for org.a ...

随机推荐

  1. 初级文件IO——IO过程、open、close、write、read、lseek、dup、dup2、errno、perror

    先要回答的问题 文件IO指的是什么? 本文主要讲述如何调用Linux OS所提供的相关的OS API,实现文件的读写. 如何理解文件IO? IO就是input output的意思,文件io就是文件输入 ...

  2. linux 、 CentOs ---> 环境变量设置

    Linux下环境变量设置 1.在Windows 系统下,很多软件安装都需要配置环境变量,比如 安装 jdk ,如果不配置环境变量,在非软件安装的目录下运行javac 命令,将会报告找不到文件,类似的错 ...

  3. 【转】Java8中list转map方法总结

    https://blog.csdn.net/zlj1217/article/details/81611834 背景在最近的工作开发之中,慢慢习惯了很多Java8中的Stream的用法,很方便而且也可以 ...

  4. 作业十一——LL(1)文法的判断

    1. 文法 G(S): (1)S -> AB (2)A ->Da|ε (3)B -> cC (4)C -> aADC |ε (5)D -> b|ε 验证文法 G(S)是不 ...

  5. Til the Cows Come Home(Dijkstra)

    Dijkstra (迪杰斯特拉)最短路算法,算是模板 POJ - 2387 #include<iostream> #include<algorithm> #include< ...

  6. Java基础 IO流的文件和目录的五类主要操作

    笔记: /** IO流的 文件和目录的操作 * 1.路径需要 需要两个反斜杠 或者一个单斜杠! * 绝对路径:包括盘符在内的完整的路径名! * 相对路径:在当前目录文件下的路径! * 2.File 是 ...

  7. 大数据之路week04--day03(网络编程)

    哎,怎么感觉自己变得懒了起来,更新博客的频率变得慢了起来,可能是因为最近得知识开始变得杂变得难了起来,之前在上课的时候,也没有好好听这一方面的知识,所以,现在可以说是在学的新的知识,要先去把新的知识思 ...

  8. javascript逻辑非(!/!!)

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  9. Codeforces Round #429 (Div. 2/Div. 1) [ A/_. Generous Kefa ] [ B/_. Godsend ] [ C/A. Leha and Function ] [ D/B. Leha and another game about graph ] [ E/C. On the Bench ] [ _/D. Destiny ]

    PROBLEM A/_ - Generous Kefa 题 OvO http://codeforces.com/contest/841/problem/A cf 841a 解 只要不存在某个字母,它的 ...

  10. 2 使用unitest 模块扩展功能测试

    准备做一个 待办事项清单网站,来演示 Web 开发过程中的所有主要步骤.以及如何在各个步骤中运用TDD理念. ”功能测试“: 从用户的角度查看应用是如何运作的. 从某种程度上可以作为应用的说明书. 作 ...