aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes EJB and JNI Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB and JNI" Watch "EJB and JNI" New topic
Author

EJB and JNI

Tauqueer Ali
Ranch Hand

Joined: Sep 05, 2001
Posts: 53
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.


SCJP2, SCWCD, XML, OOAD<br />Kolkata, India
Simon Brown
sharp shooter, and author
Ranch Hand

Joined: May 10, 2000
Posts: 1913
    
    6
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

Joined: Aug 10, 2001
Posts: 3892
    
    5
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


Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1132

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

Joined: Jul 18, 2001
Posts: 2712
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

Joined: Oct 11, 2000
Posts: 1132

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

Joined: Aug 10, 2001
Posts: 3892
    
    5
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EJB and JNI