elasticsearch插入数据报错

之前用的elasticsearch是1.3.2版本的,装了ik插件,用起来很正常,后面elasticsearch换成2.0.0的了,还装了logstash2.0.0,kibana4.2.0, ik分词器是1.5.0的,用Java代码批量插入的时候就报错了,在elasticsearch的控制台手动插入是没问题的
[INFO][2016-11-16 18:22:34] org.elasticsearch.plugins.PluginsService.(PluginsService.java:151) main [Agatha Harkness] loaded [analysis-jcseg], sites []
[INFO][2016-11-16 18:22:35] org.elasticsearch.client.transport.TransportClientNodesService$SniffNodesSampler$1$1.handleException(TransportClientNodesService.java:443) elasticsearch[Agatha Harkness][transport_client_worker][T#1]{New I/O worker #28} [Agatha Harkness] failed to get local cluster state for [#transport#-1][USER-20150529VW][inet[localhost/127.0.0.1:9300]], disconnecting...
org.elasticsearch.transport.RemoteTransportException: Failed to deserialize exception response from stream
Caused by: org.elasticsearch.transport.TransportSerializationException: Failed to deserialize exception response from stream
at org.elasticsearch.transport.netty.MessageChannelHandler.handlerResponseError(MessageChannelHandler.java:173)
at org.elasticsearch.transport.netty.MessageChannelHandler.messageReceived(MessageChannelHandler.java:125)
at org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
at org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:296)
at org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:462)
at org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:443)
at org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303)
at org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559)
at org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:268)
at org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:255)
at org.elasticsearch.common.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88)
at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108)
at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:318)
at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89)
at org.elasticsearch.common.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
at org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
at org.elasticsearch.common.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
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.io.StreamCorruptedException: Unsupported version: 1
at org.elasticsearch.common.io.ThrowableObjectInputStream.readStreamHeader(ThrowableObjectInputStream.java:46)
at java.io.ObjectInputStream.(ObjectInputStream.java:299)
at org.elasticsearch.common.io.ThrowableObjectInputStream.(ThrowableObjectInputStream.java:38)
at org.elasticsearch.transport.netty.MessageChannelHandler.handlerResponseError(MessageChannelHandler.java:170)
... 23 more
[WARN][2016-11-16 18:22:35] org.elasticsearch.transport.netty.MessageChannelHandler.messageReceived(MessageChannelHandler.java:135) elasticsearch[Agatha Harkness][transport_client_worker][T#1]{New I/O worker #28} [Agatha Harkness] Message not fully read (response) for [0] handler org.elasticsearch.client.transport.TransportClientNodesService$SniffNodesSampler$1$1@7e8c9412, error [true], resetting
[INFO][2016-11-16 18:22:39] org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:862) Thread-1 Closing org.springframework.context.support.GenericApplicationContext@fbd1f6: startup date [Wed Nov 16 18:21:55 CST 2016]; root of context hierarchy
[INFO][2016-11-16 18:22:39] org.elasticsearch.node.internal.InternalNode.stop(InternalNode.java:272) Thread-1 [Fer-de-Lance] stopping ...
[INFO][2016-11-16 18:22:39] org.elasticsearch.node.internal.InternalNode.stop(InternalNode.java:310) Thread-1 [Fer-de-Lance] stopped

