• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Doubt about EJB Restrictions

 
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what does it mean?
The enterprise bean must not attempt to define a class in a package.

Thanks
 
Ranch Hand
Posts: 290
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi gowher , how are you?

Ir means that your enterprise bean must be declared as PUBLIC!!!

see these samples below:

class MyBean implements SessionBean -- >class in package!!!
WRONG!!! It must be PUBLIC!!!

"public" class MyBean implements SessionBean -- >That's correct!!!

Hugs!!
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


The enterprise bean must not attempt to define a class in a package.



I think this statement is rather about the Reflection API or something like that...

With the Java Reflection API it's possible to do many "nasty", unusual things. For instance: accessing private class members! (Dependency injection is heavily based on this.)

This statement you've quoted (actually the EJB-container contract) prohibits some of these functions for the developer(bean provider).
That's why:

This function (defining a class in a package) is reserved for the EJB container. Allowing the enterprise bean to perform this function would create a security hole.


Correct me if I'm wrong!
Andor N�meth
[ August 07, 2007: Message edited by: Andor Nemeth ]
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic