Tiny
Tiny

Reputation: 27909

Using JRebel in NetBeans

I have a Java EE application running on WildFly 10.0.0 final having the following structure diagrammatically (it does not use Apache Maven).

enter image description here

I am using JRebel 6.4.1 for NetBeans (8.1). It works fine in web applications (thus not enterprise applications) but in enterprise applications, the IDE keeps on showing the following message, "Open project properties to setup remote servers", when changes to a Java file in the EE module or class library (as show in the picture above) are synchronized.

enter image description here

The message does not appear, when changes to the web module are synchronized.

Despite the message, changes made to the EE module are propagated when the module is synchronized but changes to the class library are not propagated upon synchronizing.

JRebel remote server is currently turned off since the application runs on localhost. Is it required to setup the server URL in the project properties dialog? What is the URL in that case?

Any other suggestion, in case, I am missing something?

enter image description here

Upvotes: 2

Views: 443

Answers (1)

Henri Viik
Henri Viik

Reputation: 664

Are you by chance using the synchronization button on toolbar? You need not press it if you're not using the remote servers feature, as you correctly pointed out that the server is running on localhost. The changes to class files are picked up directly from the file system, JRebel agent attached to server can find the updated classes thanks to the rebel.xml in each of the artifacts.

Furthermore, since 8.1 NetBeans doesn't necessarily update class files on save in the build directory during when project is running (at least for standalone projects), so verify that the classes are updated despite what the checkbox says. If the class files do not get updated, there's also gotcha in NetBeans compiler, hazily described in their FAQ, which essentially means that NetBeans doesn't automatically compile over the old classes if the existing classes are not compiled by the internal compiler, but are rather done by Ant or Maven. The trick to resolve it is to either:

  • Execute Clean to delete existing classes and then Run to have NB build the classes using the internal compiler
  • Create empty file named .netbeans_automatic_build inside build/classes or target/classes folder

If this does not help, as mentioned earlier, contact [email protected]. To speed things up, send them a trace-level jrebel.log as per manual after reproducing the issue, the class name you were trying to reload as well as link to this SO question.

Upvotes: 3

Related Questions