672329 members! Sign up to stay informed.

Sponsored Links


Resources

Enterprise Java
Research Library

Get Java white papers, product information, case studies and webcasts

EJB programming & troubleshooting EJB programming & troubleshooting EJB programming & troubleshooting Messages: 6 Messages: 6 Messages: 6 Printer friendly Printer friendly Printer friendly Post reply Post reply Post reply XML XML XML

EJB and JNI

Posted by: Premanand C on June 19, 2002 DIGG
Hi,

We have a distributed system written mainly in C/C++ on HP/UX 10.20 (uses HP DCE 1.5). We now wish to migrate to J2EE. Since we have an enormous amount of source code written in C++, we would like to use the same. The implementation will consist, mainly of stateless session beans. The actual method implementation will continue to remain in C++ (we will access the code using JNI).

What are the major issues in choosing the above architecture?

Inputs will be extremely helpful.

Regards,
Premanand C.

Threaded replies

·  EJB and JNI by Premanand C on Wed Jun 19 08:47:16 EDT 2002
  ·  EJB and JNI by hoi tsang on Wed Jun 19 09:33:44 EDT 2002
  ·  EJB and JNI by Nathan Bronson on Wed Jun 19 16:09:00 EDT 2002
    ·  EJB and JNI by Premanand C on Thu Jun 20 01:59:21 EDT 2002
  ·  EJB and JNI by Leonard Gurevich on Wed Jun 19 17:33:05 EDT 2002
    ·  EJB and JNI by Jayendran Thiagarajan on Thu Jun 20 04:39:20 EDT 2002
  ·  why EJB discourage JNI? by Java Vardhan on Fri Sep 08 00:53:16 EDT 2006
  Message #51244 Post reply Post reply Post reply Go to top Go to top Go to top

EJB and JNI

Posted by: hoi tsang on June 19, 2002 in response to Message #51234
helo, SOAP maybe another alternatives...

  Message #51287 Post reply Post reply Post reply Go to top Go to top Go to top

EJB and JNI

Posted by: Nathan Bronson on June 19, 2002 in response to Message #51234
I'm assuming that you have already know that JNI is technically disallowed by J2EE (along with several other useful and widely used constructs). You are likely to encounter problems with deployment to a running app server, as JVMs (tried Sun's and IBM's 1.3.x) are not capable of linking the same JNI code to multiple same-named Java classes living in different class loaders. The effect for our project was that the first instance of the app worked fine but a complete server restart was required when a redeployment should have sufficed.

We are no longer using this configuration so my experience was with a previous generation of app server, but I expect that the newer ones use the same child class loader mechanism.

 - Nathan

  Message #51293 Post reply Post reply Post reply Go to top Go to top Go to top

EJB and JNI

Posted by: Leonard Gurevich on June 19, 2002 in response to Message #51234
Some AppServers like Sybase EAS (Jaguar) allows to use C/C++
as components. It creates Home/Remote interfaces for C/C++ object so this object acts as EJB. Or you can use C/C++ objects using CORBA and they will communicate with EJB in this AppServer. This way you dont need to throw away all the enormous amount of source code written in C/C++

  Message #51316 Post reply Post reply Post reply Go to top Go to top Go to top

EJB and JNI

Posted by: Premanand C on June 20, 2002 in response to Message #51287
Yes, we are aware that EJB "discourages" the use of JNI. Also, the limitation that of not being able to deploy to a running server is acceptable to us.

The main issue is what happens when a problem happens when executing the JNI code. For example, let's assume a memory access violation happens when executing the JNI code. Can these errors be "trapped". Or will the JVM crash (since the JNI code is executing in the process space of the JVM)? What happens to the EJB server itself?



  Message #51333 Post reply Post reply Post reply Go to top Go to top Go to top

EJB and JNI

Posted by: Jayendran Thiagarajan on June 20, 2002 in response to Message #51293
Using JNI inside the J2EE architecture is not advisable as per the SPEC. Hence the options are using Sockets to call the C/C++ program, sending a JMS message from one app server to another, invoking the C/C++ application from another app server which doesn't have any of your J2EE components, or using other message oriented middleware techniques.

  Message #217514 Post reply Post reply Post reply Go to top Go to top Go to top

why EJB discourage JNI?

Posted by: Java Vardhan on September 08, 2006 in response to Message #51234
Hey,

I didnt understand why EJB discourages JNI.

Can you pls explain me the reason.

Thanks.

Recent active threads Recent active threads Recent active threads More More More
Oracle's Bold Plans for Java Bode Well
“Father of Java” James Gosling to keynote at TSSJS 2010
typo in faces-config to-view-id extension, but works fine?
BUY FAKE PASSPORTS OF CANADA, FAKE CANADIAN PASSPORTS FOR SALE/FAKE PASSPORTS OF USA!
BUY FAKE PASSPORTS OF UNITED KINGDOM,FAKE UK PASSPORTS FOR SALE!
BUY FAKE PASSPORTS OF CANADA, FAKE CANADIAN PASSPORTS FOR SALE!
BUY FAKE PASSPORTS OF BELGIAN,FAKE BELGIUM PASSPORTS FOR SALE!
BUY FAKE PASSPORTS OF AUSTRALIA/FAKE AUSTRALIAN PASSPORTS FOR SALE!
Milton 1.5.1 released
More active threads »
Top posters of the weekTop posters of the weekTop posters of the week
This list contains the members who have made the most posts in all forums over the last 7 days:
  1. Reza Rahman
  2. James Watson
  3. brad mcevoy
  4. Alex Besogonov
  5. Peter Monks
Hot threads Hot threads Hot threads More hot threads More hot threads More hot threads

Object pooling is now a serious performance loss

Brian Goetz continues to lift the lid and peak into the inner workings of Java in Java Urban Performance Legends. In this article he exposes the fallacy behind some of the more common performance myths found in the annals of the JVM.
(92 comments, last posted March 14, 2008)

Beyond Java

Bruce Tate, author of Better, Faster Lighter Java and Bitter EJB has come out with a new book called Beyond Java. Bruce has an epiphany about the future of software development. Does it include Java?
(770 comments, last posted September 23, 2009)

Three forms of AJAX: solid, liquid and gas.

Looks like today AJAX concept have several interpretations. We can distinguish different approaches of AJAX integration. Can they co-exist within the same application? Can we talk about layered AJAX integration?
(68 comments, last posted May 08, 2008)

Design-Time API Promises to make Java more like VB

Artima has published a short article describing the Design-Time API for JavaBeans, which was recently approved as JSR 273. This API promises to bring VB-like ease to Java development, but may face a cultural bias among Java developers who tend to think more in terms of class libraries than components.
(226 comments, last posted February 01, 2010)

Will Sun be that target of a management buyout?

There is plenty of speculation today regarding a potential buyout of Sun Microsystems by Scott McNealy and Silver Lake Partners. How would privatization of Sun affect Java?
(16 comments, last posted May 15, 2009)
More hot threads »

News | Blogs | Discussions | Tech talks | Patterns | Reviews | White Papers | Downloads | Articles | Media kit | About
Java Solutions
All Content Copyright ©2007 TheServerSide Privacy Policy      Powered by JIVE
Site Map