Hi,
I have developed a simple HelloWorld EJB using JBuilder 9.0 and Weblogic 8.1.
When I try to invoke it it gives me the error :-
javax.naming.LinkException: . Root exception is javax.naming.NameNotFoundException: remaining name: /app/ejb/HelloWorld.jar#HelloWorldBean/local-home
at weblogic.j2eeclient.SimpleContext.resolve(SimpleContext.java:35)
........
Client code :-
Context ctx = getInitialContext("t3://localhost:7001", "weblogic", "weblogic");
....
static Context getInitialContext(String url, String user, String password) {
try{
Properties h = new Properties();
h.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
h.put(Context.PROVIDER_URL, url);
h.put(Context.SECURITY_PRINCIPAL, user);
h.put(Context.SECURITY_CREDENTIALS, password);
return new InitialContext(h);
}catch(Exception e) {System.out.println("Error in getInitialContext" + e); return null;}
}
Can u please help me to solve this problem. I tried with Remote it works.
Thanks,
Samsidd
-
Local Beans + Invoking Error (5 messages)
- Posted by: Sameer Patil
- Posted on: July 22 2003 07:23 EDT
Threaded Messages (5)
- Remote Clients aren't local! by Gwyn Evans on July 22 2003 09:08 EDT
- My Client is local by Sameer Patil on July 22 2003 09:19 EDT
- Test options by Gwyn Evans on July 22 2003 11:15 EDT
-
Create a webapp client and package with the EJB as complete EAR by sabha m on July 22 2003 06:50 EDT
- It worked by Sameer Patil on July 24 2003 12:25 EDT
- My Client is local by Sameer Patil on July 22 2003 09:19 EDT
-
Remote Clients aren't local![ Go to top ]
- Posted by: Gwyn Evans
- Posted on: July 22 2003 09:08 EDT
- in response to Sameer Patil
Local interfaces are for use by beans co-located in the same EJB container, and allows them to be used without the distributed object protocol overhead - You probably want to have a facade bean exposing a remote interface then the facade bean calls your other beans via their local interfaces. -
My Client is local[ Go to top ]
- Posted by: Sameer Patil
- Posted on: July 22 2003 09:19 EDT
- in response to Gwyn Evans
hi,
I wanted a local client or any application to test the local interface ie, local bean. How should i modify my client code to call the local interface.
Thanks,
Samsidd -
Test options[ Go to top ]
- Posted by: Gwyn Evans
- Posted on: July 22 2003 11:15 EDT
- in response to Sameer Patil
Ah - now we're getting to the tricky stuff! :-)
The two approaches that I know involves either
[1] getting your test-cases on to the AppServer, e.g. JunitEE (http://www.junitee.org) or Cactus (http://jakarta.apache.org/cactus/), or
[2] running them within an app-server simulator, e.g, Glider (http://www.ensemble-systems.com/glider/)
The 1st two are open-source, while the 2nd is commercial, but definately worth a look. -
Create a webapp client and package with the EJB as complete EAR[ Go to top ]
- Posted by: sabha m
- Posted on: July 22 2003 18:50 EDT
- in response to Sameer Patil
Add a jsp file invoking your current client code and package that as a War along with the EJB as a complete EAR and deploy. The local EJB home would be only accessible within the application context and not outisde of the application as in Remote EJBs. -
It worked[ Go to top ]
- Posted by: Sameer Patil
- Posted on: July 24 2003 00:25 EDT
- in response to sabha m
Hi,
I created a EAR file having my client file , WAR file and the JAR file of EJBS.
Then my client code was able to access the Beans locally.
Thanks for everything.
samsidd