Search code examples
webspherejythonibm-mq

WebSphere Jython createWMQConnectionFactory NullPointerException with -connectionNameList option


According to the IBM docs, below is the proper way to script a Queue Connection Factory using Jython. However, whenever the -connectionNameList option is added, I'm getting a NullPointerError. If I remove -connectionNameList, or if I put an empty string in place of the hostnames, the errors go away.

We're using WebSphere 8.5.5.9

This is line 335 (I replaced the hostnames):

 AdminTask.createWMQConnectionFactory(scopeID,'[-type QCF -name someQCF -jndiName jms/someCF -wmqTransportType BINDINGS_THEN_CLIENT -qmgrSvrconnChannel SYSTEM.DEF.SVRCONN -qmgrHostname -connectionNameList host(1234),host(1234) ]')

And the error:

Exception caught during execution:
type <java function type at 613319364>
value com.ibm.ws.scripting.ScriptingException: java.lang.NullPointerException: java.lang.NullPointerException

tb Traceback (innermost last):
  File "<string>", line 383, in install_server
  File "<string>", line 335, in createWMQConnectionFactory

Update: These commands work when ran directly from the wsadmin> prompt. However, when ran from a python script using jython, they do not and instead return the NullPointerException as displayed above.


Solution

  • I resolved my issue.

    A script I had been given to run this had the

    -conntype NONE
    

    option set on ./wsadmin.sh

    I removed that and it works now. It's very strange that the option only affected that one function.