You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Anne Noseda <no...@gmail.com> on 2008/08/07 15:44:14 UTC

SE WSN - Problem when broker send notifications to subscribers

Hi,

I have a problem using servicemix-wsn-component. I can make subscription,
registration of publisher, send notifications BUT the subscribers doesn't
receive notifications.
Maybe, I have an error in the subscription configuration.

I do all these things in servicemmix-bean components.

Here the JAVA code :
--------------------

QName consumerServiceBean = new QName("http://www.etnic.be/janus/test/wsn",
"BeanWsnSuscriber");
QName publisherService = new QName("http://www.etnic.be/janus/test/wsn",
"BeanWsnNotify");
String endpoint = "endpoint";
String topic = "topicAnne";
NotificationBroker wsnBroker;

try {
       wsnBroker = new NotificationBroker(context);
       EndpointReferenceType consumer = new EndpointReferenceType();
       consumer.setAddress(new AttributedURIType());
       consumer.getAddress().setValue(consumerServiceHttp.getNamespaceURI()
+ "/"
                                      + consumerServiceHttp.getLocalPart() +
"/"+ endpoint);
       try {
              wsnBroker.subscribe(consumer, topic);
              EndpointReferenceType publisher = new EndpointReferenceType();
	      publisher.setAddress(new AttributedURIType());
             
publisher.getAddress().setValue(publisherService.getNamespaceURI() + "/"
						+ publisherService.getLocalPart() + "/" + endpoint);
              wsnBroker.registerPublisher(publisher, topic, false);
              DocumentBuilderFactory dbf =
DocumentBuilderFactory.newInstance();
              dbf.setNamespaceAware(true);
              Document outDoc = null;
              Element root = null;
              try {
                     outDoc = dbf.newDocumentBuilder().newDocument();
                     root =
outDoc.createElementNS("http://www.bull.be/test/wsn", "root");
                     root.setPrefix("wsn");
                     Element txt =
outDoc.createElementNS("http://www.bull.be/test/wsn", "txt");
                     txt.setPrefix("wsn");
                     txt.setTextContent("coucou");
                     root.appendChild(txt);
                     outDoc.appendChild(root);
                   } 
              catch (ParserConfigurationException e) {e.printStackTrace();}
	      try {
			wsnBroker.notify(topic, outDoc.getFirstChild());
	            } 
              catch (JBIException e) {e.printStackTrace();}
           } 
       catch (JBIException e1) {e1.printStackTrace();}
    } 
catch (JAXBException e1) {e1.printStackTrace();}

Here the xbean.xml of my servicemix-bean component :
-----------------------------------------------------

<beans xmlns:bean="http://servicemix.apache.org/bean/1.0"
	xmlns:wsn="http://www.etnic.be/janus/test/wsn">

	<bean:endpoint service="wsn:BeanWsnNotify" endpoint="endpoint"
		bean="#wsnBeanNotify" />

	<bean id="wsnBeanNotify"
		class="be.bull.test.wsn.WsnBean" >
	</bean>
	
	<bean:endpoint service="wsn:BeanWsnSuscriber" endpoint="endpoint"
		bean="#wsnBeanSuscriber" />

	<bean id="wsnBeanSuscriber"
		class="be.bull.test.wsn.WsnBeanSuscriber" >
	</bean>

</beans>

I use servicemix-http to call the BeanWsnNotify. This bean subscribe the
BeanWsnSubscriber, the he registers him-self and he sends a notification.

Here the stack trace :
---------------------

---------- Bienvenue dans BEAN WSN Notify----------
---------- Create subscription for bean suscriber ... it's not my role ...
----------
subscription created
registration of the publisher ...
publisher registrated
---------- Send notification ----------
message : [#document: null]
---------- Fin du BEAN WSN Notify----------
---------- on envoie le done ----------
WARN  - DeliveryChannelImpl            - Error calling listener: null
java.lang.NullPointerException
        at
org.apache.servicemix.jbi.monitoring.StatisticsService.onExchangeAccepted(StatisticsService.java:307)
        at
org.apache.servicemix.jbi.monitoring.StatisticsService$3.exchangeAccepted(StatisticsService.java:186)
        at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:598)
        at
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:170)
        at
org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:167)
        at
org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
        at java.lang.Thread.run(Thread.java:595)
