This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB and JNI

 
Tauqueer Ali
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pleas have a look at following problem
We have Client system on C++ & Solaris. Earlier Server system(Its located
at some other place) was also in C++ & Solaris. Communication protocol bet'n
client & server was DCE ( Distributed Computing Environment). Now Server has
migrated to Java & EJB.
Our problem is to access these EJB services from C++ Client with minimum
modification on Client side.
Solutions suggested are
1. Using SOAp & XML ( We r looking into it)
2. Using JNI
Out of that I am looking into JNI apporach ...but I am not able to find out
if we can access EJB services from server using JNI?
I will be thankful to if somebody can guide me in this case.
regards
Ali.
 
Simon Brown
sharp shooter, and author
Ranch Hand
Posts: 1913
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To access EJBs through JNI, I would expect that you'd have to write a plain JavaBean wrapper or proxy. This proxy would then be used by the JNI. However, saying this I'm not an expert at JNI, but wouldn't the Java side have to kick off and open the JNI connection to C++?
Simon
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, you can't access EJB's through JNI -- it's just not practical. However, there is another route you can take for interoperability -- you could use CORBA; all EJB servers are (by design) CORBA servers since they use RMI-IIOP. What's more the mapping from an EJB interface to a CORBA interface is standard. Check with your server vendor for more details.
Kyle
 
Avi Abrami
Ranch Hand
Posts: 1141
1
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of-course, specification is one thing, and compliance is another. As far as I know, Ali, not all J2EE application servers fully comply with the specification -- but since you didn't mention what J2EE application server you are using, Kyle's answer -- although technically correct -- may not be suitable for your situation.
Kyle, I'm not familiar with Websphere, perhaps you could let Ali know if it supports RMI-IIOP?
Hope this has helped you, Ali.
Good Luck,
Avi.
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Avi Abrami:
I'm not familiar with Websphere, perhaps you could let Ali know if it supports RMI-IIOP?

Actually, RMI-IIOP is a major part of the J2EE 1.3 specification. You can be sure that any application server that claims spec complaisance with J2EE 1.3 supports RMI-IIOP. WebSphere 5 is J2EE 1.3 compliant.
[ January 14, 2003: Message edited by: Chris Mathews ]
 
Avi Abrami
Ranch Hand
Posts: 1141
1
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Again, I don't know Websphere, but claiming to comply and actually complying, are two different things -- and I have experienced cases where this is true.
Cheers,
Avi.
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, and if IBM claims it, it really complies, trust me. We've supported RMI-IIOP since version 3.0 of WebSphere, back in 1999. But, why does it matter? He never asked about WebSphere... I'd go with Chris's point -- ALL servers have to support RMI-IIOP to be certified as J2EE 1.3 compliant. It's just not an issue anymore.
Kyle
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic