We help IT Professionals succeed at work.

Websphere application deploy script

chander72
chander72 asked
on
Hi,

I am trying to deploy an application using jython script.
But the issue here is my ear file consists of 3 war files and 2 jar files.
the jython script must deploy the ear file and must map 3 different hosts for 3 war files .

Example: The war is as follows.

hitcount.ear consists of

hit1.war
hit2.war
hit3.war

and these 3 different wars must map to 3 different virtualhosts..

hit1.war   map to hit1_host
hit2.war   map to hit2_host
hit3.war   map to hit3_host


Please help me on this.....
I am trying but not able to do it.

Thanks alot for your help.....

Comment
Watch Question

HonorGodSoftware Engineer

Commented:
The deployment descriptor should identify the mappings.
How was the EAR file built?

Author

Commented:
Hi ,

Thanks for the reply.

ear file is build with 2 jars and 3 war files consists of different context roots


For Example:

hit1.war   map to hit1_host   having contextroot    hitcount1
hit2.war   map to hit2_host   having contextroot    hitcount2
hit3.war   map to hit3_host   having contextroot    hitcount3


As defined above 3 wars have there different hosts with 3 different context roots.

This is how the ear is built.

Please let me know if you need any other information...

Thanks Alot..


HonorGodSoftware Engineer

Commented:
Did you use RAD, or some other tool/utility to build the EAR?  Or did you build it by hand?

Author

Commented:
using RAD tool

Author

Commented:
Hi,

Any update on this?

Thanks...
HonorGodSoftware Engineer

Commented:
I've been swamped.  Sorry for the delay.  I hope to get to it tomorrow.  I have one other EE Q that is ahead of you though.

Author

Commented:
Thanks for the response.
Waiting for your reply...

Commented:
Chander,

As shown in the following example,

use format:
-MapWebModToVH {{"HIT1" hit1.war,WEB-INF/web.xml hit1_host} {"HIT2" hit2.war,WEB-INF/web.xml hit2_host}{"HIT3" hit3.war,WEB-INF/web.xml hit3_host}

$AdminApp install "/opt/IBM/WebSphere/portal/MYEAR.ear" {  -appname MYEAR -node Node1 -cell MYWAS -server AppServer1 -MapWebModToVH {{"My Test Portal" my.war,WEB-INF/web.xml default_host} {"My Admin" Myadmin.war,WEB-INF/web.xml default_host}}}

Please check syntax.

Author

Commented:
Hi ,

Thanks for the response.
I tried it but I am unable to get it.
Can you please paste the whole script so that I can try it.
because I cant able to add these in my script its different from the above.
And also it is throwing the exceptions.

Thanks A lot

Author

Commented:
Hi,

Any update on this?

Thanks.
HonorGodSoftware Engineer

Commented:
I hope to get to this either today, or this weekend.  Sorry for the delay.

Author

Commented:
Thanks,
Waiting for the reply
HonorGodSoftware Engineer

Commented:
Sorry for the lack of progress.  We had to take our son to the hospital last week, and we've have a busy going back and forth between the house and the hospital.  I Hope to make some progress today.

Author

Commented:
Oh   now how is your?
Is he ok now..

Author

Commented:
sorry

Oh   now how is your son?
Is he ok now..
HonorGodSoftware Engineer

Commented:
He ok, but continued evaluation is needed.  Thanks for asking.  I need to get some sleep tonight.  I hope to be able to finish this tomorrow morning.  Thanks for your patience.

Author

Commented:
Hi ,

Any update on this?

Author

Commented:
Hi,

This might help ..

option = [["JavaMail 32 Sample WebApp", "mtcomps.war,WEB-INF/web.xml", "newVH"]]
mapVHOption = ["-MapWebModToVH", option]
print AdminApp.edit("JavaMail Sample", mapVHOption)

But I am not sure how we can pass multple things.

Please help me.

Thanks.
HonorGodSoftware Engineer

Commented:
If you can provide a trivial EAR file I would be able to make more progress.

I've been stuck trying to get a RAD installation image to install just to get a simple EAR file built.

Author

Commented:
Hi,

I am unable to upload the ear file.
Its giving the error as
The extension of one or more files in the archive is not in the list of allowed extensions: test1EAR.ear

Please let me know how I can upload.

Thanks.
HonorGodSoftware Engineer

Commented:
copy the ear file and have the extension be one of the supported values (e.g., .bmp).

For example:

copy myEar.ear myEar.ear.bmp

Then, add/upload the *.bmp file, and have the description be the actual filename.

Commented:
Hi Chander72

Sorry I didnt think you were waiting..

I installed my application(abcd.ear) sucessfully with the following script.
There are  2 .war files in abcd.ear - abc.war and xyz.ear
I pointed abc.war to default_host  and xyz to xyz_host
-------------------------------------------------
$AdminApp install "abcd.ear" { -appname abcd -cell devcell -cluster devcluster -server webserver1,webserver2 -MapWebModToVH {{"XYZ" xyz.war,WEB-INF/web.xml xyz_host}}}

$AdminConfig Save
----------------------------------------------
but when I try to do

$AdminApp install "abcd.ear" { -appname abcd -cell devcell -cluster devcluster -server webserver1,webserver2 -MapWebModToVH {{"ABC" abc.war,WEB-INF/web.xml default_host} {"XYZ" xyz.war,WEB-INF/web.xml xyz_host}}}

if dint work. I am thinking its because ABC is assigned to default_host by default so, it need not be mentioned one more time ( may be it comes from the applicaiton ? not sure)
--------------------------------------
Please try the command I gave and let me know if you are still having issues.
If in case it failed also let me at what point it failed.

Thanks
Lehari

Author

Commented:
Hi,

I am unable to upload the file it is giving me the same error.
Please advice.

Commented:
upload the file ?

can you paste the error here ?

Author

Commented:
Hi ,

I am trying to upload the ear file for testing for HonorGod and I am unable to do it.
And I tried the script which you pasted.
Thanks for your reply.
But when I am trying this I am unable to run the script.
This is what I am trying.

WASX7209I: Connected to process "server1" on node xNode01 using SOAP connector;  The type of process is: UnManagedProcess
WASX7017E: Exception received while running file "/opt/testinstall.py"; exception information: com.ibm.bsf.BSFException: exception from Jython:
Traceback (innermost last):
  (no code object) at line 0
  File "<string>", line 1
        AdminApp.install "/opt/test1EAR.ear" { -appname test1EAR -cell yCell -server server1 -MapWebModToVH {{"test1" test1.war,WEB-INF/web.xml test_host} {"test2" test2.war,WEB-INF/web.xml acps_host}}}
                         ^
SyntaxError: invalid syntax


Please Advice.

Thanks in Advance.

Commented:
k, So you need a jython script and what I gave you  previously was JACL.

here you go -
AdminApp.install ('abcd.ear',  '[-MapWebModToVH [["ABC"  abc.war,WEB-INF/web.xml abc_host] ["XYZ" xyz.war,WEB-INF/web.xml  xyz_host]]]' )

AdminConfig.save()

--------------------
I am a little bit confused on how you are doing this.
On Server or DMGR  node, go to <Profile Home>/bin
enter >wsadmin -user <username> -password <password> -lang jython
it takes you to a wsadmin prompt.
Run the above 2 commands and let me know what you see.