Here is a simple
ejb program.
Remote interface import javax.ejb.EJBObject;
import java.rmi.RemoteException;
import java.rmi.Remote;
public interface Hello extends EJBObject
{
public
String hello() throws java.rmi.RemoteException;
}
Home interface import javax.ejb.*;
import java.rmi.RemoteException;
public interface HelloHome extends EJBHome {
Hello create() throws RemoteException, CreateException;
}
HelloBean import java.rmi.RemoteException;
import javax.ejb.EJBException;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
public class HelloBean implements SessionBean {
public void ejbCreate(){
System.out.println("ejbCreate()");
}
public void setSessionContext(SessionContext ctx) throws EJBException,
RemoteException {
System.out.println("setSessionContext()");
}
public void ejbRemove() throws EJBException, RemoteException {
System.out.println("ejbRemove");
}
public void ejbActivate() throws EJBException, RemoteException {
System.out.println("ejbActivate()");
}
public void ejbPassivate() throws EJBException, RemoteException {
System.out.println("ejbPassivate()");
}
public String hello(){
System.out.println("hello()");
return "Hello, World";
}
}
Client import javax.ejb.*;
import javax.naming.*;
import java.rmi.*;
import java.util.Properties;
public class HelloClient {
public static void main(String[] args) {
try{
Properties props = System.getProperties();
Context ctx = new InitialContext(props);
HelloHome home = (HelloHome) ctx.lookup("HelloBean");
Hello hello = home.create();
System.out.println(hello.hello());
hello.remove();
}
catch(Exception e)
{
e.printStackTrace();
}
}
}
Ive created the jar file in
weblogic 8.1. And deployed it sucessfully. The jndi name matches the one in the client program and weblogic builde. Tried to run HelloClient.
I get the following error. Here is the error message.
com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>
WARNING: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: localhost; port: 3700"
org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: No at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2257)
And goes on in an infinite loop.
The same program works on sun application server 8.2 but not on weblogic 8.1. Please help.
[ May 14, 2007: Message edited by: Mark Spritzler ]