You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by nvijayak <nv...@cs.indiana.edu> on 2008/01/24 20:36:26 UTC

Unable to resolve endpoint for an external servlet

Hi,

I created a servlet in Jetty that will act as a notification consumer. The
notification broker and producer are deployed in servicemix. I get the
following error when I send the subscribe request to the broker. I saw some
discussion on have external endpoints in this forum before but still not
sure how to resolve this. Any help will be greatly appreciated.

I am following the example in
http://www.ibm.com/developerworks/library/gr-ws-not/
My servlet in Jetty is mapped to http://localhost:8080/test/foo. It has a
doGet and doPost method. The doGet subscribes to the servicemix WSN broker
and I would like for the broker to send notifications to the doPost method.

Request sent by servlet:
<?xml version="1.0" encoding="UTF-8"?> 
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2"
xmlns:wsa="http://www.w3.org/2005/08/addressing"> 
<env:Body><wsnt:Subscribe> 
<wsnt:ConsumerReference> <
wsa:Address> endpoint:http://localhost:8080/test/foo </wsa:Address> 
</wsnt:ConsumerReference> 
<wsnt:Filter> 
<wsnt:TopicExpression
Dialect="http://docs.oasis-open.org/wsn/t-1/TopicExpression/Simple">myTopic
</wsnt:TopicExpression> 
</wsnt:Filter> 
</wsnt:Subscribe> 
</env:Body>  
</env:Envelope>

I get the following response:
WARN org.mortbay.log - /test/foo: java.io.IOException: Server
returned HTTP response code: 500 for URL: http://localhost:8492/Broker/

In Servicemix window I see the following output:
java.lang.Exception:
org.apache.servicemix.wsn.jaxws.SubscribeCreationFailedFaul
t: Unable to resolve consumer reference endpoint
        at
org.apache.servicemix.http.processors.ConsumerProcessor.process(Consu
merProcessor.java:194)
        at
org.apache.servicemix.http.HttpBridgeServlet.doPost(HttpBridgeServlet
.java:71)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
        at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487
)
        at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:3
62)
        at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:7
12)
        at
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHand
lerCollection.java:211)
        at
org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.
java:114)
        at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:1
39)
        at org.mortbay.jetty.Server.handle(Server.java:313)
        at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:50
6)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:375)
        at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.ja
va:396)
        at
org.mortbay.jetty.nio.SelectChannelConnector$RetryContinuation.run(Se
lectChannelConnector.java:511)
        at
org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool
.java:442)
Caused by: org.apache.servicemix.wsn.jaxws.SubscribeCreationFailedFault:
Unable
to resolve consumer reference endpoint
        at
org.apache.servicemix.wsn.jbi.JbiSubscription.validateSubscription(Jb
iSubscription.java:88)
        at
org.apache.servicemix.wsn.AbstractSubscription.create(AbstractSubscri
ption.java:277)
        at
org.apache.servicemix.wsn.AbstractNotificationBroker.handleSubscribe(
AbstractNotificationBroker.java:178)
        at
org.apache.servicemix.wsn.AbstractNotificationBroker.subscribe(Abstra
ctNotificationBroker.java:163)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at
org.apache.servicemix.wsn.component.WSNEndpoint.process(WSNEndpoint.j
ava:143)
        at
org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLi
feCycle.java:538)
        at
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(Async
BaseLifeCycle.java:490)
        at
org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLife
Cycle.java:46)
        at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBoun
d(DeliveryChannelImpl.java:610)
        at
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlo
w.java:170)
        at
org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.j
ava:167)
        at
org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.jav
a:134)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
utor.java:650)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:675)
        at java.lang.Thread.run(Thread.java:595)

Thanks,
Nithya
-- 
View this message in context: http://www.nabble.com/Unable-to-resolve-endpoint-for-an-external-servlet-tp15072513s12049p15072513.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Unable to resolve endpoint for an external servlet

Posted by nvijayak <nv...@cs.indiana.edu>.
Hi,

Thanks. The problem was because I was using the keyword endpoint: in my wsa
address. Once I removed it, I don't get any errors while subscribing. Also I
think CreatePullPoint is needed only if you want a pull option for the
subscriber to collect data. For asynchronous notifications, I think just
subscribe and publish are sufficient.

Thanks,
Nithya


