I have run the taskInfo for MapResRefToEJB to work out the required
fields and values
wsadmin>$AdminApp taskInfo ./myEar.ear MapResRefToEJB
This gave me
Module: myModule
EJB: myEJB
URI: myJar.jar,META-INF/ejb-jar.xml
Reference binding: jdbc/Data
Resource type: javax.sql.DataSource
JNDI name: jdbc/Data
Login Configuration Name: null
Properties:
Module: myModule
EJB: myEJB2
URI: myJar.jar,META-INF/ejb-jar.xml
Reference binding: jdbc/Data
Resource type: javax.sql.DataSource
JNDI name: jdbc/Data
Login Configuration Name: null
Properties:
I have checked the infocenter and tried to implement the example
listed in 'Example: Migrating - Installing an application',
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/ae/rxml_minstallapp.html
but I do not understand where the information for the
'resreftoejb2' (the web archive line) variable is attained from, nor
whether it is required or not.
Under the article 'Options for the AdminApp object install,
installInteractive, edit, editInteractive, update, and
updateInteractive commands' (also in the infocenter)
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.websphere.nd.doc/info/ae/ae/rxml_taskoptions.html
the example here also references the web archive, but the
description does not.
Also both examples only have one EJB (as far as I can tell) so how
would I nest for two, as two are shown when I run the taskinfo output.
I have also tried to implement the example given in
http://www-1.ibm.com/support/docview.wss?uid=swg27006561&aid=1 (page
87), example given below . (I know this was for z/OS and I am writing
it for UNIX so may not be applicable)
I am definitley missing something simple here so any help/prodding in
the right direction is greatly appreciated.
John
# The script trying to map both options
global AdminConfig
global AdminApp
set option "-MapResRefToEJB"
set mod "\"myModule\""
set ejb "\"myEJB\""
set ejb2 "\"myEJB2\""
set uri "myJar.jar,META-INF/ejb-jar.xml"
set ref "jdbc/Data"
set class "javax.sql.DataSource"
set jndi "jdbc/Data"
set string "$mod $ejb $uri $ref $class $jndi"
set string2 "$mod $ejb2 $uri $ref $class $jndi"
set list [list $string $string2]
set cmd_opt_list [list -deployejb -nodeployws -distributeApp -
nouseMetaDataFromBinary -createMBeansForResources -noreloadEnabled -
reloadInterval 0 -nodeployws -verbose -appname appName -cluster myApp -
MapWebModToVH myVhost]
lappend cmd_opt_list $option
lappend cmd_opt_list $list
$AdminApp install ./myEar.ear $cmd_opt_list
$AdminConfig save
Create a two element list "ejbList"
% lappend ejbList "\"YourModule\" yourEjb1.jar,META-INF/ejb-jar.xml
jdbc/YourDBRef javax.sql.DataSource jdbc/ServerDB"
{"YourModule" yourEjb1.jar,META-INF/ejb-jar.xml jdbc/YourDBRef
javax.sql.DataSource jdbc/ServerDB}
% lappend ejbList "\"YourModule\" yourEjb2.jar,META-INF/ejb-jar.xml
jdbc/YourDBRef javax.sql.DataSource jdbc/ServerDB"
{"YourModule" yourEjb1.jar,META-INF/ejb-jar.xml jdbc/YourDBRef
javax.sql.DataSource jdbc/ServerDB} {"YourModule" yourEjb
2.jar,META-INF/ejb-jar.xml jdbc/YourDBRef javax.sql.DataSource jdbc/
ServerDB}
% foreach i $ejbList { puts $i }
"YourModule" yourEjb1.jar,META-INF/ejb-jar.xml jdbc/YourDBRef
javax.sql.DataSource jdbc/ServerDB
"YourModule" yourEjb2.jar,META-INF/ejb-jar.xml jdbc/YourDBRef
javax.sql.DataSource jdbc/ServerDB
Set up the options list. The argument to -MapResRefToEJB is a two
element list.
set optionList [ list -appname $appName \
-server $serverName \
-MapWebModToVH $virtualHostlist \
-MapRolesToUsers $groupRoleList \
-MapResRefToEJB $ejbList \
-MapModulesToServers $webModList \
-contextroot $contextRoot \
-noreloadEnabled \
-preCompileJSPs \
-verbose ]
}
Deploy the app.
if { [ catch { $AdminApp install $earFile $optionList }
result_var] == 0 } {
putsLog $result_var
putsLog "$appName deployed sucessfully"
} else {
putsLog $result_var
putsLog "ERROR: $appName failed to deploy"
return -code error $result_var
}
See installApp_proc.tcl at http://www.websphereconsultant.com/WSAdmin/docs/proclibdoc/index.html
for more details.
The
> Create a two element list "ejbList"
fixed the issue I was having.
Thanks again.
John