Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB Overview Doubt

 
Amit Batra
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
What exactly is a native library and why would loading it in my bean lead to security problems?
 
Leonardo Borges
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A native library is a .dll, for example. Written in C or whatever language you want. And you can use JNI to access it.

The first problem of doing this is portability. The EJB Spec does not say that all containers must even allow it.

And related to security, a exception thrown by your native library may crash your container(like a divide by zero, for example).

The bottom line is, don't do it!

Cheers!
 
Amit Batra
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!