As noted in the quoted message, J2EE 1.2 does not require that EJBs be
given the java.lang.Runtime loadLibrary permission. Code using JNI
typically requires this permission to load the native method
implementation.
Although some EJB containers might provide this permission, any EJB that
relied on having it would not be portable.
A J2EE vendor could provide some form of deployment option to preload
native methods and make them available to an EJB. Again, there is no
requirement to provide this.
There are cases where having an EJB call a native method is very useful.
It is likely that a number of vendors will support this; however, there
is simply no way to achieve binary native method portability across
machine architectures and OSs. Since this is THE goal of J2EE, there is
no way to include native methods in the definition of a J2EE app.
J2EE 1.2 vendors are required to provide a fully compliant J2SE 1.2 JVM
which includes JNI. Whether they choose to allow components to call
native methods is their choice. Using a native method is just like using
any other form environment specific facility. It likely can be done from
an EJB but it is outside the envelope of portability defined by J2EE.
Tom Valesky wrote:
>
> Can I get confirmation on this from somebody at Sun? This would make me a
> very happy camper. Restated for clarity, the question is: Is it kosher to
> use JNI from EJB?
>
> Muito Obrigado,
>
> Tom
>
> ===========================================================================
> Tom Valesky -- [EMAIL PROTECTED]
> http://www.patriot.net/users/tvalesky
>
> ----- Original Message -----
> From: "Tim Endres" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, April 21, 2000 3:10 PM
> Subject: Re: How to incorporate 3rd party native C code into EJB - example?
>
> > > I thought that the spec explicitly precluded using native code from
> within
> > > EJB.
> > >
> > > <spec quote>
> > > Section 18.1.2
> > > The enterprise bean must not attempt to load a native library.
> > > </spec quote>
> > >
> > > Has this changed? I couldn't find the string "JNI" anywhere in the spec.
> >
> > The enterprise bean does not need to load the native library in order
> > to use it. The native library only needs to be loaded once by the JVM.
> >
> > tim.
> > Tim Endres [EMAIL PROTECTED]
> > ICE Engineering, Inc. http://www.trustice.com/
> > "USENET - a slow moving self parody." - Peter Honeyman
> >
> >
> ===========================================================================
> > To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> > of the message "signoff EJB-INTEREST". For general help, send email to
> > [EMAIL PROTECTED] and include in the body of the message "help".
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff EJB-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".