You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by Suran Jayathilaka <su...@wso2.com> on 2008/06/04 09:18:15 UTC

synapse JMSListener fails if services.xml doesn't specify transport.jms.Destination

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

hi,

When testing the JMS transport with a QPid broker, I found this problem.
When I use the JMS transport in Axis2 (1.4), if a destination isn't 
given as the paramater "transport.jms.Destination" in the services.xml, 
it would create a Queue by the service name and work correctly. When 
this parameter is avaialable also the Axis2 JMS transport works without 
errors.

But when I switched to the JMS transport from the 
synapse-transports-<verison>.jar, if the above named parameter isn't 
included in the service descriptor, the JMSListener  fails saying
[ERROR] The service cannot be found for the endpoint reference (EPR)
org.apache.axis2.AxisFault: The service cannot be found for the endpoint 
reference (EPR)
~        at 
org.apache.axis2.engine.DispatchPhase.checkPostConditions(DispatchPhase.java:64)
~        at org.apache.axis2.engine.Phase.invoke(Phase.java:333)
~        at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:264)
~        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:163)
~        at 
org.apache.synapse.transport.base.AbstractTransportListener.handleIncomingMessage(AbstractTransportListener.java:256)
~        at 
org.apache.synapse.transport.jms.JMSMessageReceiver$Worker.run(JMSMessageReceiver.java:218)
~        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)

And as soon as I add the "transport.jms.Destination" param to the 
services.xml, the the synapse JMSListener would also work.

Shouldn't the transport be able to work with the auto created Queue 
without needing the parameter explicitly?
I tested this scenario with both synapse-transports-1.1.1.jar and 
synapse-transports-1.2-beta1.jar with similar results.
Please let me know if I might be doing something incorrectly.

The services.xml is
- --------------------
<service name="QpidStockQuoteService" scope="application" 
targetNamespace="http://axis2qpid.wso2.org">
~    <description>
~        Stock Quote Service Over AMQP
~    </description>
~    <messageReceivers>
~        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"
~                         
class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/>
~        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
~                         
class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
~    </messageReceivers>
~    <parameter 
name="ServiceClass">org.wso2.example.axis2qpid.service.QpidStockQuoteService</parameter>
~    <parameter name="transport.jms.Destination">directQueue</parameter>
</service>
- -------------------------------

directQueue refers to a destination  binding in a jndi properties file.
- --------------------------------
#initial context factory
#java.naming.factory.initial 
=org.apache.qpid.jndi.PropertiesFileInitialContextFactory
# register some connection factories
# connectionfactory.[jndiname] = [ConnectionURL]
connectionfactory.qpidConnectionfactory=amqp://guest:guest@clientid/test?brokerlist='tcp://localhost:5672'
# Register an AMQP destination in JNDI
# destination.[jndiName] = [BindingURL]
destination.directQueue=direct://amq.direct//QpidStockQuoteService
- -----------------------------------

Thanks.
Suran


- --
U. Suran Jayathilaka
WSO2, Inc. - http://www.wso2.com

http://suranjay.blogspot.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIRkG2Xkt94l6LfXURAhEDAJ49i4qZNupb0sUbZwXYAmJzJSSeYgCgg1qu
EP+J3NcsTP3HFa4lcl6UQo4=
=BEQz
-----END PGP SIGNATURE-----


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


Re: synapse JMSListener fails if services.xml doesn't specify transport.jms.Destination

Posted by Rajith Attapattu <ra...@gmail.com>.
On Thu, Jun 12, 2008 at 8:39 AM, Ruwan Linton <ru...@gmail.com>
wrote:

> Hi Suran,
>
> Sorry for the delay in responding,
>
> I think the issue is that Qpid does not create a queue upon receiving
> messages so in the case of missing the transport.jms.Destination parameter
> you will need to create a queue with the name of the Service of which you
> are listening over JMS.


The last time I looked at the JMS transport if transport.jms.Destination is
present it will use that, but if its not there it will based on the
destination type (if specified) will create a queue or a topic using a
QueueConnection/TopicConnection using the service name as the queue.
This is done independent of the messaging provider. So I don't think Suran
needs to do anything special here.

So irrespective of whether transport.jms.Destination is specified when the
service starts it should be listening on a queue.

