• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

VC++ calling Java code

 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I want to have a VC++ code calling a Java interface to do some work. Now does this Java application need to be based on an EJB architecture to be used by VC++ IDE ? I know that can be done through CORBA but how does a Java application based on EJB architecture be called by VC++ code, if at all it works that way. Could you also direct me to any link or technologies which talks about it ?
Thanks
Sandeep
 
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I hate giving incomplete answers, BUT you can implement EJB using IIOP instead of JRP. (IIOP is Corba -- roughly translated). How exactly you do that I have no idea.
 
Ranch Hand
Posts: 227
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'd use JMS with MQSeries or MSMQ. But CORBA/IIOP would also work.
The better question is Why do you need to mix? Which can be re-written?
 
Sandeep Advani
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Dana,
You are right, the Java code can be re-written in VC++. But the whole idea will be the time and resources spent on re-writing this massive application. More than that, I have never worked on VC++. Its been all Java most of the time.
You said JMS; does that mean that I must make this application based on EJB architecture first? Once I get this functionality encapsulated within the bean, how do I register this with the Windows in order for VC++ to call it ? Any further directions will be appreciated !
Sandeep
 
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Someone mentioned JIntegra. It is a good, quick solution but a) it can be expensive and b) you are tied to a proprietary solution. It might be OK for an internal app, but I wouldn't suggest it for a customer app.
 
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What you are trying to do here is invoke the JVM from a c/c++ program (native code). I think it is possible to do that. You don�t have to write the EJB or something. Just write the java class with main function and try invoking the jvm from your c/c++ code and pass the java class as your parameter.
See this code
http://java.sun.com/docs/books/tutorial/native1.1/invoking/example-1dot1/invoke.c
And this discussion
http://forum.java.sun.com/thread.jsp?forum=52&thread=485999&tstart=135&trange=15
see this JNI tutorial
http://java.sun.com/docs/books/tutorial/native1.1/invoking/index.html
Another method will be to write a COM wrapper on top of your java program and make you c++ program as the COM client
[ March 17, 2004: Message edited by: Kripal Singh ]
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Two words -- Web Services. Go read about how to publish your EJB's as Web Services in J2EE (perhaps using Richard Monson-Haefel's excellent book on J2EE web services) and then go learn how to invoke Web Services from .NET.
Kyle
 
Sandeep Advani
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks everyone to give me a start. This should keep me busy to look into quality stuff as mentioned by Kripal and Kyle. Thanks a lot guys !
I will post my experience once I get through this.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic