Skip to Content
0
Former Member
Apr 20, 2009 at 08:10 AM

ApplicationPropertiesAccess

98 Views

Hello everybody,

does anybody know how to do this?

I execute the following coding:

try {
// Obtain the JNDI context
	Hashtable<String, String> prop = new Hashtable<String, String>();
	prop.put(Context.INITIAL_CONTEXT_FACTORY, "com.sap.engine.services.jndi.InitialContextFactoryImpl");
	prop.put(Context.PROVIDER_URL, "servername:50004");
	InitialContext ctx = new InitialContext(prop);

// access the Application-Configuration-Façade service
ApplicationPropertiesAccess appCfgProps =   (ApplicationPropertiesAccess)ctx.lookup("ApplicationConfiguration");

java.util.Properties appProps =	appCfgProps.getApplicationProperties();
if (appProps==null) {
//do something
   } else {
//do something else
   }
}catch(Exception e) {
	e.printStackTrace();
}

The help page http://help.sap.com/saphelp_nwpi71/helpdata/en/45/c88109a0df570de10000000a114a6b/frameset.htm suggests just an initial InitialContext, so without properties. If I do this, I immediately get the exception that the naming factory is not provided. Same for the URL, this seems to be mandatory. Executing this code the server is accessed, but I receive the exception as follows:

com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Object not found in lookup of ApplicationConfiguration.

at com.sap.engine.services.jndi.implserver.ServerContextImpl.lookup(ServerContextImpl.java:584)

at com.sap.engine.services.jndi.implserver.ServerContextRedirectableImpl.lookup(ServerContextRedirectableImpl.java:80)

at com.sap.engine.services.jndi.implserver.ServerContextRedirectableImplp4_Skel.dispatch(ServerContextRedirectableImplp4_Skel.java:872)

at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:351)

at com.sap.engine.services.rmi_p4.server.ServerDispatchImpl.run(ServerDispatchImpl.java:70)

at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:62)

at com.sap.engine.services.rmi_p4.P4Message.execute(P4Message.java:37)

at com.sap.engine.services.cross.fca.FCAConnectorImpl.executeRequest(FCAConnectorImpl.java:872)

at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:53)

at com.sap.engine.services.cross.fca.MessageReader.run(MessageReader.java:58)

at com.sap.engine.core.thread.execution.Executable.run(Executable.java:108)

at com.sap.engine.core.thread.execution.CentralExecutor$SingleThread.run(CentralExecutor.java:304)

-

-


predecessor system -

-


com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Object not found in lookup of ApplicationConfiguration.

at com.sap.engine.services.jndi.implserver.ServerContextImpl.lookup(ServerContextImpl.java:584)

at com.sap.engine.services.jndi.implserver.ServerContextRedirectableImpl.lookup(ServerContextRedirectableImpl.java:80)

at com.sap.engine.services.jndi.implserver.ServerContextRedirectableImplp4_Skel.dispatch(ServerContextRedirectableImplp4_Skel.java:872)

at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:351)

at com.sap.engine.services.rmi_p4.server.ServerDispatchImpl.run(ServerDispatchImpl.java:70)

at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:62)

at com.sap.engine.services.rmi_p4.P4Message.execute(P4Message.java:37)

at com.sap.engine.services.cross.fca.FCAConnectorImpl.executeRequest(FCAConnectorImpl.java:872)

at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:53)

at com.sap.engine.services.cross.fca.MessageReader.run(MessageReader.java:58)

at com.sap.engine.core.thread.execution.Executable.run(Executable.java:108)

at com.sap.engine.core.thread.execution.CentralExecutor$SingleThread.run(CentralExecutor.java:304)

Seems like the parameters for my special application cannot be found. They're uploaded, however, I can see them in the NWA. Is any special environment parameter needed for the InitialContext? I don't see how the system is able to know which application I request (I'm executing a test method locally for testing).

Would be nice if somebody could help me, I don't want to open yet another OSS message to this topic...

Regards,

Jörg

Edited by: Joerg Thiesmann on Apr 20, 2009 10:10 AM

Edited by: Joerg Thiesmann on Apr 20, 2009 10:13 AM