Click here to Skip to main content
13,287,343 members (52,841 online)
   

Java

 
GeneralRe: can anyone help me with my final project Pin
Richard MacCutchan25-Mar-13 0:42
mvpRichard MacCutchan25-Mar-13 0:42 
GeneralRe: can anyone help me with my final project Pin
ajp5527-Mar-13 1:30
memberajp5527-Mar-13 1:30 
GeneralRe: can anyone help me with my final project Pin
konate30-Apr-13 23:14
memberkonate30-Apr-13 23:14 
Questionexception : javax.naming.NoInitialContextException: Pin
swarjava23-Mar-13 18:41
memberswarjava23-Mar-13 18:41 
Hi,
I have written a simple ejb application(stateless session bean) in eclipse. When iam running the client program getting the below exception on console:
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

My client program is as below:
import javax.naming.InitialContext;

import example.ExampleSessionBeanRemote;

public class Main {
public void runTest() throws Exception {
InitialContext ctx = new InitialContext();
ExampleSessionBeanRemote bean =
(ExampleSessionBeanRemote) ctx
.lookup("ejb/ExampleSessionBean");
int result = bean.multiply(3, 4);
System.out.println(result);
}

public static void main(String[] args) {
Main cli = new Main();
try {
cli.runTest();
} catch (Exception e) {
e.printStackTrace();
}
}
}

How to solve the above exception, do i need to include something in websphere, i have just include the jar file of the session bean i have written in eclipse.

Thanks.
AnswerRe: exception : javax.naming.NoInitialContextException: Pin
Prasad Khandekar26-Apr-13 1:30
memberPrasad Khandekar26-Apr-13 1:30 
QuestionOnlick POPUP the Calender month based on dropdownlist Pin
siddiqali md21-Mar-13 3:17
membersiddiqali md21-Mar-13 3:17 
AnswerRe: Onlick POPUP the Calender month based on dropdownlist Pin
Richard MacCutchan21-Mar-13 4:32
mvpRichard MacCutchan21-Mar-13 4:32 
QuestionHow to import file and compare the file with other file in j2se platform Pin
Member 824369315-Mar-13 10:47
memberMember 824369315-Mar-13 10:47 
AnswerRe: How to import file and compare the file with other file in j2se platform Pin
Richard MacCutchan16-Mar-13 0:11
mvpRichard MacCutchan16-Mar-13 0:11 
AnswerRe: How to import file and compare the file with other file in j2se platform Pin
Prasad Khandekar26-Apr-13 1:36
memberPrasad Khandekar26-Apr-13 1:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy |
Web02 | 2.8.171207.1 | Last Updated 9 Dec 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid