精华内容
下载资源
问答
  • C #error 用法

    千次阅读 2019-09-19 19:53:51
    定义:#error 是C/C++预处理命令。 语法: #error 错误消息 //错误消息不需要双引号括起来 作用:当预处理器预处理遇到#error命令时停止编译并输出用户自定义的错误消息。常与#if ...#endif 一起使用,用于判断...

    定义:#error 是C/C++预处理命令。

    语法:

    #error 错误消息  //错误消息不需要双引号括起来

    作用:当预处理器预处理遇到#error命令时停止编译并输出用户自定义的错误消息。常与#if ...#endif 一起使用,用于判断某个宏是否满足某个特定条件,如果不满足则执行#error命令输出错误信息,满足则跳过继续预编译。

    demo:

    #include <stdio.h>

    #ifdef __cplusplus //c++编译器宏

    #error 请使用g++,不能用gcc

    #endif

    int main()

    {

    }

    注:如果c++工程使用gcc编译,程序编译完成后会报出一堆未知错误,不方便查出问题具体所在。加上#error如果预编译器编译到#error位置则会马上停止编译,报出错误,程序员一下就知道问题出在哪里。

     

    简单总结,不足的地方希望留言,我及时补充。

    展开全文
  • C语言#error预处理

    千次阅读 2018-05-15 13:28:33
    #error 预处理指令的作用是,编译程序时,只要遇到#error 就会生成一个编译错误提示消息,并停止编译。其语法格式为:#error error-message注意,宏串error-message 不用双引号包围。遇到#error 指令时,错误信息被...

    #error 预处理指令的作用是,编译程序时,只要遇到#error 就会生成一个编译错误提示消息,并停止编译。其语法格式为:

    #error error-message

    注意,宏串error-message 不用双引号包围。遇到#error 指令时,错误信息被显示,可能同时还显示编译程序作者预先定义的其他内容。

    该预处理将产生一条编译时错误信息,信息中包含#error后指定的内容。

    C语言标准中,要求对于#error后面的指定的内容也进行宏展开,但在我测试后发现Visual Studio 2008并没有对这一特性提供支持。所以,在我们的程序中,应尽量避免出现不同编译器实现可能各不相同的标准特性。

    该预处理器指令看似无用,因为一旦遇到它,程序的编译过程就会出错,无法完成编译。那么它应该用在什么场合呢?

    大家想必对”断言“早有耳闻。在程序运行时,一旦遇到断言不成立,程序即会报错终止,以方便程序调试。#error与#if搭配使用可以认为是一个用于调试宏的编译期断言。

    下面看一个例子说明#error的典型应用实例:

    [html]  view plain  copy
    1. #include "stdio.h"  
    2. int main(int argc, char* argv[])   
    3. {  
    4. #define CONST_NAME1 "CONST_NAME1"  
    5.     printf("%s\n",CONST_NAME1);  
    6. #undef CONST_NAME1  
    7.   
    8. #ifndef CONST_NAME1  
    9.     #error No defined Constant Symbol CONST_NAME1  
    10. #endif  
    11.   
    12. #define CONST_NAME2 "CONST_NAME2"  
    13.     printf("%s\n",CONST_NAME2);    
    14.     printf("%s\n",CONST_NAME2);      
    15.     return 0;   
    16. }   
    在编译的时候输出如编译信息 :

     fatal error C1189: #error : No defined Constant Symbol CONST_NAME1

    上面的代码会引发一个#error错误。综上,对含有复杂逻辑的宏代码使用#error是一个很好用的技巧。它确保了程序在关键点上确实按照程序员的想法被预处理,否则便无法编译通过。而且,重要的是:编译期行为不会引起任何运行期的资源开销。



    编译程序时,只要遇到 #error 就会跳出一个编译错误,既然是编译错误,要它干嘛呢?其目的就是保证程序是按照你所设想的那样进行编译的。

    下面举个例子:
    程序中往往有很多的预处理指令
    #ifdef XXX
    ...
    #else

    #endif

    当程序比较大时,往往有些宏定义是在外部指定的(如makefile),或是在系统头文件中指定的,当你不太确定当前是否定义了 XXX 时,就可以改成如下这样进行编译:

    #ifdef XXX
    ...
    #error "XXX has been defined"

    #else

    #endif

    这样,如果编译时出现错误,输出了XXX has been defined,表明宏XXX已经被定义了。


    用处就是这样,是不是感觉很没有用处?

    展开全文
  • mybatis学习之User.xml小错误 1、报错源码: 2、错误表现与原因分析: 3、问题解决: 1、报错源码: 在学习mybatis过程中,报错如下 org.apache.ibatis.exceptions....### The error may exist in sqlmap/User....

    mybatis学习之User.xml小错误

    1、报错源码:
    2、错误表现与原因分析:
    3、问题解决:

    1、报错源码:

    在学习mybatis过程中,报错如下

    org.apache.ibatis.exceptions.PersistenceException: 
    ### Error building SqlSession.
    ### The error may exist in sqlmap/User.xml
    ### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'java.long.String'.  Cause: java.lang.ClassNotFoundException: Cannot find class: java.long.String
    	at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:26)
    	at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:82)
    	at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:66)
    	at cn.itcast.mybatis.first.MybatisFirst.findUserByNameTest(MybatisFirst.java:66)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
    	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
    	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
    	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
    	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:69)
    	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:48)
    	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
    	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
    	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
    	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
    	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
    	at org.junit.runners.ParentRunner.run(ParentRunner.java:292)
    	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:89)
    	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:41)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:541)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:763)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:463)
    	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:209)
    Caused by: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'java.long.String'.  Cause: java.lang.ClassNotFoundException: Cannot find class: java.long.String
    	at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:109)
    	at org.apache.ibatis.builder.xml.XMLConfigBuilder.parse(XMLConfigBuilder.java:92)
    	at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:80)
    	... 25 more
    Caused by: org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'java.long.String'.  Cause: java.lang.ClassNotFoundException: Cannot find class: java.long.String
    	at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:120)
    	at org.apache.ibatis.builder.xml.XMLMapperBuilder.parse(XMLMapperBuilder.java:92)
    	at org.apache.ibatis.builder.xml.XMLConfigBuilder.mapperElement(XMLConfigBuilder.java:322)
    	at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:107)
    	... 27 more
    Caused by: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'java.long.String'.  Cause: java.lang.ClassNotFoundException: Cannot find class: java.long.String
    	at org.apache.ibatis.builder.BaseBuilder.resolveClass(BaseBuilder.java:103)
    	at org.apache.ibatis.builder.xml.XMLStatementBuilder.parseStatementNode(XMLStatementBuilder.java:66)
    	at org.apache.ibatis.builder.xml.XMLMapperBuilder.buildStatementFromContext(XMLMapperBuilder.java:135)
    	at org.apache.ibatis.builder.xml.XMLMapperBuilder.buildStatementFromContext(XMLMapperBuilder.java:128)
    	at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:118)
    	... 30 more
    Caused by: org.apache.ibatis.type.TypeException: Could not resolve type alias 'java.long.String'.  Cause: java.lang.ClassNotFoundException: Cannot find class: java.long.String
    	at org.apache.ibatis.type.TypeAliasRegistry.resolveAlias(TypeAliasRegistry.java:117)
    	at org.apache.ibatis.builder.BaseBuilder.resolveAlias(BaseBuilder.java:130)
    	at org.apache.ibatis.builder.BaseBuilder.resolveClass(BaseBuilder.java:101)
    	... 34 more
    Caused by: java.lang.ClassNotFoundException: Cannot find class: java.long.String
    	at org.apache.ibatis.io.ClassLoaderWrapper.classForName(ClassLoaderWrapper.java:190)
    	at org.apache.ibatis.io.ClassLoaderWrapper.classForName(ClassLoaderWrapper.java:89)
    	at org.apache.ibatis.io.Resources.classForName(Resources.java:256)
    	at org.apache.ibatis.type.TypeAliasRegistry.resolveAlias(TypeAliasRegistry.java:113)
    	... 36 more
    
    
    

    2、错误表现与原因分析

    错误表现: 在debug的过程中,进行创建会话工厂,传入mybatis的配置文件信息之后,自动跳转到底层源码,然后再往下debug就会报如上错误。

    原因分析: 由上图提示可以看出,是User.xml的错误,就是
    <select id="findUserByName" parameterType="java.lang.String" resultType="cn.itcast.mybatis.po.User"> SELECT * FROM USER WHERE username LIKE '%${value}%' </select>
    这几行代码中,没有修改错误之前,忘记加了resultType="cn.itcast.mybatis.po.User
    ,加进去之后,再debug就没问题了

    3、问题解决:

    原错误代码:

    <select id="findUserByName" parameterType="java.long.String">
          select * from USER WHERE username LIKE '%${value}%'
      </select>
      
    

    正确代码:

    <select id="findUserByName" parameterType="java.lang.String" resultType="cn.itcast.mybatis.po.User">
    		SELECT * FROM USER WHERE username LIKE '%${value}%'
    	</select>
    
    展开全文
  • 如果我的博客能够帮到大家能够点个赞,关注一下,以后还会更新更过JavaWeb的高级技术,大家的支持...### Error updating database. Cause: java.sql.SQLException: Field 't_id' doesn't have a default value ### ...

        如果我的博客能够帮到大家能够点个赞,关注一下,以后还会更新更过JavaWeb的高级技术,大家的支持就是我继续更新的动力。谢谢。

              做测试的时候报错:

    ### Error updating database.  Cause: java.sql.SQLException: Field 't_id' doesn't have a default value
    ### The error may involve com.muji.zh.admin.mapper.ComplaintMapper.insertSelective-Inline
    ### The error occurred while setting parameters
    ### SQL: insert into complaint      ( id,                       cname,                       title,                       content,                                                          who_id,                                     ubarn_id,                       area_id,                       sign )       values ( ?,                       ?,                       ?,                       ?,                                                          ?,                                     ?,                       ?,                       ? )
    ### Cause: java.sql.SQLException: Field 't_id' doesn't have a default value
    ; SQL []; Field 't_id' doesn't have a default value; nested exception is java.sql.SQLException: Field 't_id' doesn't have a default value
    org.springframework.dao.DataIntegrityViolationException: 
    ### Error updating database.  Cause: java.sql.SQLException: Field 't_id' doesn't have a default value
    ### The error may involve com.muji.zh.admin.mapper.ComplaintMapper.insertSelective-Inline
    ### The error occurred while setting parameters
    ### SQL: insert into complaint      ( id,                       cname,                       title,                       content,                                                          who_id,                                     ubarn_id,                       area_id,                       sign )       values ( ?,                       ?,                       ?,                       ?,                                                          ?,                                     ?,                       ?,                       ? )
    ### Cause: java.sql.SQLException: Field 't_id' doesn't have a default value
    ; SQL []; Field 't_id' doesn't have a default value; nested exception is java.sql.SQLException: Field 't_id' doesn't have a default value
    	at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:243)
    	at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73)
    	at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:75)
    	at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:447)
    	at com.sun.proxy.$Proxy47.insert(Unknown Source)
    	at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:279)
    	at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:56)
    	at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:53)
    	at com.sun.proxy.$Proxy58.insertSelective(Unknown Source)
    	at com.muji.zh.admin.serviceImpl.ComplaintServiceImpl.insertSelective(ComplaintServiceImpl.java:41)
    	at com.alibaba.dubbo.common.bytecode.Wrapper9.invokeMethod(Wrapper9.java)
    	at com.alibaba.dubbo.rpc.proxy.javassist.JavassistProxyFactory$1.doInvoke(JavassistProxyFactory.java:46)
    	at com.alibaba.dubbo.rpc.proxy.AbstractProxyInvoker.invoke(AbstractProxyInvoker.java:72)
    	at com.alibaba.dubbo.rpc.protocol.InvokerWrapper.invoke(InvokerWrapper.java:53)
    	at com.alibaba.dubbo.rpc.filter.ExceptionFilter.invoke(ExceptionFilter.java:64)
    	at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91)
    	at com.alibaba.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:75)
    	at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91)
    	at com.alibaba.dubbo.rpc.filter.TimeoutFilter.invoke(TimeoutFilter.java:42)
    	at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91)
    	at com.alibaba.dubbo.rpc.protocol.dubbo.filter.TraceFilter.invoke(TraceFilter.java:78)
    	at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91)
    	at com.alibaba.dubbo.rpc.filter.ContextFilter.invoke(ContextFilter.java:60)
    	at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91)
    	at com.alibaba.dubbo.rpc.filter.GenericFilter.invoke(GenericFilter.java:112)
    	at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91)
    	at com.alibaba.dubbo.rpc.filter.ClassLoaderFilter.invoke(ClassLoaderFilter.java:38)
    	at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91)
    	at com.alibaba.dubbo.rpc.filter.EchoFilter.invoke(EchoFilter.java:38)
    	at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91)
    	at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol$1.reply(DubboProtocol.java:108)
    	at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleRequest(HeaderExchangeHandler.java:84)
    	at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:170)
    	at com.alibaba.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:52)
    	at com.alibaba.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:82)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    	at java.lang.Thread.run(Thread.java:745)
    Caused by: java.sql.SQLException: Field 't_id' doesn't have a default value
    	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:964)
    	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3973)
    	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3909)
    	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2527)
    	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2680)
    	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2487)
    	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1858)
    	at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1197)
    	at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:493)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:59)
    	at com.sun.proxy.$Proxy91.execute(Unknown Source)
    	at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:46)
    	at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:74)
    	at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:50)
    	at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117)
    	at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63)
    	at com.sun.proxy.$Proxy89.update(Unknown Source)
    	at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:198)
    	at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:185)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:434)
    	... 34 more
    ] with root cause
    
    java.lang.RuntimeException: org.springframework.dao.DataIntegrityViolationException: 
    ### Error updating database.  Cause: java.sql.SQLException: Field 't_id' doesn't have a default value
    ### The error may involve com.muji.zh.admin.mapper.ComplaintMapper.insertSelective-Inline
    ### The error occurred while setting parameters
    ### SQL: insert into complaint      ( id,                       cname,                       title,                       content,                                                          who_id,                                     ubarn_id,                       area_id,                       sign )       values ( ?,                       ?,                       ?,                       ?,                                                          ?,                                     ?,                       ?,                       ? )
    ### Cause: java.sql.SQLException: Field 't_id' doesn't have a default value
    ; SQL []; Field 't_id' doesn't have a default value; nested exception is java.sql.SQLException: Field 't_id' doesn't have a default value
    org.springframework.dao.DataIntegrityViolationException: 
    ### Error updating database.  Cause: java.sql.SQLException: Field 't_id' doesn't have a default value
    ### The error may involve com.muji.zh.admin.mapper.ComplaintMapper.insertSelective-Inline
    ### The error occurred while setting parameters
    ### SQL: insert into complaint      ( id,                       cname,                       title,                       content,                                                          who_id,                                     ubarn_id,                       area_id,                       sign )       values ( ?,                       ?,                       ?,                       ?,                                                          ?,                                     ?,                       ?,                       ? )
    ### Cause: java.sql.SQLException: Field 't_id' doesn't have a default value
    ; SQL []; Field 't_id' doesn't have a default value; nested exception is java.sql.SQLException: Field 't_id' doesn't have a default value
    	at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:243)
    	at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73)
    	at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:75)
    	at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:447)
    	at com.sun.proxy.$Proxy47.insert(Unknown Source)
    	at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:279)
    	at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:56)
    	at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:53)
    	at com.sun.proxy.$Proxy58.insertSelective(Unknown Source)
    	at com.muji.zh.admin.serviceImpl.ComplaintServiceImpl.insertSelective(ComplaintServiceImpl.java:41)
    	at com.alibaba.dubbo.common.bytecode.Wrapper9.invokeMethod(Wrapper9.java)
    	at com.alibaba.dubbo.rpc.proxy.javassist.JavassistProxyFactory$1.doInvoke(JavassistProxyFactory.java:46)
    	at com.alibaba.dubbo.rpc.proxy.AbstractProxyInvoker.invoke(AbstractProxyInvoker.java:72)
    	at com.alibaba.dubbo.rpc.protocol.InvokerWrapper.invoke(InvokerWrapper.java:53)
    	at com.alibaba.dubbo.rpc.filter.ExceptionFilter.invoke(ExceptionFilter.java:64)
    	at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91)
    	at com.alibaba.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:75)
    	at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91)
    	at com.alibaba.dubbo.rpc.filter.TimeoutFilter.invoke(TimeoutFilter.java:42)
    	at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91)
    	at com.alibaba.dubbo.rpc.protocol.dubbo.filter.TraceFilter.invoke(TraceFilter.java:78)
    	at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91)
    	at com.alibaba.dubbo.rpc.filter.ContextFilter.invoke(ContextFilter.java:60)
    	at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91)
    	at com.alibaba.dubbo.rpc.filter.GenericFilter.invoke(GenericFilter.java:112)
    	at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91)
    	at com.alibaba.dubbo.rpc.filter.ClassLoaderFilter.invoke(ClassLoaderFilter.java:38)
    	at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91)
    	at com.alibaba.dubbo.rpc.filter.EchoFilter.invoke(EchoFilter.java:38)
    	at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91)
    	at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol$1.reply(DubboProtocol.java:108)
    	at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleRequest(HeaderExchangeHandler.java:84)
    	at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:170)
    	at com.alibaba.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:52)
    	at com.alibaba.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:82)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    	at java.lang.Thread.run(Thread.java:745)
    Caused by: java.sql.SQLException: Field 't_id' doesn't have a default value

               报错原因:数据库非空字段插入了空值

               解决办法:给非空字段插入相应的值

    展开全文
  • C语言之#error/#warning

    千次阅读 2018-12-10 12:17:17
    很多人写了一两年代码可能也没用过#error和#warning吧!我也是如此,因为我之前也不知道C语言中还有这玩意的存在,还是在看别人的代码后才知道有这个东西的。但是事实上你在编译代码的时候它们经常会在你的眼前晃悠...
  • error: #error PCL requires C++14 or above

    千次阅读 2020-07-24 17:07:32
    SLAM十四讲中ch5 PCL编译出错解决办法 错误提示 error: #error PCL requires C++14 or above 解决办法 在CMakeLists.txt中添加 set( CMAKE_CXX_STANDARD 14) 即可解决
  • mybatis项目遇到如下问题: org.apache.ibatis.exceptions....### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last...
  • ### Error updating database. Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for StudentMapper.xml ### Cause: java.lang.IllegalArgumentException: Mapped ...
  • c++ fatal error C1189: #error:解决方案

    千次阅读 2019-12-27 14:57:49
    fatal error C1189: 方案1 方案2:修改源码: LNK1104: cannot open file 'MSCOREE.lib' fatal error C1189: 错误类型:(atl) 1、C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\mutex(8)...
  • fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h> 当你第一次遇到这个编译问题时,大家都会觉得非常奇怪,怎么会出现这么奇葩的编译错误;我已经遇到过好...
  • 在自学Mybatis的时候,创建了我的第一个Mybatis程序,可无奈一直报错,本身只是一个刚刚接触...org.apache.ibatis.exceptions.PersistenceException: Error querying database.Cause:com.mysql.jdbc.exceptions.jdbc4...
  • 找了大半天原因,最后发现是xml里面的标签在作祟,气死我了 不知道是mybatis-plus的原因还是mybatis的原因把delete换成selete就好了我也是醉了啊
  • 在编写代码是会遇到错误 1 error C1189: #error : “No Target Architecture” 的错误,错误源文件winnt.h 报错原因:所写代码头文件中即包含了windows.h,又包含了windows.h中已经包含的系统头文件 以我的错误为例...
  • org.apache.ibatis.exceptions.PersistenceException: ...### Error building SqlSession. ### The error may exist in sqlmap/User.xml ### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Ma
  • Ubuntu编译报错 error: #error PCL requires C++14 or above 自己在编译ndt_omp功能包的时候,出现报错 error: #error PCL requires C++14 or above,并且后面一堆报错,刚开始以为是PCL版本问题,后来反倒其他博主的...
  • 在写#error之前顺便学习习其他预定义的方法 如#ifdef #else #endif #ifndef等(英语不好,打印的提示不规范,勿笑话) 有如下程序 int main(void) { #ifdef ABC printf("111 有宏定义 ABC\n"); #else ...
  • org.springframework.jdbc.BadSqlGrammarException: ### Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual t...
  • C语言#error命令,阻止程序编译

    千次阅读 2018-07-01 22:52:08
    #error 指令用于在编译期间产生错误信息,并阻止程序的编译,其形式如下:#error error_message例如,我们的程序针对Linux编写,不保证兼容Windows,那么可以这样做:#ifdef WIN32#error This programme cannot ...
  • ### Error updating database. Cause: java.sql.SQLSyntaxErrorException: Unknown column 'province' in 'field list' ### The error may involve defaultParameterMap ### The error occurred while setting para....
  • 出现错误 fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>的解决办法: 整理一个授权函数加到已有的dll中,在编译加入的代码时出现如题的bug,整了好久都没...
  • .###Error querying database. Cause: com.mysql.jdbc.exceptions. 原因:为配置连接池的时候,数据库的路径写错了. 解决方案:检查配置JDBC连接池的数据库账密地址是否写对. ps:如果使用jdk9或以上...
  • mysql五种日期类型的取值范围 YEAR ,字节数为1,取值范围为“1901——2155” DATE,字节数为4,取值范围为“1000-01-01——9999-12-31” TIME,字节数为3,取值范围为“-838:59:59——838:59:59” ...
  • 在学mybatis第一个demo中就遇到这个,查询什么的没事,添加就不行了 ,后面也试了更新的update那个也不行 解决了:MySQL和mysql-connector 库的版本不匹配!!!! 我的Mysql是6.011 刚开始用的connector库版本是...
  • 请求异常:parsererror出错了:有错误发生,但无法归类到某一更为具体的异常中 ### Error updating database. Cause: java.sql.SQLException: sql injection violation, syntax error: TODO : pos 166, line 11, ...
  • 今天写mybatis面向接口代码,碰到这种异常,细看是说找不到User这个类,或者类型异常。在sqlMapperConfig.xml配置&lt;typeAliases&gt;别名即可。org.apache.ibatis.exceptions....### The error may exist ...
  • org.apache.ibatis.exceptions.PersistenceException:...### Error querying database. Cause: java.sql.SQLException: No suitable driver found for jdbc.mysql://localhost:3309/test ### The error may exist i...
  • 额,以前没遇到过呃呃呃,换包解决。 &lt;dependency&gt; &lt;groupId&gt;mysql&lt;/groupId&gt; &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&.../de
  •  ### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.M 问题原因:  查询数据库错误,经检查我的sql查询语句中的字段名写错了。 解决办法:  改正sql语句,即可解决问...
  • #error和#warning使用分析

    千次阅读 2017-11-23 22:04:10
    1 #error的用法 error用于生成一个编译错误消息。 用法:#error message(message不需要用双引号包围)。 #error编译指示字用于自定义程序员特有的编译错误消息,类似的#warning用于生成编译警告。 #error是一种预...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 4,455,497
精华内容 1,782,198
关键字:

#error