It's not a secret anymore!
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes EJB programming restrictions - Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "EJB programming restrictions - Question" Watch "EJB programming restrictions - Question" New topic

EJB programming restrictions - Question

sanker san
Ranch Hand

Joined: Dec 17, 2004
Posts: 56
Hi All,

I would like to seek explanation for the answer of the following
question(taken from

Identify correct programming restrictions that a Bean provider must
follow to ensure that the enterprise bean is portable and can be
deployed in any compliant EJB 2.0 Container. [Check all correct

1. The enterprise bean cannot define read and write to static fields.
2. The enterprise bean cannot make use of the Java Swing API.
3. The enterprise bean cannot make use of interfaces to define
business methods.
4. The enterprise bean cannot make use of the Sun JavaMail API.
5. The enterprise bean must not attempt to define a class in a

The answers are 1,2 & 5. Can anybody pls explain what does option 5
mean and how can it be an answer?

Joined: Dec 19, 2004
Posts: 3
According to the Spec:
"The EJB must not attempt to define a class in the package".

This fucntionality is usually reserved for the container and allowing the EJB to do it would create a security hole.
Valentin Crettaz
Gold Digger

Joined: Aug 26, 2001
Posts: 7610

you can search this forum by typing in the keywords "define" and "package" and you'll get plenty of answers

[Blog] [Blogroll] [My Reviews] My Linked In
I agree. Here's the link:
subject: EJB programming restrictions - Question
It's not a secret anymore!