bsnyder wrote:
> 
> On Jan 24, 2008 12:36 PM, nvijayak <nv...@cs.indiana.edu> wrote:
>>
>> Hi,
>>
>> I created a servlet in Jetty that will act as a notification consumer.
>> The
>> notification broker and producer are deployed in servicemix. I get the
>> following error when I send the subscribe request to the broker. I saw
>> some
>> discussion on have external endpoints in this forum before but still not
>> sure how to resolve this. Any help will be greatly appreciated.
>>
>> I am following the example in
>> http://www.ibm.com/developerworks/library/gr-ws-not/
>> My servlet in Jetty is mapped to http://localhost:8080/test/foo. It has a
>> doGet and doPost method. The doGet subscribes to the servicemix WSN
>> broker
>> and I would like for the broker to send notifications to the doPost
>> method.
>>
>> Request sent by servlet:
>> <?xml version="1.0" encoding="UTF-8"?>
>> <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
>> xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2"
>> xmlns:wsa="http://www.w3.org/2005/08/addressing">
>> <env:Body><wsnt:Subscribe>
>> <wsnt:ConsumerReference> <
>> wsa:Address> endpoint:http://localhost:8080/test/foo </wsa:Address>
>> </wsnt:ConsumerReference>
>> <wsnt:Filter>
>> <wsnt:TopicExpression
>> Dialect="http://docs.oasis-open.org/wsn/t-1/TopicExpression/Simple">myTopic
>> </wsnt:TopicExpression>
>> </wsnt:Filter>
>> </wsnt:Subscribe>
>> </env:Body>
>> </env:Envelope>
>>
>> I get the following response:
>> WARN org.mortbay.log - /test/foo: java.io.IOException: Server
>> returned HTTP response code: 500 for URL: http://localhost:8492/Broker/
>>
>> In Servicemix window I see the following output:
>> java.lang.Exception:
>> org.apache.servicemix.wsn.jaxws.SubscribeCreationFailedFaul
>> t: Unable to resolve consumer reference endpoint
> 
> I'm certainly not an expert on WS-Notification but the first thing I
> notice is that you're not sending a CreatePullPoint message before
> sending the Subscribe request. The important part is that the
> CreatePullPointResponse contains the address to use in the Subscribe
> message.
> 
> See an example of all the interation here:
> 
> http://servicemix.apache.org/example-scenario.html
> 
> The example messages are especially helpful in seeing the order of the
> messages.
> 
> Bruce
> -- 
> perl -e 'print
> unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
> );'
> 
> Apache ActiveMQ - http://activemq.org/
> Apache Camel - http://activemq.org/camel/
> Apache ServiceMix - http://servicemix.org/
> Apache Geronimo - http://geronimo.apache.org/
> 
> Blog: http://bruceblog.org/
> 
> 

-- 
View this message in context: http://www.nabble.com/Unable-to-resolve-endpoint-for-an-external-servlet-tp15072513s12049p15145772.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Unable to resolve endpoint for an external servlet

Posted by Bruce Snyder <br...@gmail.com>.
On Jan 24, 2008 12:36 PM, nvijayak <nv...@cs.indiana.edu> wrote:
>
> Hi,
>
> I created a servlet in Jetty that will act as a notification consumer. The
> notification broker and producer are deployed in servicemix. I get the
> following error when I send the subscribe request to the broker. I saw some
> discussion on have external endpoints in this forum before but still not
> sure how to resolve this. Any help will be greatly appreciated.
>
> I am following the example in
> http://www.ibm.com/developerworks/library/gr-ws-not/
> My servlet in Jetty is mapped to http://localhost:8080/test/foo. It has a
> doGet and doPost method. The doGet subscribes to the servicemix WSN broker
> and I would like for the broker to send notifications to the doPost method.
>
> Request sent by servlet:
> <?xml version="1.0" encoding="UTF-8"?>
> <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2"
> xmlns:wsa="http://www.w3.org/2005/08/addressing">
> <env:Body><wsnt:Subscribe>
> <wsnt:ConsumerReference> <
> wsa:Address> endpoint:http://localhost:8080/test/foo </wsa:Address>
> </wsnt:ConsumerReference>
> <wsnt:Filter>
> <wsnt:TopicExpression
> Dialect="http://docs.oasis-open.org/wsn/t-1/TopicExpression/Simple">myTopic
> </wsnt:TopicExpression>
> </wsnt:Filter>
> </wsnt:Subscribe>
> </env:Body>
> </env:Envelope>
>
> I get the following response:
> WARN org.mortbay.log - /test/foo: java.io.IOException: Server
> returned HTTP response code: 500 for URL: http://localhost:8492/Broker/
>
> In Servicemix window I see the following output:
> java.lang.Exception:
> org.apache.servicemix.wsn.jaxws.SubscribeCreationFailedFaul
> t: Unable to resolve consumer reference endpoint

I'm certainly not an expert on WS-Notification but the first thing I
notice is that you're not sending a CreatePullPoint message before
sending the Subscribe request. The important part is that the
CreatePullPointResponse contains the address to use in the Subscribe
message.

See an example of all the interation here:

http://servicemix.apache.org/example-scenario.html

The example messages are especially helpful in seeing the order of the
messages.

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache ActiveMQ - http://activemq.org/
Apache Camel - http://activemq.org/camel/
Apache ServiceMix - http://servicemix.org/
Apache Geronimo - http://geronimo.apache.org/

Blog: http://bruceblog.org/