You can use hotcode replacement when in debug mode for java code (allows replacement of function body). You can use exploded ear/war/jar for jsf pages, you still need to get the .xhtml/.jsp file from your development location into the exploded ear (but you could write an ant task for this that executes when you save a xhtml file in eclipse or similar perhaps?).
I don't quite get it. since ears are extracted to something like tmp/deploy/tmp62396jboss-seam-booking.ear-contents. Each time you deploy your ear, the folder would be differerent. how do u write a ant task for doing this?
Deploy the ear to the JBOSS_HOME/server/default/deploy directory exploded (as a directory with a .ear extension) and copy any updates to the exploded war inside the ear; jboss will take care of updating its temp directories itself. The ant copy task is useful for this.
JBOSS_HOME/server/default/deploy/ app.ear/ app-web.war/ mypage.xhtml WEB-INF/ ... app-ejb.jar
(where a trailing slash indicates a directory; you could make the ejb jar exploded as well)
You may need to touch the application.xml to get the application to hot-redeploy, I'm not sure, I do.
In Eclipse with WTP plugins you can use a Dynamic Web Project and, in a Server View, connect it to a server. This works almost fine with Tomcat.
With JBoss IDE 2, you have the adapter to use JBoss AS just like Tomcat in the scenario above.
Your files in project are exposed directly to application context in AS, including to edit jsp/xhtml in Eclipse and viewing the result on browser...
Links and More:
Thanks. finally got it working for my xhtml pages. What about ejb code? is there anyway to modify a single class at runtime?
any change in java code result in a context reload... for me, this break Tomcat (CPU 100% and nothing never)... I usually stop and start... I don't test Eclipse 3.2 / JBoss IDE 2 with this yet...
As I said above the hot code replacement function works in debug mode. Changes made when in debug mode within function bodies will change the code in the deployed ear. Works well for me for non-'structural' changes.
I've tried but it seems not work for me. I have enabled this in run.bat
set JAVA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n %JAVA_OPTS%
what else do i need to do?
Yes, I have those options specified. Have you managed to get the Eclipse debugger to connect to JBoss? I simply have the server and the port specified in my remote application configuation. Launching the debug configuration gives me a list of running processes on JBoss, from there I can do debugging and any updates made to code in functions is used on the server.
yes, i can connect it from eclipse and I have breakpoint set up with no problem. When I look at folder deploy\jboss-seam-booking.ear\jboss-seam-booking.jar\org\..., I can see the class file is the latest one. but for something, jboss ignores my chages unless I redeploy the whole ear. I haven't changed any structure, only something like out.println(...).