用spring boot,打开zuul的debug开关总是抛异常。
最终定位到
RequestContext.java : 546行
public RequestContext copy() { RequestContext copy = new RequestContext(); Iterator<String> it = keySet().iterator(); //exception!!!
抛如下异常:
com.netflix.zuul.context.RequestContext.keySet()Ljava/util/concurrent/ConcurrentHashMap$KeySetView;
查了下,这个KeySetView是1.8引入的东东,详细可以参考:
http://stackoverflow.com/questions/32954041/concurrenthashmap-crashing-application-compiled-with-jdk-8-but-targeting-jre-7
所以不要相信spring boot吹牛的兼容1.7。
如果用zuul1.3版本,就老老实实升级到1.8吧。