need help in j2ee with jboss

j2ee , java United States
  • 17 years ago

    hi
    i have written a small basic code in java following j2ee architecture. Read the following few lines  :-


    Properties h = new Properties();
    System.out.println("B4 INITIALCONTEXTFACTORY");
    //h.put(Context.INITIALCONTEXTFACTORY,"org.jboss.naming.HttpNamingContextFactory");
    h.put(Context.INITIALCONTEXTFACTORY,"org.jnp.interfaces.NamingContextFactory");
    h.put(Context.PROVIDERURL, "localhost:8080/Student/");
    System.out.println("AFTER INITIAL
    CONTEXT_FACTORY");


    System.out.println("AFTER URL");
    InitialContext context =  new InitialContext(h);
    System.out.println("AFTER context"+h.values());


    Object obj = context.lookup("StudentHome");
    System.out.println("AFTER lookup");
    home=(StudentHome) PortableRemoteObject.narrow(obj,StudentHome.class);
    home=(StudentHome) PortableRemoteObject.narrow(obj,StudentHome.class);
    System.out.println("AFTER home");


    It gives me following error :-
    org.apache.jasper.JasperException: Naming Exception: Exception thrown when tryingto look up Student EJB : StudentHome not bound


    I dont know really how to configure web.xml or any similar files if reqd.
    Plz help.
    -jay

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Most software today is very much like an Egyptian pyramid with millions of bricks piled on top of each other, with no structural integrity, but just done by brute force and thousands of slaves” - Alan Kay