1

Why is an application redeployment is needed for JSF managed bean modifications to take effect?

Development environment:

  • Eclipse Indigo.
  • JBoss as 7.
  • JBossAS Tools.

Further explanation:

If I modify a JSF page, I can visualize the modification after simply refreshing the page. But this is not the case for JSF managed bean modifications where I have to redeploy the application to visualize them.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
ahmehri
  • 756
  • 2
  • 8
  • 26

2 Answers2

2

Eclipse/JBoss cannot handle new classes, methods, nor fields during hotpublish/hotdeploy. They can however handle modified method bodies and values of non-static fields with help of JVM hot-swap.

JRebel plugin is able to handle new classes, methods and fields during hotdeploy, but not new managed bean registrations.

Please note that this all is unrelated to JSF. It's related to Java development in general and thus also affects all other kinds of Java frameworks/libraries whose code you basically try to edit "live".

See also:

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • Actually i tried it with modified fields and Eclipse/JBoss didn't handle it. – ahmehri Mar 28 '13 at 15:51
  • The field must be non-static. Further, the hotpublishing must also be enabled in IDE's server configuration. That's the process of copying changes in IDE project's build folder to server's deploy space. Finally, the hotdeploying must also be enabled in server's own configuration. That's the process of picking up changes in server's deploy folder during runtime. – BalusC Mar 28 '13 at 16:00
  • The field is not static, i'm using jboss as standalone and the IDE jboss server is configured to synchronize with it. I think that hot deploying is enabled because i can see the modifications happening in the server's deploy space (the .class files modification date is changing). – ahmehri Mar 28 '13 at 16:32
  • As indicated in my previous comment, modifications happening in server's deploy space during runtime is called "hotpublishing" not "hotdeploying". As to field modifications apparently not working, what about method body modifications? E.g. adding a `System.out.println()` line. – BalusC Mar 28 '13 at 17:29
  • I were not aware that hot deployment and hot publishing are two different concepts. I discovered that hot deployment for class files is not supported in any version of jBoss (as indicated [here](https://community.jboss.org/thread/197108) by Max Rydahl Andersen) and that explains everything (my modified jsf bean will be build into class file). Thank you for your explanations. – ahmehri Mar 29 '13 at 09:26
0

I solve like this Project -> Build Automatically