My problem is the following:
I have a build.xml file that should automatically work with WebLogic... start/stop/undeploy/deploy.... this kind of stuff.
I am running "setWLSEnv.sh" script from ANT using the "exec" task. The script gets executed successfully.
Then, I want to start WebLogic using "wlserver" task. But the server doesn't want to start....
I found that the problem is that ANT runs the "setWLSEnv.sh" in a separate process and the PATH and CLASSPATH variables are not set correctly for the ANT session. Is there any way to force ANT to run a sh in the same process? Or setting the weblogic variables somehow that they will be accessible for the ANT script?
The default is supposed to be to not use a new environment/process. Can you show your <exec> call in case something is inadvertently being set? Also, you aren't calling the .sh file itself in a new environment, right?
echo "Now setting up the CLASSPATH and PATH for WebLogic..."
echo "All set."
I know I can run the "setWLSEnv.sh" script directly from ANT (and I've done it), but doing this does not set my PATH and CLASSPATH env variables for my ANT session and when I try to start WebLogic it just fails. The solution with ". ./" was suggested by someone, and it's working if I am running manually (so, before the ANT script just run from the command line the command: ". ./setWLSEnv.sh"). But, when I am running this command from my sh file, the CLASSPATH and PATH variables are not set in my ANT session.... so, same as before, WebLogic doesn't start.
The workaround I found is to set the CLASSPAT in a build.properties file and just use the property in my ANT script, in the "wlserver" task as the value for "classpath" argument. But this is just a temporary solution... an not very platform independent because I have hardcoded paths (currently working on Solaris, and if I move to Linux, the WL CLASSPATH is's proppably changed...).
So again... is there any way to have a build.xml file that STARTS WebLogic using "wlserver" task without the user having to run manually other external scripts and without hardcoding the CLASSPATH in the property file? I just want the script to be easy to use, generic, portable... just copy it to a machine that has the WebLogic installed, set the correct WL_HOME... and run it without any problems .