Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

RemoteException

I am trying to call a method on a remote bean, but I am getting a RemoteException: com.sap.engine.services.ejb.exceptions.BaseRemoteException: Exception in method someValue.

public class TestDebtorBol extends TestCase {
  DebtorProcessorHome debProcHome;
    public void testDebtorsSomeValue() {
      try {
	Context ctx = null;
	Properties props = new Properties();
	props.put 
             Context.PROVIDER_URL, "sapserver:50004");
	props.put(
	    Context.INITIAL_CONTEXT_FACTORY, "com.sap.engine.services.jndi.InitialContextFactoryImpl");
        ctx = new InitialContext(props);
	debProcHome =
	 (DebtorProcessorHome) 
           PortableRemoteObject.narrow(ctx.lookup(
	      "onguard.com/OnGuardApplication/DebtorProcessorBean"), DebtorProcessorHome.class);
	DebtorProcessor debProc = debProcHome.create();
	assertEquals("Hi there!", debProc.someValue());
   } catch (NamingException e) {
	fail("NamingException: " + e.getMessage());
   } catch (CreateException e) {
	fail("CreateException: " + e.getMessage());
   } catch (RemoteException e) {
	fail("RemoteException: " + e.getMessage());
   }
  }
}

The method someValue simply returns a string:

public String someValue() {
// return "Hi there!";
  return new String("Hi there!");
}

What is wrong??

Former Member

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question