4 Replies Latest reply on Apr 16, 2004 9:31 AM by sesques

    Caused by: java.rmi.ServerException: RuntimeException; neste

    isurunishan2000 Newbie

      Hi.I generated ejb classes using xdoclet.
      IDE-eclipse
      plugin-lomboz
      appserver-JBOSS3.2.x

      I deployed successfully
      But testclient throws an exception
      Caused by: java.rmi.ServerException: RuntimeException; nested exception is: etc..
      What is the reason?

        • 1. Re: Caused by: java.rmi.ServerException: RuntimeException; n
          sesques Novice

          Post more logs and more code snippet, not just saying IT NOT WORK.
          Unable to investigate without infos.

          • 2. Re: Caused by: java.rmi.ServerException: RuntimeException; n
            isurunishan2000 Newbie

             

            "sesques" wrote:
            Post more logs and more code snippet, not just saying IT NOT WORK.
            Unable to investigate without infos.

            This is the client code I used (auto generated by eclipse)

            /*
            * Created on Apr 16, 2004
            *
            * To change the template for this generated file go to
            * Window>Preferences>Java>Code Generation>Code and Comments
            */
            package virtusa.dashboard.administrator.test;

            import java.rmi.RemoteException;
            import java.util.Hashtable;

            import javax.ejb.CreateException;
            import javax.naming.InitialContext;
            import javax.naming.NamingException;

            /**
            * @author isamaraweera
            *
            * To change the template for this generated type comment go to
            * Window>Preferences>Java>Code Generation>Code and Comments
            */
            public class TestClient {

            private virtusa.dashboard.administrator.session.ServiceAccessHome getHome()
            throws NamingException {
            return (
            virtusa
            .dashboard
            .administrator
            .session
            .ServiceAccessHome) getContext()
            .lookup(
            virtusa
            .dashboard
            .administrator
            .session
            .ServiceAccessHome
            .JNDI_NAME);
            }
            private InitialContext getContext() throws NamingException {
            Hashtable props = new Hashtable();

            props.put(
            InitialContext.INITIAL_CONTEXT_FACTORY,
            "org.jnp.interfaces.NamingContextFactory");
            props.put(InitialContext.PROVIDER_URL, "jnp://127.0.0.1:1099");

            // This establishes the security for authorization/authentication
            props.put(InitialContext.SECURITY_PRINCIPAL,"");
            props.put(InitialContext.SECURITY_CREDENTIALS,"");

            InitialContext initialContext = new InitialContext(props);
            return initialContext;
            }
            public void testBean() {

            try {
            virtusa.dashboard.administrator.session.ServiceAccess myBean =
            getHome().create();
            System.out.println(myBean.loginUser("isuru","isuru"));
            //--------------------------------------
            //This is the place you make your calls.
            //System.out.println(myBean.callYourMethod());

            } catch (RemoteException e) {
            e.printStackTrace();
            } catch (CreateException e) {
            e.printStackTrace();
            } catch (NamingException e) {
            e.printStackTrace();
            }
            }

            public static void main(String[] args) {
            TestClient test = new TestClient();
            test.testBean();

            }
            }


            • 3. Re: Caused by: java.rmi.ServerException: RuntimeException; n
              sesques Novice

              Are you sure you can access the InitialContext.INITIAL_CONTEXT_FACTORY wihout an Initial context instance ?

              No more idea with this code snippet.
              Perhaps with the full log.

              • 4. Re: Caused by: java.rmi.ServerException: RuntimeException; n
                sesques Novice

                Forget my previous comment. Its ridiculous.
                I have really no idea.
                Sorry.