File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes BEA/Weblogic and the fly likes Trouble running a WLST snippet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Trouble running a WLST snippet" Watch "Trouble running a WLST snippet" New topic
Author

Trouble running a WLST snippet

Dave Alvarado
Ranch Hand

Joined: Jul 02, 2008
Posts: 436
Hi,

I'm using WL 9.2.2. As part of my build process, which uses ANT, I'm embedding some WLST code. But I'm getting an error, "Deploy failed for id '1,217,948,256,238' since no targets are reachable". I have verified, though, that my connection parameters are correct -- I can connect to the server using the interactive mode of WLST. What might be causing the error?

Here's the code snippet from my build.xml file:

<target name="deploy" depends="copy-war">
<wlst debug="true" failoneror="true"
executeScriptBeforeFile="false"
fileName="./wls922_definitions.py"
arguments="${wlsuser} ${wlspwd} ${wlshosturl} "
>
<script>
connect(sys.argv[1],sys.argv[2],sys.argv[3]);
deploy("nps_config_gui", "/export/third-party/etsbea/nps_pt_wars/wls922/nps_config_gui.war", targets="NPSCONFIG_GUI_Cluster");
shutdown("NPSCONFIG_GUI_Cluster","Cluster");
start("NPSCONFIG_GUI_Cluster","Cluster");
disconnect();
</script>
</wlst>
</target>

Here's the output of the console:

deploy:
[wlst] <WLSTTask> Adding system to sys.argv
[wlst] <WLSTTask> Adding weblogic to sys.argv
[wlst] <WLSTTask> Adding t3://rhonti:17001 to sys.argv
[wlst] <WLSTTask> sys.argv is ['./wls922_definitions.py', 'system', 'weblogic', 't3://rhonti:17001']
[wlst] <WLSTTask> All lines will be trimmed by 10
[wlst] <WLSTTask> The script that will be executed
[wlst] connect(sys.argv[1],sys.argv[2],sys.argv[3]);
[wlst] deploy("nps_config_gui", "/export/third-party/etsbea/nps_pt_wars/wls922/nps_config_gui.war", targets="NPSCONFIG_GUI_Cluster");
[wlst] shutdown("NPSCONFIG_GUI_Cluster","Cluster");
[wlst] start("NPSCONFIG_GUI_Cluster","Cluster");
[wlst] disconnect();

[wlst] Connecting to t3://rhonti:17001 with userid system ...
[wlst] Successfully connected to Admin Server 'npsadmin' that belongs to domain 'nps_pt_92'.

[wlst] Warning: An insecure protocol was used to connect to the
[wlst] server. To ensure on-the-wire security, the SSL port or
[wlst] Admin port should be used instead.

[wlst] Deploying application from /export/third-party/etsbea/nps_pt_wars/wls922/nps_config_gui.war to targets NPSCONFIG_GUI_Cluster (upload=false) ...
[wlst] <Aug 5, 2008 8:57:35 AM MDT> <Info> <J2EE Deployment SPI> <BEA-260121> <Initiating deploy operation for application, nps_config_gui [archive: /export/third-party/etsbea/nps_pt_wars/wls922/nps_config_gui.war], to NPSCONFIG_GUI_Cluster .>
[wlst] .Failed to deploy the application with status failed
[wlst] Current Status of your Deployment:
[wlst] Deployment command type: deploy
[wlst] Deployment State : failed
[wlst] Deployment Message : java.lang.Exception: [DeploymentService:290049]Deploy failed for id '1,217,948,256,238' since no targets are reachable.

BUILD FAILED
/export/third-party/etsbea/staging/wls_9.2.2/nps_config_gui/build.xml:268: Error executing the script snippet
connect(sys.argv[1],sys.argv[2],sys.argv[3]);
deploy("nps_config_gui", "/export/third-party/etsbea/nps_pt_wars/wls922/nps_config_gui.war", targets="NPSCONFIG_GUI_Cluster");
shutdown("NPSCONFIG_GUI_Cluster","Cluster");
start("NPSCONFIG_GUI_Cluster","Cluster");
disconnect();

due to:
Traceback (innermost last):
File "<string>", line 2, in ?
File "<iostream>", line 234, in deploy
WLSTException: 'Error occured while performing deploy : Target exception thrown while deploying application: Error occured while performing deploy : Deployment Failed.Error occured while performing deploy : Deployment Failed. Use dumpStack() to view the full stacktrace'


Thanks, - Dave
Marcos Maia
Ranch Hand

Joined: Jan 06, 2001
Posts: 977
Hi,

check if all server on the cluster are running when you try to deploy. Are they running? Also check if at least one of them is running. If you have checked "Enable Cluster Constraints" then all servers must be up, running and reachable by admin server for your deployment to work.

regards.
Dave Alvarado
Ranch Hand

Joined: Jul 02, 2008
Posts: 436
I only have one server in my cluster if that is important.

How, using WLST, do I start a cluster only if it is stopped? - Dave
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Trouble running a WLST snippet