使用IntellijIDEA中的JRebel进行部署

时间:2016-04-04 12:22:48

标签: spring jsp spring-mvc intellij-idea jrebel

我正在阅读“Spring in Action”一书中的教程(由Manning Pubblications提供)。 当我尝试使用JRebel部署webApp(使用springMVC)时出现问题。

[2016-04-04 11:00:28,040] Artifact WebAppSpring: Artifact is being deployed, please wait...
Connected to server
2016-04-04 11:00:28 JRebel: ERROR Class 'org.apache.catalina.startup.ContextConfig' could not be processed by org.zeroturnaround.javarebel.integration.catalina.ContextConfigCBP@java.net.URLClassLoader@1134affc: org.zeroturnaround.bundled.javassist.CannotCompileException: [source error] processAnnotationsUrl(java.net.URL,org.apache.tomcat.util.descriptor.web.WebXml,boolean) not found in org.apache.catalina.startup.ContextConfig
    at org.zeroturnaround.bundled.javassist.CtNewMethod.make(JRebel:79)
    at org.zeroturnaround.bundled.javassist.CtNewMethod.make(JRebel:45)
    at org.zeroturnaround.bundled.javassist.CtMethod.make(JRebel:132)
    at org.zeroturnaround.javarebel.integration.catalina.ContextConfigCBP.implementReloadingOnTomcat8(ContextConfigCBP.java:122)
    at org.zeroturnaround.javarebel.integration.catalina.ContextConfigCBP.process(ContextConfigCBP.java:25)
    at org.zeroturnaround.javarebel.integration.support.JavassistClassBytecodeProcessor.process(JRebel:117)
    at com.zeroturnaround.javarebel.kh.a(JRebel:359)
    at com.zeroturnaround.javarebel.kh.a(JRebel:348)
    at com.zeroturnaround.javarebel.kh.a(JRebel:316)
    at com.zeroturnaround.javarebel.SDKIntegrationImpl.runBytecodeProcessors(JRebel:132)
    at com.zeroturnaround.javarebel.jP.transform(JRebel:57)
    at java.lang.ClassLoader.defineClass(ClassLoader.java)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:462)
    at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:431)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
    at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1471)
    at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76)
    at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1312)
    at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1404)
    at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:832)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:323)
    at sun.rmi.transport.Transport$1.run(Transport.java:200)
    at sun.rmi.transport.Transport$1.run(Transport.java:197)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$256(TCPTransport.java:683)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
    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: processAnnotationsUrl(java.net.URL,org.apache.tomcat.util.descriptor.web.WebXml,boolean) not found in org.apache.catalina.startup.ContextConfig
    at org.zeroturnaround.bundled.javassist.compiler.TypeChecker.atMethodCallCore(JRebel:749)
    at org.zeroturnaround.bundled.javassist.compiler.TypeChecker.atCallExpr(JRebel:695)
    at org.zeroturnaround.bundled.javassist.compiler.JvstTypeChecker.atCallExpr(JRebel:157)
    at org.zeroturnaround.bundled.javassist.compiler.ast.CallExpr.accept(JRebel:46)
    at org.zeroturnaround.bundled.javassist.compiler.CodeGen.doTypeCheck(JRebel:242)
    at org.zeroturnaround.bundled.javassist.compiler.CodeGen.atStmnt(JRebel:330)
    at org.zeroturnaround.bundled.javassist.compiler.ast.Stmnt.accept(JRebel:50)
    at org.zeroturnaround.bundled.javassist.compiler.CodeGen.atStmnt(JRebel:351)
    at org.zeroturnaround.bundled.javassist.compiler.ast.Stmnt.accept(JRebel:50)
    at org.zeroturnaround.bundled.javassist.compiler.CodeGen.atIfStmnt(JRebel:398)
    at org.zeroturnaround.bundled.javassist.compiler.CodeGen.atStmnt(JRebel:355)
    at org.zeroturnaround.bundled.javassist.compiler.ast.Stmnt.accept(JRebel:50)
    at org.zeroturnaround.bundled.javassist.compiler.CodeGen.atStmnt(JRebel:351)
    at org.zeroturnaround.bundled.javassist.compiler.ast.Stmnt.accept(JRebel:50)
    at org.zeroturnaround.bundled.javassist.compiler.CodeGen.atIfStmnt(JRebel:398)
    at org.zeroturnaround.bundled.javassist.compiler.CodeGen.atStmnt(JRebel:355)
    at org.zeroturnaround.bundled.javassist.compiler.ast.Stmnt.accept(JRebel:50)
    at org.zeroturnaround.bundled.javassist.compiler.CodeGen.atStmnt(JRebel:351)
    at org.zeroturnaround.bundled.javassist.compiler.ast.Stmnt.accept(JRebel:50)
    at org.zeroturnaround.bundled.javassist.compiler.CodeGen.atMethodBody(JRebel:292)
    at org.zeroturnaround.bundled.javassist.compiler.CodeGen.atMethodDecl(JRebel:274)
    at org.zeroturnaround.bundled.javassist.compiler.ast.MethodDecl.accept(JRebel:44)
    at org.zeroturnaround.bundled.javassist.compiler.Javac.compileMethod(JRebel:169)
    at org.zeroturnaround.bundled.javassist.compiler.Javac.compile(JRebel:95)
    at org.zeroturnaround.bundled.javassist.CtNewMethod.make(JRebel:74)
    ... 51 more

2016-04-04 11:00:32 JRebel: Directory 'C:\Users\NINO\IdeaProjects\SpringInAction\out\production\SpringInAction' will be monitored for changes.
2016-04-04 11:00:32 JRebel: Directory 'C:\Users\NINO\IdeaProjects\SpringInAction\web' will be monitored for changes.

...
...
...

出现此错误后,部署就可以了。

但是如果我修改一个静态文件(例如jsp),jrebel工作正常......如果我修改了一个java类,jrebel就不行了。

我不知道相对于部署时控制台中显示的错误是否存在问题。

在过去,我使用servlet(而不是spring)使用eclipse使用Jrebel并且它工作正常。

我用: - IntellijIDEA 2016.1.1 - Java 1.8 - 春季4.2.5

你能帮助我吗?

由于

1 个答案:

答案 0 :(得分:1)

您使用的是什么版本的tomcat? 9.0.0里程碑?从here获取JRebel 6.4.2版本并使用与在here安装每晚版本相同的说明安装zip,应该修复错误。