• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

lookup problem in jboss-3.0.8

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
reply
    Bookmark Topic Watch Topic
  • New Topic