9 Replies Latest reply on Oct 14, 2010 3:10 PM by Wolf-Dieter Fink

    Error: java.lang.reflect.UndeclaredThrowableException

    jyotsana Newbie
      Hi I am using JBoss5 as ejb container and deployed an ejb jar file in it.
      From Tomcat6 through an Servlet I am accessing this ejb.
      This is the part of code of servlet deployed in Tomcat.
                Properties props=new Properties();
                      props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
                      props.put(Context.PROVIDER_URL, "jnp://localhost:1099");
                      props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
                      System.out.println("Properties ok");
                      Context ctx=new InitialContext(props);
                      System.out.println("context ok");
                      greetHome home = (greetHome)
                      System.out.println("home ok");
                      greetRemote remote=home.create();
                      System.out.println("remote ok");
                      String a = req.getParameter("text1");
                      String s = remote.greetme(a);

      In the Tomcat Server Screen I am getting the following Message



      Properties ok

      context ok

      home ok



      context ok
      Greet Home assigned to Null
      javax.naming.NameNotFoundException: greet not bound



      Here is my ejb-jar.xml file










      <transaction-type>Container </transaction-type>






      I created a greet.jar and deployed in JBoss. greet.jar contains three class(greetHome,greetRemote,greetBeen) and META-INF/ejb-jar.xml and META-INF/jboss.xml file.


      What I am doing wrong?