使用产品:iserver 9d 912 操作系统:win server 2012 x64
数据类型: oracle 11g x64
问题详细描述:最近几天iserver频繁出问题,差不多每天都要重启一次,定位不到原因。
调用RestDataProvider 的updateFeatures()和addFeatures()方法
表现为用java api接口 连接时有的时候连接不上,打印出如下异常:
connecting Gis Data server .............................
com.supermap.services.components.spi.ServiceRuntimeException: com.supermap.services.providers.RestProviderBase$RestRequestException: 访问资源失败,code:1,001,errorMsg:The connector failed to complete the communication with the server,URL:http://192.171.100.10:8090/iserver/services/data-gisdb/rest/data/datasources.json?returnAll=true¤tProxyNode=192.171.100.7%3A8090
at com.supermap.services.providers.RestProviderBase.handleExeption(SourceFile:695)
at com.supermap.services.providers.RestDataProvider.getDatasourceInfos(SourceFile:529)
at com.nari.gis.GisReadThread.gisConnect(GisReadThread.java:214)
at com.nari.gis.GisReadThread.run(GisReadThread.java:84)
at java.lang.Thread.run(Thread.java:748)
Caused by: com.supermap.services.providers.RestProviderBase$RestRequestException: 访问资源失败,code:1,001,errorMsg:The connector failed to complete the communication with the server,URL:http://192.171.100.10:8090/iserver/services/data-gisdb/rest/data/datasources.json?returnAll=true¤tProxyNode=192.171.100.7%3A8090
at com.supermap.services.providers.RestProviderBase.a(SourceFile:546)
at com.supermap.services.providers.RestProviderBase.executeRequestForByteArray(SourceFile:339)
at com.supermap.services.providers.RestProviderBase.executeRequestForByteArray(SourceFile:297)
at com.supermap.services.providers.RestProviderBase.executeRequestForList(SourceFile:432)
at com.supermap.services.providers.RestProviderBase.executeRequestForList(SourceFile:416)
at com.supermap.services.providers.RestDataProvider.getDatasourceInfos(SourceFile:527)
... 3 more
Gis Data Server connected fail........................
有的时候能连上,打印出如下异常:
java.lang.IllegalArgumentException: 对象已经被释放
at com.supermap.services.providers.RestProviderBase.handleExeption(SourceFile:701)
at com.supermap.services.providers.RestDataProvider.a(SourceFile:1339)
at com.supermap.services.providers.RestDataProvider.a(SourceFile:482)
at com.supermap.services.providers.RestDataProvider.getFeature(SourceFile:446)
at com.nari.gis.GisReadThread.ReadBox(GisReadThread.java:1359)
at com.nari.gis.GisReadThread.run(GisReadThread.java:101)
at java.lang.Thread.run(Thread.java:748)
出问题的时候,重启iserver就好了。
连接代码如下:
private RestDataProvider gisDataReader=null;
private boolean gisConnect(){
bGisInit = false;
System.out.println("Connecting Gis Data server .............................");
try{
if(gisDataReader != null){
gisDataReader.dispose();
gisDataReader=null;
}
gisDataReader = new RestDataProvider(setting);
List<DatasourceInfo> listInfo = gisDataReader.getDatasourceInfos();
if(listInfo==null || listInfo.size()==0)
{
System.out.println(">>>>>>Gis Data Server access error");
System.out.println(">>>>>> Gis host:"+gisUrl);
System.out.println(">>>>>>Please check Gis Server status and restart tomcat!!!!!!!!!!!!");
return false;
}
}catch(ServiceRuntimeException e){
e.printStackTrace();
System.out.println("Gis Data Server connected fail........................");
return false;
}
catch(Exception e){
e.printStackTrace();
return false;
}
bGisInit = true;
System.out.println("Gis Data Server connected........................");
return true;
}
出问题时打开iserver web页面,相关地图的map服务空白,data服务没数据,但是用idesktop打开就没问题。
程序出问题时会调用gisConnect()自动重连,所以重启iserver后一切恢复正常。前一段时间都没问题,就是最近几天开始每天都要重启iserver一遍,请问这种故障怎么定位,是不是某个iserver的服务故障导致的?