Regards,

Rajith.


>
>
> Could you please try this and let me know, whether it is working with this?
>
> Thanks,
> Ruwan
>
> On Wed, Jun 4, 2008 at 12:48 PM, Suran Jayathilaka <su...@wso2.com> wrote:
>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> hi,
>>
>> When testing the JMS transport with a QPid broker, I found this problem.
>> When I use the JMS transport in Axis2 (1.4), if a destination isn't given
>> as the paramater "transport.jms.Destination" in the services.xml, it would
>> create a Queue by the service name and work correctly. When this parameter
>> is avaialable also the Axis2 JMS transport works without errors.
>>
>> But when I switched to the JMS transport from the
>> synapse-transports-<verison>.jar, if the above named parameter isn't
>> included in the service descriptor, the JMSListener  fails saying
>> [ERROR] The service cannot be found for the endpoint reference (EPR)
>> org.apache.axis2.AxisFault: The service cannot be found for the endpoint
>> reference (EPR)
>> ~        at
>> org.apache.axis2.engine.DispatchPhase.checkPostConditions(DispatchPhase.java:64)
>> ~        at org.apache.axis2.engine.Phase.invoke(Phase.java:333)
>> ~        at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:264)
>> ~        at
>> org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:163)
>> ~        at
>> org.apache.synapse.transport.base.AbstractTransportListener.handleIncomingMessage(AbstractTransportListener.java:256)
>> ~        at
>> org.apache.synapse.transport.jms.JMSMessageReceiver$Worker.run(JMSMessageReceiver.java:218)
>> ~        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)
>>
>> And as soon as I add the "transport.jms.Destination" param to the
>> services.xml, the the synapse JMSListener would also work.
>>
>> Shouldn't the transport be able to work with the auto created Queue
>> without needing the parameter explicitly?
>> I tested this scenario with both synapse-transports-1.1.1.jar and
>> synapse-transports-1.2-beta1.jar with similar results.
>> Please let me know if I might be doing something incorrectly.
>>
>> The services.xml is
>> - --------------------
>> <service name="QpidStockQuoteService" scope="application"
>> targetNamespace="http://axis2qpid.wso2.org">
>> ~    <description>
>> ~        Stock Quote Service Over AMQP
>> ~    </description>
>> ~    <messageReceivers>
>> ~        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"
>> ~
>> class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/>
>> ~        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
>> ~
>> class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
>> ~    </messageReceivers>
>> ~    <parameter
>> name="ServiceClass">org.wso2.example.axis2qpid.service.QpidStockQuoteService</parameter>
>> ~    <parameter name="transport.jms.Destination">directQueue</parameter>
>> </service>
>> - -------------------------------
>>
>> directQueue refers to a destination  binding in a jndi properties file.
>> - --------------------------------
>> #initial context factory
>> #java.naming.factory.initial
>> =org.apache.qpid.jndi.PropertiesFileInitialContextFactory
>> # register some connection factories
>> # connectionfactory.[jndiname] = [ConnectionURL]
>> connectionfactory.qpidConnectionfactory=amqp://guest:guest@clientid
>> /test?brokerlist='tcp://localhost:5672'
>> # Register an AMQP destination in JNDI
>> # destination.[jndiName] = [BindingURL]
>> destination.directQueue=direct://amq.direct//QpidStockQuoteService
>> - -----------------------------------
>>
>> Thanks.
>> Suran
>>
>>
>> - --
>> U. Suran Jayathilaka
>> WSO2, Inc. - http://www.wso2.com
>>
>> http://suranjay.blogspot.com
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.4.6 (GNU/Linux)
>> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>>
>> iD8DBQFIRkG2Xkt94l6LfXURAhEDAJ49i4qZNupb0sUbZwXYAmJzJSSeYgCgg1qu
>> EP+J3NcsTP3HFa4lcl6UQo4=
>> =BEQz
>> -----END PGP SIGNATURE-----
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
>> For additional commands, e-mail: dev-help@synapse.apache.org
>>
>>
>
>
> --
> Ruwan Linton
> http://wso2.org - "Oxygenating the Web Services Platform"
> http://ruwansblog.blogspot.com/




-- 
Regards,

