View unanswered posts | View active topics It is currently 2020-10-24 9:10



This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
 GeoServer沒有運行的Warning修改 
Author Message
中级会员
User avatar

Joined: 2013-01-27 0:46
Posts: 447
Post GeoServer沒有運行的Warning修改
我在GIS物件init時會做底下動作:

map.addLayer("all_foxconn_map", TWaverGisConst.EXECUTOR_TYPE_GEOSERVER,
"http://" + WMS_SERVER_IP + ":" + WMS_SERVER_PORT + "/geoserver/osm_taiwan/wms?");
map.addLayer("all_foxconn_map", TWaverGisConst.EXECUTOR_TYPE_GEOSERVER,
"http://" + WMS_SERVER_IP + ":" + WMS_SERVER_PORT + "/geoserver/osm_lh/wms?");
map.addLayer("all_foxconn_map", TWaverGisConst.EXECUTOR_TYPE_GEOSERVER,
"http://" + WMS_SERVER_IP + ":" + WMS_SERVER_PORT + "/geoserver/osm_tj/wms?");

但是當GeoServer沒有運行的狀態下會出現:
Attachment:
MWSnapshot003 2014-03-05, 09_06_15.jpg
MWSnapshot003 2014-03-05, 09_06_15.jpg [ 12.99 KiB | Viewed 9149 times ]


請問可以攔住並轉成自定的錯誤信息嗎?


2014-03-05 9:22
Profile
TWaver开发组
User avatar

Joined: 2010-07-22 10:58
Posts: 906
Post Re: GeoServer沒有運行的Warning修改
Code:
TWaverUtil.errorHandler = new ErrorHandler(){
      public void handle(String errorMessage, Throwable exception) {
         if(errorMessage != null){
            System.err.println(errorMessage);
         }
         if(exception != null){
            exception.printStackTrace();
         }
      }
   };


2014-03-05 14:57
Profile
中级会员
User avatar

Joined: 2013-01-27 0:46
Posts: 447
Post Re: GeoServer沒有運行的Warning修改
Vic wrote:
Code:
TWaverUtil.errorHandler = new ErrorHandler(){
      public void handle(String errorMessage, Throwable exception) {
         if(errorMessage != null){
            System.err.println(errorMessage);
         }
         if(exception != null){
            exception.printStackTrace();
         }
      }
   };



是這樣嗎???

try {
map.addLayer("all_foxconn_map", TWaverGisConst.EXECUTOR_TYPE_GEOSERVER,
"http://" + WMS_SERVER_IP + ":" + WMS_SERVER_PORT + "/geoserver/osm_taiwan/wms?");
map.addLayer("all_foxconn_map", TWaverGisConst.EXECUTOR_TYPE_GEOSERVER,
"http://" + WMS_SERVER_IP + ":" + WMS_SERVER_PORT + "/geoserver/osm_lh/wms?");
map.addLayer("all_foxconn_map", TWaverGisConst.EXECUTOR_TYPE_GEOSERVER,
"http://" + WMS_SERVER_IP + ":" + WMS_SERVER_PORT + "/geoserver/osm_tj/wms?");
} catch (Exception ex) {
ex.printStackTrace();
System.err.println("GeoServer尚未運行!");
}

TWaverUtil.errorHandler = new ErrorHandler() {
public void handle(String errorMessage, Throwable exception) {
if (errorMessage != null) {
System.err.println(errorMessage);
}
if (exception != null) {
exception.printStackTrace();
}
}
};


2014-03-05 18:42
Profile
Display posts from previous:  Sort by  
This topic is locked, you cannot edit posts or make further replies.   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron