ZeroTurnaround Support Forum » JRebel Support

Spring, NetBeans, Maven, Jetty & JavaRebel: Not playing nicely together

(7 posts)

  1. Rob

    Member
    Posts: 3

    Hi,

    I have a fairly typical WebApp using Spring and SpringMVC:

    • NetBeans 6.7
    • Maven 2.0.9
    • Java 1.6.0_13
    • JavaRebel 2.0.2b

    I can not seem to get JavaRebel to recognize any of the Spring Annotation changes (though in JavaRebel documentation it claims SpringPlugin is built into JavaRebel). When I save changes in NetBeans, JavaRebel does not automatically reload changes. I need to go to another console and issue a "mvn compile".

    This seems to defeat the benefits of JavaRebel? My web-app can redeploy in as much time as it takes to compile and reload changes in JavaRebel! The only savings here is that my session is still intact.

    Furthermore, whenever I make changes to Spring Annotations, I still need to restart my container (Jetty plugin running via Maven), or at the minimum, go to the console and wait for the sucker to compile (rather than an incremental compile via the IDE).

    I still have not realized a savings over Eclipse+Tomcat+Sysdeo-Plugin. Other than the fact that I can use NetBeans, which has a much nicer JSP editor than Eclipse.

    So I ask of you guys at ZeroTurnAround: Where is my savings? Why should I buy this for my team?

    Thanks,

    Rob

    Posted 1 year ago #
  2. toomasr

    CoreRebel
    Posts: 482

    Hi Rob,

    Currently you seem to have a configuration issue. The idea of using JavaRebel is that you skip most of redeploys, use the classes generated by the IDE and get zeroturnaround feel in Java development.

    Do you happen to be using the rebel.xml configuration? How do you start your jetty?

    Some guesses on what might be wrong right now:
    *) NetBeans is not actually doing any compiling when you hit save. You can check the timestamps of the class files.
    *) NetBeans is not outputting class files to the location where Jetty is using them from. On the other hand mvn compile is outputting classes to the correct location

    Solutions:
    *) Make NetBeans compile classes to the location that jetty is using them from
    *) Use rebel.xml to tell jetty to load classes from the location that NetBeans outputs classes to. See http://www.zeroturnaround.com/jrebel/configuration/ for more details.

    Posted 1 year ago #
  3. Rob

    Member
    Posts: 3

    Thanks Toomasr.

    My project is a Maven web (war) project. I did not configure anything special on NetBeans, and instead just rely on NetBeans' Maven support to automatically do all the mappings. As such, I assume that NetBeans is saving the files to the target directory specified by Maven (currently the $PROJECT_HOME/target/classes).

    I have not found anything in NetBeans to configure where it saves the compiled classes. (Note that JSP files do get picked up, but I believe that happens already with Jetty).

    I start Jetty with the "mvn jetty:run" command.

    I configured NetBeans' "Project --> Properties --> Build --> Compile" setting to "Compile On Save" For both application and test.

    There were no other configurations available.

    I will look into using the rebel.xml, but I don't see where I would put that file. It seems like it would have to be included in my project source (not a deal breaker, but I would rather keep the source clean of any dev tool artifacts).

    Regards,

    Rob

    Posted 1 year ago #
  4. toomasr

    CoreRebel
    Posts: 482

    Can you manually verify that NetBeans is compiling classes to $PROJECT_HOME/target/classes? You can do this by checking the timestamps of the changed .class files.

    If not and it is not possible to configure output paths for NetBeans, then you need to use rebel.xml. For web apps rebel.xml needs to end up in WEB-INF/classes so it does not need to be in your source folder per se but I do know that it is handy to have it there (Eclipse automatically copies all resources from src folders to output folders for example). And the rebel.xml must contain the actual output path of NetBeans generated classes.

    Posted 1 year ago #
  5. mkleint

    Member
    Posts: 4

    only NetBeans 6.8 will do true Compile on Save. In 6.7 we did what the other project types do. Only compile before Run/Deploy. However that beats the purpose of javarebel that should not need re-runs and re-deploys.

    http://www.netbeans.org/issues/show_bug.cgi?id=148499

    Posted 1 year ago #
  6. toomasr

    CoreRebel
    Posts: 482

    Ok, thanks for the info. So a manual compile is actually needed with NetBeans < 6.8.

    Posted 1 year ago #
  7. Rob

    Member
    Posts: 3

    @mkleint

    Thanks for the insight. I have gotten this to work nicely with NetBeans 6.8, however I am having some strange behavior with NetBeans.

    I realize this is not JRebel related, but has anyone seen issues with NetBeans 6.8 Compile-on-Save feature?

    Some projects (Maven war type) work great, others do not Compile-on-Save.

    Thanks,

    Rob

    Posted 7 months ago #

RSS feed for this topic

Reply

(required)

(required)

(optional)

(required)

Allowed markup: a blockquote code em strong ul ol li.
Put code in between `backticks`.

Olark Livehelp