File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JBoss/WildFly and the fly likes Please help me to run a client Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Please help me to run a client " Watch "Please help me to run a client " New topic

Please help me to run a client

Jasmine kaur
Ranch Hand

Joined: Nov 25, 2003
Posts: 160
Hello Everybody ,
Iam facing this problem to run a client with JBoss4.0 , this is my client code and In the classpath I have put the following jar files :
if any other file is requierd please tell me or something is wrong in the classpath or in code so please do tell me.

import java.util.*;
import javax.rmi.*;
import javax.ejb.*;
import javax.naming.*;

public class MathClient
public static void main(String h[])
System.out.println("Iam in the client");
Properties prop=new Properties();
Context context=new InitialContext(prop);
Object object=context.lookup("abhi");
MathHome home=(MathHome)PortableRemoteObject.narrow(object,MathHome.class);
MathRemote remote=home.create();
System.out.println("My addition value is:"+remote.add(20,20));
catch(NamingException e){
catch(Exception f){

This exception is comming after running the program .

D:\ABHI\EJB\SESSION>java MathClient
javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interf
aces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: o
at javax.naming.spi.NamingManager.getInitialContext(
at javax.naming.InitialContext.getDefaultInitCtx(
at javax.naming.InitialContext.init(
at javax.naming.InitialContext.<init>(
at MathClient.main(
Caused by: java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFac
at Method)
at java.lang.ClassLoader.loadClass(
at sun.misc.Launcher$AppClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
at java.lang.ClassLoader.loadClassInternal(
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(
at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.jav
at javax.naming.spi.NamingManager.getInitialContext(
... 4 more

Thanks in advance.

jasmine kaur
Heonkoo Lee
Ranch Hand

Joined: Feb 10, 2005
Posts: 85
Add jbossall-client.jar to your classpath. This is only API you need to include to run your client.
Dave Salter
Ranch Hand

Joined: Jul 20, 2005
Posts: 293

If you use jbossall-client.jar instead of all the other jars, you should have everything you need.
Jasmine kaur
Ranch Hand

Joined: Nov 25, 2003
Posts: 160
Hi ,
Thanks a lot for helping me , client is running .
Thanks a tonnne.
Thanks once again.
I agree. Here's the link:
subject: Please help me to run a client
It's not a secret anymore!