|
Problem(Abstract) |
How do I create a shared library and associate it with an
application using wsadmin in WebSphere version 5.0.x? |
|
|
|
Resolving the
problem |
This can be done through the console but is also easily to
do using the scripting tool, wsadmin, which is new with WebSphere 5.0.x.
Determine the scope of the shared library and get the appropriate ID.
In the examples below, each command is followed by sample output.
Getting an ID:
- Example for getting cell ID:
wsadmin>set cell [$AdminConfig getid /Cell:murcielago/]
murcielago(cells/murcielago:cell.xml#Cell_1)
- Example for getting server ID:
wsadmin>set server [$AdminConfig getid
/Cell:murcielago/Node:murcielago/Server:server1/]
server1(cells/murcielago/nodes/murcielago/servers/server1:server.xml#Server_1)
Working with ID to create and manage shared library:
- Create the shared library
wsadmin>$AdminConfig create Library $server {{name testlib}
{classPath c:\temp}}
testlib(cells/murcielago/nodes/murcielago/servers/server1:libraries.xml#Library_1066957364688)
- Set the application deployments to which to connect the library
wsadmin>set deployments [$AdminConfig getid
/Deployment:DefaultApplication/]
DefaultApplication(cells/murcielago/applications/DefaultApplication.ear/deployments/DefaultApplication:deployment.xml#Deployment_1)
- Get the deployment object
wsadmin>set deploymentObject [$AdminConfig showAttribute
$deployments deployedObject]
(cells/murcielago/applications/DefaultApplication.ear/deployments/DefaultApplication:deployment.xml#ApplicationDeployment_1)
- Get the classloader object
wsadmin>set classloader [$AdminConfig showAttribute
$deploymentObject classloader]
(cells/murcielago/applications/DefaultApplication.ear/deployments/DefaultApplication:deployment.xml#Classloader_1)
- Create the library and connect it to the one created previously
wsadmin>$AdminConfig create LibraryRef $classloader {{libraryName
testlib}}
(cells/murcielago/applications/DefaultApplication.ear/deployments/DefaultApplication:deployment.xml#LibraryRef_1066957692406)
- Save the configuration
wsadmin>$AdminConfig save
|
|
|
|
|
Cross Reference information |
Segment |
Product |
Component |
Platform |
Version |
Edition |
Application Servers |
Runtimes for Java Technology |
Java SDK |
|
|
|
|
|
|