This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes C / C++ and the fly likes Wrap Java with C Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Languages » C / C++
Bookmark "Wrap Java with C" Watch "Wrap Java with C" New topic
Author

Wrap Java with C

Chris Cody
Greenhorn

Joined: Mar 20, 2008
Posts: 2

I am sorry if this is the wrong place or if this question has been repeated too many times.
[I did look and did not find an answer.]
The short version is that I have been instructed to wrap a set of objects and methods in a Jar file from a C based application.
Is this possible, if so what resources exist to do this?

The longer version:
There is a deployment that exists as a set of EJBs on a web server (Weblogic).
There exists a C application (in Solaris Unix) that is required to send information to and retrieve messages from the EJB.
There exists a Jar file containing the interface and stubs in order to connect to the EJB from another EJB or from another Java application.
There does not exist a set of interfaces that are available to the C application.
The "managerial" solution is that the Jar file should be wrapped by the C code and use the Java objects to access the EJB.

Is there a way to get this done, or is there a better way to do it?

My suggestion is to create a Java application that connects natively through the libraries to the EJB and then write a TCP/IP interface between the C application and the Java application.

Any technical advice would be greatly appreciated.
I would also appreciate sage advice about how to tactfully describe the managerial solution as a very bad idea [If it is as bad as it appears to be].

Thank you very much in advance.


Madhan Sundararajan Devaki
Ranch Hand

Joined: Mar 18, 2011
Posts: 312

I am not sure, if you have C library(s) that can do what you want.

However, on the assumption that it is not there, there is no technical feasibility to wrap Java objects in C code.

Further, you may talk with EJB via CORBA/ORB/IDL technique, a quite cumbersome and complicated approach (without support IDEs etc...).


S.D. MADHAN
Not many get the right opportunity !
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Wrap Java with C
 
Similar Threads
long post IBM.158
Test 252: Mock exam
IBM Exam 157 - Questions and Answers (Sample Exam)
EJB JAR resources classloader issues
Weblogic 7.0 certification mock test question