axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "adisesha" <adisesha.neelaiah...@in.ness.com>
Subject RE: Axis2 with JMS Transport
Date Wed, 28 May 2008 10:03:33 GMT
Hi,

 

I tried both options as suggested; still I am getting same error

        1.<parameter name="Operation">urn:echoString</parameter>

   2. I would suggest the Synapse JMS transport implementation

 

Can you please look in to this issue?

 

Adi

  _____  

From: Asankha C. Perera [mailto:asankha@wso2.com] 
Sent: Tuesday, May 27, 2008 5:38 PM
To: axis-user@ws.apache.org
Subject: Re: Axis2 with JMS Transport

 

Hi Adi

Can you go through the following links:

http://marc.info/?l=axis-dev
<http://marc.info/?l=axis-dev&m=120000476710938&w=2> &m=120000476710938&w=2
http://www.nabble.com/Axis2-JMS-Transport-to-WebSphere-MQ-td14738492.html
https://issues.apache.org/jira/browse/AXIS2-2816

Related questions have been asked on the axis dev and user lists and these
should be helpful to you..

I am sorry I am unable to look at this issue in detail right now, but if the
above does not help resolve your issue, please ping again..

asankha


adisesha wrote: 

HI Asankha,

 

Firstly thanks a lot for replying, I have been sending mails since last week
& I got one from you :-)

 

My Requirement: I want to use Axis2Service with jms & websphereMQ (Soap
Message). In net I haven't seen any article related to this combination.
Kindly correct me if I am wrong

1.	Axis2.Xml (Created SampleQCF connection factory in MQ using JMSAdmin
& sampleconfig.scp)

<transportReceiver name="jms"
class="org.apache.axis2.transport.jms.JMSListener">

    <parameter name="myQueueConnectionFactory" locked ="false">

            <parameter
name="java.naming.factory.initial">com.ibm.mq.jms.context.WMQInitialContextF
actory</parameter>

            <parameter
name="java.naming.provider.url">localhost:1414/SYSTEM.DEF.SVRCONN</parameter
>

          <parameter
name="transport.jms.ConnectionFactoryJNDIName">SampleQCF</parameter>

        </parameter>

</transportReceiver>

<transportSender name="jms"

                     class="org.apache.axis2.transport.jms.JMSSender">

      <parameter name="myQueueConnectionFactory" locked ="false">

        <parameter
name="java.naming.factory.initial">com.ibm.mq.jms.context.WMQInitialContextF
actory</parameter>

        <parameter
name="java.naming.provider.url">localhost:1414/SYSTEM.DEF.SVRCONN</parameter
>

        <parameter
name="transport.jms.ConnectionFactoryJNDIName">SampleQCF</parameter>

      </parameter>

    </transportSender>

2.	services.xml

<service name="Echo">

      <description>   Echo Service  </description>   

     <operation name="echoString">

       <messageReceiver
class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>

             <actionMapping>urn:echoString</actionMapping>

     </operation>

  <parameter name="ServiceClass" locked="true">Echo</parameter>    

  <parameter name="transport.jms.ConnectionFactory"
locked="true">myQueueConnectionFactory</parameter>

  <parameter name="transport.jms.Destination"
locked="true">SampleQueue</parameter>  

</service>

3.	Echo.java (Axis2Service, i.e Created .class & then .aar & then
copied it to tomcat.\axis2\....services)

public class Echo

{

                  public String echoString(String in) 

                        {

                        return "thanks:";

                        }     

}

