Commit 22a205e8fc77feb02d70b01329886c6dc9261516
1 parent
c3ce2bc5
优化异常处理
Showing
4 changed files
with
31 additions
and
37 deletions
src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java
| @@ -520,7 +520,7 @@ public class StreamInfo implements Serializable, Cloneable{ | @@ -520,7 +520,7 @@ public class StreamInfo implements Serializable, Cloneable{ | ||
| 520 | try{ | 520 | try{ |
| 521 | instance = (StreamInfo)super.clone(); | 521 | instance = (StreamInfo)super.clone(); |
| 522 | }catch(CloneNotSupportedException e) { | 522 | }catch(CloneNotSupportedException e) { |
| 523 | - logger.error("未处理的异常 ", e); | 523 | + e.printStackTrace(); |
| 524 | } | 524 | } |
| 525 | return instance; | 525 | return instance; |
| 526 | } | 526 | } |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/SubscribeRequestProcessor.java
| 1 | package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl; | 1 | package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl; |
| 2 | 2 | ||
| 3 | -import com.genersoft.iot.vmp.common.VideoManagerConstants; | ||
| 4 | -import com.genersoft.iot.vmp.conf.DynamicTask; | ||
| 5 | -import com.genersoft.iot.vmp.conf.UserSetting; | ||
| 6 | import com.genersoft.iot.vmp.gb28181.bean.CmdType; | 3 | import com.genersoft.iot.vmp.gb28181.bean.CmdType; |
| 7 | import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; | 4 | import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; |
| 8 | import com.genersoft.iot.vmp.gb28181.bean.SubscribeHolder; | 5 | import com.genersoft.iot.vmp.gb28181.bean.SubscribeHolder; |
| 9 | import com.genersoft.iot.vmp.gb28181.bean.SubscribeInfo; | 6 | import com.genersoft.iot.vmp.gb28181.bean.SubscribeInfo; |
| 10 | -import com.genersoft.iot.vmp.gb28181.task.impl.MobilePositionSubscribeHandlerTask; | ||
| 11 | import com.genersoft.iot.vmp.gb28181.transmit.SIPProcessorObserver; | 7 | import com.genersoft.iot.vmp.gb28181.transmit.SIPProcessorObserver; |
| 12 | import com.genersoft.iot.vmp.gb28181.transmit.SIPSender; | 8 | import com.genersoft.iot.vmp.gb28181.transmit.SIPSender; |
| 13 | -import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander; | ||
| 14 | -import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; | ||
| 15 | import com.genersoft.iot.vmp.gb28181.transmit.event.request.ISIPRequestProcessor; | 9 | import com.genersoft.iot.vmp.gb28181.transmit.event.request.ISIPRequestProcessor; |
| 16 | import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; | 10 | import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; |
| 17 | import com.genersoft.iot.vmp.gb28181.utils.SipUtils; | 11 | import com.genersoft.iot.vmp.gb28181.utils.SipUtils; |
| 18 | import com.genersoft.iot.vmp.gb28181.utils.XmlUtil; | 12 | import com.genersoft.iot.vmp.gb28181.utils.XmlUtil; |
| 19 | -import com.genersoft.iot.vmp.storager.IRedisCatchStorage; | ||
| 20 | import com.genersoft.iot.vmp.storager.IVideoManagerStorage; | 13 | import com.genersoft.iot.vmp.storager.IVideoManagerStorage; |
| 21 | -import gov.nist.javax.sip.SipProviderImpl; | ||
| 22 | import gov.nist.javax.sip.message.SIPRequest; | 14 | import gov.nist.javax.sip.message.SIPRequest; |
| 23 | import gov.nist.javax.sip.message.SIPResponse; | 15 | import gov.nist.javax.sip.message.SIPResponse; |
| 24 | import org.dom4j.DocumentException; | 16 | import org.dom4j.DocumentException; |
| @@ -29,7 +21,9 @@ import org.springframework.beans.factory.InitializingBean; | @@ -29,7 +21,9 @@ import org.springframework.beans.factory.InitializingBean; | ||
| 29 | import org.springframework.beans.factory.annotation.Autowired; | 21 | import org.springframework.beans.factory.annotation.Autowired; |
| 30 | import org.springframework.stereotype.Component; | 22 | import org.springframework.stereotype.Component; |
| 31 | 23 | ||
| 32 | -import javax.sip.*; | 24 | +import javax.sip.InvalidArgumentException; |
| 25 | +import javax.sip.RequestEvent; | ||
| 26 | +import javax.sip.SipException; | ||
| 33 | import javax.sip.header.ExpiresHeader; | 27 | import javax.sip.header.ExpiresHeader; |
| 34 | import javax.sip.message.Response; | 28 | import javax.sip.message.Response; |
| 35 | import java.text.ParseException; | 29 | import java.text.ParseException; |
src/main/java/com/genersoft/iot/vmp/utils/redis/RedisUtil.java
| @@ -38,7 +38,7 @@ public class RedisUtil { | @@ -38,7 +38,7 @@ public class RedisUtil { | ||
| 38 | } | 38 | } |
| 39 | return true; | 39 | return true; |
| 40 | } catch (Exception e) { | 40 | } catch (Exception e) { |
| 41 | - logger.error("未处理的异常 ", e); | 41 | + e.printStackTrace(); |
| 42 | return false; | 42 | return false; |
| 43 | } | 43 | } |
| 44 | } | 44 | } |
| @@ -66,7 +66,7 @@ public class RedisUtil { | @@ -66,7 +66,7 @@ public class RedisUtil { | ||
| 66 | try { | 66 | try { |
| 67 | return redisTemplate.hasKey(key); | 67 | return redisTemplate.hasKey(key); |
| 68 | } catch (Exception e) { | 68 | } catch (Exception e) { |
| 69 | - logger.error("未处理的异常 ", e); | 69 | + e.printStackTrace(); |
| 70 | return false; | 70 | return false; |
| 71 | } | 71 | } |
| 72 | } | 72 | } |
| @@ -91,7 +91,7 @@ public class RedisUtil { | @@ -91,7 +91,7 @@ public class RedisUtil { | ||
| 91 | } | 91 | } |
| 92 | return true; | 92 | return true; |
| 93 | } catch (Exception e) { | 93 | } catch (Exception e) { |
| 94 | - logger.error("未处理的异常 ", e); | 94 | + e.printStackTrace(); |
| 95 | return false; | 95 | return false; |
| 96 | } | 96 | } |
| 97 | } | 97 | } |
| @@ -124,7 +124,7 @@ public class RedisUtil { | @@ -124,7 +124,7 @@ public class RedisUtil { | ||
| 124 | redisTemplate.opsForValue().set(key, value); | 124 | redisTemplate.opsForValue().set(key, value); |
| 125 | return true; | 125 | return true; |
| 126 | } catch (Exception e) { | 126 | } catch (Exception e) { |
| 127 | - logger.error("未处理的异常 ", e); | 127 | + e.printStackTrace(); |
| 128 | return false; | 128 | return false; |
| 129 | } | 129 | } |
| 130 | } | 130 | } |
| @@ -148,7 +148,7 @@ public class RedisUtil { | @@ -148,7 +148,7 @@ public class RedisUtil { | ||
| 148 | } | 148 | } |
| 149 | return true; | 149 | return true; |
| 150 | } catch (Exception e) { | 150 | } catch (Exception e) { |
| 151 | - logger.error("未处理的异常 ", e); | 151 | + e.printStackTrace(); |
| 152 | return false; | 152 | return false; |
| 153 | } | 153 | } |
| 154 | } | 154 | } |
| @@ -226,7 +226,7 @@ public class RedisUtil { | @@ -226,7 +226,7 @@ public class RedisUtil { | ||
| 226 | redisTemplate.opsForHash().putAll(key, map); | 226 | redisTemplate.opsForHash().putAll(key, map); |
| 227 | return true; | 227 | return true; |
| 228 | } catch (Exception e) { | 228 | } catch (Exception e) { |
| 229 | - logger.error("未处理的异常 ", e); | 229 | + e.printStackTrace(); |
| 230 | return false; | 230 | return false; |
| 231 | } | 231 | } |
| 232 | } | 232 | } |
| @@ -249,7 +249,7 @@ public class RedisUtil { | @@ -249,7 +249,7 @@ public class RedisUtil { | ||
| 249 | } | 249 | } |
| 250 | return true; | 250 | return true; |
| 251 | } catch (Exception e) { | 251 | } catch (Exception e) { |
| 252 | - logger.error("未处理的异常 ", e); | 252 | + e.printStackTrace(); |
| 253 | return false; | 253 | return false; |
| 254 | } | 254 | } |
| 255 | } | 255 | } |
| @@ -269,7 +269,7 @@ public class RedisUtil { | @@ -269,7 +269,7 @@ public class RedisUtil { | ||
| 269 | redisTemplate.opsForHash().put(key, item, value); | 269 | redisTemplate.opsForHash().put(key, item, value); |
| 270 | return true; | 270 | return true; |
| 271 | } catch (Exception e) { | 271 | } catch (Exception e) { |
| 272 | - logger.error("未处理的异常 ", e); | 272 | + e.printStackTrace(); |
| 273 | return false; | 273 | return false; |
| 274 | } | 274 | } |
| 275 | } | 275 | } |
| @@ -293,7 +293,7 @@ public class RedisUtil { | @@ -293,7 +293,7 @@ public class RedisUtil { | ||
| 293 | } | 293 | } |
| 294 | return true; | 294 | return true; |
| 295 | } catch (Exception e) { | 295 | } catch (Exception e) { |
| 296 | - logger.error("未处理的异常 ", e); | 296 | + e.printStackTrace(); |
| 297 | return false; | 297 | return false; |
| 298 | } | 298 | } |
| 299 | } | 299 | } |
| @@ -365,7 +365,7 @@ public class RedisUtil { | @@ -365,7 +365,7 @@ public class RedisUtil { | ||
| 365 | try { | 365 | try { |
| 366 | return redisTemplate.opsForSet().members(key); | 366 | return redisTemplate.opsForSet().members(key); |
| 367 | } catch (Exception e) { | 367 | } catch (Exception e) { |
| 368 | - logger.error("未处理的异常 ", e); | 368 | + e.printStackTrace(); |
| 369 | return null; | 369 | return null; |
| 370 | } | 370 | } |
| 371 | } | 371 | } |
| @@ -383,7 +383,7 @@ public class RedisUtil { | @@ -383,7 +383,7 @@ public class RedisUtil { | ||
| 383 | try { | 383 | try { |
| 384 | return redisTemplate.opsForSet().isMember(key, value); | 384 | return redisTemplate.opsForSet().isMember(key, value); |
| 385 | } catch (Exception e) { | 385 | } catch (Exception e) { |
| 386 | - logger.error("未处理的异常 ", e); | 386 | + e.printStackTrace(); |
| 387 | return false; | 387 | return false; |
| 388 | } | 388 | } |
| 389 | } | 389 | } |
| @@ -401,7 +401,7 @@ public class RedisUtil { | @@ -401,7 +401,7 @@ public class RedisUtil { | ||
| 401 | try { | 401 | try { |
| 402 | return redisTemplate.opsForSet().add(key, values); | 402 | return redisTemplate.opsForSet().add(key, values); |
| 403 | } catch (Exception e) { | 403 | } catch (Exception e) { |
| 404 | - logger.error("未处理的异常 ", e); | 404 | + e.printStackTrace(); |
| 405 | return 0; | 405 | return 0; |
| 406 | } | 406 | } |
| 407 | } | 407 | } |
| @@ -424,7 +424,7 @@ public class RedisUtil { | @@ -424,7 +424,7 @@ public class RedisUtil { | ||
| 424 | } | 424 | } |
| 425 | return count; | 425 | return count; |
| 426 | } catch (Exception e) { | 426 | } catch (Exception e) { |
| 427 | - logger.error("未处理的异常 ", e); | 427 | + e.printStackTrace(); |
| 428 | return 0; | 428 | return 0; |
| 429 | } | 429 | } |
| 430 | } | 430 | } |
| @@ -441,7 +441,7 @@ public class RedisUtil { | @@ -441,7 +441,7 @@ public class RedisUtil { | ||
| 441 | try { | 441 | try { |
| 442 | return redisTemplate.opsForSet().size(key); | 442 | return redisTemplate.opsForSet().size(key); |
| 443 | } catch (Exception e) { | 443 | } catch (Exception e) { |
| 444 | - logger.error("未处理的异常 ", e); | 444 | + e.printStackTrace(); |
| 445 | return 0; | 445 | return 0; |
| 446 | } | 446 | } |
| 447 | } | 447 | } |
| @@ -459,7 +459,7 @@ public class RedisUtil { | @@ -459,7 +459,7 @@ public class RedisUtil { | ||
| 459 | try { | 459 | try { |
| 460 | return redisTemplate.opsForSet().remove(key, values); | 460 | return redisTemplate.opsForSet().remove(key, values); |
| 461 | } catch (Exception e) { | 461 | } catch (Exception e) { |
| 462 | - logger.error("未处理的异常 ", e); | 462 | + e.printStackTrace(); |
| 463 | return 0; | 463 | return 0; |
| 464 | } | 464 | } |
| 465 | } | 465 | } |
| @@ -625,7 +625,7 @@ public class RedisUtil { | @@ -625,7 +625,7 @@ public class RedisUtil { | ||
| 625 | try { | 625 | try { |
| 626 | return redisTemplate.opsForList().range(key, start, end); | 626 | return redisTemplate.opsForList().range(key, start, end); |
| 627 | } catch (Exception e) { | 627 | } catch (Exception e) { |
| 628 | - logger.error("未处理的异常 ", e); | 628 | + e.printStackTrace(); |
| 629 | return null; | 629 | return null; |
| 630 | } | 630 | } |
| 631 | } | 631 | } |
| @@ -642,7 +642,7 @@ public class RedisUtil { | @@ -642,7 +642,7 @@ public class RedisUtil { | ||
| 642 | try { | 642 | try { |
| 643 | return redisTemplate.opsForList().size(key); | 643 | return redisTemplate.opsForList().size(key); |
| 644 | } catch (Exception e) { | 644 | } catch (Exception e) { |
| 645 | - logger.error("未处理的异常 ", e); | 645 | + e.printStackTrace(); |
| 646 | return 0; | 646 | return 0; |
| 647 | } | 647 | } |
| 648 | } | 648 | } |
| @@ -662,7 +662,7 @@ public class RedisUtil { | @@ -662,7 +662,7 @@ public class RedisUtil { | ||
| 662 | try { | 662 | try { |
| 663 | return redisTemplate.opsForList().index(key, index); | 663 | return redisTemplate.opsForList().index(key, index); |
| 664 | } catch (Exception e) { | 664 | } catch (Exception e) { |
| 665 | - logger.error("未处理的异常 ", e); | 665 | + e.printStackTrace(); |
| 666 | return null; | 666 | return null; |
| 667 | } | 667 | } |
| 668 | } | 668 | } |
| @@ -681,7 +681,7 @@ public class RedisUtil { | @@ -681,7 +681,7 @@ public class RedisUtil { | ||
| 681 | redisTemplate.opsForList().rightPush(key, value); | 681 | redisTemplate.opsForList().rightPush(key, value); |
| 682 | return true; | 682 | return true; |
| 683 | } catch (Exception e) { | 683 | } catch (Exception e) { |
| 684 | - logger.error("未处理的异常 ", e); | 684 | + e.printStackTrace(); |
| 685 | return false; | 685 | return false; |
| 686 | } | 686 | } |
| 687 | } | 687 | } |
| @@ -704,7 +704,7 @@ public class RedisUtil { | @@ -704,7 +704,7 @@ public class RedisUtil { | ||
| 704 | } | 704 | } |
| 705 | return true; | 705 | return true; |
| 706 | } catch (Exception e) { | 706 | } catch (Exception e) { |
| 707 | - logger.error("未处理的异常 ", e); | 707 | + e.printStackTrace(); |
| 708 | return false; | 708 | return false; |
| 709 | } | 709 | } |
| 710 | } | 710 | } |
| @@ -723,7 +723,7 @@ public class RedisUtil { | @@ -723,7 +723,7 @@ public class RedisUtil { | ||
| 723 | redisTemplate.opsForList().rightPushAll(key, values); | 723 | redisTemplate.opsForList().rightPushAll(key, values); |
| 724 | return true; | 724 | return true; |
| 725 | } catch (Exception e) { | 725 | } catch (Exception e) { |
| 726 | - logger.error("未处理的异常 ", e); | 726 | + e.printStackTrace(); |
| 727 | return false; | 727 | return false; |
| 728 | } | 728 | } |
| 729 | } | 729 | } |
| @@ -746,7 +746,7 @@ public class RedisUtil { | @@ -746,7 +746,7 @@ public class RedisUtil { | ||
| 746 | } | 746 | } |
| 747 | return true; | 747 | return true; |
| 748 | } catch (Exception e) { | 748 | } catch (Exception e) { |
| 749 | - logger.error("未处理的异常 ", e); | 749 | + e.printStackTrace(); |
| 750 | return false; | 750 | return false; |
| 751 | } | 751 | } |
| 752 | } | 752 | } |
| @@ -766,7 +766,7 @@ public class RedisUtil { | @@ -766,7 +766,7 @@ public class RedisUtil { | ||
| 766 | redisTemplate.opsForList().set(key, index, value); | 766 | redisTemplate.opsForList().set(key, index, value); |
| 767 | return true; | 767 | return true; |
| 768 | } catch (Exception e) { | 768 | } catch (Exception e) { |
| 769 | - logger.error("未处理的异常 ", e); | 769 | + e.printStackTrace(); |
| 770 | return false; | 770 | return false; |
| 771 | } | 771 | } |
| 772 | } | 772 | } |
| @@ -787,7 +787,7 @@ public class RedisUtil { | @@ -787,7 +787,7 @@ public class RedisUtil { | ||
| 787 | try { | 787 | try { |
| 788 | return redisTemplate.opsForList().remove(key, count, value); | 788 | return redisTemplate.opsForList().remove(key, count, value); |
| 789 | } catch (Exception e) { | 789 | } catch (Exception e) { |
| 790 | - logger.error("未处理的异常 ", e); | 790 | + e.printStackTrace(); |
| 791 | return 0; | 791 | return 0; |
| 792 | } | 792 | } |
| 793 | } | 793 | } |
| @@ -829,7 +829,7 @@ public class RedisUtil { | @@ -829,7 +829,7 @@ public class RedisUtil { | ||
| 829 | Set<String> set = redisTemplate.keys(key); | 829 | Set<String> set = redisTemplate.keys(key); |
| 830 | return new ArrayList<>(set); | 830 | return new ArrayList<>(set); |
| 831 | } catch (Exception e) { | 831 | } catch (Exception e) { |
| 832 | - logger.error("未处理的异常 ", e); | 832 | + e.printStackTrace(); |
| 833 | return null; | 833 | return null; |
| 834 | } | 834 | } |
| 835 | } | 835 | } |
| @@ -854,7 +854,7 @@ public class RedisUtil { | @@ -854,7 +854,7 @@ public class RedisUtil { | ||
| 854 | // //关闭cursor | 854 | // //关闭cursor |
| 855 | // cursor.close(); | 855 | // cursor.close(); |
| 856 | // } catch (Exception e) { | 856 | // } catch (Exception e) { |
| 857 | -// logger.error("未处理的异常 ", e); | 857 | +// e.printStackTrace(); |
| 858 | // } | 858 | // } |
| 859 | // return result; | 859 | // return result; |
| 860 | // } | 860 | // } |
web_src/src/components/dialog/platformEdit.vue
| @@ -331,7 +331,7 @@ export default { | @@ -331,7 +331,7 @@ export default { | ||
| 331 | return result; | 331 | return result; |
| 332 | }, | 332 | }, |
| 333 | checkExpires: function() { | 333 | checkExpires: function() { |
| 334 | - if (this.platform.enable && this.platform.expires == "0") { | 334 | + if (this.platform.enable && this.platform.expires === "0") { |
| 335 | this.platform.expires = "300"; | 335 | this.platform.expires = "300"; |
| 336 | } | 336 | } |
| 337 | }, | 337 | }, |