on ‎2008 Aug 07 3:49 PM
Hello Experts,
I have a little problem with my Java programm:
Test remote = null;
* try {*
// Create a new intial context, which loads from jndi.properties file.
* *
* Context ctx = new InitialContext();*
* System.out.println("Context:" + ctx);*
// Look up the home interface using the JNDI name.
// This JNDI lookup returns a reference to an EJBHome instance.
* TestHome home = (TestHome) ctx.lookup("sap.com/TestWorldEar/TestBean");*
* System.out.println("TestHome:" + home);*
// Create a session object.
* remote = home.create();*
* System.out.println("Remote:" + remote);*
// Invoke the remote EJB methods, test and debug.
* System.out.println("Result:" + remote.getWert());*
* } catch (Exception e) {*
* System.out.println("Exception: " + e.getLocalizedMessage());*
* }*
I always get the following error and I don't know how to solve the problem.
Exception: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
I hope anybody of you can help me solving this problem.
Additional information:
The Java program is running on a XI (Netweaver 7.0).
I want to get information from a deployed EJB. The Bean still works.
Thank you for your answers in advance!!!
Greetings, Alexander
Request clarification before answering.
Hi Alexander,
If you are not sure about the JNDI name of the Bean ,You should check its JNDI Name fom the ejb-j2ee-engine.xml file and if the JNDI name is not there you can specify any valid name,deploy the EJB Proj again.
Then try to lookup the EJB with its JNDI name instead of its Path on server.
Regards,
Siddharth
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 13 | |
| 8 | |
| 7 | |
| 5 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.