I have written a simple remote interface, home interface, the bean class, the deployment descriptor and the vendoe specific xml file (all manually) to
test a simple Hello World case.
Now I have created the HelloWorld.jar file with the files in its proper folders --
i.e. I kept
Hello.class (Remote interface)
HelloHome.class (Home interface)
HelloBean.class (Bean class)
within a folder called "examples" while I kept
ejb-jar.xml (Deployment descriptor)
jboss.xml (Vendor specific file)
within a folder called "META-INF"
I successfully deployed the jar file (created by jar cf HelloWorld.jar *) into the deployment directory of
JBOSS.
I now have the HelloClient file.
Few points to take not of --
I am working from the folder "samples" and I have three folders "src", "examples" and "META-INF" as the sub-folders. I am using "package examples" in all the
java files which are placed in the "src" folder. I have compiled the files using "java -d examples src\*.java" This resulted in the generation of the corresponding 4 class files in the "examples" folder.
Now the main file is when I am trying to execute the Client file.
I am trying to execute the following command from the "samples" folder ---
"java examples.HelloClient"
This is giving the following errors --
C:\JBoss-2.4.3_Tomcat-3.2.3\samples>java examples.HelloClient
Exception in thread "main" javax.naming.NoInitialContextException: Need to speci
fy class name in environment or system property, or as an applet parameter, or i
n an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
40)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243
)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.jav
a:280)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at examples.HelloClient.main(HelloClient.java:36) I am listing the full codes for the 4 java files ---
Hello.java HelloHome.java HelloBean.java HelloClient.java Above 4 files are part from Ed Roman's book.
jboss.xml ejb-jar.xml CAN ANYONE PLEASE HELP ME ?? 
[ May 28, 2002: Message edited by: Arijit Ghosh ]