mre
mre

Reputation: 113

WebSphere wsadmin script to create custom properties for JMS provider

I have created a custom JMS provider in WebSphere 8. Now I want to add custom properties to this JMS provider, but the usual procedure does not work.

I created the JMS provider with the following commands (Jython):

server = AdminConfig.getid('/Cell:cell/Node:node0/Server:appserver/')
jms_provider = AdminConfig.create('JMSProvider', server, '[[name "ActiveMQ"] [externalInitialContextFactory "org.apache.activemq.jndi.ActiveMQWASInitialContextFactory"] [externalProviderURL "tcp://10.1.1.1:61616"]]')

Usually, I would get a custom property set in order to popultate it, but I just get "None":

wsadmin> print(AdminConfig.showAttribute(jms_provider, 'propertySet'))
(None)

Creating a new one does not work either:

wsadmin> AdminConfig.create('J2EEResourceProperty', jms_provider, [])

WASX7015E: Exception running command: "AdminConfig.create('J2EEResourceProperty', jms_provider, [])"; exception information:
 com.ibm.ws.scripting.ScriptingException: WASX7129E: Cannot create objects of type "J2EEResourceProperty" in parents of type "JMSProvider"

How can I create the initial property set for a JMS provider?

Upvotes: 0

Views: 1353

Answers (1)

mre
mre

Reputation: 113

Solution was to create a J2EEResourcePropertySet instead of a J2EEResourceProperty:

props = AdminConfig.create('J2EEResourcePropertySet', jms_provider, [])
AdminConfig.create('J2EEResourceProperty', props, '[[name "java.naming.queue.Queue1"] [value "Queue1"]]')

Upvotes: 1

Related Questions