on 09-07-2005 7:14 PM
From a web dynpro application I am trying to connection to a thrid party application that lives on a JBOSS server. The third party application requires me to set the JDNI properties as specified below.
I am not too familiar with JDNI and keep an error that the initial context could not be found.
My question is mainly about the first JDNI property. If I am setting java.naming.factory.initial to org.jnp.interfaces.NameingContextFactory, does my sap j2ee server need some special library to call this type of JDNI inital context? Or do I have to use a sap context factory type like "com.sap.engine.services.jndi.InitialContextFactoryImpl"
Again I'm not too familiar with JNDI but have been reading alot about it, so any help or experience with this would be appreciated.
JDNI Properties:
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.provider.url=jnp://tybw202021:1099
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
thanks,
Tom
You need to do something like this in your code:
Properties props = new Properties();
props.put( Context.PROVIDER_URL, "tybw202021:1099" );
props.put( Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory" );
Context ctx = new InitialContext( props );
if( ctx == null )
throw new Exception( "Failed to create context" );
Object o = ctx.lookup( "some/path/to/bean" );
(and then narrow the reference down, etc, etc).
I'm not sure what you would have to do with the java.naming.factory.url.pkgs - the docs for the Context interface might have more information on what key you should use - probably URL_PKG_PREFIXES.
Hope that helps you out!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.