Websphere / Java question

rh71

No Lifer
Aug 28, 2001
52,844
1,049
126
We have an app run by Websphere Application Server 3.x..

if I wanted to make a change to a .java file (via notepad), I'd recompile via the java command in DOS (to create the new class file). Would I need to do anything else to get the changes applied ? Like a WAS / HTTP service restart etc. ?

I'm still a n00b to it all... thx.
 

MrChad

Lifer
Aug 22, 2001
13,507
3
81
You can technically drop a class file in the appropriate spot in the WEB-INF\classes folder of your EAR directory. You shouldn't need to restart WAS for the changes to take effect.

The other option is to rebuild your WAR or EAR file and redeploy the entire application to WAS. There are benefits to this (if you need to redeploy your application for whatever reason, you have a full copy of the latest code bundled together), but it's not 100 percent necessary to implement the change.
 

rh71

No Lifer
Aug 28, 2001
52,844
1,049
126
I would like to do this as cleanly and simple as possible so I don't want to involve WAR/EAR files... so I just want to be sure of what you confirmed... can I just modi the java file, do the compile (will it overwrite the current class ?) Should I expect any warnings because I'll only have 1 chance (timeframe) to do this right.
 

MrChad

Lifer
Aug 22, 2001
13,507
3
81
Originally posted by: rh71
I would like to do this as cleanly and simple as possible so I don't want to involve WAR/EAR files... so I just want to be sure of what you confirmed... can I just modi the java file, do the compile (will it overwrite the current class ?) Should I expect any warnings because I'll only have 1 chance (timeframe) to do this right.

Are you working in WSAD or some other IDE? What do you mean you only have 1 chance to do this right?
 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
WS 3.x is so old that it doesn't do war/ears, right? The first thing to do is to make sure that the code you are working from is identical to the code that was compiled and is currently deployed. This is extremely important. Then, yes, compile that particular class with the changes, find where it has been deployed, and drop it in right on top of the old one. A server restart is probably required.

A few things to watch out for:
-it's possible the original was put in a jar and then duplicated. You'll want to track down each instance as it's hard to tell which is loaded first. Make sure you look into any deployed-but-not-exploded jars as well.
-changes to the source code of a single java class can affect multiple class files. For instance, if you are changing the value of a static final string, you need to replace the binaries of every single place that the constant is referenced from.