users@glassfish.java.net

Re: problem with running ejb client

From: <glassfish_at_javadesktop.org>
Date: Fri, 16 Jan 2009 05:55:12 PST

what do you mean exactly?

My code is very simple atm because i want to run it and then refactor my simple rmi server to ejb project. So code for a client:

package com.webage.client;

import java.util.Properties;

import javax.naming.*;
import com.webage.ejbs.SimpleBean;

public class TestClient {

        public void runTest() throws Exception {
                
                InitialContext ctx = new InitialContext();
                SimpleBean bean = (SimpleBean) ctx.lookup("ejb/SimpleBeanJNDI");
                String result = bean.sayHello("Billy Bob");
                System.out.println(result);
        }

        public static void main(String[] args) {
                try {
                        TestClient cli = new TestClient();
                        cli.runTest();

                } catch (Exception e) {
                        e.printStackTrace();
                }
        }
}



BTW: i have read sth about adding jars from glassfish/lib to a classpath. What in case where i want to run client on sth other machine without gf? Should i copy these jars to that machine? Does it mean than even simple 'Hello' application weights several megabytes?
[Message sent by forum member 'freeq1986' (freeq1986)]

http://forums.java.net/jive/thread.jspa?messageID=326462