WebSphere Application Server - jacl question

This is Interesting: Free IT Magazines  
Home > Archive > WebSphere Application Server > April 2006 > jacl question





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author jacl question
Anant M

2006-04-27, 8:08 am

Hi,
I am writing a jacl script which should create the URL for URLProvider resource at the cluster level.

set clusterName myCluster
puts "The Cluster Name is: $clusterName"
set provider [$AdminConfig getid /ServerCluster:$clusterName/]
puts "provider : $provider"
set objectType URL
set attrs "{name \"Test\"}"
append attrs "{jndiName \"url\"}"
append attrs "{description \"Test\"}"
append attrs "{category \"Test\"}"
append attrs "{spec \"Test\"}"
set object [$AdminConfig create $objectType $provider $attrs]
puts "Created object"
$AdminConfig save
puts "Execution completed successfully"
exit 0

But when I execute this script, i am getting the error saying that Cannot create objects of type "URL" in parents of type "ServerCluster".



$ wsadmin.sh -f /home/jacl/test2.jacl
WASX7209I: Connected to process "dmgr" on node dpmanager using SOAP connector; The type of process is: DeploymentManager

The Cluster Name is: myCluster
provider : myCluster(cells/cj/clusters/myCluster|cluster.xml#ServerCluster_1144268361651)
WASX7017E: Exception received while running file "/home/jacl/test2.jacl"; exception information: com.ibm.ws.scripting.ScriptingException: WASX7129E: Cannot create objects of type "URL" in parents of type "ServerCluster"





I could manually create a new url using console for a cluster.

This is from the in the dmgr/config/cells/cj/clusters/myCluster/resources.xml

<resources.url:URLProvider xmi:id="URLProvider_1" name="Default URL Provider" streamHandlerClassName="unused" protocol="unused">
<factories xmi:type="resources.url:URL" xmi:id="URL_1145476864381" name="Test" jndiName="url\Test" spec="Test"/>
</resources.url:URLProvider>


Name IBM WebSphere Application Server - ND
Version 6.0.2.7

Any help would be greatly appreciated.
Thanks in advance.
Anant


2006-04-27, 8:08 am

Hi,

a URL resource always has to have a URL Provider as its parent and this URLProvider has the cluster as its parent.
So to create a URL at cluster level you should do something like this:

set cluster [$AdminConfig getid /ServerCluster:$clusterName/]
set urlprovider [$AdminConfig list URLProvider $cluster]

set urlProperties {{spec $yourURL} {name $nameOfTheURLResource} {jndiName $jndiName}}

set url [$AdminConfig create URL $urlprovider $urlProperties]

Best regards,
Robert
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com