ERROR - HttpComponent                  - Error processing exchange InOnly[
  id: ID:192.168.80.103-11b9d3e2a0d-11:0
  status: Active
  role: provider
  endpoint: http://www.etnic.be/janus/test/wsn/HttpOutSuscriber/endpoint
  in: <?xml version="1.0" encoding="UTF-8"?><ns2:Notify
xmlns:ns2="http://docs.oasis-open.org/wsn/b-2" xmlns="http://www.w3.o
rg/2005/08/addressing" xmlns:ns3="http://docs.oasis-open.org/wsn/t-1"
xmlns:ns4="http://docs.oasis-open.org/wsrf/bf-2"><ns2:N
otificationMessage><ns2:Topic>topicAnne</ns2:Topic><ns2:Message><wsn:root
xmlns:wsn="http://www.bull.be/test/wsn"><wsn:txt>co
ucou</wsn:txt></wsn:root></ns2:Message></ns2:NotificationMessage></ns2:Notify>
]
java.lang.Exception: Invalid status response: 405
        at
org.apache.servicemix.http.processors.ProviderProcessor.process(ProviderProcessor.java:179)
        at
org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:538)
        at
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:490)
        at
org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLifeCycle.java:46)
        at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)
        at
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:170)
        at
org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:167)
        at
org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
        at java.lang.Thread.run(Thread.java:595)
WARN  - ActiveMQConnection             - Async exception with no exception
listener: org.apache.activemq.transport.Inactivity
IOException: Channel was inactive for too long: localhost/127.0.0.1:61616
org.apache.activemq.transport.InactivityIOException: Channel was inactive
for too long: localhost/127.0.0.1:61616
        at
org.apache.activemq.transport.InactivityMonitor$4.run(InactivityMonitor.java:108)
WARN  - ActiveMQConnection             - Async exception with no exception
listener: java.net.SocketException: socket closed
java.net.SocketException: socket closed
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.read(SocketInputStream.java:129)
        at
org.apache.activemq.transport.tcp.TcpBufferedInputStream.fill(TcpBufferedInputStream.java:50)
        at
org.apache.activemq.transport.tcp.TcpBufferedInputStream.read(TcpBufferedInputStream.java:58)
        at java.io.DataInputStream.readInt(DataInputStream.java:353)
        at
org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:268)
        at
org.apache.activemq.transport.tcp.TcpTransport.readCommand(TcpTransport.java:192)
        at
org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:184)
        at
org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:172)
        at java.lang.Thread.run(Thread.java:595)
WARN  - ActiveMQManagedConnection      - Connection failed:
javax.jms.JMSException: java.io.EOFException
WARN  - GeronimoConnectionEventListener - connectionErrorOccurred called
with null
javax.jms.JMSException: java.io.EOFException
        at
org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:49)
        at
org.apache.activemq.ActiveMQConnection.onAsyncException(ActiveMQConnection.java:1642)
        at
org.apache.activemq.ActiveMQConnection.onException(ActiveMQConnection.java:1659)
        at
org.apache.activemq.transport.TransportFilter.onException(TransportFilter.java:98)
        at
org.apache.activemq.transport.ResponseCorrelator.onException(ResponseCorrelator.java:116)
        at
org.apache.activemq.transport.TransportFilter.onException(TransportFilter.java:98)
        at
org.apache.activemq.transport.TransportFilter.onException(TransportFilter.java:98)
        at
org.apache.activemq.transport.WireFormatNegotiator.onException(WireFormatNegotiator.java:143)
        at
org.apache.activemq.transport.InactivityMonitor.onException(InactivityMonitor.java:169)
        at
org.apache.activemq.transport.TransportSupport.onException(TransportSupport.java:95)
        at
org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:176)
        at java.lang.Thread.run(Thread.java:595)
Caused by: java.io.EOFException
        at java.io.DataInputStream.readInt(DataInputStream.java:358)
        at
org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:268)
        at
org.apache.activemq.transport.tcp.TcpTransport.readCommand(TcpTransport.java:192)
        at
org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:184)
        at
org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:172)
        ... 1 more

Thanks in advance for any help,

Anne.


-- 
View this message in context: http://www.nabble.com/SE-WSN---Problem-when-broker-send-notifications-to-subscribers-tp18870804p18870804.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.