1个回答

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
ElasticSearch插入数据优化
1、多线程程序插入 可以根据服务器情况开启多个线程index,速度可以提高n倍, n>=2。如在上篇博文《将Mysql数据导入到ElasticSearch集群》示例的代码,开启了10个线程。但是可以线程也不是越多越好,要根据你磁盘的io,cpu等而定。2、设置复制分片数量 如果有多台机器,可以以每台设置n个shards的方式,根据业务情况,可以考虑取消replias(复制分片),等数据插入结束以
(五)ElasticSearch插入数据
分类:分为指定文档id插入、自动产生文档id插入两类。(文档id是唯一索引指,指向索引数据) 1 自己指定id 点击send,查看响应结果   查看插入得效果   点击数据浏览   2 es产生文档id   响应结果    es中查看
提高ElasticSearch插入数据性能
正常的真实环境es集群都是有副本数的,如果在大量插入数据的情况下面,副本拷贝其实会使插入速度变慢的,根据业务情况,可以考虑取消replias(复制分片),等数据插入结束以后再进行更新操作,设置复制分片。此方法可使插入速度提高一倍。 curl -XPUT http://ip:9200/index/_settings -d '{ "settings" : { "numbe
ElasticSearch插入数据问题
ElasticSearch 1.Content-Type header [] is not supported curl -H "Content-Type: application/json" -XPUT '168.63.1.61:9200/enterprise_data_gov_20170314/enterprise_data_gov/华泰证券股份有限公司?pretty' -d '{jso...
elasticsearch 创建type及插入数据
创建 type ("store":"yes") PUT my_index {   "mappings": {     "type_one": {       "properties": {         "text": {            "type": "string",           "analyzer": "standard"         }      
插入数据报错
<%rnSet conn = server.CreateObject("adodb.connection")rnconn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("jackguestbook.mdb")rnname=request.Form("name")rntel=request.Form("tel")rnmessage=request.Form("message")rnexec="insert into guestbook(name,tel,message) values ('"+name+"',"+tel+",'"+message+"')"rnconn.execute execrnconn.closernSet conn=Nothingrnrepose.write "success"rn%>rn请问sql语句哪里出问题了呢?
插入数据报错!
ORA-01631 :表121.mydbm达到max#extents(T_PACK)rnrn插入数据时报上述错误,请教各位,她是什么错误,怎么解决!
elasticsearch使用restclient接口插入数据
elasticsearch使用restclient接口插入数据首先定义要插入的数据。1 定义一个student类,并json序列化,对于复杂的数据结构,使用以下的json格式化很方便的能得到我们需要的数据结构,可以参考 http://blog.csdn.net/wslyk606/article/details/78325474 这篇文章。package es; import com.faster...
使用Python往Elasticsearch插入数据
使用Python往Elasticsearch插入数据 在这里,我使用Elasticsearch官方推荐elasticsearch第三方包来讲述插入数据的两种方法。 1. index 这是很简单的一个插入数据的方法,每条数据调用一个index方法,代码如下from datetime import datetime from elasticsearch import Elasticsearches
ElasticSearch安装报错集锦
最近频繁的在使用的ES,有时候是在虚拟机上有时候是在正式环境上,在安装的时候总这样那样的启动出错,今天正好有时间整理一下。一、[1] bootstrap checks failed [1]: max number of threads [1024] for user [elasticsearch] is too low, increase to at least [2048]引导检查失败,最大线程...
ElasticSearch建立索引报错
报错为:MapperParsingException[Object mapping for [title] tried to parse field [tilte] as object ,but found a concrete value] 映射异常:title 的对象映射 字段应该为object,但是却发现是一个真实的值。 解决方法:重新建立新的mapping ,你可以先用最简单的,建立一
Ubuntu 下 配置 jdk1.7
第一步:下载jdk-7-linux-i586.tar.gz wget -c http://download.oracle.com/otn-pub/java/jdk/7/jdk-7-linux-i586.tar.gz   (注:如果下载不下来,建议使用迅雷下载,然后
ElasticSearch常见的报错及解决
报错1 all indices on this node will be marked read-only FORBIDDEN/12/index read-only / allow delete (api) 原因: 磁盘空间不够啦,我使用df -h查看磁盘空间,发现使用了97%,es默认达到95%就全都设置只读 解决 配置 config/elasticsearch.py # 控制洪水阶段水印...
linux启动elasticsearch报错内存不足
启动时报如下错误 找到elasticsearch下的config下的jvm.options 修改启动时需要的内存默认是2g 由于我购买的服务器内存总共才2g,内存肯定是不足的 所以修改为1g 如果更小 至于详细的操作大家需要学习一下linux的基本命令方便日后使用 ...
ElasticSearch创建索引报错
当执行 curl -X PUT '9.112.4.34:9200/accounts/person/1' -d ' {   &quot;user&quot;: &quot;张三&quot;,   &quot;title&quot;: &quot;工程师&quot;,   &quot;desc&quot;: &quot;数据库管理&quot; }' 报错:{&quot;error&quot;:&quot;Content-Type header [application/x-www-form-urlenco
Elasticsearch安装遇到报错
Elasticsearch安装遇到报错 1.不能以root用户运行 报错信息 [root@node4 elasticsearch-2.2.0]# bin/elasticsearch Exception in thread &quot;main&quot; java.lang.RuntimeException: don't run elasticsearch as root. at org.ela...
ElasticSearch学习(4)--ElasticSearch启动时的各种报错
ElasticSearch启动时的各种报错 【1】expecting token of type [START_OBJECT] but found [VALUE_STRING]]; 报错详细信息: SettingsException[Failed to load settings from [elasticsearch.yml]]; nested: ParsingException[F...
插入数据(自增列)报错
我通过实体影射到数据库中的数据表,然后调用实体的insert方法插入记录,rn插入语句如下:rn stockindetail.StockInId = stockInId;rn //stockindetail.StockInDetailId = null;//自增列,注释掉的rn stockindetail.WarehouseId = warehouseId;rn stockindetail.WarehouseName = warehouseName;rn stockindetail.SKUId = int.Parse(reader["sku"].ToString());rn stockindetail.ProductName = reader["productName"].ToString();rn stockindetail.Productkind = productkind;rn stockindetail.Price = decimal.Parse(reader["supplierLastPrice"].ToString());rn stockindetail.ActualQuantity = int.Parse(reader["actureQuantity"].ToString());rn stockindetail.Remark = "暂时没有";rn Ck_t_rk_StockInDetailProvider.Insert(stockindetail); rn但是报错,报错信息如下:rn异常详细信息: System.Data.SqlClient.SqlException: 当 IDENTITY_INSERT 设置为 OFF 时,不能向表 'ck_t_rk_StockInDetail' 中的标识列插入显式值。rn
mysql 临时表插入数据报错
CREATE TEMPORARY TABLE mmm(material_id varchar(255));rnCREATE TEMPORARY TABLE tem(id varchar(255),time datetime,weight float,price float,total_price float,type int,stock_total_m float,stock_total_w float,create_date varchar(255))rnrnrninsert into mmm valuesrnselect id from t_comm_material where id in('8adee284554cb68301556c8bec232743',
关于数据库插入数据报错
最近用vb.net向sybase数据库插入数据时,有时会报错:attempted to read or wirte protect momery,This is often an indication that other memory is corrupt。或者是这样的:'Sybase.ASEOLEDBProvider' failed with no error message available,result code:E_OUTOFMEMORY(0X8007000E)..rn求各位大神帮忙瞅瞅大约是什么原因引起的[img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/monkey/31.gif][/img]
map插入数据报错
我定义了一个maprnmap > m_channelMap;rn在向里面插数据rnOutputFileInfo tempFileInfo;rnint j=1;rn......rnrnm_batchMap.insert(map::value_type(j,tempFileInfo)); rnrn上面编译不过。rnrn在hp的机器上,rn报错如下,请高手帮帮忙rn"/opt/aCC/include_std/fstream", line 373: error #2330-D: rn "std::basic_ios<_CharT, _Traits>::basic_ios(constrn std::basic_ios<_CharT, _Traits> &) [with _CharT=char,rn _Traits=std::char_traits]" (declared at line 173 ofrn "/opt/aCC/include_std/ios") is inaccessiblern class basic_ofstream: public basic_ostream<_CharT, _Traits>rn ^rn detected during:rn implicit generation of "std::basic_ofstream<_CharT,rn _Traits>::basic_ofstream(const std::basic_ofstream> &) [with _CharT=char,rn _Traits=std::char_traits]" at line 103 ofrn "/opt/aCC/include_std/utility"rn instantiation of class "std::basic_ofstream<_CharT, _Traits> [withrn _CharT=char, _Traits=std::char_traits]" at linern 103 of "/opt/aCC/include_std/utility"rn implicit generation ofrn "OutputFileInfo::OutputFileInfo(const OutputFileInfo &)"rn at line 103 of "/opt/aCC/include_std/utility"rn instantiation of "std::pair<_TypeT, _TypeU>::pair(const _TypeT &,rn const _TypeU &) [with _TypeT=int, _TypeU=OutputFileInfo]"rn at line 116 of "MonthEndOutputFile.cpp"rnrn"/opt/aCC/include_std/ostream", line 66: error #2330-D: rn "std::basic_ios<_CharT, _Traits>::basic_ios(constrn std::basic_ios<_CharT, _Traits> &) [with _CharT=char,rn _Traits=std::char_traits]" (declared at line 173 ofrn "/opt/aCC/include_std/ios") is inaccessiblern virtual public basic_ios<_CharT, _Traits>rn ^rn detected during:rn implicit generation of "std::basic_ostream<_CharT,rn _Traits>::basic_ostream(const std::basic_ostream> &) [with _CharT=char,rn _Traits=std::char_traits]" at line 103 ofrn "/opt/aCC/include_std/utility"rn instantiation of class "std::basic_ostream<_CharT, _Traits> [withrn _CharT=char, _Traits=std::char_traits]" at linern 103 of "/opt/aCC/include_std/utility"rn implicit generation of "std::basic_ofstream<_CharT,rn _Traits>::basic_ofstream(const std::basic_ofstream> &) [with _CharT=char,rn _Traits=std::char_traits]" at line 103 ofrn "/opt/aCC/include_std/utility"rn instantiation of class "std::basic_ofstream<_CharT, _Traits> [withrn _CharT=char, _Traits=std::char_traits]" at linern 103 of "/opt/aCC/include_std/utility"rn implicit generation ofrn "OutputFileInfo::OutputFileInfo(const OutputFileInfo &)"rn at line 103 of "/opt/aCC/include_std/utility"rn instantiation of "std::pair<_TypeT, _TypeU>::pair(const _TypeT &,rn const _TypeU &) [with _TypeT=int, _TypeU=OutputFileInfo]"rn at line 116 of "MonthEndOutputFile.cpp"rnrn"/opt/aCC/include_std/rw/stdmutex.h", line 310: error #2330-D: rn "__rw::__rw_mutex_base::__rw_mutex_base(const __rw::__rw_mutex_basern &)" (declared at line 285) is inaccessiblern class __rw_mutex: public __rw_mutex_basern ^rn detected during:rn implicit generation ofrn "__rw::__rw_mutex::__rw_mutex(const __rw::__rw_mutex &)"rn at line 103 of "/opt/aCC/include_std/utility"rn implicit generation ofrn "__rw::__rw_synchronized::__rw_synchronized(constrn __rw::__rw_synchronized &)" at line 103 ofrn "/opt/aCC/include_std/utility"rn implicit generation of "std::basic_streambuf<_CharT,rn _Traits>::basic_streambuf(constrn std::basic_streambuf> &)rn [with _CharT=char, _Traits=std::char_traits]" atrn line 103 of "/opt/aCC/include_std/utility"rn instantiation of class "std::basic_streambuf<_CharT, _Traits>rn [with _CharT=char, _Traits=std::char_traits]" atrn line 103 of "/opt/aCC/include_std/utility"rn implicit generation of "std::basic_filebuf<_CharT,rn _Traits>::basic_filebuf(const std::basic_filebuf> &) [with _CharT=char,rn _Traits=std::char_traits]" at line 103 ofrn "/opt/aCC/include_std/utility"rn instantiation of class "std::basic_filebuf<_CharT, _Traits> [withrn _CharT=char, _Traits=std::char_traits]" at linern 103 of "/opt/aCC/include_std/utility"rn implicit generation of "std::basic_ofstream<_CharT,rn _Traits>::basic_ofstream(const std::basic_ofstream> &) [with _CharT=char,rn _Traits=std::char_traits]" at line 103 ofrn "/opt/aCC/include_std/utility"rn instantiation of class "std::basic_ofstream<_CharT, _Traits> [withrn _CharT=char, _Traits=std::char_traits]" at linern 103 of "/opt/aCC/include_std/utility"rn implicit generation ofrn "OutputFileInfo::OutputFileInfo(const OutputFileInfo &)"rn at line 103 of "/opt/aCC/include_std/utility"rn instantiation of "std::pair<_TypeT, _TypeU>::pair(const _TypeT &,rn const _TypeU &) [with _TypeT=int, _TypeU=OutputFileInfo]"rn at line 116 of "MonthEndOutputFile.cpp"rnrnrnrn====================opt/aCC/include_std/fstream", line 373:rntemplaternclass basic_ofstream: public basic_ostream<_CharT, _Traits>rnrnpublic:rnrn typedef _CharT char_type;rn typedef _Traits traits_type;rn _TYPEDEF (traits_type::int_type, _RWSTD_WINT_T, int_type);rn _TYPEDEF (traits_type::pos_type, fpos, pos_type);rn _TYPEDEF (traits_type::off_type, streamoff, off_type);rnrn // NOTE: the ctors below pass the address of an unitializedrn // member variable, _C_filebuf, to a base class ctorrn // the variable will be initialized only *after* the basern // class ctor returnsrnrn basic_ofstream ()rn : basic_ostream (rdbuf ()) rnrn _EXPLICIT basic_ofstream (const char *__name,rn ios::openmode __mode = ios::out,rn long __prot = 0666)rn : basic_ostream (rdbuf ()) rn open (__name, __mode, __prot);rn
DB2插入数据报错
插入的时候提示:SQL0668N 不允许对表XXX执行操作,原因代码7。SQLSTATE=57016
MQSQL插入数据报错
### The error may involve repository.mybatis.itf.order.source.OrderSourceImportDataMapper.insert-Inlinern### The error occurred while setting parametersrn### SQL: insert into oms_order_source_import_data (id,flag_id, shop_id, express_id, warehouse_id, enterprise_id, tid, buyer_nick, title, num_iid, goods_barcode, plat_status, created, pay_time, num, price, post_fee, total_fee, buyer_message, seller_memo, receiver_name, receiver_phone, receiver_mobile, receiver_state, receiver_city, receiver_district, receiver_address) values (?,? ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)rn### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1, 4, rn 2, 1, 505300001, rn '友商通', '举例产品名称luna 上衣' at line 10rn; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1, 4, rn 2, 1, 505300001, rn '友商通', '举例产品名称luna 上衣' at line 10rn[DEBUG] org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver.doResolveHandlerMethodException(360) | Invoking @ExceptionHandler method: public org.springframework.web.servlet.ModelAndView controller.BaseController.doResolveException(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,java.lang.Object,java.lang.Exception)rn七月 17, 2015 3:50:07 下午 com.yonyou.util.exception.ShopExceptionHandler doRuntimeExceptionrnSEVERE: file:[SQLErrorCodeSQLExceptionTranslator.java],class:[org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator],method:[doTranslate],line:[231],type:[RuntimeException],message:rnrnrnorg.apache.ibatis.logging.commons.JakartaCommonsLoggingImpl.debug(46) | ==> Parameters: a5a65d137ac54932bf9e5ac5c6534716(String), 3f69a80d580c4e2ab720cfa499a29cf6(String), 1(Integer), 4(Integer), 2(Integer), 1(Integer), 505300001(BigDecimal), 友商通(String), 举例产品名称luna 上衣(String), 1(BigDecimal), 69012345678(String), 已付款(String), 42129.4237268519(String), 42129.4244212963(String), 12(BigDecimal), 12(String), 10(String), 154(String), 买家留言(String), 卖家备注(String), 张三(String), 收货人电话(String), 收货人手机(String), 北京(String), 北京市(String), 朝阳区(String), 北京市朝阳区张三路112号(String)
python3 爬虫插入数据报错
报错: pymysql.err.ProgrammingError: (1064, &quot;You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1&quot;) 原因: ...
插入数据报错,怎么解决?
提示信息是"表 Tablename 无法通过17643(在表空间user_data中)扩展rnrn请问我该怎么处理?rnrn万分感谢!!
hibernate插入数据时报错
hibernate配置文件rn[code=Java]rnrn rn rn rn rn rn rn rn rn rn rn rn[/code]rnrnMonitoredObj类rn[code=Java]rnpublic class MonitoredObjrnrn private String name;rnrn private String group;rnrn private String descri;rnrn[/code]rnrn表结构:rn[code=SQL]rnCREATE TABLE `CIA_MONITORED_OBJ` (rn `name` varchar(50) NOT NULL,rn `descri` varchar(200) NOT NULL,rn `group` varchar(50) NOT NULL,rn PRIMARY KEY (`name`)rn) rn[/code]rnrn测试rnrnpublic void testSave()rn MonitoredObj monitoredObj=new MonitoredObj();rn monitoredObj.setName("Obj1");rn monitoredObj.setDescri("first Obj");rn monitoredObj.setGroup("Obj");rn monitoredObjDao.save(monitoredObj);rnrn rnrn在插入数据的时候报了以下错误信息:rnrnHibernate: insert into CIA_MONITORED_OBJ (descri, group, name) values (?, ?, ?)rn2010-08-13 09:27:02,671 [org.hibernate.util.JDBCExceptionReporter]-[WARN] SQL Error: 1064, SQLState: 42000rn2010-08-13 09:27:02,671 [org.hibernate.util.JDBCExceptionReporter]-[ERROR] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'group, name) values ('first Obj', 'Obj', 'Obj1')' at line 1rn2010-08-13 09:27:02,671 [org.hibernate.event.def.AbstractFlushingEventListener]-[ERROR] Could not synchronize database state with sessionrnorg.hibernate.exception.SQLGrammarException: Could not execute JDBC batch updatern at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:70)rn at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)rn at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:181)rn at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:226)rn at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:136)rn at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:274)rn at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)rn at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:730)rn at com.spring.test.BaseTester.tearDown(BaseTester.java:32)rn at junit.framework.TestCase.runBare(TestCase.java:140)rn at junit.framework.TestResult$1.protect(TestResult.java:110)rn at junit.framework.TestResult.runProtected(TestResult.java:128)rn at junit.framework.TestResult.run(TestResult.java:113)rn at junit.framework.TestCase.run(TestCase.java:124)rn at junit.framework.TestSuite.runTest(TestSuite.java:232)rn at junit.framework.TestSuite.run(TestSuite.java:227)rn at org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:76)rn at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)rn at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)rnCaused by: java.sql.BatchUpdateException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'group, name) values ('first Obj', 'Obj', 'Obj1')' at line 1rn at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:1237)rn at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:936)rn at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPreparedStatement.java:1723)rn at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:57)rn at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:174)rn ... 20 morernorg.hibernate.exception.SQLGrammarException: Could not execute JDBC batch updatern at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:70)rn at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)rn at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:181)rn at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:226)rn at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:136)rn at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:274)rn at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)rn at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:730)rn at com.spring.test.BaseTester.tearDown(BaseTester.java:32)rn at junit.framework.TestCase.runBare(TestCase.java:140)rn at junit.framework.TestResult$1.protect(TestResult.java:110)rn at junit.framework.TestResult.runProtected(TestResult.java:128)rn at junit.framework.TestResult.run(TestResult.java:113)rn at junit.framework.TestCase.run(TestCase.java:124)rn at junit.framework.TestSuite.runTest(TestSuite.java:232)rn at junit.framework.TestSuite.run(TestSuite.java:227)rn at org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:76)rn at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)rn at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)rnCaused by: java.sql.BatchUpdateException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'group, name) values ('first Obj', 'Obj', 'Obj1')' at line 1rn at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:1237)rn at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:936)rn at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPreparedStatement.java:1723)rn at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:57)rn at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:174)rn ... 20 morernrn大家帮忙看看。rnrnrn
插入数据报错怎么办?
[code=sql]rn[INSERT INTO `test`(`id`, `uid`, `regdate`, `remark`) VALUES ([],[小明],[now()],[软件工程师])rn/code][img=https://img-bbs.csdn.net/upload/201404/30/1398840936_381721.jpg][/img]
ACCESS数据库插入数据时报错。
对于数据库的操作一直不怎么会,看着以前代码依葫芦画瓢到也没出什么问题,现在需要建个新表action 记录些数据的时候出问题了:同样插入条数据,对表users操作正常的,但对我新建的表action就有报错了。现在按书本上的方式重写了段操作数据库的代码,还是有错误,代码:rn[code=C]/C++ _ConnectionPtr m_pConnection;rn _RecordsetPtr m_pRecordset;rn tryrn rn m_pConnection.CreateInstance("ADODB.Connection");rn CString strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=hospital.mdb";rn m_pConnection->Open((_bstr_t)strConnect,"","",adModeUnknown);rn rn catch(_com_error e)rn rn AfxMessageBox(e.Description());rn //连接数据库没问题rn CString strSql;rn //strSql.Format("INSERT INTO action (user_Id,user_begintime,user_Dstairname, user_Pstairname) VALUES (%d ,'%s', '%s', '%s')",rn // 2,m_sBegintime, "wer", "xiaojiji");//对表actionrn strSql.Format("INSERT INTO users (user_Id,user_Name,user_sex, user_age, user_docname, user_Divisions,user_Begintime,user_Endtime,user_Totaltime,user_Addr,user_Tel,user_Desp) VALUES (%d ,'%s', '%s',%d, '%s', '%s', '%s', '%s', '%s','%s', '%s','%s')",rn 224,"11", "男", 23, "xiaojiji","骨科",m_sBegintime,strText1,strText1,strText1,strText1,strText1);//对表usersrn //strSql ="INSERT INTO text(user_id,user_name) VALUES (1, 'wwww')";//对表textrn m_pConnection->Execute((_bstr_t)strSql,NULL,adCmdText);rn m_pConnection->Close();[/code]rnrn对action 和 text表插入数据的时候报未处理的异常:在msado15.tli文件里rnrn[code=C]/C++inline _RecordsetPtr Connection15::Execute ( _bstr_t CommandText, VARIANT * RecordsAffected, long Options ) rn struct _Recordset * _result = 0;rn HRESULT _hr = raw_Execute(CommandText, RecordsAffected, Options, &_result);rn if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));rn return _RecordsetPtr(_result, false);rn[/code]rnrn处未处理的异常: Microsoft C++ exception: _com_error @ 0x00122bb4 。程序中断在return语句。rntext表我重建用来尝试其它方法的。对表 text 和 action 的操作 和对表user 操作上没什么区别了啊。 rn搞了半天了,求提示~~
Hibernate插入数据时报错!
使用Access作数据库(知道它很差,但是方案定了,无奈...)rnID使用AutoIncrecement(counter),就是自动编号rn在插入数据时报错,在外面直接插入时没有问题rn1。配置文件中ID用rn generator class="identity" 或 generator class="native"rn 出错信息:rn Hibernate: insert into teacher (paperID, course, grade, name, notes, operateCustom,passwd, permitItem, permitPaper, teachClass) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) select scope_identity()rnJDBCExceptionReporter - [Microsoft][ODBC Microsoft Access Driver] SQL 语句的结束位置缺少分号 (;)。rnorg.hibernate.exception.SQLGrammarException: could not insert: [com.maystar.model.Teacher]rnrn ... ...rn2。配置文件中如果自己写sqlrn nsert into teacher (paperID, course, grade, name, notes, operateCustom, passwd, permitItem, permitPaper, teachClass) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)rn 出错信息:rn root cause rnrnjava.lang.NullPointerExceptionrn org.hibernate.persister.entity.BasicEntityPersister.insert(BasicEntityPersister.java:1755)rn org.hibernate.persister.entity.BasicEntityPersister.insert(BasicEntityPersister.java:2178)rn org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:34)rn org.hibernate.engine.ActionQueue.execute(ActionQueue.java:239)rn org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:240)rn org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:160)rn org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:95)rn org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:184)rn org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)rn org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:173)rn org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)rn org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:69)rn org.hibernate.impl.SessionImpl.save(SessionImpl.java:481)rn org.hibernate.impl.SessionImpl.save(SessionImpl.java:476)rn test.student.BaseDAO.createObj(BaseDAO.java:21)rn test.struts.StuAction.insert(StuAction.java:27)rn sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn java.lang.reflect.Method.invoke(Method.java:324)rn org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:274)rn org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:194)rn org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)rn org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)rn org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)rn org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:763)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:856)rnrnrn各位大侠帮帮忙吧!郁闷好久了。rn
请教:MYSQL插入数据报错
大家好,我在学习MYSQL,在练习一些基本的SQL语句。在插入数据的时候遇到了错误:rn[code=SQL]rnmysql> CREATE TABLE my_tablern -> (rn -> last_name VARCHAR(30),rn -> first_name VARCHAR(20)rn -> );rnQuery OK, 0 rows affected (0.08 sec)rnrnmysql> INSERT INFO my_tablern -> (last_name, first_name)rn -> VALUESrn -> ('River', 'Bule');rnERROR 1064 (42000): You have an error in your SQL syntax; check the manual thatrncorresponds to your MySQL server version for the right syntax to use near 'my_tarnblern(last_name, first_name)rnVALUESrn('River', 'Bule')' at line 1rn[/code]rn请大家帮忙看一下,这到底是什么地方出错了?
php插入数据到数据库报错
//获取链接rn $link = mysql_connect("localhost","root","root");rn //选择数据库rn mysql_select_db("weibotest") or die("could not conent to sql");rn rn //发送sql指令rn //先根据mid查询是否存在,若不存在则插入,若存在则不动rn foreach ($IdArr as $keys=>$v) rn $insertSql ="insert into users(mid)values('$IdArr[$keys]')";rn rn $res = mysql_query($insertSql) or die("insert failed"); rnrn rn mysql_close($link); //关闭数据库rnrn以上是我的php代码,发现只能够存入第一条数据,其他数据都会报错,求解
插入数据的时候报错~~~~
我有个问题[code=C#] string sql = string.Format("insert into News_Info Values('0','1','2','3','4')",GetID,txt_Title,txt_Text,GetTime,txt_Rank);rn SqlCommand cmd = new SqlCommand(sql, conn);rn int x = 0;rn x = cmd.ExecuteNonQuery();rn rn if (x > 0)rn rn Label3.Text="添加成功!";rn rn rn elsern rn Label3.Text="添加失败!";rn rn [/code]rn执行到 x = cmd.ExecuteNonQuery();的时候会报错说String or binary data would be truncated.rnThe statement has been terminated.rnrn但是我直接插入从数据库插入数据的话,是没有问题的,为什么啊?
Oracle 插入数据时报错
[code=SQL]rnSQL> insert into YN_9110_DYS_90 values('2010-10-01','123','1','444','90','1234456',2);rn rninsert into YN_9110_DYS_90 values('2010-10-01','123','1','444','90','1234456',2)rn rnORA-01861: literal does not match format stringrn rnSQL> show errors;rnNo errorsrn rnSQL> rn[/code]rnrn数据库中有7个字段,第一个是data,第二个到第六个为char,最后一个是numberrn错误是什么东西不匹配string类型嘛? 各位大侠走过路过来帮忙解决一下啊!
插入数据时报错??
proc程序执行时,在插入数据时报错,错误信息为error[ORA-01460: 未实现或无理rn的转换请求]。把程序重新编译make一下,什么都没改,就OK了,真是搞不懂???
Mysql插入数据时报错
我用的mysql数据库版本是5.0.18rn使用的sql语句是:rncreate database bbs;rnrnuse bbs;rnrncreate table article rn(rnid int primary key auto_increment,rnpid int,rnrootid int,rntitle varchar(255),rncont text,rnpdate datetime,rnisleaf int rn) ;rnrninsert into article values (null, 0, 1, '蚂蚁大战大象', '蚂蚁大战大象', now(), 1);rninsert into article values (null, 1, 1, '大象被打趴下了', '大象被打趴下了',now(), 1);rninsert into article values (null, 2, 1, '蚂蚁也不好过','蚂蚁也不好过', now(), 0);rninsert into article values (null, 2, 1, '瞎说', '瞎说', now(), 1);rninsert into article values (null, 4, 1, '没有瞎说', '没有瞎说', now(), 0);rninsert into article values (null, 1, 1, '怎么可能', '怎么可能', now(), 1);rninsert into article values (null, 6, 1, '怎么没有可能', '怎么没有可能', now(), 0);rninsert into article values (null, 6, 1, '可能性是很大的', '可能性是很大的', now(), 0);rninsert into article values (null, 2, 1, '大象进医院了', '大象进医院了', now(), 1);rninsert into article values (null, 9, 1, '护士是蚂蚁', '护士是蚂蚁', now(), 0);rnrn数据库报的错误是:rnERROR 1406 (22001): Data too long for column 'title' at row 1rn请问高手这个问题该如何解决rn附:数据库安装的时候选择的默认编码格式为utf8rnrnrn
使用游标插入数据报错
DECLARErn vQty integer;rn vQpc integer;rn rn cursor c isrn select rowid, fpickarea, fbin, farticle from fu_tbinarticles_20081228;rnrnBEGIN rnrn DELETE FROM fu_tbinarticles_20081228;rn COMMIT;rn rnrn INSERT INTO fu_tbinarticles_20081228(farticle, fpickarea, fbin)rn select a.fgid farticle, rn (select fpickarea from tpickschemedtl where fcode = '-' and farticle = a.fgid and FITEMNO = 1) fpickarea,rn (select fpickbin from tpickschemedtl where fcode = '-' and farticle = a.fgid and FITEMNO = 1) fpickbinrn from tarticle a;rnrn for r in c looprn select nvl(sum(fqty), 0) into vQty ,fqpc into vQpc from tbinarticles where fbin = r.fbin and farticle = r.farticle;rn update fu_tbinarticles_20081228 set fqty = vQty,fqpc=vQpc where rowid = r.rowid;rn end loop;rn commit;rnEND;rnrnrnORA-06550: 第 21 行, 第 46 列: rnPL/SQL: ORA-00923: 未找到预期 FROM 关键字rnORA-06550: 第 21 行, 第 5 列: rnPL/SQL: SQL Statement ignoredrnrnrn
elasticsearch Insert 插入数据和delete 删除数据(Java)
首先我不赞成再采用一些中间件(jar包)来解决和 Elasticsearch  之间的交互,比如 Spring-data-elasticsearch.jar 系列一样,用就得依赖它。而 Elasticsearch  本身的用法就是很简洁的,也很容易,只要稍微加一下封装,即可解决。下面上我的简单封装的批量处理。 package com.sojson.core.elasticsearc
elasticsearch系列(一):创建mapping和插入数据
分享我自己在安装elastisearch以及创建mapping和录入数据的过程,自己一步一步摸索过来的,遇到好多问题,也是各种百度。好在最后成功了。不足的地方,还请指出。在已经安装elasticsearch的基础上,新建一个索引(这个直接在head插件操作,不在赘述)创建一个空索引之后,默认的mapping的是空的,如图:执行以下语句,可以创建出mapping{    &quot;news_notice&quot;:...
elasticsearch的Linux下安装报错问题解决
1.启动报错如下: vim /etc/security/limits.conf 然后修改如下 * soft nofile 65536 * hard nofile 65536 sudo vi /etc/pam.d/common-session 添加 session required pam_limits.so sudo vi /etc/pam.d/common-session-no...
记一次Elasticsearch查询报错
记一次Elasticsearch异常: 异常:org.elasticsearch.search.SearchParseException: No mapping found for [id] in order to sort on 出现场景:Elasticsearch库中无数据时,带过滤条件查询。 原因查找:It only happens the first time, when you hav
相关热词 c# 标准差 计算 c#siki第五季 c#入门推荐书 c# 解码海康数据流 c# xml的遍历循环 c# 取 查看源码没有的 c#解决高并发 委托 c#日期转化为字符串 c# 显示问号 c# 字典对象池