【问题标题】:Deploy with JRebel from IntellijIDEA使用 JRebel 部署 Intellij IDEA
【发布时间】:2016-04-04 12:22:48
【问题描述】:

我正在学习“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

你能帮我吗???

谢谢

【问题讨论】:

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


    【解决方案1】:

    你用的是什么版本的tomcat? 9.0.0 里程碑?从 here 获取 JRebel 6.4.2 版本并使用与在 here 安装夜间构建相同的说明安装 zip,应该可以修复错误。

    【讨论】:

    • 谢谢,但我已经解决了这个问题.... 问题是 tomcat (9.x) 的版本。版本 7 没问题,一切正常...
    猜你喜欢
    • 2013-01-06
    • 2017-07-12
    • 1970-01-01
    • 1970-01-01
    • 2016-06-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多