on 03-31-2006 11:35 AM
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?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.