This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes EJB and Sun One Application server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB and Sun One Application server" Watch "EJB and Sun One Application server" New topic

EJB and Sun One Application server

Balaji Thirnrayan

Joined: Nov 13, 2003
Posts: 8
I am trying to run the simple EJB given in J2EE tutorials on Sun 's application server.
I am getting following error,
javax.naming.NameNotFoundException: No object bound for java:comp/env/ejb/Conver
at javax.naming.InitialContext.lookup(
at ConverterClient.main(
Caused by: java.lang.NullPointerException
Please let me know what am I missing here, this is my client code. ( The server is rnning and the EJB is deployed properly)
public static void main(String[] args) {
try {
Hashtable env = new Hashtable();
env.put (Context.INITIAL_CONTEXT_FACTORY, "com.sun.enterprise.naming.SerialInitContextFactory");
env.put(Context.PROVIDER_URL, "t3://localhost:8080");
env.put(Context.URL_PKG_PREFIXES, "com.sun.enterprise.naming" );
Context initial = new InitialContext(env);
Context myEnv = (Context) initial.lookup("java:comp/env");
Object objref = initial.lookup("ejb/ConverterBean");
ConverterHome home = (ConverterHome) PortableRemoteObject.narrow(objref,
Converter currencyConverter = home.create();
BigDecimal param = new BigDecimal("100.00");
BigDecimal amount = currencyConverter.dollarToYen(param);
amount = currencyConverter.yenToEuro(param);
} catch (Exception ex) {
System.err.println("Caught an unexpected exception!");
I agree. Here's the link:
subject: EJB and Sun One Application server
Similar Threads
Output from Sun's J2EE Tutorial
ejb hanging
Getting Class cast exception while Lookup EJB2.1 session bean using JNDI name in WAS6.1
How to run the ConverterClient app?
Advice Client problem