• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2864
  • Last Modified:

Jython Script

Hello HonorGod,
Thank you very much for help on my previous questions.

Now I am looking for a script to take properties files as input to configure NameSpaceBinding and MQ Queue Configurations. I have 1200 different NameSpaceBinding to be configured and 1200 MQ Queue to be configured.  You help will be highly appreciated.

Script -1

Script to create NameSpaceBinding by taking input from Properties files.
Command :
AdminConfig.create('StringNameSpaceBinding', AdminConfig.getid('/Cell:Proc01/Node:wps1Node01/Server:server1/'), '[[name "CACHE_SWITCH"] [nameInNameSpace "CACHE_SWITCH"] [stringToBind "ON"]]')

The Properties file will contain –
Scope=
             Name: nameInNameSpace, stringToBind
Property:Value= CACHE_SWITCH, CACHE_SWITCH,ON


Script-2
Need a script to Create MQ Queues by taking properties from properties file.
Command –
Example
AdminTask.createWMQQueue('Proc1(cells/Proc1|cell.xml)', '[-name Queue1 -jndiName Queue1 -queueName Queue1 -qmgr QMGR1 -description -customProperties [[MDREAD YES] [MDMSGCTX SET_ALL_CONTEXT] [MSGBODY MQ]]]')

For the this script in the properties file will have

Scope=
  Name:Destination JNDI Name,Qmgr name,Base queue name,Targate client, MDREAD, MDMSGCTX, MSGBODY
Property:Value=Queue1:Queue1,QMG1,Queue1,JMS, YES, SET_ALL_CONTEXT, MQ

MDREAD, MDMSGCTX and MSGBODY are custom properties.
0
k_satish22
Asked:
k_satish22
  • 57
  • 54
1 Solution
 
HonorGodSoftware EngineerCommented:
> I have 1200 different NameSpaceBinding to be configured and 1200 MQ Queue to be configured.

  Are you sure you don't want to do this manually?  ;-)

ok, will the properties file to be processed by script 1 have mult-line entries?

----------------------------------------------------------------------
Scope= Name: nameInNameSpace, stringToBind
Property:Value= CACHE_SWITCH, CACHE_SWITCH,ON
----------------------------------------------------------------------

- Does the Scope entry identify the scope of a namespace binding to be created?
- Are there multiple Scope entries in the file?
- Is the order guaranteed to be that shown above?
- How do the "values" for the scope record relate to the create() parameters?

  Can you related the entries from the Scope and Property records to the following (just to help me understand)?
parent = AdminConfig.getid( '/Cell:Proc01/Node:wps1Node01/Server:server1/' )
attr   = '[[name "CACHE_SWITCH"] [nameInNameSpace "CACHE_SWITCH"] [stringToBind "ON"]]'
AdminConfig.create('StringNameSpaceBinding', parent, attr )

Open in new window

0
 
k_satish22Author Commented:
Please find my answers below...
- Does the Scope entry identify the scope of a namespace binding to be created?
Yes.
- Are there multiple Scope entries in the file?
No
- Is the order guaranteed to be that shown above?
The oder should not be changed. If you have some other idea that you can yo use it.
- How do the "values" for the scope record relate to the create() parameters?
please find the attached script and properties file. They may help you.

createMQ.py
createMQ.txt
0
 
k_satish22Author Commented:
WASX7209I: Connected to process "dmgr" on node dmgr1ProcNode01 using SOAP connector;  The type of process is: DeploymentManager
WASX7303I: The following options are passed to the scripting environment and are available as arguments that are stored in the argv variable: "[createMQ.properties]"

createMQ: INFO --- In main function

createMQ: INFO --- Loading the properties to Hash Map => START......

createMQ: INFO --- Loading the properties to Hash Map => DONE.


createMQ: INFO --- Adding property value to servers START......

WASX7017E: Exception received while running file "createMQ.py"; exception information: com.ibm.bsf.BSFException: exception from Jython:
Traceback (innermost last):
  File "<string>", line 129, in ?
  File "<string>", line 122, in main
  File "<string>", line 46, in createPropValues
java.lang.IllegalAccessException: Class org.python.core.PyReflectedFunction can not access a member of class java.util.HashMap$AbstractMapIterator with modifiers "public"
        at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65)
        at java.lang.reflect.Method.invoke(Method.java:591)
        at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java)
        at org.python.core.PyMethod.__call__(PyMethod.java)
        at org.python.core.PyObject.__call__(PyObject.java)
        at org.python.core.PyInstance.invoke(PyInstance.java)
        at org.python.pycode._pyx47.createPropValues$2(<string>:46)
        at org.python.pycode._pyx47.call_function(<string>)
        at org.python.core.PyTableCode.call(PyTableCode.java)
        at org.python.core.PyTableCode.call(PyTableCode.java)
        at org.python.core.PyFunction.__call__(PyFunction.java)
        at org.python.pycode._pyx47.main$5(<string>:122)
        at org.python.pycode._pyx47.call_function(<string>)
        at org.python.core.PyTableCode.call(PyTableCode.java)
        at org.python.core.PyTableCode.call(PyTableCode.java)
        at org.python.core.PyFunction.__call__(PyFunction.java)
        at org.python.pycode._pyx47.f$0(<string>:129)
        at org.python.pycode._pyx47.call_function(<string>)
        at org.python.core.PyTableCode.call(PyTableCode.java)
        at org.python.core.PyCode.call(PyCode.java)
        at org.python.core.Py.runCode(Py.java)
        at org.python.core.Py.exec(Py.java)
        at org.python.util.PythonInterpreter.exec(PythonInterpreter.java)
        at com.ibm.bsf.engines.jython.JythonEngine$BSFPythonInterpreter.exec(Unknown Source)
        at com.ibm.bsf.engines.jython.JythonEngine.exec(Unknown Source)
        at com.ibm.bsf.BSFManager$6.run(Unknown Source)
        at java.security.AccessController.doPrivileged(AccessController.java:251)
        at com.ibm.bsf.BSFManager.exec(Unknown Source)
        at com.ibm.ws.scripting.AbstractShell.executeScript(AbstractShell.java:1189)
        at com.ibm.ws.scripting.AbstractShell.run(AbstractShell.java:2202)
        at com.ibm.ws.scripting.WasxShell.main(WasxShell.java:1010)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:600)
        at com.ibm.wsspi.bootstrap.WSLauncher.launchMain(WSLauncher.java:213)
        at com.ibm.wsspi.bootstrap.WSLauncher.main(WSLauncher.java:93)
        at com.ibm.wsspi.bootstrap.WSLauncher.run(WSLauncher.java:74)
        at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:600)
        at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
        at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
        at org.eclipse.core.launcher.Main.run(Main.java:977)
        at com.ibm.wsspi.bootstrap.WSPreLauncher.launchEclipse(WSPreLauncher.java:340)
        at com.ibm.wsspi.bootstrap.WSPreLauncher.main(WSPreLauncher.java:110)

java.lang.IllegalAccessException: java.lang.IllegalAccessException: Class org.python.core.PyReflectedFunction can not access a member of class java.util.HashMap$AbstractMapIterator with modifiers "public"
0
Managing Security & Risk at the Speed of Business

Gartner Research VP, Neil McDonald & AlgoSec CTO, Prof. Avishai Wool, discuss the business-driven approach to automated security policy management, its benefits and how to align security policy management with business processes to address today's security challenges.

 
HonorGodSoftware EngineerCommented:
ok, it's going to take me a bit to get my head around your code.  Thanks for providing it.
0
 
HonorGodSoftware EngineerCommented:
hm.   Can I make extensive changes to your code?

Or, do you prefer for me to make minimum changes?
0
 
HonorGodSoftware EngineerCommented:
It appears that you prefer Java constructs to Jython ones.
Is that what you prefer that I use?  Or should I, as part of the modification, use Jython idioms, instead?
0
 
k_satish22Author Commented:
I just send that script as an example. You can use which every is easy and convient for you.
0
 
k_satish22Author Commented:
Hello HonorGod,
Any luck? If you can give me the scripts today that will be highly appreciated. I have some deadline to meet.  I am really sorry for the rush.

Thanks
0
 
HonorGodSoftware EngineerCommented:
Something like this perhaps?
createMQ.py
0
 
k_satish22Author Commented:
Thank you HonorGod for the script. But when I am executing the script  it is failing with below information.

 ./wsadmin.sh -lang jython -f createMQ.py createMQ.txt
WASX7209I: Connected to process "dmgr" on node dmgr1ProcNode01 using SOAP connector;  The type of process is: DeploymentManager
WASX7303I: The following options are passed to the scripting environment and are available as arguments that are stored in the argv variable: "[createMQ.txt]"
argc: 1
Error: Unexpected number of parameters: 1
Command: createMQ.txt

Purpose: Use the information from the specified properties file, and use it to
         create the specified MQ items.

  Usage: wsadmin -f createMQ.txt.py <propertiesFileName>

Example: ./wsadmin.sh -f createMQ.txt.py createMQ.txt.txt
0
 
HonorGodSoftware EngineerCommented:
oops.  Sorry.

I also realized that I forgot to call save() or do a sync()... sigh

Please forgive my earlier attempt
createMQ.py
0
 
k_satish22Author Commented:
Now it is failing with below error

$ ./wsadmin.sh -lang jython -f /opt/app/IBM/WebSphere/ProcDmgr70/profiles/ProcDmgr01/bin/createMQ.py /opt/app/IBM/WebSphere/ProcDmgr70/profiles/ProcDmgr01/bin/createMQ.txt
WASX7209I: Connected to process "dmgr" on node dmgr1ProcNode01 using SOAP connector;  The type of process is: DeploymentManager
WASX7303I: The following options are passed to the scripting environment and are available as arguments that are stored in the argv variable: "[/opt/app/IBM/WebSphere/ProcDmgr70/profiles/ProcDmgr01/bin/createMQ.txt]"
WASX7017E: Exception received while running file "/opt/app/IBM/WebSphere/ProcDmgr70/profiles/ProcDmgr01/bin/createMQ.py"; exception information: com.ibm.bsf.BSFException: exception from Jython:
Traceback (innermost last):
  (no code object) at line 0
  File "<string>", line 179
            if ( node no in [ 'was_dmgr_node', 'wps_dmgr_node' ] :
                      ^
0
 
HonorGodSoftware EngineerCommented:
stupid, stupid, stupid...

That line should be:

if node not in [ 'was_dmgr_node', 'wps_dmgr_node' ] :


createMQ.py
0
 
k_satish22Author Commented:
Now I am getting below Error.

$ ./wsadmin.sh -lang jython -f createMQ.py createMQ.txt
WASX7209I: Connected to process "dmgr" on node dmgr1ProcNode01 using SOAP connector;  The type of process is: DeploymentManager
WASX7303I: The following options are passed to the scripting environment and are available as arguments that are stored in the argv variable: "[createMQ.txt]"
argc: 1
WASX7017E: Exception received while running file "createMQ.py"; exception information: com.ibm.bsf.BSFException: exception from Jython:
Traceback (innermost last):
  File "<string>", line 214, in ?
IndexError: index out of range: 1
0
 
HonorGodSoftware EngineerCommented:
That's what I get for testing with Jython, and not wsadmin :-(
createMQ.py
0
 
k_satish22Author Commented:
Thank you so much for the script. But when I am setting the Scope to Cell it failing with below error.

$ ./wsadmin.sh -lang jython -f createMQ.py createMQ.txt
WASX7209I: Connected to process "dmgr" on node dmgr1ProcNode01 using SOAP connector;  The type of process is: DeploymentManager
WASX7303I: The following options are passed to the scripting environment and are available as arguments that are stored in the argv variable: "[createMQ.txt]"
argc: 1

createMQ: INFO --- Enter main()

createMQ: INFO --- Enter Properties() - load from Properties file

createMQ: INFO --- Exit  Properties()

createMQ: INFO --- processing queue names

WASX7017E: Exception received while running file "createMQ.py"; exception information: com.ibm.ws.scripting.ScriptingException: Invalid object name: /Cell:ProcCell01/ProcCell01/JMSProvider:WebSphere MQ JMS Provider
0
 
k_satish22Author Commented:
I am sorry. The issues is with the properties file Now I corrected. But I am getting below error.
$ ./wsadmin.sh -lang jython -f createMQ.py createMQ.txt
WASX7209I: Connected to process "dmgr" on node dmgr1ProcNode01 using SOAP connector;  The type of process is: DeploymentManager
WASX7303I: The following options are passed to the scripting environment and are available as arguments that are stored in the argv variable: "[createMQ.txt]"
argc: 1

createMQ: INFO --- Enter main()

createMQ: INFO --- Enter Properties() - load from Properties file

createMQ: INFO --- Exit  Properties()

createMQ: INFO --- processing queue names


createMQ: ERROR --- Unable to get WebSphere MQ JMS Provider at the scopeCell:ProcCell01specified.Check the logs for more information.

createMQ: ERROR --- Unable to get WebSphere MQ JMS Provider at the scopeCell:ProcCell01specified.Check the logs for more information.

createMQ: ERROR --- Unable to get WebSphere MQ JMS Provider at the scopeCell:ProcCell01specified.Check the logs for more information.

createMQ: INFO --- Saving configuration changes.

createMQ: Enter SynchNodes().

createMQ: ERROR --- Unable to synchronise with node dmgr1ProcNode01. Nodeagent appears inactive.

createMQ: SUCCESS --- Synchronization successfull with Node wps01Node01

createMQ: SUCCESS --- Synchronization successfull with Node wps02Node01

createMQ: Exit  SynchNodes().

createMQ: INFO --- Exit  main() 3 error(s) encountered
0
 
HonorGodSoftware EngineerCommented:
hm.  Super.  Thanks for the output.

I'm checking line 75, now that I have access to my AppServer...

I think that it should be as shown below.

One moment please.
mqjmsp = AdminConfig.getid( '/Cell:%s/%s/JMSProvider:WebSphere MQ JMS Provider/' % ( cellName, scope )

Open in new window

0
 
HonorGodSoftware EngineerCommented:
Ah.  Thanks for the update.

What is the output for serverStatus for all profiles?

To list all configured profile names, you can use:

*ix:
  ./manageprofiles.sh -listProfiles

Windows:

  manageprofiles -listProfiles

Then, for each profile name listed, use:

*ix:
  ./serverStatus.sh -all -profileName <profileName>

Windows
  serverStatus -all -profileName <profileName>

e.g.,
  serverStatus -all -profileName AppSrv01
0
 
HonorGodSoftware EngineerCommented:
This will provide us with more information!
createMQ.py
0
 
k_satish22Author Commented:
After executing the above script I am getting the same error with more details. Please find the attached file for the results.

One More thing, for my second script on NameSpaceBinding do you have any script to export NameSpaceBinding from one Server and Import them to diffrent server. Instead of creating the NameSpaceBindings. I want to export all NameSpaceBindings  at diffrent scopes and import them at the same scops.
Thank you very much for all your help.
OutPut.txt
0
 
HonorGodSoftware EngineerCommented:
The problem is that in your input (Properties) file, you have scope as

Cell:ProcCell01

Which isn't what is needed.

Since the valid/configured MQ JMS Providers are as shown below, that the scope should be something like:

clusters/Rules_Cluster

or

clusters/NonClaims_Cluster

Does this make sense?
"WebSphere MQ JMS Provider(cells/ProcCell01/clusters/Claims_Cluster|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/clusters/Cots_Cluster|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/clusters/ME_Cluster|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/clusters/NonClaims_Cluster|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/clusters/Rules_Cluster|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/nodes/dmgr1ProcNode01|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/nodes/wps01Node01/servers/Claims1|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/nodes/wps01Node01/servers/Cots1|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/nodes/wps01Node01/servers/ME1|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/nodes/wps01Node01/servers/NonClaims1|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/nodes/wps01Node01/servers/Rules1|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/nodes/wps01Node01|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/nodes/wps02Node01/servers/Claims2|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/nodes/wps02Node01/servers/Cots2|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/nodes/wps02Node01/servers/ME2|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/nodes/wps02Node01/servers/NonClaims2|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/nodes/wps02Node01/servers/Rules2|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/nodes/wps02Node01|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01|resources.xml#builtin_mqprovider)"

Open in new window

0
 
k_satish22Author Commented:
The Script is working fine at Node and Server level  when using
Scope=Node:wps01Node01
or
Scope=Node:wps01Node01/Server:Cots1



$ ./wsadmin.sh -lang jython -f createMQ.py createMQ.txt
WASX7209I: Connected to process "dmgr" on node dmgr1ProcNode01 using SOAP connector;  The type of process is: DeploymentManager
WASX7303I: The following options are passed to the scripting environment and are available as arguments that are stored in the argv variable: "[createMQ.txt]"
argc: 1

createMQ: INFO --- Enter main()

createMQ: INFO --- Enter Properties() - load from Properties file

createMQ: INFO --- Exit  Properties()

createMQ: INFO --- processing queue names


createMQ: SUCCESS ---Created the Queue Sample1 at scope Node:wps01Node01/Server:Cots1

createMQ: SUCCESS ---Created the Queue Sample2 at scope Node:wps01Node01/Server:Cots1

createMQ: SUCCESS ---Created the Queue Sample3 at scope Node:wps01Node01/Server:Cots1

createMQ: INFO --- Saving configuration changes.

createMQ: Enter SynchNodes().

createMQ: ERROR --- Unable to synchronise with node dmgr1ProcNode01. Nodeagent appears inactive.

createMQ: SUCCESS --- Synchronization successfull with Node wps01Node01

createMQ: SUCCESS --- Synchronization successfull with Node wps02Node01

createMQ: Exit  SynchNodes().

createMQ: INFO --- Exit  main() no error(s) encountered
0
 
HonorGodSoftware EngineerCommented:
good.

So, what's next?
0
 
HonorGodSoftware EngineerCommented:
Please note:
This error message is because of the way you originally had the SynchNode() check for the DM nodename.
I used the same kind of test.  

createMQ: ERROR --- Unable to synchronise with node dmgr1ProcNode01. Nodeagent appears inactive.

If you want the code to correctly detect (and not try to synch) the DM, change line 182 from this:

    if node not in [ 'was_dmgr_node', 'wps_dmgr_node' ] :

To correctly identify the DM node name(s), e.g.,

    if node not in [ 'dmgr1ProcNode01', 'wps_dmgr_node' ] :

You might even be able to get by with something like:

    if node.find( 'dmgr' ) < 0 :

Which only tries to synch for nodes what have a name that doesn't include "dmgr" somewhere in the node name.

Does that make sense?
0
 
k_satish22Author Commented:
The Script is not working at Cell Scope.

Cell:ProcCell01
0
 
HonorGodSoftware EngineerCommented:
Ah, that's because the script, as originally written, didn't take that into account, and therefore I didn't consider it.  One moment please
0
 
k_satish22Author Commented:
One more thing: The script is not taking the custom properties "'MDREAD', ' MDMSGCTX', ' MSGBODY'


$ ./wsadmin.sh -lang jython -f createMQ.py createMQ.txt
WASX7209I: Connected to process "dmgr" on node dmgr1ProcNode01 using SOAP connector;  The type of process is: DeploymentManager
WASX7303I: The following options are passed to the scripting environment and are available as arguments that are stored in the argv variable: "[createMQ.txt]"
argc: 1

createMQ: INFO --- Enter main()

createMQ: INFO --- Enter Properties() - load from Properties file

createMQ: INFO --- Exit  Properties()

createMQ: INFO --- processing queue names


createMQ: ERROR --- Unexpecited roles specified: ['queue/sample_sat', 'INKMW00', 'NKM.ACQUISITION.WAS', 'JMS', 'MDREAD', ' MDMSGCTX', ' MSGBODY']

createMQ: INFO --- Saving configuration changes.

createMQ: Enter SynchNodes().

createMQ: ERROR --- Unable to synchronise with node dmgr1ProcNode01. Nodeagent appears inactive.

createMQ: SUCCESS --- Synchronization successfull with Node wps01Node01

createMQ: SUCCESS --- Synchronization successfull with Node wps02Node01

createMQ: Exit  SynchNodes().

createMQ: INFO --- Exit  main() 1 error(s) encountered
0
 
HonorGodSoftware EngineerCommented:
I wonder if it would work for the cell if the scope were specified as

nodes/dmgr1ProcNode01
0
 
HonorGodSoftware EngineerCommented:
> The script is not taking the custom properties "'MDREAD', ' MDMSGCTX', ' MSGBODY'

When the Properties file contains these properties:

['queue/sample_sat', 'INKMW00', 'NKM.ACQUISITION.WAS', 'JMS', 'MDREAD', ' MDMSGCTX', ' MSGBODY']

Then I understand the stuff shown below.

However, you haven't told me how the rest are to be interpreted...
'queue/sample_sat'    == qjndiname
'INKMW00'             == qManager
'NKM.ACQUISITION.WAS' == bqname
'JMS'                 == tclient

Open in new window

0
 
k_satish22Author Commented:
My Bad I am sorry. Can you please include them.  These values also can be hardcoded.

 MDREAD =  YES,
MDMSGCTX =  SET_ALL_CONTEXT
 MSGBODY =  MQ

-customProperties [[MDREAD YES] [MDMSGCTX SET_ALL_CONTEXT] [MSGBODY MQ]]


0
 
k_satish22Author Commented:
I think the issue with the script is the script was initially developed configured at node level so it is not working at Cell level

mqjmsp = AdminConfig.getid( '/Cell:%s/%s/JMSProvider:WebSphere MQ JMS Provider/' % ( cellName, scope ) )

In the script it is taking the Scope for Node as  Node:wps01Node01 and it working fine
mqjmsp = AdminConfig.getid( '/Cell:Node/wps01Node01/JMSProvider:WebSphere MQ JMS Provider/' % ( cellName, scope ) )

When comming to Cell it is failing  because of follwing issue. it taking Cell:Cell/ProcCell01 Instead of /Cell:ProcCell01

mqjmsp = AdminConfig.getid( '/Cell:Cell/ProcCell01/JMSProvider:WebSphere MQ JMS Provider/' % ( cellName, scope ) )
0
 
HonorGodSoftware EngineerCommented:
I'm (very) surprised that

/Cell:Node/wps01Node01/

appears to work.  The proper syntax is:

/Cell:/Node:wps01Node01/

or even better:

/Node:wps01Node01/

The statements you are showing appear to have been modified.  The ones that I show in the code are:

mqjmsp = AdminConfig.getid( '/Cell:%s/%s/JMSProvider:WebSphere MQ JMS Provider/' % ( cellName, scope ) )

which should cause the following string substitution to occur:

...

So, if we look at the point shown above (i.e.,  http://e-e.com/Q_26928348.html?cid=1572#a35314539) identifies all of the valid configuration ID's for the configured MQ JMS Providers.
'/Cell:%s/%s/JMSProvider:WebSphere MQ JMS Provider/' % ( cellName, scope )

The value of cellName should be put in place of the first %s, and the value of scope should be put in place of the 2nd %s.  So, if "cellName" is ProcCell01, the first phase of the substitution would have the string looking something like:

'/Cell:ProcCell01/%s/JMSProvider:WebSphere MQ JMS Provider/'
                  ^^

The question is, at this point, what value of scope should we use/supply to identify that actual destination to be used.

Open in new window

0
 
k_satish22Author Commented:
We need to supply below values in the properties file and the script should pick it from there.
CellName=ProcCell01
Scope=Node:dmgr1ProcNode01

Scope can be Cell, Node or Server
examples
Scope=Node:dmgr1ProcNode01
Server=Node:abcNode/Server:abcServer
Scope=Cell:ProcCell01
0
 
HonorGodSoftware EngineerCommented:
Why would you want to duplicate the cell if you want the cell scope?

CellName=ProcCell01
Scope=Cell:ProcCell01
0
 
k_satish22Author Commented:
hmm. I dont want to duplicate.  I thought it is a Mandatory value to be passed.
0
 
HonorGodSoftware EngineerCommented:
As a matter of fact, unless you are using something like Hypervisor Edition (www.IBM.com/software/webservers/appserv/hypervisor), then there will only be 1 Cell.
0
 
k_satish22Author Commented:
I have only one cell.
0
 
HonorGodSoftware EngineerCommented:
So, the question is:

When you want the configuration scope to the the cell, what are the preferred values (in the Properties) file of CellName and Scope?
0
 
HonorGodSoftware EngineerCommented:
In fact, if the server name is unique (i.e., only exists in one node), then you shouldn't even have to specify (qualify) the server name with the node name.

The script could even figure it out.

What if you had:

CellName=
NodeName=
ServerName=
ClusterName=

in the first part of the Properties file, as well as something like:

Scope=(Cell|Cluster|Node|Server)
0
 
k_satish22Author Commented:
I have a cluster environment and AppServer name are unique on nodes. If script can parse the values to proper nodes/servers then it is ok for me. Thanks alot for your help.
0
 
k_satish22Author Commented:
Hi HonorGod,

Do you have a script handy to import and report Namespace Bindings from one environment other.

Thanks
0
 
HonorGodSoftware EngineerCommented:
Do you, by any chance, mean detail information about the configured NameSpaceBinding objects?


print AdminConfig.list( 'NameSpaceBinding' )

Open in new window

0
 
k_satish22Author Commented:
I need a script to export and import Namespace Bindings from one environment other.

0
 
HonorGodSoftware EngineerCommented:
ok, that's a different question...

I'm not quite done with this one, at least not yet... ;-)
0
 
HonorGodSoftware EngineerCommented:
Do me a favor though, when you open that new question, please include the output of the following.

Thanks
for ns in AdminConfig.list( 'NameSpaceBinding' ).splitlines() :
  print ns
  print '-' * 50
  print AdminConfig.show( ns )
  print '-' * 50
  print

Open in new window

0
 
k_satish22Author Commented:
Any Luck with the script... I am sorry to rush you, as I need accomplish my task by tomorrow.
0
 
HonorGodSoftware EngineerCommented:
This version attempts to do what was discussed above (i.e., http://e-ecom/Q_26928348.html#a35316498)

i.e., To define the scope in the properties file, provide the appropriate values of:
CellName, ClusterName, NodeName, and ServerName

Then, the value of Scope in the properties file must be 1 of:
  Cell        - CellName  is required
  Cluster  - ClusterName  is required, CellName is optional
  Node     - NodeName  is required, CellName is optional
  Server   - ServerName is required, CellName and NodeName are optional

Let's see if this works for you.
createMQ.py
0
 
k_satish22Author Commented:
Thank you for the script.

If I Want to define the scope at cell level then what I need to specify the properties file?
The values in the properties file are....
CellName=ProcCell01
Scope=ProcCell01
Property:Value=Sample_sat:queue/sample_sat,INKMW00,NKM.ACQUISITION.WAS,JMS

when I try to use Cell as scope I am getting below error.
$ ./wsadmin.sh -lang jython -f createMQ.py createMQ.txt
WASX7209I: Connected to process "dmgr" on node dmgr1ProcNode01 using SOAP connector;  The type of process is: DeploymentManager
WASX7303I: The following options are passed to the scripting environment and are available as arguments that are stored in the argv variable: "[createMQ.txt]"
argc: 1

createMQ: INFO --- Enter main()

createMQ: INFO --- Enter Properties() - load from Properties file

createMQ: INFO --- Exit  Properties()

createMQ: Error unexpected "Scope" value: ProcCell01
WASX7017E: Exception received while running file "createMQ.py"; exception information: com.ibm.bsf.BSFException: exception from Jython:
Traceback (innermost last):
  File "<string>", line 284, in ?
  File "<string>", line 155, in main
NameError: configID
0
 
HonorGodSoftware EngineerCommented:
Q: If I Want to define the scope at cell level then what I need to specify the properties file?

CellName=rocCell01
Scope=Cell
0
 
HonorGodSoftware EngineerCommented:
Sorry, there was a typographical error on line 155

configID should be scopeID, so the line should be:


Note: The indentation was right!
if scopeID :

Open in new window

0
 
HonorGodSoftware EngineerCommented:
0
 
k_satish22Author Commented:
Now I am getting follow error.

./wsadmin.sh -lang jython -f createMQ.py createMQ.txt
WASX7209I: Connected to process "dmgr" on node dmgr1ProcNode01 using SOAP connector;  The type of process is: DeploymentManager
WASX7303I: The following options are passed to the scripting environment and are available as arguments that are stored in the argv variable: "[createMQ.txt]"
argc: 1

createMQ: INFO --- Enter main()

createMQ: INFO --- Enter Properties() - load from Properties file

createMQ: INFO --- Exit  Properties()

createMQ: ERROR --- Unable to locate WebSphere MQ JMS Provider at the specified scope. Check the logs for more information.

createMQ: Debug - configured JMSProviders:
--------------------------------------------------
"WebSphere JMS Provider(cells/ProcCell01/clusters/Claims_Cluster|resources.xml#builtin_jmsprovider)"
"WebSphere JMS Provider(cells/ProcCell01/clusters/Cots_Cluster|resources.xml#builtin_jmsprovider)"
"WebSphere JMS Provider(cells/ProcCell01/clusters/ME_Cluster|resources.xml#builtin_jmsprovider)"
"WebSphere JMS Provider(cells/ProcCell01/clusters/NonClaims_Cluster|resources.xml#builtin_jmsprovider)"
"WebSphere JMS Provider(cells/ProcCell01/clusters/Rules_Cluster|resources.xml#builtin_jmsprovider)"
"WebSphere JMS Provider(cells/ProcCell01/nodes/dmgr1ProcNode01|resources.xml#builtin_jmsprovider)"
"WebSphere JMS Provider(cells/ProcCell01/nodes/wps01Node01/servers/Claims1|resources.xml#builtin_jmsprovider)"
"WebSphere JMS Provider(cells/ProcCell01/nodes/wps01Node01/servers/Cots1|resources.xml#builtin_jmsprovider)"
"WebSphere JMS Provider(cells/ProcCell01/nodes/wps01Node01/servers/ME1|resources.xml#builtin_jmsprovider)"
"WebSphere JMS Provider(cells/ProcCell01/nodes/wps01Node01/servers/NonClaims1|resources.xml#builtin_jmsprovider)"
"WebSphere JMS Provider(cells/ProcCell01/nodes/wps01Node01/servers/Rules1|resources.xml#builtin_jmsprovider)"
"WebSphere JMS Provider(cells/ProcCell01/nodes/wps01Node01|resources.xml#builtin_jmsprovider)"
"WebSphere JMS Provider(cells/ProcCell01/nodes/wps02Node01/servers/Claims2|resources.xml#builtin_jmsprovider)"
"WebSphere JMS Provider(cells/ProcCell01/nodes/wps02Node01/servers/Cots2|resources.xml#builtin_jmsprovider)"
"WebSphere JMS Provider(cells/ProcCell01/nodes/wps02Node01/servers/ME2|resources.xml#builtin_jmsprovider)"
"WebSphere JMS Provider(cells/ProcCell01/nodes/wps02Node01/servers/NonClaims2|resources.xml#builtin_jmsprovider)"
"WebSphere JMS Provider(cells/ProcCell01/nodes/wps02Node01/servers/Rules2|resources.xml#builtin_jmsprovider)"
"WebSphere JMS Provider(cells/ProcCell01/nodes/wps02Node01|resources.xml#builtin_jmsprovider)"
"WebSphere JMS Provider(cells/ProcCell01|resources.xml#builtin_jmsprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/clusters/Claims_Cluster|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/clusters/Cots_Cluster|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/clusters/ME_Cluster|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/clusters/NonClaims_Cluster|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/clusters/Rules_Cluster|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/nodes/dmgr1ProcNode01|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/nodes/wps01Node01/servers/Claims1|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/nodes/wps01Node01/servers/Cots1|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/nodes/wps01Node01/servers/ME1|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/nodes/wps01Node01/servers/NonClaims1|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/nodes/wps01Node01/servers/Rules1|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/nodes/wps01Node01|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/nodes/wps02Node01/servers/Claims2|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/nodes/wps02Node01/servers/Cots2|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/nodes/wps02Node01/servers/ME2|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/nodes/wps02Node01/servers/NonClaims2|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/nodes/wps02Node01/servers/Rules2|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/nodes/wps02Node01|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01|resources.xml#builtin_mqprovider)"
--------------------------------------------------

createMQ: INFO --- Saving configuration changes.

createMQ: Enter SynchNodes().

createMQ: ERROR --- Unable to synchronise with node dmgr1ProcNode01. Nodeagent appears inactive.

createMQ: SUCCESS --- Synchronization successfull with Node wps01Node01

createMQ: SUCCESS --- Synchronization successfull with Node wps02Node01

createMQ: Exit  SynchNodes().

createMQ: INFO --- Exit  main(), 1 error(s) encountered.
0
 
HonorGodSoftware EngineerCommented:
Revised debug output to better understand what is occurring.
createMQ.py
0
 
k_satish22Author Commented:
here is the output...
$ ./wsadmin.sh -lang jython -f createMQ.py createMQ.txt
WASX7209I: Connected to process "dmgr" on node dmgr1ProcNode01 using SOAP connector;  The type of process is: DeploymentManager
WASX7303I: The following options are passed to the scripting environment and are available as arguments that are stored in the argv variable: "[createMQ.txt]"
argc: 1

createMQ: INFO --- Enter main()

createMQ: INFO --- Enter Properties() - load from Properties file

createMQ: INFO --- Exit  Properties()

createMQ: ERROR --- Unable to locate WebSphere MQ JMS Provider at the specified scope. Check the logs for more information.

createMQ: Debug Begin:
ProcCell01(cells/ProcCell01|cell.xml#Cell_1)
--------------------------------------------------
"WebSphere JMS Provider(cells/ProcCell01/clusters/Claims_Cluster|resources.xml#builtin_jmsprovider)"
"WebSphere JMS Provider(cells/ProcCell01/clusters/Cots_Cluster|resources.xml#builtin_jmsprovider)"
"WebSphere JMS Provider(cells/ProcCell01/clusters/ME_Cluster|resources.xml#builtin_jmsprovider)"
"WebSphere JMS Provider(cells/ProcCell01/clusters/NonClaims_Cluster|resources.xml#builtin_jmsprovider)"
"WebSphere JMS Provider(cells/ProcCell01/clusters/Rules_Cluster|resources.xml#builtin_jmsprovider)"
"WebSphere JMS Provider(cells/ProcCell01/nodes/dmgr1ProcNode01|resources.xml#builtin_jmsprovider)"
"WebSphere JMS Provider(cells/ProcCell01/nodes/wps01Node01/servers/Claims1|resources.xml#builtin_jmsprovider)"
"WebSphere JMS Provider(cells/ProcCell01/nodes/wps01Node01/servers/Cots1|resources.xml#builtin_jmsprovider)"
"WebSphere JMS Provider(cells/ProcCell01/nodes/wps01Node01/servers/ME1|resources.xml#builtin_jmsprovider)"
"WebSphere JMS Provider(cells/ProcCell01/nodes/wps01Node01/servers/NonClaims1|resources.xml#builtin_jmsprovider)"
"WebSphere JMS Provider(cells/ProcCell01/nodes/wps01Node01/servers/Rules1|resources.xml#builtin_jmsprovider)"
"WebSphere JMS Provider(cells/ProcCell01/nodes/wps01Node01|resources.xml#builtin_jmsprovider)"
"WebSphere JMS Provider(cells/ProcCell01/nodes/wps02Node01/servers/Claims2|resources.xml#builtin_jmsprovider)"
"WebSphere JMS Provider(cells/ProcCell01/nodes/wps02Node01/servers/Cots2|resources.xml#builtin_jmsprovider)"
"WebSphere JMS Provider(cells/ProcCell01/nodes/wps02Node01/servers/ME2|resources.xml#builtin_jmsprovider)"
"WebSphere JMS Provider(cells/ProcCell01/nodes/wps02Node01/servers/NonClaims2|resources.xml#builtin_jmsprovider)"
"WebSphere JMS Provider(cells/ProcCell01/nodes/wps02Node01/servers/Rules2|resources.xml#builtin_jmsprovider)"
"WebSphere JMS Provider(cells/ProcCell01/nodes/wps02Node01|resources.xml#builtin_jmsprovider)"
"WebSphere JMS Provider(cells/ProcCell01|resources.xml#builtin_jmsprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/clusters/Claims_Cluster|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/clusters/Cots_Cluster|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/clusters/ME_Cluster|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/clusters/NonClaims_Cluster|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/clusters/Rules_Cluster|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/nodes/dmgr1ProcNode01|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/nodes/wps01Node01/servers/Claims1|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/nodes/wps01Node01/servers/Cots1|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/nodes/wps01Node01/servers/ME1|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/nodes/wps01Node01/servers/NonClaims1|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/nodes/wps01Node01/servers/Rules1|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/nodes/wps01Node01|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/nodes/wps02Node01/servers/Claims2|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/nodes/wps02Node01/servers/Cots2|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/nodes/wps02Node01/servers/ME2|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/nodes/wps02Node01/servers/NonClaims2|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/nodes/wps02Node01/servers/Rules2|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01/nodes/wps02Node01|resources.xml#builtin_mqprovider)"
"WebSphere MQ JMS Provider(cells/ProcCell01|resources.xml#builtin_mqprovider)"
--------------------------------------------------

createMQ: Debug Finish:

createMQ: INFO --- Saving configuration changes.

createMQ: Enter SynchNodes().

createMQ: ERROR --- Unable to synchronise with node dmgr1ProcNode01. Nodeagent appears inactive.

createMQ: SUCCESS --- Synchronization successfull with Node wps01Node01

createMQ: SUCCESS --- Synchronization successfull with Node wps02Node01

createMQ: Exit  SynchNodes().

createMQ: INFO --- Exit  main(), 1 error(s) encountered.
0
 
HonorGodSoftware EngineerCommented:
Very strange, that last config ID should match...
createMQ.py
0
 
k_satish22Author Commented:
Now I got below error
./wsadmin.sh -lang jython -f createMQ.py createMQ.txt
WASX7209I: Connected to process "dmgr" on node dmgr1ProcNode01 using SOAP connector;  The type of process is: DeploymentManager
WASX7303I: The following options are passed to the scripting environment and are available as arguments that are stored in the argv variable: "[createMQ.txt]"
argc: 1

createMQ: INFO --- Enter main()

createMQ: INFO --- Enter Properties() - load from Properties file

createMQ: INFO --- Exit  Properties()

createMQ: Debug  Scope( "Cell" ) == ProcCell01(cells/ProcCell01|cell.xml#Cell_1)
WASX7017E: Exception received while running file "createMQ.py"; exception information: com.ibm.ws.scripting.ScriptingException: Invalid object name: /Cell:/<function scope at 471997474>/JMSProvider:WebSphere MQ JMS Provider/MQQueue:Sample_sat/
0
 
HonorGodSoftware EngineerCommented:
You're making me work... ;-)
createMQ.py
0
 
k_satish22Author Commented:
I am really sorry about that. I really need this script.
still getting the same error. :(
$ ./wsadmin.sh -lang jython -f createMQ.py createMQ.txt
WASX7209I: Connected to process "dmgr" on node dmgr1ProcNode01 using SOAP connector;  The type of process is: DeploymentManager
WASX7303I: The following options are passed to the scripting environment and are available as arguments that are stored in the argv variable: "[createMQ.txt]"
argc: 1

createMQ: INFO --- Enter main()

createMQ: INFO --- Enter Properties() - load from Properties file

createMQ: INFO --- Exit  Properties()

createMQ: Debug  Scope( "Cell" ) == ProcCell01(cells/ProcCell01|cell.xml#Cell_1)

createMQ: Debug: createMQ( "ProcCell01(cells/ProcCell01|cell.xml#Cell_1)", "Sample_sat", "['queue/sample_sat', 'INKMW00', 'NKM.ACQUISITION.WAS', 'JMS']" )
WASX7017E: Exception received while running file "createMQ.py"; exception information: com.ibm.ws.scripting.ScriptingException: Invalid object name: /Cell:/<function scope at 546709654>/JMSProvider:WebSphere MQ JMS Provider/MQQueue:Sample_sat/


I think somthing to do with command used to create the Queue destination. If I execute the below command it is working fine.
AdminTask.createWMQQueue('ProcCell01(cells/ProcCell01|cell.xml#Cell_1)', '[-name HonorGod -jndiName HonorGod -queueName sample1 -qmgr Sample -description -customProperties [[MDREAD YES] [MDMSGCTX SET_ALL_CONTEXT] [MSGBODY MQ]]]')
'HonorGod(cells/ProcCell01|resources.xml#MQQueue_1302035665579)'
0
 
HonorGodSoftware EngineerCommented:
Ah, I found a bug.  Let's see what this does for you.
createMQ.py
0
 
k_satish22Author Commented:
Thank you so much the script is working for Cell scope. But it is not working at when I am specifying Scope as Node as below. I am not sure whether I am specifying it correctly in the properties file or not .
Scope=wps01Node01
0
 
HonorGodSoftware EngineerCommented:
Nope,  Specify

Scope=Node

That's the beauty of using this technique.
We specify only the required names (e.g., CellName, NodeNode, ClusterName, and/or ServerName), then one of the corresponding Scope values:

Cell
Node
Cluster
Server
0
 
HonorGodSoftware EngineerCommented:
Sorry for the delayed response.  My machine died (BSoD) on me. ;-(
0
 
k_satish22Author Commented:
Excellent!!! The Scirpt is working fine.  You are Marvelous. Thank you somuch for helping me.
0
 
HonorGodSoftware EngineerCommented:
;-)

Thanks for the compliments, grade and points.

Good luck & have a great day.
0
 
k_satish22Author Commented:
I am sorry for commenting on this question, The script is not working. I am getting error is Queue Defination is already configured at  specified scope. Skipping the MQ Queue creation.


$ ./wsadmin.sh -lang jython -f createMQ.py createMQ.txt
WASX7209I: Connected to process "dmgr" on node dmgr1ProcNode01 using SOAP connector;  The type of process is: DeploymentManager
WASX7303I: The following options are passed to the scripting environment and are available as arguments that are stored in the argv variable: "[createMQ.txt]"
argc: 1

createMQ: INFO --- Enter main()

createMQ: INFO --- Enter Properties() - load from Properties file

createMQ: INFO --- Exit  Properties()

createMQ: Debug  Scope( "Node" ) == wps02Node01(cells/ProcCell01/nodes/wps02Node01|node.xml#Node_1)

createMQ: Debug: createMQ( "wps02Node01(cells/ProcCell01/nodes/wps02Node01|node.xml#Node_1)", "NHFA.UNIT.EN05.BATCH.ELIGIBILITY.REQ", "['NHFA.UNIT.EN05.BATCH.ELIGIBILITY.REQ', 'MQSHCU01', 'NHFA.UNIT.EN05.BATCH.ELIGIBILITY.REQ', 'JMS']" )

createMQ: INFO --- MQ Queue NHFA.UNIT.EN05.BATCH.ELIGIBILITY.REQ is already configured at specified scope. Skipping the MQ Queue creation.

createMQ: Debug: createMQ( "wps02Node01(cells/ProcCell01/nodes/wps02Node01|node.xml#Node_1)", "NHFA.UNIT.EN05.BATCH.ELIGIBILITY.REQ.BKOUT", "['NHFA.UNIT.EN05.BATCH.ELIGIBILITY.REQ.BKOUT', 'MQSHCU01', 'NHFA.UNIT.EN05.BATCH.ELIGIBILITY.REQ.BKOUT', 'JMS']" )

createMQ: INFO --- MQ Queue NHFA.UNIT.EN05.BATCH.ELIGIBILITY.REQ.BKOUT is already configured at specified scope. Skipping the MQ Queue creation.

createMQ: Debug: createMQ( "wps02Node01(cells/ProcCell01/nodes/wps02Node01|node.xml#Node_1)", "NHFA.UNIT.EN05.BATCH.ENROLLMENT.REQ.BKOUT", "['NHFA.UNIT.EN05.BATCH.ENROLLMENT.REQ.BKOUT', 'MQSHCU01', 'NHFA.UNIT.EN05.BATCH.ENROLLMENT.REQ.BKOUT', 'JMS']" )

createMQ: INFO --- MQ Queue NHFA.UNIT.EN05.BATCH.ENROLLMENT.REQ.BKOUT is already configured at specified scope. Skipping the MQ Queue creation.

createMQ: Debug: createMQ( "wps02Node01(cells/ProcCell01/nodes/wps02Node01|node.xml#Node_1)", "NHFA.UNIT.EN05.BATCH.ENROLLMENT.REQUEST", "['NHFA.UNIT.EN05.BATCH.ENROLLMENT.REQUEST', 'MQSHCU01', 'NHFA.UNIT.EN05.BATCH.ENROLLMENT.REQUEST', 'JMS']" )

createMQ: INFO --- MQ Queue NHFA.UNIT.EN05.BATCH.ENROLLMENT.REQUEST is already configured at specified scope. Skipping the MQ Queue creation.

createMQ: Debug: createMQ( "wps02Node01(cells/ProcCell01/nodes/wps02Node01|node.xml#Node_1)", "NHFA.UNIT.EN05.BATCH.ENROLLMENT.RESP.BKOUT", "['NHFA.UNIT.EN05.BATCH.ENROLLMENT.RESP.BKOUT', 'MQSHCU01', 'NHFA.UNIT.EN05.BATCH.ENROLLMENT.RESP.BKOUT', 'JMS']" )

createMQ: INFO --- MQ Queue NHFA.UNIT.EN05.BATCH.ENROLLMENT.RESP.BKOUT is already configured at specified scope. Skipping the MQ Queue creation.

createMQ: Debug: createMQ( "wps02Node01(cells/ProcCell01/nodes/wps02Node01|node.xml#Node_1)", "NHFA.UNIT.EN05.BATCH.ENROLLMENT.RESPONSE", "['NHFA.UNIT.EN05.BATCH.ENROLLMENT.RESPONSE', 'MQSHCU01', 'NHFA.UNIT.EN05.BATCH.ENROLLMENT.RESPONSE', 'JMS']" )

createMQ: INFO --- MQ Queue NHFA.UNIT.EN05.BATCH.ENROLLMENT.RESPONSE is already configured at specified scope. Skipping the MQ Queue creation.

createMQ: Debug: createMQ( "wps02Node01(cells/ProcCell01/nodes/wps02Node01|node.xml#Node_1)", "NHFA.UNIT.EN05.BATCH.SWIPECARD.FFA", "['NHFA.UNIT.EN05.BATCH.SWIPECARD.FFA', 'MQSHCU01', 'NHFA.UNIT.EN05.BATCH.SWIPECARD.FFA', 'JMS']" )

createMQ: INFO --- MQ Queue NHFA.UNIT.EN05.BATCH.SWIPECARD.FFA is already configured at specified scope. Skipping the MQ Queue creation.

createMQ: Debug: createMQ( "wps02Node01(cells/ProcCell01/nodes/wps02Node01|node.xml#Node_1)", "NHFA.UNIT.EN05.BATCH.SWIPECARD.FFA.BKOUT", "['NHFA.UNIT.EN05.BATCH.SWIPECARD.FFA.BKOUT', 'MQSHCU01', 'NHFA.UNIT.EN05.BATCH.SWIPECARD.FFA.BKOUT', 'JMS']" )

createMQ: INFO --- MQ Queue NHFA.UNIT.EN05.BATCH.SWIPECARD.FFA.BKOUT is already configured at specified scope. Skipping the MQ Queue creation.

createMQ: Debug: createMQ( "wps02Node01(cells/ProcCell01/nodes/wps02Node01|node.xml#Node_1)", "NHFA.UNIT.EN05.BATCH.SWIPECARD.PROCESS", "['NHFA.UNIT.EN05.BATCH.SWIPECARD.PROCESS', 'MQSHCU01', 'NHFA.UNIT.EN05.BATCH.SWIPECARD.PROCESS', 'JMS']" )

createMQ: INFO --- MQ Queue NHFA.UNIT.EN05.BATCH.SWIPECARD.PROCESS is already configured at specified scope. Skipping the MQ Queue creation.

createMQ: Debug: createMQ( "wps02Node01(cells/ProcCell01/nodes/wps02Node01|node.xml#Node_1)", "NHFA.UNIT.EN05.BATCH.SWIPECARD.PROCESS.BKOUT", "['NHFA.UNIT.EN05.BATCH.SWIPECARD.PROCESS.BKOUT', 'MQSHCU01', 'NHFA.UNIT.EN05.BATCH.SWIPECARD.PROCESS.BKOUT', 'JMS']" )

createMQ: INFO --- MQ Queue NHFA.UNIT.EN05.BATCH.SWIPECARD.PROCESS.BKOUT is already configured at specified scope. Skipping the MQ Queue creation.

createMQ: Debug: createMQ( "wps02Node01(cells/ProcCell01/nodes/wps02Node01|node.xml#Node_1)", "NHFA.UNIT.EN05.CNTYPMT.REQ", "['NHFA.UNIT.EN05.CNTYPMT.REQ', 'MQSHCU01', 'NHFA.UNIT.EN05.CNTYPMT.REQ', 'JMS']" )

createMQ: INFO --- MQ Queue NHFA.UNIT.EN05.CNTYPMT.REQ is already configured at specified scope. Skipping the MQ Queue creation.

createMQ: Debug: createMQ( "wps02Node01(cells/ProcCell01/nodes/wps02Node01|node.xml#Node_1)", "NHFA.UNIT.EN05.CNTYPMT.REQ.BKOUT", "['NHFA.UNIT.EN05.CNTYPMT.REQ.BKOUT', 'MQSHCU01', 'NHFA.UNIT.EN05.CNTYPMT.REQ.BKOUT', 'JMS']" )

createMQ: INFO --- MQ Queue NHFA.UNIT.EN05.CNTYPMT.REQ.BKOUT is already configured at specified scope. Skipping the MQ Queue creation.

createMQ: Debug: createMQ( "wps02Node01(cells/ProcCell01/nodes/wps02Node01|node.xml#Node_1)", "NHFA.UNIT.EN05.CNTYPMT.RSP", "['NHFA.UNIT.EN05.CNTYPMT.RSP', 'MQSHCU01', 'NHFA.UNIT.EN05.CNTYPMT.RSP', 'JMS']" )

createMQ: INFO --- MQ Queue NHFA.UNIT.EN05.CNTYPMT.RSP is already configured at specified scope. Skipping the MQ Queue creation.

createMQ: Debug: createMQ( "wps02Node01(cells/ProcCell01/nodes/wps02Node01|node.xml#Node_1)", "NHFA.UNIT.EN05.CNTYPMT.RSP.BKOUT", "['NHFA.UNIT.EN05.CNTYPMT.RSP.BKOUT', 'MQSHCU01', 'NHFA.UNIT.EN05.CNTYPMT.RSP.BKOUT', 'JMS']" )

createMQ: INFO --- MQ Queue NHFA.UNIT.EN05.CNTYPMT.RSP.BKOUT is already configured at specified scope. Skipping the MQ Queue creation.

createMQ: Debug: createMQ( "wps02Node01(cells/ProcCell01/nodes/wps02Node01|node.xml#Node_1)", "NHFA.UNIT.EN05.COBILL.ITEMS.REQ", "['NHFA.UNIT.EN05.COBILL.ITEMS.REQ', 'MQSHCU01', 'NHFA.UNIT.EN05.COBILL.ITEMS.REQ', 'JMS']" )

createMQ: INFO --- MQ Queue NHFA.UNIT.EN05.COBILL.ITEMS.REQ is already configured at specified scope. Skipping the MQ Queue creation.

createMQ: Debug: createMQ( "wps02Node01(cells/ProcCell01/nodes/wps02Node01|node.xml#Node_1)", "NHFA.UNIT.EN05.COBILL.ITEMS.REQ.BKOUT", "['NHFA.UNIT.EN05.COBILL.ITEMS.REQ.BKOUT', 'MQSHCU01', 'NHFA.UNIT.EN05.COBILL.ITEMS.REQ.BKOUT', 'JMS']" )

createMQ: INFO --- MQ Queue NHFA.UNIT.EN05.COBILL.ITEMS.REQ.BKOUT is already configured at specified scope. Skipping the MQ Queue creation.

createMQ: Debug: createMQ( "wps02Node01(cells/ProcCell01/nodes/wps02Node01|node.xml#Node_1)", "NHFA.UNIT.EN05.COBILL.ITEMS.RSP", "['NHFA.UNIT.EN05.COBILL.ITEMS.RSP', 'MQSHCU01', 'NHFA.UNIT.EN05.COBILL.ITEMS.RSP', 'JMS']" )

createMQ: INFO --- MQ Queue NHFA.UNIT.EN05.COBILL.ITEMS.RSP is already configured at specified scope. Skipping the MQ Queue creation.

createMQ: Debug: createMQ( "wps02Node01(cells/ProcCell01/nodes/wps02Node01|node.xml#Node_1)", "NHFA.UNIT.EN05.COBILL.ITEMS.RSP.BKOUT", "['NHFA.UNIT.EN05.COBILL.ITEMS.RSP.BKOUT', 'MQSHCU01', 'NHFA.UNIT.EN05.COBILL.ITEMS.RSP.BKOUT', 'JMS']" )

0
 
HonorGodSoftware EngineerCommented:
revised to provide information about previously configured resource of the specified name:
createMQ.py
0
 
k_satish22Author Commented:
Thank you oncea agin for helping me out. Now I am getting below error.

createMQ: Debug: createMQ( "ProcCell01(cells/ProcCell01|cell.xml#Cell_1)", "NHFA.SYST.EN57.BATCH.ELIGIBILITY.REQ", "['NHFA.UNIT.BATCH.ELIGIBILITY.REQ', 'MQSHCS01', 'NHFA.SYST.EN57.BATCH.ELIGIBILITY.REQ', 'JMS']" )
WASX7017E: Exception received while running file "/opt/app/IBM/WebSphere/ACSProject/createMQ.py"; exception information: java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: WASX7480E: """ found instead of expected [.
Attribute= had invalid value= for input parameter=['name' 'NHFA.SYST.EN57.BATCH.ELIGIBILITY.REQ'] ['jndiName' 'NHFA.UNIT.BATCH.ELIGIBILITY.REQ'] ['baseQueueName' 'NHFA.SYST.EN57.BATCH.ELIGIBILITY.REQ'] ['targetClient' 'JMS'] ['baseQueueManagerName' 'MQSHCS01'] "customProperties" [['MDREAD' 'YES'] ['MDMSGCTX' 'SET_ALL_CONTEXT'] ['MSGBODYMQ']]
 
0
 
HonorGodSoftware EngineerCommented:
If we display the attributes for an MQQueue, we see the following:

So I don't see where the "customProperties" you identified should exist...
.                      CCSID int                                                                      
.       baseQueueManagerName String                                                                   
.              baseQueueName String                                                                   
.                   category String                                                                   
.            decimalEncoding ENUM(Normal, Reversed)                                                   
.                description String                                                                   
.                     expiry ENUM(APPLICATION_DEFINED, SPECIFIED, UNLIMITED)                          
.      floatingPointEncoding ENUM(IEEENormal, IEEEReversed, S390)                                     
.            integerEncoding ENUM(Normal, Reversed)                                                   
.                   jndiName String                                                                   
.                       name String                                                                   
.                   password String                                                                   
.                persistence ENUM(APPLICATION_DEFINED, HIGH, NONPERSISTENT, PERSISTENT, QUEUE_DEFINED)
.                   priority ENUM(APPLICATION_DEFINED, SPECIFIED, QUEUE_DEFINED)                      
.                propertySet J2EEResourcePropertySet                                                  
.                   provider J2EEResourceProvider@                                                    
.               providerType String                                                                   
.           queueManagerHost String                                                                   
.           queueManagerPort int                                                                      
.                  readAhead ENUM(QUEUE_DEFINED, YES, NO)                                             
.             readAheadClose ENUM(DELIVERCURRENT, DELIVERALL)                                         
.                  sendAsync ENUM(QUEUE_DEFINED, YES, NO)                                             
.serverConnectionChannelName String                                                                   
.            specifiedExpiry long                                                                     
.          specifiedPriority int                                                                      
.               targetClient ENUM(JMS, MQ)                                                            
.          useNativeEncoding boolean                                                                  
.                   userName String

Open in new window

0
 
k_satish22Author Commented:
If we us wsadmin command intractivly we can see that option.  
Below command is working fine for me,

AdminTask.createWMQQueue('Proc1(cells/Proc1|cell.xml)', '[-name Queue1 -jndiName Queue1 -queueName Queue1 -qmgr QMGR1 -description -customProperties [[MDREAD YES] [MDMSGCTX SET_ALL_CONTEXT] [MSGBODY MQ]]]')
0
 
HonorGodSoftware EngineerCommented:
Ah, that's the problem!

Here, try this one. (I hope you don't have Triskaidekaphobia ;-)
createMQ.py
0
 
k_satish22Author Commented:
Still getting the same error.....
wasadmin@env5_dmgr1:bin$ ./wsadmin.sh -lang jython -f createMQ.py createMQ.txt
WASX7209I: Connected to process "dmgr" on node dmgr1ProcNode01 using SOAP connector;  The type of process is: DeploymentManager
WASX7303I: The following options are passed to the scripting environment and are available as arguments that are stored in the argv variable: "[createMQ.txt]"
argc: 1

createMQ: INFO --- Enter main()

createMQ: INFO --- Enter Properties() - load from Properties file

createMQ: INFO --- Exit  Properties()

createMQ: Debug  Scope( "Node" ) == wps02Node01(cells/ProcCell01/nodes/wps02Node01|node.xml#Node_1)

createMQ: Debug: createMQ( "wps02Node01(cells/ProcCell01/nodes/wps02Node01|node.xml#Node_1)", "NHFA.UNIT.EN05.BATCH.ELIGIBILITY.REQ", "['NHFA.UNIT.EN05.BATCH.ELIGIBILITY.REQ', 'MQSHCU01', 'NHFA.UNIT.EN05.BATCH.ELIGIBILITY.REQ', 'JMS']" )
WASX7017E: Exception received while running file "createMQ.py"; exception information: java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: WASX7480E: "-customProperties" found instead of expected [.
Attribute= had invalid value= for input parameter=['name' 'NHFA.UNIT.EN05.BATCH.ELIGIBILITY.REQ'] ['jndiName' 'NHFA.UNIT.EN05.BATCH.ELIGIBILITY.REQ'] ['baseQueueName' 'NHFA.UNIT.EN05.BATCH.ELIGIBILITY.REQ'] ['targetClient' 'JMS'] ['baseQueueManagerName' 'MQSHCU01'] -customProperties  [['MDREAD' 'YES'] ['MDMSGCTX' 'SET_ALL_CONTEXT'] ['MSGBODYMQ']]

0
 
HonorGodSoftware EngineerCommented:
ooh. I missed something.

Note how your "example" uses the AdminTask.createWMQQueue() method, instead of the AdminConfig.createUsingTemplate() one.

Can we change the input (properties) file format from this:

--------------------------------------------------------------------------------
Property:Value=Sample1:queue/sample1,INKMW00,NKM.ACQUISITION.WAS,JMS
Property:Value=Sample2:queue/sample2,INKMW00,NKM.ACQUISITION.WAS,JMS
Property:Value=Sample3:queue/sample3,INKMW00,NKM.ACQUISITION.WAS,JMS
--------------------------------------------------------------------------------

Which maps to

--------------------------------------------------------------------------------
Property:Value=<Qname>:<jndiname>,<qManager>,<bqname>,<tclient>
--------------------------------------------------------------------------------

To something that more closely matches the AdminTask.createWMQQueue() arguments?
Perhaps something like:

--------------------------------------------------------------------------------
Property:Value=<Name>:<jndiname>,<Qname>,<Qmgr>,<Persistence>,<Priority>,<Expiry>
--------------------------------------------------------------------------------

Please let me know.

Thanks!
0
 
HonorGodSoftware EngineerCommented:
Just in case you need it, here's the link to the Information Center to the AdminTask.createWMQQueue() method:

http://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=/com.ibm.websphere.express.doc/info/exp/ae/rmj_wmq_jmswmqq_create.html
0
 
k_satish22Author Commented:
Changing properties file is not a problem. Please let me know which one to use.
0
 
HonorGodSoftware EngineerCommented:
Use the link shown above, and you tell me the ones you want/need.  Most are optional.
0
 
k_satish22Author Commented:
I need -
Name,
JNDI
QMGR
QUEUE
type
and -customproperties

0
 
k_satish22Author Commented:
Any luck with the script ?
0
 
k_satish22Author Commented:
I thinks to set the custom properties is the limitation in using template. I found this info in below link.http://www.ibm.com/developerworks/forums/thread.jspa?messageID=14586071
0
 
HonorGodSoftware EngineerCommented:
hm..

To which AdminTask.createWMQQueu() parameter does the "type" mentioned above refer?
Name             = -name      : Required parm, ok
JNDI             = -jndiName  : Required parm, ok
QMGR             = -qmgr      : Optional parm, ok
QUEUE            = -queueName : Optional parm, ok
type             = This, I don't understand
-customproperties ... ok

Open in new window

0
 
k_satish22Author Commented:
type = targetClient ENUM(JMS, MQ)  
0
 
k_satish22Author Commented:
You can ignore it. Let us take it out.
0
 
k_satish22Author Commented:
I desperately need this script today. I need to meet my dead lines today. I am really sorry for the rush. Your help is highly appreciated.
0
 
HonorGodSoftware EngineerCommented:
ok, so the values after Property:Value should be:

Name,JNDI,QMGR,Queue

which relate to the corresponding arguments, as documented on this page of the Information Center: http://goo.gl/XCn5e
Name  = -name      : Required parm, ok
JNDI  = -jndiName  : Required parm, ok
QMGR  = -qmgr      : Optional parm, ok
QUEUE = -queueName : Optional parm, ok

Open in new window

createMQ.py
0
 
HonorGodSoftware EngineerCommented:
Let me know, ASAP, if it doesn't work for you.  Thanks!
0
 
k_satish22Author Commented:
Just came for lunch. Please give me 20 minutes. Thank you so much for your quick response.
0
 
k_satish22Author Commented:
Getting below error:

./wsadmin.sh -lang jython -port 28879 -username wpsbind -password passw0rd -f  createMQ_new.py MQ_input.txt
WASX7209I: Connected to process "dmgr" on node dmgr1ProcNode01 using SOAP connector;  The type of process is: DeploymentManager
WASX7303I: The following options are passed to the scripting environment and are available as arguments that are stored in the argv variable: "[MQ_input.txt]"
WASX7017E: Exception received while running file "createMQ_new.py"; exception information: com.ibm.bsf.BSFException: exception from Jython:
Traceback (innermost last):
  (no code object) at line 0
  File "<string>", line 81
            print 'qname, roles:', qname, roles print '-' * 50
                                                ^
SyntaxError: invalid syntax
0
 
HonorGodSoftware EngineerCommented:
Somehow 2 lines got joined...
createMQ.py
0
 
k_satish22Author Commented:
Now I am getting this error...
wasadmin@env57_dmgr1:bin$ ./wsadmin.sh -lang jython -port 28879 -username wpsbind -password passw0rd -f  createMQ_new2.py MQ_input.txt
WASX7209I: Connected to process "dmgr" on node dmgr1ProcNode01 using SOAP connector;  The type of process is: DeploymentManager
WASX7303I: The following options are passed to the scripting environment and are available as arguments that are stored in the argv variable: "[MQ_input.txt]"
argc: 1

createMQ: INFO --- Enter main()

createMQ: INFO --- Enter Properties() - load from Properties file
WASX7017E: Exception received while running file "createMQ_new2.py"; exception information: com.ibm.bsf.BSFException: exception from Jython:
Traceback (innermost last):
  File "<string>", line 289, in ?
  File "<string>", line 147, in main
  File "<string>", line 54, in Properties
ValueError: unpack sequence too short
0
 
HonorGodSoftware EngineerCommented:
argh...

Please attach your properties (input) file.
0
 
k_satish22Author Commented:
0
 
HonorGodSoftware EngineerCommented:
Why does your Property:Value have 5 (comma separated) values?

Previously, you had the Queue Name (1st parm) delimited by a ':'

Property:Value=Queue1:Queue1,QMG1,Queue1,JMS, YES, SET_ALL_CONTEXT, MQ

Do you want all of the stuff after "Property:Value=" comma separated?
NHFA.SYST.EN57.BATCH.ELIGIBILITY.REQ_satish
NHFA.UNIT.BATCH.ELIGIBILITY.REQ_satish
MQSHCS01
NHFA.SYST.EN57.BATCH.ELIGIBILITY.REQ
JMS

Open in new window

0
 
k_satish22Author Commented:
As per your comment  at 04/11/11 09:39 AM, ID: 35367917 I have change my properties.

Now I have changed it back to ":"After changing it I am gettting below error.

./wsadmin.sh -lang jython -port 28879 -username wpsbind -password passw0rd -f  createMQ_new2.py MQ_input.txt
WASX7209I: Connected to process "dmgr" on node dmgr1ProcNode01 using SOAP connector;  The type of process is: DeploymentManager
WASX7303I: The following options are passed to the scripting environment and are available as arguments that are stored in the argv variable: "[MQ_input.txt]"
argc: 1

createMQ: INFO --- Enter main()

createMQ: INFO --- Enter Properties() - load from Properties file

createMQ: INFO --- Exit  Properties()

createMQ: Debug  Scope( "Cell" ) == ProcCell01(cells/ProcCell01|cell.xml#Cell_1)

createMQ: Debug: createMQ( "ProcCell01(cells/ProcCell01|cell.xml#Cell_1)", "NHFA.SYST.EN57.BATCH.ELIGIBILITY.REQ_satish", "['NHFA.UNIT.BATCH.ELIGIBILITY.REQ_satish', 'MQSHCS01', 'NHFA.SYST.EN57.BATCH.ELIGIBILITY.REQ', 'JMS']" )

createMQ: ERROR --- Unexpected roles specified: ['NHFA.UNIT.BATCH.ELIGIBILITY.REQ_satish', 'MQSHCS01', 'NHFA.SYST.EN57.BATCH.ELIGIBILITY.REQ', 'JMS']

createMQ: INFO --- Saving configuration changes.

createMQ: Enter SynchNodes().

createMQ: ERROR --- Unable to synchronise with node dmgr1ProcNode01. Nodeagent appears inactive.

createMQ: SUCCESS --- Synchronization successfull with Node wps01Node01

createMQ: SUCCESS --- Synchronization successfull with Node wps02Node01

createMQ: Exit  SynchNodes().

createMQ: INFO --- Exit  main(), 1 error(s) encountered.
0
 
HonorGodSoftware EngineerCommented:
ok, what does your input file look like now, and what to the values after Property:Value= represent?
0
 
k_satish22Author Commented:
Property:Value=NHFA.SYST.EN57.BATCH.ELIGIBILITY.REQ_satish:NHFA.UNIT.BATCH.ELIGIBILITY.REQ_satish,MQSHCS01,NHFA.SYST.EN57.BATCH.ELIGIBILITY.REQ,JMS
0
 
HonorGodSoftware EngineerCommented:
ok, that answers the 1st part of the question, but not the second...

From that:
Name  = -name      : NHFA.SYST.EN57.BATCH.ELIGIBILITY.REQ_satish
JNDI  = -jndiName  : NHFA.UNIT.BATCH.ELIGIBILITY.REQ_satish
QMGR  = -qmgr      : MQSHCS01
QUEUE = -queueName : NHFA.SYST.EN57.BATCH.ELIGIBILITY.REQ


What, is this? JMS

Open in new window

0
 
k_satish22Author Commented:
type = targetClient ENUM(JMS, MQ) which ignored. I have removed JMS and tried it again I am getting below error. I think we are still using MQ template to create the queue destination.  custom properties is the limitation in using template. I think we can not set custom properties using the MQ template. I am not sure.

./wsadmin.sh -lang jython -port 28879 -username wpsbind -password passw0rd -f  createMQ_new2.py MQ_input.txt
WASX7209I: Connected to process "dmgr" on node dmgr1ProcNode01 using SOAP connector;  The type of process is: DeploymentManager
WASX7303I: The following options are passed to the scripting environment and are available as arguments that are stored in the argv variable: "[MQ_input.txt]"
argc: 1

createMQ: INFO --- Enter main()

createMQ: INFO --- Enter Properties() - load from Properties file

createMQ: INFO --- Exit  Properties()

createMQ: Debug  Scope( "Cell" ) == ProcCell01(cells/ProcCell01|cell.xml#Cell_1)

createMQ: Debug: createMQ( "ProcCell01(cells/ProcCell01|cell.xml#Cell_1)", "NHFA.SYST.EN57.BATCH.ELIGIBILITY.REQ_satish", "['NHFA.UNIT.BATCH.ELIGIBILITY.REQ_satish', 'MQSHCS01', 'NHFA.SYST.EN57.BATCH.ELIGIBILITY.REQ']" )
WASX7017E: Exception received while running file "createMQ_new2.py"; exception information: java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: WASX7480E: "-customProperties" found instead of expected [.
Attribute= had invalid value= for input parameter=['name' 'NHFA.SYST.EN57.BATCH.ELIGIBILITY.REQ_satish'] ['jndiName' 'NHFA.UNIT.BATCH.ELIGIBILITY.REQ_satish'] ['baseQueueName' 'MQSHCS01'] ['baseQueueManagerName' 'NHFA.SYST.EN57.BATCH.ELIGIBILITY.REQ'] -customProperties  [['MDREAD' 'YES'] ['MDMSGCTX' 'SET_ALL_CONTEXT'] ['MSGBODYMQ']]
0
 
k_satish22Author Commented:
sorry for the typo -- type = targetClient ENUM(JMS, MQ) which can be ignored/removed
0
 
HonorGodSoftware EngineerCommented:
You are absolutely right.  Please accept my apologies.
I was rushed, and didn't check my work as completely as I should have
createMQ.py
0
 
k_satish22Author Commented:
Now I am getting this error.

wasadmin@env5_dmgr1:bin$ ./wsadmin.sh -lang jython -f createMQ_new3.py createMQ.txt
WASX7209I: Connected to process "dmgr" on node dmgr1ProcNode01 using SOAP connector;  The type of process is: DeploymentManager
WASX7303I: The following options are passed to the scripting environment and are available as arguments that are stored in the argv variable: "[createMQ.txt]"
argc: 1

createMQ: INFO --- Enter main()

createMQ: INFO --- Enter Properties() - load from Properties file

createMQ: INFO --- Exit  Properties()

createMQ: Debug  Scope( "Cell" ) == ProcCell01(cells/ProcCell01|cell.xml#Cell_1)

createMQ: Debug: createMQ( "ProcCell01(cells/ProcCell01|cell.xml#Cell_1)", "NHFA.UNIT.EN05.BATCH.12", "['NHFA.UNIT.BATCH12', 'MQSHCU01', 'NHFA.UNIT.EN05.BATCH.REQ']" )
WASX7017E: Exception received while running file "createMQ_new3.py"; exception information: java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: WASX7122E: Expected "-"  not found.
[['name' 'NHFA.UNIT.EN05.BATCH.12'] ['jndiName' 'NHFA.UNIT.BATCH12'] ['baseQueueName' 'MQSHCU01'] ['baseQueueManagerName' 'NHFA.UNIT.EN05.BATCH.REQ'] -customProperties  [['MDREAD' 'YES'] ['MDMSGCTX' 'SET_ALL_CONTEXT'] ['MSGBODYMQ']] ]
^
0
 
HonorGodSoftware EngineerCommented:
This should fix that error.
I am so sorry for the number of errors.
createMQ.py
0
 
k_satish22Author Commented:
still same error......

wasadmin@env5_dmgr1:bin$ ./wsadmin.sh -lang jython -f createMQ_new4.py createMQ.txt
WASX7209I: Connected to process "dmgr" on node dmgr1ProcNode01 using SOAP connector;  The type of process is: DeploymentManager
WASX7303I: The following options are passed to the scripting environment and are available as arguments that are stored in the argv variable: "[createMQ.txt]"
argc: 1

createMQ: INFO --- Enter main()

createMQ: INFO --- Enter Properties() - load from Properties file

createMQ: INFO --- Exit  Properties()

createMQ: Debug  Scope( "Cell" ) == ProcCell01(cells/ProcCell01|cell.xml#Cell_1)

createMQ: Debug: createMQ( "ProcCell01(cells/ProcCell01|cell.xml#Cell_1)", "NHFA.SYST.EN57.BATCH.ELIGIBILITY.REQ.BKOUT", "['NHFA.SYST.EN57.BATCH.ELIGIBILITY.REQ.BKOUT', 'MQSHCU01', 'NHFA.SYST.EN57.BATCH.ELIGIBILITY.REQ.BKOUT']" )
WASX7017E: Exception received while running file "createMQ_new4.py"; exception information: java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: WASX7122E: Expected "-"  not found.
[['-name' 'NHFA.SYST.EN57.BATCH.ELIGIBILITY.REQ.BKOUT'] ['-jndiName' 'NHFA.SYST.EN57.BATCH.ELIGIBILITY.REQ.BKOUT'] ['-baseQueueName' 'MQSHCU01'] ['-baseQueueManagerName' 'NHFA.SYST.EN57.BATCH.ELIGIBILITY.REQ.BKOUT'] -customProperties  [['MDREAD' 'YES'] ['MDMSGCTX' 'SET_ALL_CONTEXT'] ['MSGBODYMQ']] ]
^
0
 
HonorGodSoftware EngineerCommented:
I don't understand that error message.  It makes no sense.  When I used the '-interactive' option to step through the generation of the AdminTask.createWMQQueue() command the "generated" command looked like this:

ooh... wait a minute.

Alright, here's what I've done.
I've modified the createMQ() function, as well as the expected parameters from the properties file!!!

Here's a sample test of the routine from an interactive wsadmin session:

Things to note:
* The 1st value from the Properties file between the "=" and the ":" is the:

The administrative name assigned to this WebSphere MQ messaging provider queue type destination.

* The value after the ":" is the jndiName
* The value after the 1st comma is the queueName
* The value after the 2nd (last) comma is the qMgr
wsadmin>from cre8 import createMQ
wsadmin>cell = AdminConfig.list( 'Cell' )
wsadmin>createMQ( cell, 'myProvider', [ 'jndiName', 'queueName', 'qMgr' ] )

createMQ Debug: AdminTask.createWMQQueue( "ragweedCell02(cells/ragweedCell02|cell.xml#Cell_1)", "-name myProvider -jndiName jndi
Name -queueName queueName -customProperties [[MDREAD yes] [MDMSGCTX SET_ALL_CONTEXT] [MSGBODY MQ]]" )

createMQ: SUCCESS ---Created the Queue queueName at specified scope
0

Open in new window

AdminTask.createWMQQueue( scopeID, '[-name myQueue -jndiName  JNDIname -queueName queueName -customProperties [ [ MDREAD yes] [ MDMSGCTX SET_ALL_CONTEXT] [ MSGBODY MQ ] ] ]' )

Open in new window

createMQ.py
0
 
k_satish22Author Commented:
Now the issue is the not taking Qmgr value. In place of Queue Name it is talking Qmgr Name from the properties file. Please check the output below.

Values in properties file:
Property:Value=Nam:jndi,QMGR,Queue
Property:Value=NHFA.SYST.EN57.BATCH.ELIGIBILITY.REQ.BKOUT:NHFA.SYST.EN57.BATCH.ELIGIBILITY.REQ.BKOUT,MQSHCU01,NHFA.SYST.EN57.BATCH.ELIGIBILITY.REQ.BKOUT


 ./wsadmin.sh -lang jython -f createMQ_new5.py createMQ.txt
WASX7209I: Connected to process "dmgr" on node dmgr1ProcNode01 using SOAP connector;  The type of process is: DeploymentManager
WASX7303I: The following options are passed to the scripting environment and are available as arguments that are stored in the argv variable: "[createMQ.txt]"
argc: 1

createMQ: INFO --- Enter main()

createMQ: INFO --- Enter Properties() - load from Properties file

createMQ: INFO --- Exit  Properties()

createMQ: Debug  Scope( "Cell" ) == ProcCell01(cells/ProcCell01|cell.xml#Cell_1)

createMQ: Debug: createMQ( "ProcCell01(cells/ProcCell01|cell.xml#Cell_1)", "NHFA.SYST.EN57.BATCH.ELIGIBILITY.REQ.BKOUT", "['NHFA.SYST.EN57.BATCH.ELIGIBILITY.REQ.BKOUT', 'MQSHCU01', 'NHFA.SYST.EN57.BATCH.ELIGIBILITY.REQ.BKOUT']" )

createMQ Debug: AdminTask.createWMQQueue( "ProcCell01(cells/ProcCell01|cell.xml#Cell_1)", "-name NHFA.SYST.EN57.BATCH.ELIGIBILITY.REQ.BKOUT -jndiName NHFA.SYST.EN57.BATCH.ELIGIBILITY.REQ.BKOUT -queueName MQSHCU01 -customProperties [[MDREAD yes] [MDMSGCTX SET_ALL_CONTEXT] [MSGBODY MQ]]" )

createMQ: SUCCESS ---Created the Queue MQSHCU01 at specified scope

createMQ: INFO --- Saving configuration changes.

createMQ: Enter SynchNodes().

createMQ: ERROR --- Unable to synchronise with node dmgr1ProcNode01. Nodeagent appears inactive.

createMQ: SUCCESS --- Synchronization successfull with Node wps01Node01

createMQ: SUCCESS --- Synchronization successfull with Node wps02Node01

createMQ: Exit  SynchNodes().

createMQ: INFO --- Exit  main(), 0 error(s) encountered.
0
 
HonorGodSoftware EngineerCommented:
0
 
k_satish22Author Commented:
The script is working fine. But in place of QueueName it is taking qmgr and viceversa. Do I need to check the the values in properties file or it can be fixed in the code?
0
 
HonorGodSoftware EngineerCommented:
Are you saying that the order isn't what you expect?

The code is expecting:

Do you need that changed?
Property:Value=name:jndiName,qName,qMgr

Open in new window

0
 
k_satish22Author Commented:
No. I am just check whether the order can be chaged to Property:Value=Name:JNDI,QmgrName,QueueName
Not a problem. I have changed the values to
Property:Value=name:jndiName,qName,qMgr

Now the script is working absolutely fine. Thank you so much for you help. I am doing testing now. I will let you know the result by tomorrow.

0
 
HonorGodSoftware EngineerCommented:
ok, this version expects the Property values to be in this order:

Property:Value=name:jndiName,qName,qMgr

Use whichever version you prefer.

I really appreciate your patience, and willingness to continue working with me on this.
Thanks
createMQ.py
0
 
k_satish22Author Commented:
I am sorry for delayed response. I want out of country for few weeks.  Now the script is work fine. Thank you so much. I really appreciate it.
0
 
HonorGodSoftware EngineerCommented:
Super.  I'm glad to hear it.  I hope that you had a safe trip.

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

  • 57
  • 54
Tackle projects and never again get stuck behind a technical roadblock.
Join Now