![]() Bug 4910812 received a fresh comment in December. Yes, it is not easy but Oracle should still ship cure with the JVM. Honestly, I wonder why SpringSource is not making serious noise about spring-loaded. I have just started using this and I am exploring further possibilities. Neither spring-loaded nor the IDE need to be aware of what is actually happing. ![]() ![]() This union-mount makes changes of class files in target/classes directories of projects appear immediately in the webapp where they are detected by spring-loaded. Unionfs-fuse /opt/alfresco/tomcat/webapps/alfresco/WEB-INF/classes-default=RO:/home/deas/projects/project-a/target/classes=RO:/home/deas/work/projects/project-b/target/classes=RO /opt/alfresco/tomcat/webapps/alfresco/WEB-INF/classes Layering the directories works like this: The missing ingredient was a stacking filesystem – I picked FUSE based UnionFS. I hope IntelliJ has a similiar feature (I am about to switch).įor my current alfresco repository case I needed a way to get the project classes directory “merged” with the one of the webapp. Eclipse has “build automatically” set by default and hence does the latter out of the box. Depending on your use case, this may already be most you need besides immediate recompilation of classes whenever they change. javaagent:/opt/spring-loaded/springloaded-1.1.1-dev.jar -noverify. At the end of the day, I don’t really care about how ugly the source looks as long as is works for me and there is no need to understand it.Īll the spring-loaded agent requires to work are a few Java command line arguments, e.g. I doubt JRebel sources look better in this respect. I consider SpringSource and the Grails community trustworthy, so I decided to try adding the missing pieces for my “other than grails day to day” work.įrankly, the spring-loaded agent source looks ugly, but I guess that is due to current JVM limitations imposed at an agent based solution in general. I was watching Graeme Rochers Groovy / Grails Exchange 2012 Keynote where he mentioned that spring-loaded, the agent based reloading solution introduced with Grails 2 is available separately on github. Revisiting Class ReloadingĪctually, I was fairly happy with the help offered by dynamic languages. DCEVM and most other efforts seem either dead or immature. JRebel, the canonical choice was ruled out because it is not Open Souce and I don’t like that it wants the IDE to be aware of it. The ones I looked at over time did not work for me for one reason or another. I am still doing this and will keep doing it when I feel it makes sense.Īpproaches Solutions addressing the bug issue generally separate in to categories, JVM – und agent based ones. One of my heavyweights is a webapp called alfresco repository, and one workaround is trying to avoid the Java language and use a dynamic language instead. But it can matter a lot when you are working on server side components which need a heavyweight environment bootstrapped to run. It may not really matter in situations where restarts are fast, such as in the case of desktop applications. Pain perceived depends on various factors. ![]() Sure, the problem is not easy to solve, but there still is demand – not everybody has given up hope yet. In fact, reloading pain was a major driver for me to almost convert towards dynamic languages. I tend to switch context, do something else and forget about the restarted application. The most annoying thing for me is the fact that restarts distract a lot. Official bug entry “4910812 : Enhance Hot Code Replacement” dates back to 2003. Java Class Reloading : A long History of Painĭevelopers’ desire to reload class changes is as old as Java. Even if, I am fairly sure it is possible to come up with an alternative which does not leverage OS support. I don’t know whether a stacked filesystem that will do is available on every other OS Juava supports. My workstation is a Linux system and a part of the approach outlined uses a stacked filesystem. It may not address every scenario requiring class updates, but it reduced the total amount of restarts significantly for me. This post introduces a very simple pure Open Source approach knocking down JVM- and application restarts during development. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |