This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes ejb on weblogic Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "ejb on weblogic" Watch "ejb on weblogic" New topic
Author

ejb on weblogic

Prakash Dwivedi
Ranch Hand

Joined: Sep 28, 2002
Posts: 452
Hello Friends,
I am trying to work on EJBs and i am using weblogic 6.0
I have created my bean and deployed it on the server using command line
weblogic.deploy deploy password HelloWorld c:\helloWorld.jar
When i start my server, the server also creates 10 instances of my bean (I have mentioned this in deplyment decripter)
But my problem is my client is not able to locate the bean, the error which comes is
javax.naming.NameNotFoundException: Unable to resolve HelloWorld. Resolved: '' Unresolved:'HelloWorld' ; remaining name ''
i dont know why it is not working, when i start weblogic console, the name of my bean there is HelloWorld, then why it can not resolve the name HelloWorld.
I am attaching code of my java client

import javax.ejb.*;
import javax.naming.*;
import java.rmi.*;
import java.util.Properties;
import helloWorld.*;
public class HelloClient4
{
public static void main(String[] args)
{
try
{
Properties props = new Properties();
props.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.TengahInitialContextFactory");
props.put(Context.PROVIDER_URL,"t3://localhost:7001");
Context ctx = new InitialContext(props);
HelloHome home = (HelloHome) ctx.lookup("HelloWorld");
Hello hello = home.create();
System.out.println(hello.hello());
hello.remove();
}
catch(Exception e)
{
System.out.println(e);
}
}
}


Prakash Dwivedi (SCJP2, SCWCD, SCBCD)
"Failure is not when you fall down, Its only when you don't get up again"
Chris Mathews
Ranch Hand

Joined: Jul 18, 2001
Posts: 2712
What is the JNDI name you set in your weblogic-ejb-jar.xml deployment descriptor? Is this the name you are performing the lookup on?
BTW, this type of question should be posted in the WebLogic forum, you would probably get a better response. Could a moderator move this?
Prakash Dwivedi
Ranch Hand

Joined: Sep 28, 2002
Posts: 452
Thank you for your response, it is working now, the name specified in ejb-jar.xml was different.
Actually i was confused, i was in the impression that the name specified at weblogic.deploy is the jndi name.
thanks again

saddysan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ejb on weblogic
 
Similar Threads
NameNotFoundException
I have deployed my ejb with Weblogic and I have a problem with my client
Running EJB Client
EJB Client code Error : NameNotFoundException
Calling EJB from Java client