XQ_ENDPOINT_EXCEPTION while sending message to exit endpoint

Posted by Admin on 26-Aug-2009 11:48

I have created custom service to call REST web service through it.I want to to send response of webservice to the endpoint of the service.

but it is giving exception at the end of service after passing message to outbox.

I am not getting anything at the RME endpoint but instead I am getting XQ_ENDPOINT_EXCEPTION in container log
I am getting following error log in conatiner log.

[09/08/26 22:07:22] ID=dev_ESBTest (info) [Dispatch] Message Rejected, rejected message could not be created for XQDispatcher for application HTTPSPostTOSC

[09/08/26 22:07:22] ID=dev_ESBTest (info) [Dispatch] Cause of rejected message: XQ_ENDPOINT_EXCEPTION

[09/08/26 22:07:23] ID=dev_ESBTest (info) Trace follows...
com.sonicsw.xq.XQEndpointException: null: DestinationName=Sample.Q1
at com.sonicsw.xq.connector.jms.JMSEndpoint$EndpointConnection.sendWithUnbound(JMSEndpoint.java:1621)
at com.sonicsw.xq.connector.jms.JMSEndpoint.sendWithUnbound(JMSEndpoint.java:289)
at com.sonicsw.xq.connector.jms.JMSEndpointContext.send(JMSEndpointContext.java:144)
at com.sonicsw.xqimpl.endpoint.container.EndpointContextContainer.send(EndpointContextContainer.java:234)
at com.sonicsw.xqimpl.service.MessageSendingHelper.sendToEndpoint(MessageSendingHelper.java:199)
at com.sonicsw.xqimpl.service.MessageSendingHelper.sendToAddress(MessageSendingHelper.java:72)
at com.sonicsw.xqimpl.service.MessageSendingHelper.sendEnvelopes(MessageSendingHelper.java:951)
at com.sonicsw.xqimpl.service.XQDispatcher.onMessage(XQDispatcher.java:493)
at com.sonicsw.xqimpl.endpoint.container.EndpointContextContainer.onMessage(EndpointContextContainer.java:84)
at com.sonicsw.xq.connector.jms.JMSEndpoint$JMSEndpointListener.onMessage(JMSEndpoint.java:570)
at progress.message.jimpl.Session.deliver(Session.java:2998)
at progress.message.jimpl.Session.run(Session.java:2390)
at progress.message.jimpl.Session$SessionThread.run(Session.java:2775)
Caused by: java.lang.NullPointerException
at javax.activation.MimeType.parse(MimeType.java:86)
at javax.activation.MimeType.<init>(MimeType.java:54)
at javax.activation.DataHandler.getBaseType(DataHandler.java:603)
at javax.activation.DataHandler.getDataContentHandler(DataHandler.java:568)
at javax.activation.DataHandler.getContent(DataHandler.java:511)
at progress.message.jimpl.xmessage.Part.marshalPart(Part.java:652)
at progress.message.jimpl.xmessage.MultipartMessage.marshal(MultipartMessage.java:595)
at progress.message.jimpl.MessageProducer.internalSend(MessageProducer.java:573)
at progress.message.jimpl.MessageProducer.send(MessageProducer.java:1357)
at com.sonicsw.xq.connector.jms.messagingbean.Session.produceMessageWithUnbound(Session.java:766)
at com.sonicsw.xq.connector.jms.messagingbean.Session.produceMessageWithUnbound(Session.java:745)
at com.sonicsw.xq.connector.jms.messagingbean.MessagingBean.produceMessageWithUnbound(MessagingBean.java:1290)
at com.sonicsw.xq.connector.jms.JMSEndpoint$EndpointConnection.sendWithUnbound(JMSEndpoint.java:1590)
... 12 more

Please suggest something for this exception.

Thanks,

Yashwant

All Replies

Posted by jtownsen on 26-Aug-2009 14:35

Do you just send the incoming message to the outbox or do you create a new message?  Could you attach the piece of code that sends the message to the outbox?

Alternatively, it could be just because your Service Instance is configured to use an Endpoint that no longer exists in the Domain...

Posted by Admin on 27-Aug-2009 02:04

Thanks,

I am sending new message to the outbox which is actually a response from REST web service.

I checked those endpoints also for services and processes.

I am sending the piece of code.

env = ctx.getNextIncoming();
       
            if (env != null) {
    XQMessage msg = env.getMessage();
    try {
     // create the email content
     System.out.println("In try block of Service method...");
                 int iPartCount = msg.getPartCount();
                 for (int i=0; i
                  msgBody = msgBody+(String)msg.getPart(i).getContent();
                  if(m_headervalue)
                  {
                   m_postingurl=msg.getStringHeader("XQPostURL");
                   m_basicauth=msg.getStringHeader("XQAuthString");
                  }
                 }
     // post the message
                 System.out.println("Incoming Message for posting data--||"+msgBody);
                 postMessage(msgBody);
    }
            catch (Exception ex) {
     ex.printStackTrace();
    }
          
            
                // Pass message onto the outbox.
               
                    //Add the message to the Outbox
                try{
                 XQMessageFactory messageFactory = ctx.getMessageFactory();
                
                 //String contentType = XQConstants.CONTENT_TYPE_XML;

                 XQMessage newProcessMsg = messageFactory.createMessage();
                 newProcessMsg.addPart(newProcessMsg.createPart(m_response,"text/xml"));
                
                 env.setMessage(newProcessMsg);
                    ctx.addOutgoing(env);
                    System.out.println("Message added to the outbox" );
                }
                catch (Exception ex) {
     ex.printStackTrace();
    }

Message is being added to the outbox because this "Message added to the outbox"  is printing succesfully in log and after that I am getting error.

I found one regarding this error

If there is an error sending a message returned from the XQEndpoint.send( ) method:

rejectedCode = XQ_ENDPOINT_EXCEPTION

But I am not sure how to solve this

Thanks,

Yashwant

Posted by Admin on 27-Aug-2009 04:23

I found an issue regarding this exception.

It was giving null pointer exception because the string which I used for creation of message was set NULL by mistake.

WHich was causing an exception for message.

Posted by Bill Wood on 01-Oct-2009 08:49

Problem was in the orignial service code -- just a simple mistake. There was no ESB issue, per se.

This thread is closed