環境:Jrebel6.4.3 + Spring 4.3.0.RELEASE + Java SE8 (Java1.8)

錯誤訊息:

2016-06-13 12:07:52 JRebel: ERROR Class 'org.springframework.core.io.support.PathMatchingResourcePatternResolver' could not be processed by org.zeroturnaround.javarebel.integration.spring.core.cbp.PathMatchingResourcePatternResolverCBP@org.apache.catalina.loader.WebappClassLoader@54905459: org.zeroturnaround.bundled.javassist.CannotCompileException: [source error] getURL() not found in java.net.URL
    at org.zeroturnaround.bundled.javassist.expr.MethodCall.replace(SourceFile:241)
    at org.zeroturnaround.javarebel.integration.spring.core.cbp.PathMatchingResourcePatternResolverCBP$1.edit(PathMatchingResourcePatternResolverCBP.java:70)
(中略)
Caused by: compile error: getURL() not found in java.net.URL
    at org.zeroturnaround.bundled.javassist.compiler.TypeChecker.atMethodCallCore(SourceFile:749)
    at org.zeroturnaround.bundled.javassist.compiler.TypeChecker.atCallExpr(SourceFile:695)
    at org.zeroturnaround.bundled.javassist.compiler.JvstTypeChecker.atCallExpr(SourceFile:157)

原因:jRebel程式碼錯誤,不知道為什麼會去 java.net.URL 裡用 getURL() 這個方法,可是 java.net.URL 沒有這個方法

解法:把Spring降回4.2.6.RELEASE版本就好了,大概在 jRebel 處理前這個問題不會消失
看下Spring4.3.0的發表時間是6月10日,JRebel最後更新(6.4.5) 是6月2日
還沒反應很正常......

2016-07-06更新
JRebel更新 6.4.6版本已解決這個問題。

相關文章