cancel
Showing results for 
Search instead for 
Did you mean: 

How to code JMS client to receive message from XI?

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

Answers (1)

Answers (1)

moorthy
Active Contributor
0 Kudos

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