Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Help Needed with Jacl script.

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Trying to automate Message listener port creation.

I can run these commands while inside of wsadmin, and everything works fine:

set server [$AdminConfig getid /Cell:mycell/Node:mynode/Server:server1/]
set mls [$AdminConfig list MessageListenerService $server]
set new [$AdminConfig create ListenerPort $mls {{name my} {destinationJNDIName di} {connectionFactoryJNDIName jndi/fs}}]
$AdminConfig create StateManageable $new {{initialState START}}

When I try to pass a vaiable as the name of the Listner port I get this error:

om.ibm.websphere.management.exception.InvalidAttributeValException: ADMG0012E: The attribute value for attribute name is not valid.

It seems like nothing is getting passed to the variables, everything fails.

This is the script I have:

proc setupLP { node server name DJNDI CFJNDI mR mS mM } {
global AdminConfig

set server [$AdminConfig getid /Node:$node/Server:$server/]
set mls [$AdminConfig list MessageListenerService $server]

set new [$AdminConfig create ListenerPort $mls {{name $name} {destinationJNDIName $DJNDI} {connectionFactoryJNDIName $CFJNDI}}]
$AdminConfig create StateManageable $new {{initialState START}}

set lports [$AdminConfig showAttribute $mls listenerPorts]
set lport [lindex $lports 0]
$AdminConfig modify $lport {{maxRetries $mR}}
$AdminConfig modify $lport {{maxSessions $mS}}
$AdminConfig modify $lport {{maxMessages $mM}}
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try using this. It is working fine for me....

########################

global AdminConfig

set widCell [string trim [$props getProperty cell.name]]
set widNode [string trim [$props getProperty node.name]]
set widServer [string trim [$props getProperty server.name]]

set cell [$AdminConfig getid "/Cell:$widCell/"]
set node [$AdminConfig getid /Cell:$widCell/Node:$widNode/]
set server [$AdminConfig getid /Cell:$widCell/Node:$widNode/Server:$widServer/]

set mls [$AdminConfig list MessageListenerService $server]

set listenerConfigNos [string trim [$props getProperty listener.config.nos]]

for {set i 1} {$i <= $listenerConfigNos} {incr i} {

set listenerName [string trim [$props getProperty listener.$i.name]]
set initialState [string trim [$props getProperty listener.$i.initialState]]
set description [string trim [$props getProperty listener.$i.description]]
set connectionFactoryJNDIName [string trim [$props getProperty listener.$i.connectionFactoryJNDIName]]
set destinationJNDIName [string trim [$props getProperty listener.$i.destinationJNDIName]]
set maxMessages [string trim [$props getProperty listener.$i.maxMessages]]
set maxRetries [string trim [$props getProperty listener.$i.maxRetries]]
set maxSessions [string trim [$props getProperty listener.$i.maxSessions]]

$AdminConfig create ListenerPort $mls [list [list connectionFactoryJNDIName $connectionFactoryJNDIName] \
[list destinationJNDIName $destinationJNDIName] \
[list maxMessages $maxMessages] \
[list maxRetries $maxRetries] \
[list maxSessions $maxSessions] \
[list name $listenerName] \
[list description $description] \
[list stateManagement [list [list initialState $initialState]]]]

$AdminConfig save
}

########################

Paresh
 
author and cow tipper
Posts: 5006
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I like Paresh's suggestion. It should work.

Just for reference, I put together a bunch of JACL scripts that I either wrote, or 'borrowed' from various places. You might find something helpful there if you're doing alot of advanced scripting:

WebSphere JACL Scripts for Automated Administration of WAS

Kind regards,

-Cameron McKenzie
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic