You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-dev@ws.apache.org by "Vinh Nguyen (JIRA)" <ji...@apache.org> on 2006/11/09 02:15:37 UTC

[jira] Created: (MUSE-146) NotificationProducer unable to send complex type elements

NotificationProducer unable to send complex type elements
---------------------------------------------------------

                 Key: MUSE-146
                 URL: http://issues.apache.org/jira/browse/MUSE-146
             Project: Muse
          Issue Type: Bug
         Environment: Windows XP SP2, Apache 2.2, Tomcat 5.5, Muse 2.0.0, Eclipse 3.2.1, XmlBeans 2.2.0
            Reporter: Vinh Nguyen
         Assigned To: Dan Jemiolo


Sending a notification containing a complex element doesn't seem to work.  It only works for an element containing a simple string message.  I'm using XmlBeans for conversion between xml schemas and java objects.  Using the code below, the notification does not appear to be sent, nor do any errors get thrown in the process.

BoxDocument doc = BoxDocument.Factory.newInstance();
BoxType type = doc.addNewBox();
type.setWidth(BigInteger.valueOf(123));
type.setHeight(BigInteger.valueOf(123));

QName qname = new QName(NAMESPACE_URI, "MyMessage", PREFIX);
Element payload = XmlUtils.createElement(qname, XmlUtils.getFirstElement((Document)doc.getDomNode()));
NotificationProducer np = ...
np.publish(TOPIC_NAME, payload);

Here is the XML from doc.xmlText():
<box:Box xmlns:box="http://cisco.com/musebox/schemas/box"><box:width>123</box:width><box:height>123</box:height></box:Box>


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-dev-help@ws.apache.org


[jira] Closed: (MUSE-146) NotificationConsumer creates empty NotificationMessage array when no XML prefixes present

Posted by "Dan Jemiolo (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/MUSE-146?page=all ]

Dan Jemiolo closed MUSE-146.
----------------------------

    Resolution: Fixed

Fixed

> NotificationConsumer creates empty NotificationMessage array when no XML prefixes present
> -----------------------------------------------------------------------------------------
>
>                 Key: MUSE-146
>                 URL: http://issues.apache.org/jira/browse/MUSE-146
>             Project: Muse
>          Issue Type: Bug
>          Components: Core Engine - Routing and Serialization, WSN NotificationConsumer
>    Affects Versions: 2.0.0
>         Environment: Windows XP SP2, Apache 2.2, Tomcat 5.5, Muse 2.0.0, Eclipse 3.2.1, XmlBeans 2.2.0
>            Reporter: Vinh Nguyen
>         Assigned To: Dan Jemiolo
>            Priority: Minor
>             Fix For: 2.1.0
>
>         Attachments: MuseBox.zip
>
>
> Sending a notification containing a complex element doesn't seem to work.  It only works for an element containing a simple string message.  I'm using XmlBeans for conversion between xml schemas and java objects.  Using the code below, the notification does not appear to be sent, nor do any errors get thrown in the process.
> BoxDocument doc = BoxDocument.Factory.newInstance();
> BoxType type = doc.addNewBox();
> type.setWidth(BigInteger.valueOf(123));
> type.setHeight(BigInteger.valueOf(123));
> QName qname = new QName(NAMESPACE_URI, "MyMessage", PREFIX);
> Element payload = XmlUtils.createElement(qname, XmlUtils.getFirstElement((Document)doc.getDomNode()));
> NotificationProducer np = ...
> np.publish(TOPIC_NAME, payload);
> Here is the XML from doc.xmlText():
> <box:Box xmlns:box="http://cisco.com/musebox/schemas/box"><box:width>123</box:width><box:height>123</box:height></box:Box>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-dev-help@ws.apache.org


[jira] Commented: (MUSE-146) NotificationConsumer creates empty NotificationMessage array when no XML prefixes present

Posted by "Dan Jemiolo (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/MUSE-146?page=comments#action_12453744 ] 
            
Dan Jemiolo commented on MUSE-146:
----------------------------------

Okay, using my latest build, I get the following trace when I send a message payload that doesn't use prefixes:

Nov 27, 2006 6:28:10 PM org.apache.muse.util.LoggingUtils logMessage
FINE: [SERVER TRACE] SOAP envelope contents (incoming):

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Header>
        <wsa:To xmlns:wsa="http://www.w3.org/2005/08/addressing">http://9.65.227.130:8080/wsn-consumer/services/consumer</wsa:To>
        <wsa:Action xmlns:wsa="http://www.w3.org/2005/08/addressing">http://docs.oasis-open.org/wsn/bw-2/NotificationConsumer/NotifyRequest</wsa:Action>
        <wsa:MessageID xmlns:wsa="http://www.w3.org/2005/08/addressing">uuid:65b369aa-c51d-e805-2946-9cd1f7aa86d3</wsa:MessageID>
        <wsa:From xmlns:wsa="http://www.w3.org/2005/08/addressing">
            <wsa:ReferenceParameters/>
            <wsa:Address>http://9.65.227.130:8080/wsn-producer/services/WsResource</wsa:Address>
        </wsa:From>
    </soap:Header>
    <soap:Body>
        <wsnt:Notify xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
            "http://ws.apache.org/muse/test/wsrf"
                xmlns:muse-wsa="http://ws.apache.org/muse/addressing"
                xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2"&gt;
                <wsnt:SubscriptionReference>
                <wsa:Address xmlns:wsa="http://www.w3.org/2005/08/addressing">http://9.65.227.130:8080/wsn-producer/services/SubscriptionManager</wsa:Address>
                <wsa:ReferenceParameters xmlns:wsa="http://www.w3.org/2005/08/addressing">
                    <muse-wsa:ResourceId xmlns:muse-wsa="http://ws.apache.org/muse/addressing">MuseResource-1</muse-wsa:ResourceId>
                </wsa:ReferenceParameters>
            </wsnt:SubscriptionReference>
            <wsnt:Topic
                Dialect="http://docs.oasis-open.org/wsn/t-1/TopicExpression/Concrete" xmlns:tns="http://ws.apache.org/muse/test/wsrf">tns:MyTopic</wsnt:Topic>
            <wsnt:ProducerReference>
                <wsa:ReferenceParameters xmlns:wsa="http://www.w3.org/2005/08/addressing"/>
                <wsa:Address xmlns:wsa="http://www.w3.org/2005/08/addressing">http://9.65.227.130:8080/wsn-producer/services/WsResource</wsa:Address>
            </wsnt:ProducerReference>
            <wsnt:Message>
                <MyMessage xmlns="http://ws.apache.org/muse/test/wsrf">This is a message from muse-test.apache.org</MyMessage>
            </wsnt:Message>
        </wsnt:Notify>
    </soap:Body>
</soap:Envelope>


Nov 27, 2006 6:28:10 PM org.apache.muse.util.LoggingUtils logError
INFO: There was an error while processing a request:

[ID = 'NoMessageContent'] The NotificationMessage XML does not have a Message element. All messages must have a message payload associated with them.

	org.apache.muse.ws.notification.impl.SimpleNotificationMessage.<init>(SimpleNotificationMessage.java:114)
	org.apache.muse.ws.notification.impl.NotificationMessageSerializer.fromXML(NotificationMessageSerializer.java:42)
	org.apache.muse.core.serializer.ArraySerializer.fromXML(ArraySerializer.java:123)
	org.apache.muse.core.routing.ReflectionMessageHandler.fromXML(ReflectionMessageHandler.java:135)
	org.apache.muse.core.SimpleResource.invoke(SimpleResource.java:351)
	org.apache.muse.core.routing.SimpleResourceRouter.invoke(SimpleResourceRouter.java:278)
	org.apache.muse.core.platform.axis2.AxisIsolationLayer.handleRequest(AxisIsolationLayer.java:105)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	java.lang.reflect.Method.invoke(Method.java:324)
	org.apache.axis2.receivers.RawXMLINOutMessageReceiver.invokeBusinessLogic(RawXMLINOutMessageReceiver.java:99)
	org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(AbstractInOutSyncMessageReceiver.java:39)
	org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:504)
	org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:324)
	27 more...
