• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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 ]
 
Now I am super curious what sports would be like if we allowed drugs and tiny ads.
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic