先看具体日志:

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. pymysql 1064, 'You have an error in your SQL syntax; check the manual that corresponds to

    在python 连接mysql时,最近一直出现了 1064, 'You have an error in your SQL syntax; check the manual that correspo ...

  2. stm32f429 仿真器不能识别芯片

    刚买的野火挑战者开发板,下载几次程序后,忽然就不能通过JLINK下载了,提示如下错误: No Cortex-M Device found in JTAG chain. Error: Flash Dow ...

  3. 【2017-11-26】Linq表连接查询

    class Program { static void Main(string[] args) { //Linq创建的数据库上下文对象db DataClasses2DataContext db = n ...

  4. Linux学习笔记(七)Linux常用命令:挂载命令

    一.查询与自动挂载 mount  查询系统中以及挂载的设备 mount -a 依据配置文件 etc/fstab的内容,自动挂载 二.挂载命令 特殊选项 三.挂载光盘 光盘的设备名是默认已知的,为sr0 ...

  5. docker安装redis并以配置文件方式启动

    镜像相关 redis镜像 # 不限定版本 docker pull redis # 拉取 redis为4.0.9版本的镜像 docker pull redis:4.0.9 # 拉取之后查看镜像 dock ...

  6. 算法之暴力破解和kmp算法 判断A字符串是否包含B字符串

    我们都知道java中有封装好的方法,用来比较A字符串是否包含B字符串 如下代码,contains,用法是 str1.contains(str2), 这个布尔型返回,存在返回true,不存在返回fals ...

  7. PHP 调用 exec 执行中文命令的坑

    服务器系统Linux通过php exec 执行rar x 解压命令 保持目录结构,压缩包内英文目录正常解压中文目录解压失败,请问有什么办法可以解决直接在终端命令进行解压是没有问题的 最终解决办法 $s ...

  8. sql 发生死锁

    SELECT request_session_id spid , OBJECT_NAME(resource_associated_entity_id) tableName FROM sys.dm_tr ...

  9. Python 10--模块

    可以在模块中,直接使用__file__,识别出该模块文件的路径. print __file__  

  10. rect dict tect 词根助记

    rect: r (跑)e(E 槽子)ct(不停的跑)  就是直的 dict:  d(椅子)i(人)C(开口说)t(T 桌子)  : 椅子前站人 开口说前面是桌子 tect: tt(TT像盖子)EC(E ...