File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes lookup problem in jboss-3.0.8 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "lookup problem in jboss-3.0.8" Watch "lookup problem in jboss-3.0.8" New topic
Author

lookup problem in jboss-3.0.8

Nalini Reddy
Greenhorn

Joined: Jul 01, 2004
Posts: 18
Hi All,
I have deployed HelloWorld EJB on jboss successfully.But when i am trying to run it it gives me the following error.

javax.naming.CommunicationException:RootException is java.rmi.Marshall Exception

also returns Exception:null


Could any of u please help me out.I need to develop a project on jboss,so trying to learn doing a sample example (HelloWorld example)first.

My HelloWorldClient program is as follows:

import javax.naming.Context;
import javax.naming.InitialContext;
import java.util.Hashtable;
import javax.ejb.CreateException;
import javax.rmi.PortableRemoteObject;
import javax.naming.NamingException;
import javax.ejb.RemoveException;


public class HelloWorldClient
{
public static void main( String [] args )
{
Hashtable h = new Hashtable();
h.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
h.put(Context.PROVIDER_URL, "localhost:1099");
h.put("java.naming.factory.url.pkgs",
"org.jboss.naming rg.jnp.interfaces");
try
{
Context ctx = new InitialContext(h);
Object obj = ctx.lookup( "HelloWorld" );

HelloWorldHome home =
(HelloWorldHome)javax.rmi.PortableRemoteObject.narrow(
obj, HelloWorldHome.class );
HelloWorld helloWorld = home.create();
System.out.println( helloWorld.hello());
helloWorld.remove();
}
catch ( Exception e )
{
e.printStackTrace();
System.out.println( "Exception: " + e.getMessage() );
}
}
}


I would b very grateful if anyone could help me out soon,please........

Thanks,in advance
Nalini.
 
GeeCON Prague 2014
 
subject: lookup problem in jboss-3.0.8