Skip to Content
avatar image
Former Member

How to code JMS client to receive message from XI?

Hello guys,

I'm trying to setup an integration scenario with FTP as sender and JMS java client as receiver. XI AS as JMS provider, thus "Access JMS Provider with JNDI" is set as transport protocol for the receiver communication channel. As I code the java client, I need the jar file that contains SAP JMS implementation like the class com.sap.engine.services.jndi.InitialContextFactoryImpl. Where can I download this jar file to run the java client?

(The jms client is not running in the same machine as XI)

BTW, the initial context in the java JMS client is created like:

Properties p = new Properties();

p.put(Context.INITIAL_CONTEXT_FACTORY,"com.sap.engine.services.jndi.InitialContextFactoryImpl");

p.put(Context.PROVIDER_URL,"http://pwdf2709.wdf.sap.corp:50010");

jndiContext = new InitialContext(p);

However I'm not sure about protocol in the URL, is it HTTP or anything else?

Can somebody give me a hint for the problems?

Thanks

Jianjun

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Apr 19, 2006 at 03:41 AM

    Jianjun,

    >>I need the jar file that contains SAP JMS >>implementation like the class >>com.sap.engine.services.jndi.InitialContextFactoryImpl.

    It is <b>sapj2eeclient.jar</b>

    >> http://pwdf2709.wdf.sap.corp:50010

    for me , on the locally installed J2EE engine, localhost:50204 works...no need of HTTP. so in your code just change it to

    p.put(Context.PROVIDER_URL,"pwdf2709.wdf.sap.corp:50010");

    Make sure that it is the same port you see in P4 provider settings in Visual admin.

    Hope this helps.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Amol

      thanks for the infor, I found the jar file and this solves the original problem. However my jms client still doesn't work, The InitialContext can not be instantiated, it throws an exception <b>java.lang.NoClassDefFoundError: com/sap/exception/IBaseException</b> when execute <b><u>jndiContext = new InitialContext(p);</u> </b> , looks like the IBaseException is not included in the sapj2eeclient.jar. Any way it looks like the property I used to instantiate the initialcontext doens't contain all necessary/correct informatino. BTW 50010 is the default port for the SAP JMS provider's port, right? How can I find out what port is configured for the JMS provide in XI AS?

      Anyone can give me further help?

      Thanks

  • avatar image
    Former Member
    Apr 18, 2006 at 08:44 PM

    Hi,

    Please have a look into this part of SAP Help.

    http://help.sap.com/saphelp_nw04/helpdata/en/e8/01683c43e87845e10000000a11402f/frameset.htm

    Hope this helps,

    Regards,

    Moorthy

    Add comment
    10|10000 characters needed characters exceeded