Link to home
Start Free TrialLog in
Avatar of Adrian
AdrianFlag for United States of America

asked on

Websphere application deploy script

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.....

Avatar of HonorGod
HonorGod
Flag of United States of America image

The deployment descriptor should identify the mappings.
How was the EAR file built?
Avatar of Adrian

ASKER

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..


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

ASKER

using RAD tool
Avatar of Adrian

ASKER

Hi,

Any update on this?

Thanks...
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.
Avatar of Adrian

ASKER

Thanks for the response.
Waiting for your reply...
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.
Avatar of Adrian

ASKER

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
Avatar of Adrian

ASKER

Hi,

Any update on this?

Thanks.
I hope to get to this either today, or this weekend.  Sorry for the delay.
Avatar of Adrian

ASKER

Thanks,
Waiting for the reply
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.
Avatar of Adrian

ASKER

Oh   now how is your?
Is he ok now..
Avatar of Adrian

ASKER

sorry

Oh   now how is your son?
Is he ok now..
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.
Avatar of Adrian

ASKER

Hi ,

Any update on this?
Avatar of Adrian

ASKER

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.
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.
Avatar of Adrian

ASKER

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.
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.
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
Avatar of Adrian

ASKER

Hi,

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

can you paste the error here ?
Avatar of Adrian

ASKER

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.

ASKER CERTIFIED SOLUTION
Avatar of mylehari
mylehari
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial