10-07-2011 08:09 PM
I've been using JSF facelets autorefresh and JBoss Seam hot reload to provide some hot reload abilities but I've read that Nuxeo IDE is able to hot reload bundles.
Are there any limitations and how can we do it using Ant or Maven ?
10-12-2011 07:10 AM
Ok, I've been doing some research into this and I'll be updating this answer according to my findings:
I've been using release-5.4.2 but I found that starting on release-5.4.2-HF07 they backported "org.nuxeo.runtime.tomcat.dev.NuxeoDevWebappClassLoader".
You can read some details in the NXP-7389
Basically to enable hot reload you should modify the conf/Catalina/localhost/nuxeo.xml l context configuration file and replace:
<Loader className="org.nuxeo.runtime.tomcat.NuxeoWebappLoader"
loaderClass="org.nuxeo.runtime.tomcat.NuxeoWebappClassLoader" />
by
<Loader className="org.nuxeo.runtime.tomcat.NuxeoWebappLoader"
loaderClass="org.nuxeo.runtime.tomcat.dev.NuxeoDevWebappClassLoader" />
Then you will be able to reload jars or bundles that ARE NOT in nxserver/bundles or nxserver/lib by specifyin the list of these bundles in the file nxserver/dev.bundles.
The format of this file is one file path per line (the file corresponding to the bundle JAR or directory). Thus, you can point to project bin directories in your Eclipse IDE, or on JARs outside nuxeo server.
To specify a third party JAR that is not a BUNDLE you must prepend its path with a !. YOu can use blank lines or lines starting with # for comments. Example:
/path/to/may/project1/bin
/path/to/may/project2/bin
!/path/to/may/thirdparty.jar
...
Please notice that if you're using the 5.4 branch according to NXP-7629 the automatic hot-reloading (which checks dev bundles every 2 seconds) was disabled by default. To re-activate, just edit the launcher.properties template file and set the timer property org.nuxeo.app.installReloadTimer to true. A JMX a bean is exposed for controlling the reset instead.
If you ant to use ant to update the dev.bundles file, you can use something like this:
<target name="hotreload">
<condition property="file.matches">
<resourcecontains resource="${nxserver.dir}/dev.bundles" substring="${basedir}/target/classes" />
</condition>
<antcall target="update-dev-bundles"/>
<antcall target="touch-dev-bundles"/>
</target>
<target name="update-dev-bundles" unless="file.matches">
<echo message="Adding ${basedir}/target/classes to dev.bundles"/>
<echo file="${nxserver.dir}/dev.bundles" append="true"
message="${basedir}/target/classes"/>
</target>
<target name="touch-dev-bundles">
<touch file="${nxserver.dir}/dev.bundles"/>
</target>
10-10-2011 06:41 PM
Though you might already be aware of this, hot reload with ant is presented in the following documentation entry: How to do incremental deployment (hot reload) in the JSF-Seam layer.
You also have to make sure that the bundles you want to reload are configured to be hot-reloadable: How to make a bundle able to hot-reload
10-11-2011 07:53 AM
Thank you. I'm aware of that. I was looking for a way to reload all sorts of bundles, this would really take the pain out of development and constant restarts.
10-12-2011 07:10 AM
Ok, I've been doing some research into this and I'll be updating this answer according to my findings:
I've been using release-5.4.2 but I found that starting on release-5.4.2-HF07 they backported "org.nuxeo.runtime.tomcat.dev.NuxeoDevWebappClassLoader".
You can read some details in the NXP-7389
Basically to enable hot reload you should modify the conf/Catalina/localhost/nuxeo.xml l context configuration file and replace:
<Loader className="org.nuxeo.runtime.tomcat.NuxeoWebappLoader"
loaderClass="org.nuxeo.runtime.tomcat.NuxeoWebappClassLoader" />
by
<Loader className="org.nuxeo.runtime.tomcat.NuxeoWebappLoader"
loaderClass="org.nuxeo.runtime.tomcat.dev.NuxeoDevWebappClassLoader" />
Then you will be able to reload jars or bundles that ARE NOT in nxserver/bundles or nxserver/lib by specifyin the list of these bundles in the file nxserver/dev.bundles.
The format of this file is one file path per line (the file corresponding to the bundle JAR or directory). Thus, you can point to project bin directories in your Eclipse IDE, or on JARs outside nuxeo server.
To specify a third party JAR that is not a BUNDLE you must prepend its path with a !. YOu can use blank lines or lines starting with # for comments. Example:
/path/to/may/project1/bin
/path/to/may/project2/bin
!/path/to/may/thirdparty.jar
...
Please notice that if you're using the 5.4 branch according to NXP-7629 the automatic hot-reloading (which checks dev bundles every 2 seconds) was disabled by default. To re-activate, just edit the launcher.properties template file and set the timer property org.nuxeo.app.installReloadTimer to true. A JMX a bean is exposed for controlling the reset instead.
If you ant to use ant to update the dev.bundles file, you can use something like this:
<target name="hotreload">
<condition property="file.matches">
<resourcecontains resource="${nxserver.dir}/dev.bundles" substring="${basedir}/target/classes" />
</condition>
<antcall target="update-dev-bundles"/>
<antcall target="touch-dev-bundles"/>
</target>
<target name="update-dev-bundles" unless="file.matches">
<echo message="Adding ${basedir}/target/classes to dev.bundles"/>
<echo file="${nxserver.dir}/dev.bundles" append="true"
message="${basedir}/target/classes"/>
</target>
<target name="touch-dev-bundles">
<touch file="${nxserver.dir}/dev.bundles"/>
</target>
10-12-2011 07:39 AM
Note
10-12-2011 07:46 AM
I've only seen the sdk profile in 5.4.3-I20111003_1046 will it be backported in a HF?
10-12-2011 08:11 AM
No as this is not a bugfix.
10-12-2011 12:50 PM
Well, I've got the hot reload working... should it run the deployment fragment and do a Seam hot reload as well ? It not a sample build.xml with these tasks would be great!
11-21-2011 05:39 PM
I work with nuxeo-dm-5.4.3-I20111024_2229-tomcat.
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.