Hi all,

I am learning the EJB3. I follow a tutorial under:
http://www.webagesolutions.com/knowledgebase/javakb/jkb005/index.html

and it runs quite well since I use the SUN Application Server.

So I deployed the EJB Jars onto Geronimo 2. Bu tas I try to start the client
I got exception as follow:

Caused by: java.net.ConnectException: Connection refused: connect
        at sun.nio.ch.Net.connect(Native Method)
        at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:464)
        at
com.sun.corba.ee.impl.orbutil.ORBUtility.openSocketChannel(ORBUtility.java:105)
        at
com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:332)
        ... 16 more

Here is my session bean:
[code]
@Stateless(name = "Example",  mappedName = "ejb/SimpleBeanJNDI")
public class SimpleBeanImpl implements SimpleBean {
        public String sayHello(String name) {
                return "Hello, the text you enter is: " + name + "!";
        }
}

[/code]

And here is the client and lookup:

[code]
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, Wei Chen");
                System.out.println(result);
        }

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

                } catch (Exception e) {
                        e.printStackTrace();
                }
        }
}
[/code]

Has someone idea?

Regards

Thomas


-- 
View this message in context: 
http://www.nabble.com/Exception-by-using-EJB3-on-Geronimo-2-tp16418687s134p16418687.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.

Reply via email to