geotools导出shapefile出错:

java.io.IOException: Current fid index is null, next must be called before write()

经过查找,发现出现该问题的原因是SQLServer数据库中有几个字符型字段的类型为NVARCAHR类型。
NVARCHAR类型支持双字节,shapefile数据是用DBF文件来存储。字符类型text只支持单字节数据。
因此,如果字段QI_YUAN在SQLServer定义成NVARCHAR(6),导出的DBF结构为text(6)。QI_YUAN值为"人工造林"时,
存入SQLServer是没问题的,但存入DBF就会出错。DBF将"人工造林"算成8个字节,超出定义的text(6)。

解决方法:
将SQLServer中可能出错的NVARCHAR字段类型长度加长或增加一倍也行。

geotools导出shapefile出错: java.io.IOException: Current fid index is null, next must be called before write()的更多相关文章

  1. java.io.IOException: Could not locate executable null\bin\winutils.exe in the Hadoop binaries

    在已经搭建好的集群环境Centos6.6+Hadoop2.7+Hbase0.98+Spark1.3.1下,在Win7系统Intellij开发工具中调试Spark读取Hbase.运行直接报错: ? 1 ...

  2. windows 中使用hbase 异常:java.io.IOException: Could not locate executable null\bin\winutils.exe in the Hadoop binaries.

    平时一般是在windows环境下进行开发,在windows 环境下操作hbase可能会出现异常(java.io.IOException: Could not locate executable nul ...

  3. Spark- ERROR Shell: Failed to locate the winutils binary in the hadoop binary path java.io.IOException: Could not locate executable null\bin\winutils.exe in the Hadoop binaries.

    运行 mport org.apache.log4j.{Level, Logger} import org.apache.spark.rdd.RDD import org.apache.spark.{S ...

  4. spark开发常见问题之一:java.io.IOException: Could not locate executable null\bin\winutils.exe in the Hadoop binaries.

    最近在学习研究pyspark机器学习算法,执行代码出现以下异常: 19/06/29 10:08:26 ERROR Shell: Failed to locate the winutils binary ...

  5. Spark报错java.io.IOException: Could not locate executable null\bin\winutils.exe in the Hadoop binaries.

    Spark 读取 JSON 文件时运行报错 java.io.IOException: Could not locate executable null\bin\winutils.exe in the ...

  6. POI 导入导出时异常[java.io.IOException: Broken pipe]

    使用用POI导出文件时抛出异常java.io.IOException: Broken pipe ERROR: 'java.io.IOException: Broken pipe' org.apache ...

  7. hadoop错误Could not obtain block blk_XXX_YYY from any node:java.io.IOException:No live nodes contain current block

    错误: 10/12/08 20:10:31 INFO hdfs.DFSClient: Could not obtain block blk_XXXXXXXXXXXXXXXXXXXXXX_YYYYYYY ...

  8. hadoop异常: 到目前为止解决的最牛逼的一个异常(java.io.IOException: Incompatible clusterIDs)

    (注意: 本人用的版本为hadoop2.2.0, 旧的版本和此版本的解决方法不同) 异常为: 9 (storage id DS-2102177634-172.16.102.203-50010-1384 ...

  9. myEclipse中改了项目名,出现的问题 和 错误java.io.IOException: tmpFile.renameTo(classFile) failed

    今天遇到一个很头疼的问题,建的一个新项目,后来因为一些原因把项目名改了,之后就做了一些业务,但运行时总是没有反应,后来在myEclipse工作空间下的webapps文件中发现, 部署的文件名和项目名称 ...

随机推荐

  1. mysql变量使用总结

    set语句的学习: 使用select定义用户变量的实践将如下语句改成select的形式: set @VAR=(select sum(amount) from penalties);我的修改: sele ...

  2. VS2013试用期结束后如何激活

    在激活框中输入密钥:BWG7X-J98B3-W34RT-33B3R-JVYW9

  3. three.js 简介

    What is Three.js? Let's try to describe it briefly: Three.js is a library that makes WebGL - 3D in t ...

  4. mq_close

    NAME mq_close - 关闭一个消息队列 (REALTIME) SYNOPSIS #include <mqueue.h>int mq_close(mqd_t mqdes) DESC ...

  5. ffmpeg转码时对编码率和固定码率的处理

    http://www.rosoo.net/a/201107/14663.html 一般fps在代码里这样表示 Fps = den/num 如果den = 15,num=1,则fps = 15. 如果帧 ...

  6. Delphi对于控件的SuperClassing(封装并扩展Button,使之变成TButton)

    写博客写了这么久,但是一直不知道应该怎么样写函数之间的调用关系和执行顺序,因为不停的跳来跳去的,但是写的时候却只能顺序写调用关系,直到今天发现这种写法很不错: TButton创建窗口是在CreateW ...

  7. Oracle 全文索引相关命令

    --用sys用户登录,解锁ctxsys用户alter user ctxsys account unlock; --授权给对应用户grant execute on ctx_ddl to yw; --用y ...

  8. ES6入门之set和map

    Set ES6提供了新的数据结构Set.它类似于数组,但是成员的值都是唯一的,没有重复的值. Set函数可以接受一个数组(或类似数组的对象)作为参数,用来初始化. // 例一 var set = ne ...

  9. SPOJ 370 Ones and zeros BFS + 同余剪枝

    题意:给一些n,求出最小的只包含0,1的n的倍数 设两数a, b满足: a < b 并且a % n = b % n. 如果 ( a * 10^x + c ) % n = z , 根据同余定理,( ...

  10. 创建下拉列表并通过ajax填充下拉数据

    $(document).ready(function(e) { jQuery.post('${basePath}/customerService/getCustomerService4List.do' ...