[JRebel] 개발시 서버 리부팅 시간을 줄이자. 아니 없애자!!
http://www.zeroturnaround.com/jrebel/installation/
JSP에서 DB 쿼리, 자바코드, HTML 짬뽕으로 몇 천 줄짜리 코드를 만들고 힘들게 유지보수 하는 이유가... '서버 리부팅을 하지 않아도 되니까'라고 하던데... 정말 그 이유 때문인지 모르겠습니다.
암튼, 그렇게까지 서버 리부팅이 하기 싫으시다면, JRebel을 쓰시는걸 추천하고 싶습니다.
사용법도 매우 간단합니다.
상용제품이기는 한데, 라이센스 없이 30일간 무료로 사용해볼 수 있습니다.
예전에도 이 제품을 써보려고 살펴보긴 했는데, 애플리케이션을 실행할 때 마다
noverify -javaagent:/path/to/jrebel.jar
이런 옵션을 줘야 한다는게 너무 귀찮아서 해보지도 않았습니다.
그런데 오늘은 방명록에 올라온 글 때문에 다시 살펴봤더니 이름도 JavaRebel에서 JRebel로 짧게 바꾸고 이클립스 플러긴도 제공해서 저런 옵션을 수동으로 주지 않아도 되게 해놨더군요. 대박이닷!! 해보자!!
그래서 해봤더니.. 정말 잘 돌아가고 너무 간단합니다.
개발 시간을 상당히 많이 단축 시킬 수 있을 것으로 보입니다.
톰캣 로그가 다음과 같은 모습이 됩니다.
JRebel 2.1a (200910071200)
(c) Copyright ZeroTurnaround, Ltd, 2007-2009. All rights reserved.
A rough estimate: Over the last 1 days JRebel
prevented the need for at least 0 redeploys/restarts.
Using industry standard build and redeploy times,
JRebel saved you between 0 and 0 hours.
You are running JRebel evaluation license.
You have 30 days until the license expires.
You will see this notification until you obtain a
full license for your installation.
Visit www.jrebel.com for instructions on obtaining
a full license. If you wish to continue your evaluation
please e-mail to support@zeroturnaround.com.
If you think you should not see this message contact
support@zeroturnaround.com or check that you have your
license file in the same directory as the JAR file. #############################################################
2009. 10. 15 오전 10:56:59 org.apache.tomcat.util.digester.SetPropertiesRule begin
경고: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:springsprout2' did not find a matching property.
2009. 10. 15 오전 10:56:59 org.apache.catalina.core.AprLifecycleListener init
정보: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.6.0_10\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\oracle\product\10.2.0\db_1\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\QuickTime\QTSystem;c:\Program Files\Microsoft SQL Server\90\Tools\binn;C:\Program Files\VanDyke Software\SecureCRT;C:\Program Files\SecureCRT;C:\Program Files\QuickTime\QTSystem;c:\Program Files\Microsoft SQL Server\90\Tools\binn;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Subversion\bin;C:\Program Files\ESTsoft\ALZip;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\Java\jdk1.6.0_10\bin;C:\apps\apache-maven-2.0.10\bin;"C:\Program Files\PostgreSQL\8.3\bin";C:\apps\apache-ant-1.7.1\bin;C:\Program Files\Git\bin;C:\Program Files\ESTsoft\ALZip;C:\apps\spring-roo-1.0.0.M1\bin
2009. 10. 15 오전 10:56:59 org.apache.coyote.http11.Http11Protocol init
정보: Initializing Coyote HTTP/1.1 on http-8080
2009. 10. 15 오전 10:56:59 org.apache.catalina.startup.Catalina load
정보: Initialization processed in 323 ms
2009. 10. 15 오전 10:56:59 org.apache.catalina.core.StandardService start
정보: Starting service Catalina
2009. 10. 15 오전 10:56:59 org.apache.catalina.core.StandardEngine start
정보: Starting Servlet Engine: Apache Tomcat/6.0.18
JRebel: Directory 'C:\workspace-sts\springsprout2\web\WEB-INF\classes' will be monitored for changes.
JRebel: Directory 'C:\workspace-sts\springsprout2\target\test-classes' will be monitored for changes.
JRebel: Directory 'C:\workspace-sts\springsprout2\web' will be monitored for changes.
2009. 10. 15 오전 10:56:59 org.apache.catalina.loader.WebappClassLoader validateJarFile
정보: validateJarFile(C:\workspace-sts\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\springsprout2\WEB-INF\lib\com.springsource.javax.servlet-2.5.0.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
=============================== [JRebel Spring Framework Plugin] ===============================
Plugins are contributed by third party and can cause compatibility problems.
If you have any troubles set -Drebel.spring_plugin=false to disable it.
------------------------------------------------------------------------------------------
Description: Supports adding new beans and adding new bean dependencies using
annotations or XML. Singletons will be reconfigured after the change. It also
supports adding or changing Spring MVC controllers or handlers.
=============================== [/JRebel Spring Framework Plugin] ==============================
=============================== [JRebel AspectJ Plugin DISABLED] ==============================
You can enable AspectJ Plugin by setting -Drebel.aspectj_plugin=true.
------------------------------------------------------------------------------------------
Description: Allows the AspectJ load-time weaving (javaagent launched by aj5 or
-javaagent:aspectjweaver.jar) to be used with JavaRebel. Note that AspectJ
weaver will still show "java.lang.Exception: AspectJ5 does not weave hotswapped
class" in the beginning, but this can be safely ignored.
=============================== [/JRebel AspectJ Plugin DISABLED] =============================
2009. 10. 15 오전 10:57:00 org.apache.catalina.core.ApplicationContext log
...생략...
INFO - FrameworkServlet.initServletBean(322) | FrameworkServlet 'springsprout': initialization completed in 828 ms
Hibernate: select this_.id as id4_0_, this_.authCode as authCode4_0_, this_.avatar as avatar4_0_, this_.blog as blog4_0_, this_.email as email4_0_, this_.joined as joined4_0_, this_.name as name4_0_, this_.outDate as outDate4_0_, this_.outReason as outReason4_0_, this_.password as password4_0_, this_.status as status4_0_, this_.totalAttendanceRate as totalAt12_4_0_, this_.totalTrustRate as totalTr13_4_0_ from Member this_ where this_.status=?
Hibernate: select this_.id as id13_1_, this_.descr as descr13_1_, this_.endDay as endDay13_1_, this_.manager_id as manager10_13_1_, this_.maximum as maximum13_1_, this_.meetingCount as meetingC5_13_1_, this_.memberCount as memberCo6_13_1_, this_.startDay as startDay13_1_, this_.status as status13_1_, this_.studyName as studyName13_1_, member2_.id as id4_0_, member2_.authCode as authCode4_0_, member2_.avatar as avatar4_0_, member2_.blog as blog4_0_, member2_.email as email4_0_, member2_.joined as joined4_0_, member2_.name as name4_0_, member2_.outDate as outDate4_0_, member2_.outReason as outReason4_0_, member2_.password as password4_0_, member2_.status as status4_0_, member2_.totalAttendanceRate as totalAt12_4_0_, member2_.totalTrustRate as totalTr13_4_0_ from Study this_ left outer join Member member2_ on this_.manager_id=member2_.id where this_.status in (?, ?, ?)
JRebel: Reloading class 'springsprout.modules.study.StudyController'.
JRebel-Spring: Reconfiguring bean 'studyController' [springsprout.modules.study.StudyController]
WARN - DefaultHandlerExceptionResolver.handleNoSuchRequestHandlingMethod(142) | No matching handler method found for servlet request: path '/study/index.do', method 'GET', parameters map[[empty]]
JRebel: Reloading class 'springsprout.modules.study.StudyController'.
JRebel-Spring: Reconfiguring bean 'studyController' [springsprout.modules.study.StudyController]
OSAF를 이용해서 오픈 소스 라이선스를 신청해야겠습니다. 냐하하~
JRebel에 스프링 빈들의 의존성과 컨트롤러, 핸들러 등을 XML과 애노테이션 정보가 바뀔 때마다 클래스를 릴로딩 해주는 것을 플러긴화해서 내장하고 있나봅니다. 스프링 뿐 아니라, 구글쥬스, 스트럿츠 설정이 변경되는 것도 감지하도록 되어 있네요. 캬...
감동입니다!
ps: 오늘 할 일이 다 끝나고도 여유가 생기면 오랜만에 스크린캐스팅으로 찍어보겠습니다.