Hi All,

I have the following server code on a JSP page which is used to publish a
message in MB.

BrokerClient brokerClient = UIUtils.getBrokerClient(config, session,
request);
    String topic = request.getParameter("topic");
    String textMsg = request.getParameter("xmlMessage");
    session.setAttribute("errorTopic", topic);
    session.setAttribute("xmlMessage", textMsg);
    OMElement message;
    String messageToBePrinted = null;
    StAXOMBuilder builder = null;
    try {
        builder = new StAXOMBuilder(new
ByteArrayInputStream(textMsg.getBytes()));
        message = builder.getDocumentElement();
        if (message != null) {
            brokerClient.publish(topic, message);
        } else {
            messageToBePrinted = "Error: Failed to get document element
from message " + textMsg;
        }
    } catch (Exception e) {
        messageToBePrinted = "Error: while publishing the message " +
e.getMessage();
    }

    if (messageToBePrinted == null) {
        messageToBePrinted = "Successfully published the message to the
topic :" + topic;
    }


But I am getting an error when executing it.

The type javax.xml.stream.XMLStreamReader cannot be resolved. It is
indirectly referenced from required .class files


The error is coming from the following line.

builder = new StAXOMBuilder(new ByteArrayInputStream(textMsg.getBytes()));


I saw an earlier thread asking the same question, but unable to get a fix
from it [1].

Any idea why it is coming on a JSP page ?

[1] - http://mail.wso2.org/mailarchive/dev/2014-April/030470.html

Hemika Kodikara
Software Engineer
WSO2 Inc.
lean . enterprise . middleware
http://wso2.com

Mobile : +94777688882
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to