Session Bean Client hangs at Context Lookup
tmccrary Aug 11, 2004 12:06 PMHi, I am new to JBoss and I am having a problem.
I created a test session bean and deployed it:
15:44:58,306 INFO [EjbModule] Deploying TestEJB
15:44:58,376 INFO [StatelessSessionInstancePool] Started jboss.j2ee:jndiName=TestEJB,plugin=pool,service=EJB
15:44:58,377 INFO [StatelessSessionContainer] Started jboss.j2ee:jndiName=TestEJB,service=EJB
15:44:58,377 INFO [EjbModule] Started jboss.j2ee:module=TestEJB.jar,service=EjbModule
15:44:58,377 INFO [EJBDeployer] Deployed: file:/opt/jboss/server/default/deploy/TestEJB.jar
15:44:58,391 INFO [MainDeployer] Deployed package: file:/opt/jboss/server/default/deploy/TestEJB.jar
But whenever I run the client, it hangs at the context lookup forever. There are no exceptions thrown, it just sits there.
Here is the code I am using:
Remote Interface
package com.test.ejbtest;
import java.rmi.RemoteException;
import javax.ejb.EJBObject;
/**
*
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
public interface TestEJB extends EJBObject {
public String test() throws RemoteException;
}
Home Interface
package com.test.ejbtest;
import java.rmi.RemoteException;
import javax.ejb.CreateException;
import javax.ejb.EJBHome;
/**
*
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
public interface TestEJBHome extends EJBHome {
TestEJB create() throws RemoteException, CreateException;
}
EJB
package com.test.ejbtest;
import java.rmi.RemoteException;
import javax.ejb.EJBException;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
/**
*
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
public class TestEJBBean implements SessionBean {
/* (non-Javadoc)
* @see javax.ejb.SessionBean#ejbActivate()
*/
public void ejbActivate() throws EJBException, RemoteException {
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see javax.ejb.SessionBean#ejbPassivate()
*/
public void ejbPassivate() throws EJBException, RemoteException {
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see javax.ejb.SessionBean#ejbRemove()
*/
public void ejbRemove() throws EJBException, RemoteException {
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see javax.ejb.SessionBean#setSessionContext(javax.ejb.SessionContext)
*/
public void setSessionContext(SessionContext arg0) throws EJBException,
RemoteException {
// TODO Auto-generated method stub
}
public String test() {
System.out.println("Testing the EJB on JBoss");
return "Testing EJB ";
}
public void ejbCreate() {
System.out.println("ejbCreate");
}
}
EJB Descriptor
<?xml version="1.0" encoding="UTF-8"?> <ejb-jar> <description>JBoss Test EJB</description> <display-name>Test EJB</display-name> <enterprise-beans> <session> <ejb-name>TestEJB</ejb-name> <home>com.nd.ejbtest.TestEJBHome</home> <remote>com.nd.ejbtest.TestEJB</remote> <ejb-class>com.nd.ejbtest.TestEJBBean</ejb-class> <session-type>Stateless</session-type> <transaction-type>Bean</transaction-type> </session> </enterprise-beans> </ejb-jar>
Any help would be much appreciated :)