cancel
Showing results for 
Search instead for 
Did you mean: 

Java Proxies problem

Former Member
0 Kudos

When I was trying to do lookup for JNDI in my standalone application, I was replied with the following error...

"Cannot instantiate class: com.sap.engine.services.jndi.InitialContextFactoryImpl [Root exception is java.lang.ClassNotFoundException: com.sap.engine.services.jndi.InitialContextFactoryImpl"

Here is my code snippet

Properties p = System.getProperties();

p.put(Context.INITIAL_CONTEXT_FACTORY,"com.sap.engine.services.jndi.InitialContextFactoryImpl");

p.put(Context.PROVIDER_URL, "gbdci550.in.ibm.com:50300");

p.put(Context.SECURITY_PRINCIPAL, myusername);

p.put(Context.SECURITY_CREDENTIALS, mypassword);

Context ctx = new InitialContext(p);

queryOutHome = (FlightSeatAvailabilityQueryOut_PortTypeHome)

PortableRemoteObject.narrow(ctx.lookup("ejb/com/sap/FlightQuery"),FlightSeatAvailabilityQueryOut_PortTypeHome.class);

Here "FlightQuery" is application JNDI name.However I followed the documentation provided in SDN for building application.

Can any one assist me how can i call ejb from a standalone application.

Thanks

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

If you are using non-central AE,

then

To compile the Java proxy source code you have to apply several libraries, which you

will find on your non-central Adapter Framework installation:

aii_proxy_xirt.jar C:\usr\sap\J2E\JC00\j2ee\cluster\server0\bin\ext\com.sap.aii.proxy.xiruntime

aii_msg_runtime.jar C:\usr\sap\J2E\JC00\j2ee\cluster\server0\bin\ext\com.sap.aii.messaging.runtime

aii_utilxi_misc.jar C:\usr\sap\J2E\JC00\j2ee\cluster\server0\bin\ext\com.sap.xi.util.misc

guidgenerator.jar C:\usr\sap\J2E\JC00\j2ee\cluster\server0\bin\ext\com.sap.guid

The path is an example from an installation on a Windows server and may be

different in your environment.

Did you configured.

Regards

Chilla

stefan_grube
Active Contributor
0 Kudos

The class com.sap.engine.services.jndi.InitialContextFactoryImpl

should be in the lib sapj2eeclient.jar

Check the jar, if the class is inside (with Winzip) and check if the lib is applied to your Java program.

Stefan

Former Member
0 Kudos

Hi,

Have you assigned library References to the project accurately.

Please refer this doc it might help:

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d06315a6-e66e-2910-039c-ba8bbbd2...

Are you using the central J2EE Adapter Framework Instance.

If yes then you can try installing a non-central separate instance of it and add it to SLD and then try.

Former Member
0 Kudos

Hi Sumit..

Thanks for u r response...

Currently we are using central Adapter Engine.So how can i configure an instance which refers a non-central adapter Engine? I followed the same documentation what u had provided. There u can observe the lookup() which caused an error..

How can i overcome this lookup problem?