Search in sources :

Example 56 with EJBHome

use of javax.ejb.EJBHome in project tomee by apache.

the class StatelessRmiIiopTests method test39_returnEJBHomeArray.

public void test39_returnEJBHomeArray() {
    try {
        final EncStatelessHome[] expected = new EncStatelessHome[3];
        for (int i = 0; i < expected.length; i++) {
            final Object obj = initialContext.lookup("client/tests/stateless/EncBean");
            expected[i] = (EncStatelessHome) obj;
            assertNotNull("The EJBHome returned from JNDI is null", expected[i]);
        }
        final EJBHome[] actual = ejbObject.returnEJBHomeArray(expected);
        assertNotNull("The EJBHome array returned is null", actual);
        assertEquals(expected.length, actual.length);
    } catch (final Exception e) {
        fail("Received Exception " + e.getClass() + " : " + e.getMessage());
    }
}
Also used : EJBHome(javax.ejb.EJBHome) EJBObject(javax.ejb.EJBObject) RemoteException(java.rmi.RemoteException)

Example 57 with EJBHome

use of javax.ejb.EJBHome in project tomee by apache.

the class StatelessHomeHandleTests method test01_getEJBHome.

// =================================
// Test home handle methods
// 
public void test01_getEJBHome() {
    try {
        final EJBHome home = ejbHomeHandle.getEJBHome();
        assertNotNull("The EJBHome is null", home);
    } catch (final Exception e) {
        fail("Received Exception " + e.getClass() + " : " + e.getMessage());
    }
}
Also used : EJBHome(javax.ejb.EJBHome)

Example 58 with EJBHome

use of javax.ejb.EJBHome in project tomee by apache.

the class StatelessEjbMetaDataTests method test01_getEJBHome.

// =================================
// Test meta data methods
// 
public void test01_getEJBHome() {
    try {
        final EJBHome home = ejbMetaData.getEJBHome();
        assertNotNull("The EJBHome is null", home);
    } catch (final Exception e) {
        fail("Received Exception " + e.getClass() + " : " + e.getMessage());
    }
}
Also used : EJBHome(javax.ejb.EJBHome)

Example 59 with EJBHome

use of javax.ejb.EJBHome in project tomee by apache.

the class StatelessPojoHomeHandleTests method test01_getEJBHome.

// =================================
// Test home handle methods
// 
public void test01_getEJBHome() {
    try {
        final EJBHome home = ejbHomeHandle.getEJBHome();
        assertNotNull("The EJBHome is null", home);
    } catch (final Exception e) {
        fail("Received Exception " + e.getClass() + " : " + e.getMessage());
    }
}
Also used : EJBHome(javax.ejb.EJBHome)

Example 60 with EJBHome

use of javax.ejb.EJBHome in project tomee by apache.

the class RmiIiopBmpBean method returnEJBHome.

public EJBHome returnEJBHome() throws javax.ejb.EJBException {
    EJBHome data = null;
    try {
        final InitialContext ctx = new InitialContext();
        data = (EJBHome) ctx.lookup("java:comp/env/bmp/rmi-iiop/home");
    } catch (final Exception e) {
        e.printStackTrace();
        throw new javax.ejb.EJBException(e);
    }
    return data;
}
Also used : EJBException(javax.ejb.EJBException) EJBHome(javax.ejb.EJBHome) InitialContext(javax.naming.InitialContext) EJBException(javax.ejb.EJBException) RemoveException(javax.ejb.RemoveException) RemoteException(java.rmi.RemoteException)

Aggregations

EJBHome (javax.ejb.EJBHome)67 RemoteException (java.rmi.RemoteException)15 EJBObject (javax.ejb.EJBObject)11 InitialContext (javax.naming.InitialContext)10 HomeHandle (javax.ejb.HomeHandle)8 ObjectNotFoundException (javax.ejb.ObjectNotFoundException)7 EJBException (javax.ejb.EJBException)6 ByteArrayInputStream (java.io.ByteArrayInputStream)3 ByteArrayOutputStream (java.io.ByteArrayOutputStream)3 ObjectInputStream (java.io.ObjectInputStream)3 ObjectOutputStream (java.io.ObjectOutputStream)3 Method (java.lang.reflect.Method)3 MarshalledObject (java.rmi.MarshalledObject)3 EJBLocalHome (javax.ejb.EJBLocalHome)2 EJBMetaData (javax.ejb.EJBMetaData)2 Handle (javax.ejb.Handle)2 RemoveException (javax.ejb.RemoveException)2 PortableRemoteObject (javax.rmi.PortableRemoteObject)2 Test (org.junit.Test)2 InvalidServiceException (com.ing.ifsa.internal.exceptions.InvalidServiceException)1