4.	Soap Message (I am putting directly in to Queue using "Put Text
Message" in websphere MQ explorer)

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV=
<http://schemas.xmlsoap.org/soap/envelope/>
"http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC=
<http://schemas.xmlsoap.org/soap/encoding/>
"http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi=
<http://www.w3.org/2001/XMLSchema-instance>
"http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd=
<http://www.w3.org/2001/XMLSchema>
"http://www.w3.org/2001/XMLSchema"<SOAP-ENV:Body><ns:Echo
xmlns:ns="urn:echoString"><UserInfo>String</UserInfo><Input>Welcome to
sample</Input></ns:Echo></SOAP-ENV:Body></SOAP-ENV:Envelope>

 

Let me know if I need synapse.jar & <parameter
name="Operation">urn:echoString</parameter>
 
Thanks in advance
Adi
  _____  


From: Asankha C. Perera [mailto:asankha@wso2.com] 
Sent: Tuesday, May 27, 2008 4:45 PM
To: axis-user@ws.apache.org
Subject: Re: Axis2 with JMS Transport

 

Adi




Error:

1. Now when I put text message in to Queue "Echo" immediately it disappears
from MQ. In tomcat log I can see "Exception in thread "JMSWorker-1"
java.lang.NullPointerException

      at
org.apache.axis2.transport.jms.JMSMessageReceiver.createMessageContext(JMSMe
ssageReceiver.java:190)"

What is the content type of your message? if your payload is text/plain, it
could be due to a MessageBuilder problem. 

I would suggest the Synapse JMS transport implementation (which is an
updated version of the same JMS transport available with Axis2) for you
here. You can drop the Jar from here
<http://repo1.maven.org/maven2/org/apache/synapse/synapse-transports/1.1.2/s
ynapse-transports-1.1.2.jar>
[http://repo1.maven.org/maven2/org/apache/synapse/synapse-transports/1.1.2/s
ynapse-transports-1.1.2.jar]

A typical configuration on your axis2.xml would be like:
    <!--Uncomment this and configure as appropriate for JMS transport
support, after setting up your JMS environment (e.g. ActiveMQ)
    <transportReceiver name="jms"
class="org.apache.synapse.transport.jms.JMSListener">
        <parameter name="myTopicConnectionFactory">
            <parameter
name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialC
ontextFactory</parameter>
            <parameter
name="java.naming.provider.url">tcp://localhost:61616</parameter>
            <parameter
name="transport.jms.ConnectionFactoryJNDIName">TopicConnectionFactory</param
eter>
        <parameter name="transport.jms.ConnectionFactoryType"
locked="false">topic</parameter>
        </parameter>

        <parameter name="myQueueConnectionFactory">
            <parameter
name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialC
ontextFactory</parameter>
            <parameter
name="java.naming.provider.url">tcp://localhost:61616</parameter>
            <parameter
name="transport.jms.ConnectionFactoryJNDIName">QueueConnectionFactory</param
eter>
        <parameter name="transport.jms.ConnectionFactoryType"
locked="false">queue</parameter>
        </parameter>

        <parameter name="default">
            <parameter
name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialC
ontextFactory</parameter>
            <parameter
name="java.naming.provider.url">tcp://localhost:61616</parameter>
            <parameter
name="transport.jms.ConnectionFactoryJNDIName">QueueConnectionFactory</param
eter>
        <parameter name="transport.jms.ConnectionFactoryType"
locked="false">queue</parameter>
        </parameter>
    </transportReceiver>-->

....
    <transportSender name="jms"
class="org.apache.synapse.transport.jms.JMSSender">
        <!-- uncomment this and configure to use connection pools for
sending messages
        <parameter name="myTopicConnectionFactory">
            <parameter
name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialC
ontextFactory</parameter>
            <parameter
name="java.naming.provider.url">tcp://localhost:61616</parameter>
            <parameter
name="transport.jms.ConnectionFactoryJNDIName">TopicConnectionFactory</param
eter>
        </parameter>
    
        <parameter name="myQueueConnectionFactory">
            <parameter
name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialC
ontextFactory</parameter>
            <parameter
name="java.naming.provider.url">tcp://localhost:61616</parameter>
            <parameter
name="transport.jms.ConnectionFactoryJNDIName">QueueConnectionFactory</param
eter>
        </parameter>
    
        <parameter name="default">
            <parameter
name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialC
ontextFactory</parameter>
            <parameter
name="java.naming.provider.url">tcp://localhost:61616</parameter>
            <parameter
name="transport.jms.ConnectionFactoryJNDIName">QueueConnectionFactory</param
eter> 
        </parameter> -->
    </transportSender>





2. If I put message using "standalonewmq" program, I can see "[ERROR] Cannot
find operation : urn:mediate on the service Echo

Exception in thread "JMSWorker-1"
org.apache.axis2.transport.jms.AxisJMSException: Cannot find operation :
urn:mediate on the service Echo

      at
org.apache.axis2.transport.jms.JMSUtils.handleException(JMSUtils.java:464)

      at
org.apache.axis2.transport.jms.JMSUtils.getSOAPEnvelope(JMSUtils.java:378)"

With the JMS transport, unless you specify the operation name in your
services.xml with the parameter "Operation", this defaults to an operation
named "mediate"





<parameter name="Operation">urn:sayHello</parameter>
 
asankha







Disclaimer

The information contained in this communication is intended solely for the
use of the individual or entity to whom it is addressed and others
authorized to receive it. It may contain confidential or legally privileged
information. If you are not the intended recipient you are hereby notified
that any disclosure, copying, distribution or taking any action in reliance
on the contents of this information is strictly prohibited and may be
unlawful. If you have received this communication in error, please notify us
immediately by forwarding this email to MailAdmin@ness.com and then delete
it from your system. Ness technologies is neither liable for the proper and
complete transmission of the information contained in this communication nor
for any delay in its receipt.

 


Mime
View raw message