2

I am trying to configure JRebel

Dev environment description:

  • Eclipse Juno IDE
  • JBoss 6.0.1 - Running externally from eclipse (same machine, not remotely)
  • Debugging: Remote, all hotswapping functionalities off
  • Ant script that: compiles, deploys and lifts target WAR to the JBoss

I have not used JRebel before, the configuration guide seemed pretty easy, but i am having troubles with my particular case.

All source (incl. jsps and images) is being compiled in project's bin folder.

Ant script creates WAR which holds separately JSPs, style, property files and compiled application classes are put inside dedicated jar in /web-inf/lib/ together with libraries. The script lifts the generated WAR to the JBoss and runs the server.

Where should i put my rebel.xml (i suppose in my project's bin folder?!) and what should i write into it in order to get jrebel-hotswapped the code changes inside the jar inside the war that is deployed in JBoss server.

I provided JBoss run script with necessary jrebel VM arguments.

Many thanks in advance!

Erik Kaju
  • 3,147
  • 3
  • 19
  • 28

1 Answers1

2

rebel.xml should end up in WEB-INF/classes of your application. If you have dependencies in WEB-INF/lib folder, then every archive should have its own dedicated rebel.xml configuration file.

See the doc

If you deploy using Eclipse WTP, then it is fine to put it into source folder. But if you are using Ant to build the WAR, then you have to make sure that your Ant script will detect rebel.xml and copy it to the correct location.

The paths in the rebel.xml should point to the folder where the compiled classes are, i.e. the location where your IDE compiles these classes to.

Anton Arhipov
  • 6,479
  • 1
  • 35
  • 43
  • Hey, I appreciate your personal contribution as jrebel engineer in public discussions. That's very nice ;) I got it working with java class and property files (located in: that is inside /WEB-INF/lib). But unfortunately not with JSPs yet (located in /jsp). (two different rebel.xml files) – Erik Kaju Jun 25 '13 at 11:50
  • JSPs are a part of the web module, I presume and reside somewhere in WEB-INF directory, probably in some sub-directory? Then rebel.xml just has to have the tag with the link tag pointing to the directory with the resources and it should be mapped with the 's target attribute, which will map the resources according to the way you refer to those resources in the application. If this doesn't work for you, please ask from JRebel support - it might be a bug related to a specific JBoss version. – Anton Arhipov Jun 25 '13 at 11:54
  • The structure is slightly confusing. I will try to be precise: WAR itself has four top level directories - WEB-INF, META-INF, jsp, css. Java functionality is in /WEB-INF/lib/ which is holding classes. So, no, JSPs are not inside WEB-INF directory, but next to it in "jsp" folder. It was quite similar with mentioned jar, classes were not inside WEB-INF/classes, but there i was able to configure it by putting the rebel.xml just into the jar (not into WEB-INF/classes). I got it as it is and it was not designed by me. I hope my description is clear. – Erik Kaju Jun 25 '13 at 12:11
  • So the link value should just point to the directory where the jsp files are in your project. However, the link target attribute value is derived from the archive structure - the jps might be outside of the WEB-INF folder in your project workspace, but I'm sure they are copied into WEB-INF when you assemble the WAR – Anton Arhipov Jun 25 '13 at 12:19
  • JSPs are outside WEB-INF both in my project and in assembled WAR, i peeked into war to make sure. Maybe i should put rebel.xml into WEB-INF and point somehow like "../jsp/" ? Server startup was showing that correct folder with JSPs was being monitored, but no changes were applied inside war. – Erik Kaju Jun 25 '13 at 12:28
  • I got everything working. Got some matter-of-fact help from ZT helpdesk. Thanks for responses. – Erik Kaju Aug 02 '13 at 07:54