------------------------------------------



This is very weird. The NotificationMessage element is removed! the <wsnt:NotificationMessage part is erased, but the namespace declarations remain as text, and the closing bracket (>) has been normalized to the proper character code (as if it were text data). When you put a prefix back in, the NotificationMessage element remains.

Because the NotificationMessage element is removed (and its children become Notify's children), the parser gets screwed up.

I honestly don't know what to do about this, because that server-side logging (LoggingUtils.logMessage()) happens right after the XML is received from Axis2. I'm guessing it may be an Axis2 problem, but I will doublecheck using our new "mini" platform tonight.




> NotificationConsumer creates empty NotificationMessage array when no XML prefixes present
> -----------------------------------------------------------------------------------------
>
>                 Key: MUSE-146
>                 URL: http://issues.apache.org/jira/browse/MUSE-146
>             Project: Muse
>          Issue Type: Bug
>          Components: Core Engine - Routing and Serialization, WSN NotificationConsumer
>    Affects Versions: 2.0.0
>         Environment: Windows XP SP2, Apache 2.2, Tomcat 5.5, Muse 2.0.0, Eclipse 3.2.1, XmlBeans 2.2.0
>            Reporter: Vinh Nguyen
>         Assigned To: Dan Jemiolo
>            Priority: Minor
>             Fix For: 2.1.0
>
>         Attachments: MuseBox.zip
>
>
> Sending a notification containing a complex element doesn't seem to work.  It only works for an element containing a simple string message.  I'm using XmlBeans for conversion between xml schemas and java objects.  Using the code below, the notification does not appear to be sent, nor do any errors get thrown in the process.
> BoxDocument doc = BoxDocument.Factory.newInstance();
> BoxType type = doc.addNewBox();
> type.setWidth(BigInteger.valueOf(123));
> type.setHeight(BigInteger.valueOf(123));
> QName qname = new QName(NAMESPACE_URI, "MyMessage", PREFIX);
> Element payload = XmlUtils.createElement(qname, XmlUtils.getFirstElement((Document)doc.getDomNode()));
> NotificationProducer np = ...
> np.publish(TOPIC_NAME, payload);
> Here is the XML from doc.xmlText():
> <box:Box xmlns:box="http://cisco.com/musebox/schemas/box"><box:width>123</box:width><box:height>123</box:height></box:Box>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-dev-help@ws.apache.org


[jira] Commented: (MUSE-146) NotificationConsumer creates empty NotificationMessage array when no XML prefixes present

Posted by "Dan Jemiolo (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/MUSE-146?page=comments#action_12453755 ] 
            
Dan Jemiolo commented on MUSE-146:
----------------------------------

It's not Axis2, it's Xerces:

2006-11-27 18:46:15 StandardWrapperValve[ApacheMuseServlet]: Servlet.service() for servlet ApacheMuseServlet threw exception
java.io.IOException: Element or attribute do not match QName production: QName::=(NCName':')?NCName. 
	at org.apache.muse.core.platform.mini.MiniServlet.doPost(MiniServlet.java:62)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


Xerces and default namespaces in DOM L2 do not jive. The only info I could find on this online was from the Cocoon project, which was not too helpful. I'm going to resolve this by adding an item to our "troubleshooting" section.



> NotificationConsumer creates empty NotificationMessage array when no XML prefixes present
> -----------------------------------------------------------------------------------------
>
>                 Key: MUSE-146
>                 URL: http://issues.apache.org/jira/browse/MUSE-146
>             Project: Muse
>          Issue Type: Bug
>          Components: Core Engine - Routing and Serialization, WSN NotificationConsumer
>    Affects Versions: 2.0.0
>         Environment: Windows XP SP2, Apache 2.2, Tomcat 5.5, Muse 2.0.0, Eclipse 3.2.1, XmlBeans 2.2.0
>            Reporter: Vinh Nguyen
>         Assigned To: Dan Jemiolo
>            Priority: Minor
>             Fix For: 2.1.0
>
>         Attachments: MuseBox.zip
>
>
> Sending a notification containing a complex element doesn't seem to work.  It only works for an element containing a simple string message.  I'm using XmlBeans for conversion between xml schemas and java objects.  Using the code below, the notification does not appear to be sent, nor do any errors get thrown in the process.
> BoxDocument doc = BoxDocument.Factory.newInstance();
> BoxType type = doc.addNewBox();
> type.setWidth(BigInteger.valueOf(123));
> type.setHeight(BigInteger.valueOf(123));
> QName qname = new QName(NAMESPACE_URI, "MyMessage", PREFIX);
> Element payload = XmlUtils.createElement(qname, XmlUtils.getFirstElement((Document)doc.getDomNode()));
> NotificationProducer np = ...
> np.publish(TOPIC_NAME, payload);
> Here is the XML from doc.xmlText():
> <box:Box xmlns:box="http://cisco.com/musebox/schemas/box"><box:width>123</box:width><box:height>123</box:height></box:Box>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-dev-help@ws.apache.org


[jira] Updated: (MUSE-146) NotificationConsumer creates empty NotificationMessage array when no XML prefixes present

Posted by "Dan Jemiolo (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/MUSE-146?page=all ]

Dan Jemiolo updated MUSE-146:
-----------------------------

          Component/s: Core Engine - Routing and Serialization
                       WSN NotificationConsumer
              Summary: NotificationConsumer creates empty NotificationMessage array when no XML prefixes present  (was: NotificationProducer unable to send complex type elements)
        Fix Version/s: 2.1.0
    Affects Version/s: 2.0.0
             Priority: Minor  (was: Major)

The root of this problem is actually on the consumer side. The ReflectionMessageHandler, when using NotificationMessageSerializer to parse an array of NotificationMessage elements, returns an empty array if the message payload does not use XML prefixes for its namespaces. The call does not fail with a runtime exception, NPE, etc. - it simply does not parse any messages, and so the array that the notify() implementation iterates over is zero-length. If prefixes are used, the messages are parsed properly.

If I cannot determine the cause of this by EOD tomorrow, it will have to wait for 2.2 and we will make an entry in the troubleshooting section of the manual.


> NotificationConsumer creates empty NotificationMessage array when no XML prefixes present
> -----------------------------------------------------------------------------------------
>
>                 Key: MUSE-146
>                 URL: http://issues.apache.org/jira/browse/MUSE-146
>             Project: Muse
>          Issue Type: Bug
>          Components: WSN NotificationConsumer, Core Engine - Routing and Serialization
>    Affects Versions: 2.0.0
>         Environment: Windows XP SP2, Apache 2.2, Tomcat 5.5, Muse 2.0.0, Eclipse 3.2.1, XmlBeans 2.2.0
>            Reporter: Vinh Nguyen
>         Assigned To: Dan Jemiolo
>            Priority: Minor
>             Fix For: 2.1.0
>
>         Attachments: MuseBox.zip
>
>
> Sending a notification containing a complex element doesn't seem to work.  It only works for an element containing a simple string message.  I'm using XmlBeans for conversion between xml schemas and java objects.  Using the code below, the notification does not appear to be sent, nor do any errors get thrown in the process.
> BoxDocument doc = BoxDocument.Factory.newInstance();
> BoxType type = doc.addNewBox();
> type.setWidth(BigInteger.valueOf(123));
> type.setHeight(BigInteger.valueOf(123));
> QName qname = new QName(NAMESPACE_URI, "MyMessage", PREFIX);
> Element payload = XmlUtils.createElement(qname, XmlUtils.getFirstElement((Document)doc.getDomNode()));
> NotificationProducer np = ...
> np.publish(TOPIC_NAME, payload);
> Here is the XML from doc.xmlText():
> <box:Box xmlns:box="http://cisco.com/musebox/schemas/box"><box:width>123</box:width><box:height>123</box:height></box:Box>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-dev-help@ws.apache.org