Rajith Attapattu
Red Hat
http://rajith.2rlabs.com/

Re: synapse JMSListener fails if services.xml doesn't specify transport.jms.Destination

Posted by Ruwan Linton <ru...@gmail.com>.
Hi Suran,

Sorry for the delay in responding,

I think the issue is that Qpid does not create a queue upon receiving
messages so in the case of missing the transport.jms.Destination parameter
you will need to create a queue with the name of the Service of which you
are listening over JMS.

Could you please try this and let me know, whether it is working with this?

Thanks,
Ruwan

On Wed, Jun 4, 2008 at 12:48 PM, Suran Jayathilaka <su...@wso2.com> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> hi,
>
> When testing the JMS transport with a QPid broker, I found this problem.
> When I use the JMS transport in Axis2 (1.4), if a destination isn't given
> as the paramater "transport.jms.Destination" in the services.xml, it would
> create a Queue by the service name and work correctly. When this parameter
> is avaialable also the Axis2 JMS transport works without errors.
>
> But when I switched to the JMS transport from the
> synapse-transports-<verison>.jar, if the above named parameter isn't
> included in the service descriptor, the JMSListener  fails saying
> [ERROR] The service cannot be found for the endpoint reference (EPR)
> org.apache.axis2.AxisFault: The service cannot be found for the endpoint
> reference (EPR)
> ~        at
> org.apache.axis2.engine.DispatchPhase.checkPostConditions(DispatchPhase.java:64)
> ~        at org.apache.axis2.engine.Phase.invoke(Phase.java:333)
> ~        at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:264)
> ~        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:163)
> ~        at
> org.apache.synapse.transport.base.AbstractTransportListener.handleIncomingMessage(AbstractTransportListener.java:256)
> ~        at
> org.apache.synapse.transport.jms.JMSMessageReceiver$Worker.run(JMSMessageReceiver.java:218)
> ~        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)
>
> And as soon as I add the "transport.jms.Destination" param to the
> services.xml, the the synapse JMSListener would also work.
>
> Shouldn't the transport be able to work with the auto created Queue without
> needing the parameter explicitly?
> I tested this scenario with both synapse-transports-1.1.1.jar and
> synapse-transports-1.2-beta1.jar with similar results.
> Please let me know if I might be doing something incorrectly.
>
> The services.xml is
> - --------------------
> <service name="QpidStockQuoteService" scope="application" targetNamespace="
> http://axis2qpid.wso2.org">
> ~    <description>
> ~        Stock Quote Service Over AMQP
> ~    </description>
> ~    <messageReceivers>
> ~        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"
> ~
> class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/>
> ~        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
> ~
> class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
> ~    </messageReceivers>
> ~    <parameter
> name="ServiceClass">org.wso2.example.axis2qpid.service.QpidStockQuoteService</parameter>
> ~    <parameter name="transport.jms.Destination">directQueue</parameter>
> </service>
> - -------------------------------
>
> directQueue refers to a destination  binding in a jndi properties file.
> - --------------------------------
> #initial context factory
> #java.naming.factory.initial
> =org.apache.qpid.jndi.PropertiesFileInitialContextFactory
> # register some connection factories
> # connectionfactory.[jndiname] = [ConnectionURL]
> connectionfactory.qpidConnectionfactory=amqp://guest:guest@clientid
> /test?brokerlist='tcp://localhost:5672'
> # Register an AMQP destination in JNDI
> # destination.[jndiName] = [BindingURL]
> destination.directQueue=direct://amq.direct//QpidStockQuoteService
> - -----------------------------------
>
> Thanks.
> Suran
>
>
> - --
> U. Suran Jayathilaka
> WSO2, Inc. - http://www.wso2.com
>
> http://suranjay.blogspot.com
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFIRkG2Xkt94l6LfXURAhEDAJ49i4qZNupb0sUbZwXYAmJzJSSeYgCgg1qu
> EP+J3NcsTP3HFa4lcl6UQo4=
> =BEQz
> -----END PGP SIGNATURE-----
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
> For additional commands, e-mail: dev-help@synapse.apache.org
>
>


-- 
Ruwan Linton
http://wso2.org - "Oxygenating the Web Services Platform"
http://ruwansblog.blogspot.com/