aspose file tools*
The moose likes BEA/Weblogic and the fly likes WLSERVER ANT TASK Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "WLSERVER ANT TASK" Watch "WLSERVER ANT TASK" New topic
Author

WLSERVER ANT TASK

Jithesh Kozhipurath
Ranch Hand

Joined: Aug 27, 2003
Posts: 76
Hi,
I m using wlserver ant task to stop-deploy-start weblogic server after my build execution. But when I start weblogic after deployment and when the ant execution is complete the weblogic server autmatically shutdown the server. Why is it not running as a new process. Is there anything to be specificaly given in the ant task to start it as a different process.
My Ant build file is,
<project name="iRes" default="all" basedir=".">

<property name="WL_HOME" value="D:\bea8.1"/>
<property name="DOMAIN_HOME" value="D:\bea8.1\user_projects\domains\mydomain"/>
<property name="JAVA_HOME" value="D:\APPLNS\jdk1.4"/>

<target name="all" depends="stop-server,start-server,connect-server" />

<target name="init">
<taskdef name="wlserver"
classname="weblogic.ant.taskdefs.management.WLServer"/>
</target>

<target name="serverStart" depends="init">
<wlserver dir="D:\bea8.1\user_projects\domains\myClusterDomain"
host="192.168.8.66"
port="7010"
username="system"
password="weblogic"
servername="myManagedServer"
domainname="myClusterDomain"
weblogichome="D:\bea8.1\weblogic81"
beahome="D:\bea8.1"
adminserverurl="http://192.168.8.66:7001"
classpath="D:\bea8.1\jdk141_05\jre\lib\rt.jar; D:\bea8.1\weblogic81\server\lib\weblogic.jar; D:\bea8.1\weblogic81\server\lib\webservices.jar"
action="start"
fork="true"
/>
</target>
</project>

The output that I get while running the ant task is,

Buildfile: build.xml

serverStart:
[wlserver] <Aug 6, 2004 9:38:13 AM IST> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with Java HotSpot(TM) Client VM Version 1.4.0-b92 from Sun Microsystems Inc.>
[wlserver] <Aug 6, 2004 9:38:14 AM IST> <Info> <Management> <BEA-141140> <The managed server is going to contact the admin server at http://192.168.8.66:7001 to check if there exists a running admin
server at this URL.>
[wlserver] <Aug 6, 2004 9:38:15 AM IST> <Info> <Configuration Management> <BEA-150017> <This server is being started as a dependent managed server.>
[wlserver] <Aug 6, 2004 9:38:15 AM IST> <Info> <Management> <BEA-141107> <Version: WebLogic Server 8.1 SP2 Fri Dec 5 15:01:51 PST 2003 316284
[wlserver] WebLogic XMLX Module 8.1 SP2 Fri Dec 5 15:01:51 PST 2003 316284 >
[wlserver] <Aug 6, 2004 9:38:15 AM IST> <Info> <Configuration Management> <BEA-150015> <Connecting to the administration server http://192.168.8.66:7001 to retrieve the initial configuration.>
[wlserver] <Aug 6, 2004 9:38:20 AM IST> <Notice> <Log Management> <BEA-170019> <The server log file D:\bea8.1\user_projects\domains\myClusterDomain\myManagedServer\myManagedServer.log is opened. All
server side log events will be written to this file.>
[wlserver] <Aug 6, 2004 9:38:50 AM IST> <Notice> <Security> <BEA-090082> <Security initializing using security realm myrealm.>
[wlserver] <Aug 6, 2004 9:38:51 AM IST> <Notice> <WebLogicServer> <BEA-000328> <Starting WebLogic Managed Server "myManagedServer" for domain "myClusterDomain">
[wlserver] <Aug 6, 2004 9:39:02 AM IST> <Warning> <HTTP> <BEA-101296> <Unable to load the default compiler class "com.sun.tools.javac.Main". Using the default javac compiler to compile JSPs.>
[wlserver] <Aug 6, 2004 9:39:04 AM IST> <Notice> <Cluster> <BEA-000138> <Listening for announcements from cluster myCluster on 237.0.0.1:7020.>
[wlserver] <Aug 6, 2004 9:39:04 AM IST> <Notice> <Cluster> <BEA-000133> <Waiting to synchronize with other running members of myCluster.>
[wlserver] <Aug 6, 2004 9:39:40 AM IST> <Notice> <Cluster> <BEA-000102> <Joining cluster myCluster on 237.0.0.1:7020>
[wlserver] <Aug 6, 2004 9:39:40 AM IST> <Notice> <WebLogicServer> <BEA-000332> <Started WebLogic Managed Server "myManagedServer" for domain "myClusterDomain" running in Development Mode>
[wlserver] <Aug 6, 2004 9:39:40 AM IST> <Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode>
[wlserver] <Aug 6, 2004 9:39:56 AM IST> <Notice> <WebLogicServer> <BEA-000355> <Thread "ListenThread.Default" listening on port 7010, ip address 192.168.8.66>

