Stop IBM RAD from restarting applications on code change.
Asked Answered
H

2

5

I'm using IBM RAD 9.0 with WebSphere 8.5. I've opened the server options and selected 'Never publish automatically' under 'Publishing'.

However, if I make any bigger changes in code, IBM RAD is restarting the application. If I made some changes in libraries project used by every applications, RAD is restarting all the applications. Even if I start external maven build, he keeps restarting applications (to make matters worse, he builds the project paralell to maven, often causing conflicts).

It takes a lot of time, and what is even worse, it simply doesn't work. Restarted appllications don't start correctly, can't connect to crucial services (like JSF engine, or LDAP authorization), or even don't see their own classes! So I must republish manually, which often requires doing additional clean.

As a result, before making any significant change in code, like refactoring or changing the shared API, I have to stop the websphere.

Is there any way to override that behaviour? I've expected, that selecting 'Never publish automatically' should be enough, but apparently it doesn't stop RAD/WebSphere from restarting the applications when THEY find it necessary.

Hygrometry answered 13/6, 2014 at 12:29 Comment(0)
G
7

The safest options to prevent application restarts are as follows:

  • In the Server properties (dbl click on server) set:
    • on Publishing tab set - Never publish automatically
    • on Publishing settings for WebSphere set - Run server with resources on Server

Otherwise, if resources are changed and you run 'from workspace' server may decide to restart app.

If you are building using maven then disable automatic build in menu Project > Build Automatically.

If you plan to make many changes or your app is not working, you can always remove project from the server, do changes and then add project to the server instead of restarting server.

Grizzle answered 13/6, 2014 at 14:18 Comment(5)
You're seeing the appl restarts because RAD is set to build automatically AND the WAS integration is set to "Run with Resources in the Workspace". The latter means instead of deploying to <profile>/installedApps the app is deployed in-place within the RAD workspace. Classes are loaded by WAS from the workspace (for example WebContent/WEB-INF/classes). RAD is subsequently compiling .java changes on save (build automatically), into WEB-INF/classes. This causes WAS to restart the app module. If your app/module starts up slowly (like with a large Spring config) this is painful.Precedential
It seems to work well. Why do people need the option 'run from workspace' anyway? I see now no gain from it...Hygrometry
Republishing is quicker, if it is 'from workspace' as it doesn't have to create ear, upload it to the server and extract. But it works well only for very basic projects.Grizzle
Well, running from server, not from workspace, has a great side effect I've noticed. The changes in, for example, JSF pages are not seen after republish, until you clean the whole project. After that, republish republishes also the applications, that were unchanged. This is probably why it's recommended in my organization to set 'run from workspace'. There are huge time tradeoffs for both settings, as I see.Hygrometry
This is very strange behavior that you are describing... Republish usually worked fine for me when set to running from server. But before you switch configuration from workspace to server, make sure to remove all projects from server. Otherwise some unexpected behavior sometimes might be noticed :-). I've never had to clean project, if something is not picked up, I do Add/Remove from server on given projectGrizzle
F
0

Can u check window-preferences-server-launching: When required, restart the server: Never

Fingered answered 13/6, 2014 at 12:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.