tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Samuel Ravikumar Thangamuthu, Chennai" <>
Subject Help needed...
Date Wed, 29 Apr 2009 12:25:29 GMT



  I am using Eclipse and Weblogic App Server to run "HelloWorld"
Application. I have written everything correctly but when I run the
application it shows the error "Error
javax.naming.NoInitialContextException: 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". 


But when I include the code "

It says that "weblogic.jndi.TengahInitialContextFactory" could not be
instantiated. The below is the Client program. I am struck and not able
to proceed. Please help me to overcome this.


package com.mypack;


import java.util.*;

import java.util.Properties;

import javax.naming.InitialContext;

import javax.naming.Context;

import javax.naming.*;

import java.rmi.*;

import javax.rmi.PortableRemoteObject;


public class HelloClient {

      public static void main(String a[]){






            InitialContext initialContext = new InitialContext();

            System.out.println(" CONTEXT GOT");


            Object ref =  initialContext.lookup("HelloWorldHome");

            System.out.println(" REFERENCE GOT");


            HelloWorldHome home =
(HelloWorldHome)PortableRemoteObject.narrow(ref, HelloWorldHome.class);


            HelloWorld myHelloWorld = home.create();

            System.out.println(" Calling EJB ...");


            String message = "";

            message = myHelloWorld.sayHello();


            System.out.println("The message is "+message);


      }catch(Exception e){

            System.err.println(" Error "+e);








Thanks in advance, <> 

Samuel.T <> 




The contents of this e-mail and any attachment(s) are confidential and intended for the named
recipient(s) only.
It shall not attach any liability on the originator or HCL or its affiliates. Any views or
opinions presented in 
this email are solely those of the author and may not necessarily reflect the opinions of
HCL or its affiliates.
Any form of reproduction, dissemination, copying, disclosure, modification, distribution and
/ or publication of 
this message without the prior written consent of the author of this e-mail is strictly prohibited.
If you have
received this email in error please delete it and notify the sender immediately. Before opening
any mail and 
attachments please check them for viruses and defect.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message