cancel
Showing results for 
Search instead for 
Did you mean: 

Remote lookup of WAS-JMS-Factory from standalone nonJ2EE client?

0 Kudos

Hello,

I am working on a non-J2EE-Client which runs as a bundled application on OSGI, and need to send and receive messages to/from a queue which is adminstered by the WAS JMS provider. Unfortunately, I cannot even do a lookup of the ConnectionFactory so far..

A naive attempt was to do the following:

props.put(Context.PROVIDER_URL, "hostOfServer:50004");

Context jndiContext = new InitialContext(props);

factory = (QueueConnectionFactory) jndiContext.lookup(CONNECTION_FACTORY);

but as expected that didn't work with JNDI.

Does anybody have a hint what I have to do to to the remote lookup?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello Katrin,

Perhaps it's not quite good idea to hardcode user/pass in the code. A better approach would be to have a file jndi.properties somewhere in the classpath.

And in that text file the following lines

java.naming.factory.initial=com.sap.engine.services.jndi.InitialContextFactoryImpl

java.naming.provider.url=MyServer:50004

java.naming.security.principal=MyUser

java.naming.security.credentials=MyPassword

Btw, in order to do the jndi lookup you will need sapj2eeclient.jar in the classpath as well.

Btw, did you receiver any exception ? It would be helpful to post the message.

HTH

Peter

former_member182372
Active Contributor
0 Kudos

Hi Katrin,

Don`t really know whether it will usefull for you but anyway - check this

Best regards, Maksim Rashchynski.