Error : illegal character 'R' at offset 0 when sending an XML message to JMS Queue
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Error : illegal character 'R' at offset 0 when sending an XML message to JMS Queue
Hi,
I have written a groovy script which creates an xml file and then tries to send the created xml to a JMS queue.
but I am seeing an exception(in my application's log which reads : "illegal character 'R' at offset 0"
I followed the steps mentioned here(used Byte instead of Text) : https://www.soapui.org/jms/working-with-jms-messages.html
When I tried to copy the created xml and posted the same through RFHUTILC, I don't see any error.
Sample of what I tried to do :
def jmsEndpoint = new JMSEndpoint("jms://MQSession::QueueName")
def hermes = HermesUtils.getHermes( context.testCase.testSuite.project, jmsEndpoint.sessionName)
def jmsConnectionHolder = new JMSConnectionHolder( jmsEndpoint, hermes, false, null ,null ,null)
Session queueSession = jmsConnectionHolder.getSession();
Queue queueSend = jmsConnectionHolder.getQueue( jmsConnectionHolder.getJmsEndpoint().getSend() );
//Queue queueBrowse = jmsConnectionHolder.getQueue( jmsConnectionHolder.getJmsEndpoint().getReceive() );
MessageProducer messageProducer = queueSession.createProducer( queueSend );
BytesMessage textMessageSend = queueSession.createBytesMessage();
< my XML creation code goes here which I have captured in the var updatedXml >
textMessageSend.writeUTF(updatedXml);
messageProducer.send(textMessageSend);
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @nmrao
The script doesn't throw any error.
The SOPAUI log has the below line if it helps "JMS Endpoint String does not contain a parameter at index 2, parameters: [MQSession, MyQueueName]
Thanks
A
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try changing below statement:
def jmsEndpoint = new JMSEndpoint("jms://MQSession::QueueName")
to
def jmsEndpoint = new JMSEndpoint("jms://${session}::${channelType}_${send}::${channelType}_${receive}")
session is MQSession
channelType is queue or topic
send is Name of the queue to which message has to be send
receive is Name of the queue on which it receives response
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@nmrao The error remains the same. I have copied below the exception log form my application's logging.
I have renamed some of the names below.
<RecoverableException>
<Function>mpgw_nameOf the EG</Function>
<Type>Multiprotocol Gateway</Type>
<Name/>
<Label/>
<Catalog>Datapower</Catalog>
<Severity>3</Severity>
<Number>0x00030001</Number>
<Text>illegal character 'R' at offset 0 of dpmq://dpmq_Eai/fsh_MQ_Name?RequestQueue=QueueName</Text>
</RecoverableException>
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hope you are trying to send a soap request, right?
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@nmrao That is all I had to show what error I could see.
The script doesn't throw any error.
I am posting a simple xml to a queue.
When I copy & post the same xml which was generated by the script, through RFHUTIL, I dont see any errors in my app logging.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I skipped the Groovy steps to send to the queue and instead updated the generated xml in the Request tab, but still the same issue
When I copy the xml from the Request tab, create an xml file using notepad & post this file through rfhutilc, there is no error at all.
Has it got anything to do with the editor ? encoding ?