BUILD SUCCESSFUL
Total time: 1 minute 55 seconds
[wlserver] <Aug 6, 2004 9:40:15 AM IST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to SUSPENDING>
[wlserver] <Aug 6, 2004 9:40:15 AM IST> <Notice> <HTTP> <BEA-101278> <There are no active sessions. The Web service is ready to suspend.>
[wlserver] <Aug 6, 2004 9:40:15 AM IST> <Error> <Cluster> <BEA-000103> <Disconnecting from cluster myCluster>
[wlserver] <Aug 6, 2004 9:40:15 AM IST> <Alert> <WebLogicServer> <BEA-000228> <The disabling of server logins has been requested by <WLS Kernel>>
[wlserver] <Aug 6, 2004 9:40:15 AM IST> <Alert> <WebLogicServer> <BEA-000229> <Server logins have been disabled.>
[wlserver] <Aug 6, 2004 9:40:16 AM IST> <Notice> <WebLogicServer> <BEA-000353> <Thread "ListenThread.Default" stopped listening on port 7010, ip address 192.168.8.66>
[wlserver] <Aug 6, 2004 9:40:16 AM IST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STANDBY>
[wlserver] <Aug 6, 2004 9:40:16 AM IST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to SHUTTING_DOWN>
Press any key to continue . . .

Thanks in advance


Jithesh K
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

Moving to our Weblogic forum.


[Jess in Action][AskingGoodQuestions]
Harsh Agarwal
Greenhorn

Joined: Mar 17, 2004
Posts: 2
Hi,
I am also trying to start the WL 7 remotely with ANT. I downloaded 1.6.2 and was trying to use <wlrun>.
But problem I am facing is that the ANT's wlrun.class file, it appends an explicit "config" to the domain.dir and then looks for domain.name. But in WL 7 domain.name is right under domain.dir (the "user_projects" directory, is what I am refering to as domain.dir) So now I might need to remove the explicit addition of config and then proceed further.
Am I on the right track, or is there anything I am doing incorrect.
Refer URL: wlrun


Thanks & Regards, <br />Harsh Agarwal
Caoilte O'Connor
Greenhorn

Joined: May 09, 2009
Posts: 1
Hi,
I had a similar problem and this place came up tops in my google results. The place I actually found the answer however was,

http://objectmix.com/weblogic/529816-weblogic-server-fails-start-ant-wlserver-command.html

Specifically you will need to set the following attribute on your wlserver ant task.

noExit="true"
Ben Haschalk
Greenhorn

Joined: Oct 09, 2007
Posts: 6
I've researched for days and this was one of the first threads anywhere, and only, that I've found which was helpful.
I'm upgrading our build.xml script for ant to deploy to our dev server(s) and have been researching wlserver/wldeploy to make this happen.

My script is nearly identical to Jithesh's, with the exception of the path's. Developer and SCM boxes which run the build/deploy are windows, while the weblogic managed server(s) are Unix. When I run the following (removed my IPs just for security reasons) in my build.xml it looked promising, til I realized that by supplying my local classpath/beahome/weblogichome, that it was trying to start weblogic on the local windows machine. :

<property name="rel.bea.dir" location="../../bea92"/>
<wlserver
host="99.99.99.99"
port="7001"
adminserverurl="http://99.99.99.99:7001"
username="system"
password="weblogic"
action="start"
weblogichome="${rel.bea.dir}\weblogic92"
beahome="${rel.bea.dir}"
classpath="${rel.bea.dir}\weblogic92\server\lib\weblogic.jar;${rel.bea.dir}\weblogic92\server\lib\webservices.jar"
servername="weblogicServer"
domainname="appV1.0-development5"
/>

However, if I try to point to the Unix directory, as was actually my first test(s) as :

<wlserver
host="99.99.99.99"
port="7001"
adminserverurl="http://99.99.99.99:7001"
username="system"
password="weblogic"
action="reboot"
weblogichome="/opt/bea/weblogic92"
beahome="/opt/bea"
classpath="/opt/bea/weblogic92/server/lib/weblogic.jar;/opt/bea/weblogic92/server/lib/webservices.jar"
servername="weblogicServer"
domainname="appV1.0-development5"
verbose="true"
/>

returns:

BUILD FAILED
C:\workspace\ACF_income_rules_engine\build.xml:304: BEA home \opt\bea not valid


Any help at all turning my into a would be sweet.

- Benji
Ben Haschalk
Greenhorn

Joined: Oct 09, 2007
Posts: 6
I solved *my* problem via my own research and wanted to post for anyone that might find it useful. I wound up using SSHEXEC task for ANT.
So basically, here is what my script is doing to solve remote server deployment, from windows box -> unix box:

Build -> sshexec stopWebLogic.sh -> SCP deploy to server -> sshexec startWebLogic.sh



-Benji
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6662
    
    5

Ben Haschalk wrote:I solved *my* problem via my own research and wanted to post for anyone that might find it useful. I wound up using SSHEXEC task for ANT.
So basically, here is what my script is doing to solve remote server deployment, from windows box -> unix box:

Build -> sshexec stopWebLogic.sh -> SCP deploy to server -> sshexec startWebLogic.sh



-Benji


This is a zombie thread but I am glad it helped you. Why are you guys trying to restart the server though.

sshexec stopWebLogic.sh -> SCP deploy to server -> sshexec startWebLogic.sh


You stop weblogic, do a secure copy and then start it again ? The script is ok for DEV environments but surely there is a better way to do this. I will try to tinker with WL 9.2+ and post here if I find a solution. WLST scripts are also a good option.


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
Ben Haschalk
Greenhorn

Joined: Oct 09, 2007
Posts: 6
Oops, sorry didn't realize it was a zombie thread, I'm just trying to be helpful
It is a dev environment actually, one of about 8 dev servers. In our office these deploys have been done manually for years (an analyst ftp's an ear out to a dev server, explodes/moves these files to their appropriate locations on that server, and restarts weblogic in order for the changes made to the code to appear).
The ANT script simply automates these steps.

Thanks a bunch! I'd be happy to see anything you provide that could better our development

- Benji
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: WLSERVER ANT TASK