javaeclipsespringtomcat8jrebel

Exception when deploying Java app in tomcat8 with spring 4.3 and JRebel


Using...

Recently I have upgraded from Spring 4.2 to 4.3.4.RELEASE

When I try to deploy (run or debug) my tomcat server in eclipse,with jrebel enabled, the following error appears:

2016-12-19 12:10:43 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@28cb48ca: 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:69)
at org.zeroturnaround.bundled.javassist.expr.ExprEditor.loopBody(SourceFile:192)
at org.zeroturnaround.bundled.javassist.expr.ExprEditor.doit(SourceFile:91)
at org.zeroturnaround.bundled.javassist.CtBehavior.instrument(SourceFile:712)
at org.zeroturnaround.javarebel.integration.spring.core.cbp.PathMatchingResourcePatternResolverCBP.processClassPathScanning(PathMatchingResourcePatternResolverCBP.java:60)
at org.zeroturnaround.javarebel.integration.spring.core.cbp.PathMatchingResourcePatternResolverCBP.process(PathMatchingResourcePatternResolverCBP.java:38)
at org.zeroturnaround.javarebel.integration.support.JavassistClassBytecodeProcessor.process(SourceFile:71)
at com.zeroturnaround.javarebel.ic.a(SourceFile:344)
at com.zeroturnaround.javarebel.ic.a(SourceFile:333)
at com.zeroturnaround.javarebel.ic.a(SourceFile:311)
at com.zeroturnaround.javarebel.SDKIntegrationImpl.runBytecodeProcessors(SourceFile:31)
at com.zeroturnaround.javarebel.hh.transform(SourceFile:88)
at java.lang.ClassLoader.defineClass(ClassLoader.java)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2494)
at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:860)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1302)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at com.zeroturnaround.javarebel.hm.a(SourceFile:91)
at com.zeroturnaround.javarebel.hm.a(SourceFile:257)
at com.zeroturnaround.javarebel.hh.transform(SourceFile:104)
at java.lang.ClassLoader.defineClass(ClassLoader.java)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2494)
at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:860)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1302)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167)
at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.getResourcePatternResolver(AbstractRefreshableWebApplicationContext.java:183)
at org.springframework.context.support.AbstractApplicationContext.<init>(AbstractApplicationContext.java:217)
at org.springframework.context.support.AbstractRefreshableApplicationContext.<init>(AbstractRefreshableApplicationContext.java:80)
at org.springframework.context.support.AbstractRefreshableConfigApplicationContext.<init>(AbstractRefreshableConfigApplicationContext.java:50)
at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.<init>(AbstractRefreshableWebApplicationContext.java:95)
at org.springframework.web.context.support.AnnotationConfigWebApplicationContext.<init>(AnnotationConfigWebApplicationContext.java:82)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:142)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:102)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:380)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:313)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4793)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5236)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
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)
at org.zeroturnaround.bundled.javassist.compiler.ast.CallExpr.accept(SourceFile:46)
at org.zeroturnaround.bundled.javassist.compiler.CodeGen.doTypeCheck(SourceFile:242)
at org.zeroturnaround.bundled.javassist.compiler.CodeGen.atDeclarator(SourceFile:743)
at org.zeroturnaround.bundled.javassist.compiler.ast.Declarator.accept(SourceFile:100)
at org.zeroturnaround.bundled.javassist.compiler.CodeGen.atStmnt(SourceFile:351)
at org.zeroturnaround.bundled.javassist.compiler.ast.Stmnt.accept(SourceFile:50)
at org.zeroturnaround.bundled.javassist.compiler.Javac.compileStmnt(SourceFile:569)
at org.zeroturnaround.bundled.javassist.expr.MethodCall.replace(SourceFile:235)
... 53 more

Does anyone having the same problem?


Solution

  • Are you certain that you're using 7.0.1 version of JRebel agent? According to stacktrace it looks to be 6.2.5 or older, particular bug should've been fixed in 6.4.4. Check what version number is displayed in JRebel banner on server startup. Perhaps Eclipse is currently configured to use older external agent - go to Help > JRebel > Configuration > Advanced to select agent bundled with JRebel Eclipse plugin.