Discussions

EJB programming & troubleshooting: Calling C++ APIs on a Remote System from an EJB

  1. Hi,
    I need to call some third-party APIs written in C++ from an EJB. The APIs will be available on a remote machine. Which technology is best suited to achieve this and which type of EJB do I use ?
    Thanks,
    Kapil Nagpal
  2. Make CORBA calls from Session Beans.
  3. If the C++ APIs are on the local machine, does this scenario make a difference to the approach ?
  4. By any chance you need to use CORBA ,as c++ cannot talk to EJB directly.
  5. You could wrap your C++ API's in JNI and make native calls from your session beans, but remember that the EJB spec frowns on using native libraries so you might have some issues with your app server. Using straight CORBA or RMI/IIOP is the best choice.