0

I am trying to create JMSQueue with following code but getting error on

cd ('/JMSSystemResources/BAMJMSSystemResource/JMSResource/BAMJMSSystemResource/Queues/SampleQueue') 

When I connected to server runtimeand check I can see JMS Module is not available, but from Admin Console I can clearly see it's (JMS Module BAMJMSSystemResource) available, also it's not giving errors for

Note : I am creating JMS module before calling createJMSQueue function )

def createJMSQueue(jmsQueueName, jmsModuleName, jndiName, subdeployment): print ' Creating Queue '+jmsQueueName cd('/') cd("/JMSSystemResources/"+jmsModuleName+"/JMSResource/"+jmsModuleName) cmo.createQueue(jmsQueueName) print('DEBUG >> '+jmsModulePath+'/Queues/'+jmsQueueName) cd("/JMSSystemResources/"+jmsModuleName+"/JMSResource/"+jmsModuleName+'/Queues/'+jmsQueueName) set('JNDIName',jndiName) set('SubDeploymentName',subdeployment) cd('/JMSSystemResources/'+jmsModuleName+'/SubDeployments/'+subdeployment) cmo.addTarget(getMBean('/JMSServers/BAMMonitoringServer')) 

Error is ,

Starting an edit session ... Started edit session, please be sure to save and activate your changes once you are done. *** Creating JMS Queues .... Creating Queue SampleQueue DEBUG >> JMSSystemResources/BAMJMSSystemResource/JMSResource/BAMJMSSystemResource/Queues/SampleQueue No stack trace available. Problem invoking WLST - Traceback (innermost last): File "/home/oracle/JMSConfigurations.py", line 188, in ? File "/home/oracle/JMSConfigurations.py", line 77, in createJMSQueue File "<iostream>", line 182, in cd File "<iostream>", line 1847, in raiseWLSTException WLSTException: Error cding to the MBean 

Would really like to understand what's wrong ?

5 Answers 5

0

Shanaka, there could be problem in 'cd' command given after the DEBUG statement. You can give the cd line as below:

cd(jmsModulePath+'/Queues/'+jmsQueueName) 

You can also get some more clarity on JMS module creation using WLST by Examples

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks Pavan, I went through you example. but path looks like ok, that is why I am printing to see path is correct or not ( from DEBUG). Other point I am wondering is by JMS module is not available on MBean Tree as well ?
0

This section of script looks fine except mix of double and single quote in " cd("/JMSSystemResources/"+jmsModuleName+"/JMSResource/"+jmsModuleName+'/Queues/'+jmsQueueName)" and assigning target "cmo.addTarget()" , you dont need to target queue if sub-deployment is already targeted to JMS server. You can check if your edit session of creating JMS module,Sub deployment, target JMS module to server and sub deployment to JMS server is activated successfully. Then this Queue creation should work fine.

regards, Kshitij

Comments

0

That can mean that the JMS you are trying to create already exists in WebLogic. Confirm that the JMS names are not existing ones.

Comments

0

I share with you my correct code:

def create_jms_object(name, module, subdeployment, type): cd('/JMSSystemResources/'+module+'/JMSResource/'+module) myob=create(name, type) myob.setJNDIName("jms/"+name) myob.setSubDeploymentName(subdeployment) 

and I call the function here:

queue_name = queue['name'] sub_depl_name = queue['sub_deployment'] if(not_exists_jms_ud_qeue(jms_module_name, queue_name)): print 'Creating queue '+queue_name create_jms_object(queue_name, jms_module_name, sub_depl_name, 'UniformDistributedQueue') print 'Created queue '+queue_name else: print 'UniformDistributedQueue ' + queue_name + ' already exists' cmo = cd('/JMSSystemResources/'+jms_module_name+'/JMSResource/'+jms_module_name+'/UniformDistributedQueues/'+queue_name+'/DeliveryFailureParams/'+queue_name) redelivery_limit = queue.get('redelivery_limit',-1) set('RedeliveryLimit', redelivery_limit) errorDestinationName = queue.get('error_destination', None) if (errorDestinationName is not None): errorDestination = getMBean('/JMSSystemResources/'+jms_module_name+'/JMSResource/'+jms_module_name+'/UniformDistributedQueues/'+errorDestinationName) set('ErrorDestination', errorDestination) print 'Dead letter queue set to: '+errorDestinationName else: cmo.unSet('ErrorDestination') print 'Dead letter queue unset' cd('/JMSSystemResources/'+jms_module_name+'/JMSResource/'+jms_module_name+'/UniformDistributedQueues/'+queue_name+'/DeliveryParamsOverrides/'+queue_name) redelivery_delay = queue.get('redelivery_delay',-1) set('RedeliveryDelay', redelivery_delay) time_to_deliver = queue.get('time_to_deliver',-1) set('TimeToDeliver', time_to_deliver) 

where the queue object is the following:

{ "name" : "events_reg_queue", "sub_deployment" : "Registry-SD", "redelivery_limit" : 1 } 

and the following utility function:

def not_exists_jms_ud_qeue(jmsModuleName, jmsResourceName): try: myMBean = getMBean('/JMSSystemResources/'+jmsModuleName+'/JMSResource/'+jmsModuleName+'/UniformDistributedQueues/'+jmsResourceName) if (myMBean is None): return true return false except: return true 

Comments

0

Did you try traversing the path manually ?

You can traverse the /edit location using the wlst command line. Use cd("") and ls() to traverse and list those properties you created.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.