on 08-01-2006 3:18 AM
Hello,
I have programmed JSP application with EJB that is using BAPI's and it is running on SAP J2EE server.
I have no idea how to use remote EJB on simple Java application.
can anybody help?.
Thank you in advance.
Thamas.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Create simple java applcation do the following steps:
public class SSample {
public static void main(String[] args) {
SampleEJB remote = null;
try {
Context ctx = new InitialContext();
SampleEJBHome home = (SampleEJBHome) ctx.lookup("SampleJNDI");
remote = home.create();
} catch (Exception e) {
System.out.println("Exception:" + e.getLocalizedMessage());
}
String result = remote.add(aFirst,aSecond,);
System.out.print("Result:" + result);
} catch (Exception ex) {
System.out.println("Exception:" + ex.getLocalizedMessage());
}
}
}
Go To Run > choose your program(client program to call ejb method) >
Arguments : VM Environment
paste the following code
-Djava.naming.factory.initial=com.sap.engine.services.jndi.InitialContextFactoryImpl -Djava.naming.provider.url=192.168.0.100:50004
replace the server IP address with your server IP address where your ejbs are running.
Under Class path settings for the program put the following jar files.
You can search for them from net weaver soruce folders
or copy from c:\usr\... (search under this folder)
connector.jar
activation.jar
ejb20.jar
ogging.jar
exception.jar
sapj2eeclient.jar
sapj2eenginedeploy.jar
and RUN >>>
this makes testing of your client programs easier, you can find the error trace on which line and saves lot of time.
Regards
Suresh KB
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.