0

I have created two liberty instances on my local machine. I deployed a war module which contains a remote ejb in server X and deployed another war in server Y which has to remote lookup the ejb from server X.

Below is the code to lookup the ejb from a restful webservice.

Properties p = new Properties();
p.setProperty("java.naming.provider.url", "corbaname:iiop:localhost:2809");
InitialContext context = new InitialContext (p);
context.lookup("corbaname:rir:#ejb/global/caching/CachingServiceBean!com%5c.ejb%5c.CachingService");

When I try to call the web service I get below exception

DII operation not supported by local object

enter image description here

P.S. I have enabled ejbRemote feature on both the servers with different port numbers.

I changed my lookup string to "corbaloc:iiop:localhost:2809/NameService#ejb/global/caching/CachingServiceBean!com%5c.ejb%5c.CachingService" and then I get the below error

enter image description here

Then I changed my lookup string to "corbaname:iiop:localhost:2809/NameService#ejb/global/caching/CachingServiceBean!com%5c.ejb%5c.CachingService" and then I got the below error

enter image description here

After checking apache geronimo-yoko implementation on GitHub, I understood that I have to use corbaloc:iiop:localhost:2809. But still I am getting exceptions caused by

org.omg.CORBA.OBJECT_NOT_EXIST: unable to dispatch - servant or POA not found

I used the following urls with no luck:

  1. corbaloc:iiop:localhost:2809/global/caching/CachingServiceBean!com.ejb.CachingService
    1. corbaloc:iiop:localhost:2809/#ejb/global/caching/CachingServiceBean!com.ejb.CachingService 3.corbaloc:iiop:localhost:2809/caching/CachingServiceBean!com.ejb.CachingService 4.corbaloc:iiop:localhost:2809/ejb/global/caching/CachingServiceBean!com.ejb.CachingService
Krishna Chaitanya
  • 2,533
  • 4
  • 40
  • 74
  • 1
    please don't post pictures of stack traces. It makes it very hard to read and search. Instead, copy/paste the text into your question – Andy Guibert Feb 20 '17 at 14:51
  • I am sorry I am behind a proxy which won't allow me to post. I am using my mobile – Krishna Chaitanya Feb 20 '17 at 14:58
  • I have tried all possible ways but no luck. I have tried corbaloc:iiop:localhost:2809/NameService#ejb/global/caching/CachingServiceBean!com.ejb.CachingService, corbaloc:iiop:localhost:2809/NameService/global/caching/CachingServiceBean!com.ejb.CachingService, corbaloc:iiop:localhost:2809/NameService#java: global/caching/CachingServiceBean!com.ejb.CachingService, corbaloc:iiop:localhost:2809/#ejb/global/caching/CachingServiceBean!com.ejb.CachingService, corbaloc:iiop:localhost:2809/#java/global/caching/CachingServiceBean!com.ejb.CachingService and many more combinations without any luck. – Krishna Chaitanya Feb 20 '17 at 15:35
  • I understood/assumed that server X where the ejb is deployed is saying that there is no ejb with the name and throwing some exception and that is why client code is running into exceptions at unmarshalSystemException in geronimo yoko – Krishna Chaitanya Feb 20 '17 at 15:41

1 Answers1

0

I think the problem is with the packaging. I packed my ejb in a war module.

I followed the steps described in the PDF mentioned in this page http://www.redbooks.ibm.com/redpieces/abstracts/sg248076.html and everything is working now.

I used corbaname::host:port syntax to lookup the remote ejb instead of corbaloc:iiop:host:port

After packing my ejb in an ear then it started working.

Krishna Chaitanya
  • 2,533
  • 4
  • 40
  • 74