Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!

Steven Gao Song

Ranch Hand
+ Follow
since Oct 02, 2006
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Steven Gao Song

Hi, everyone,

I am reading the book RMH. On page 36,
it says that targetNamespace attribute declares the XML namespace of all
new types explicitly created within the schema.
So, in its example, USAddress type is automatically assigned to targetNamespace.
Since USAddress is in targetNamespace automatically, why the schema element still assigns a prefix mh to USAddress as "mh:USAddress"?

Thank you.
Hi Herman,

Q5:
(D) public int ejbCreate() throws javax.ejb.CreateException
The prim.key type is int. So, correct.

Q12:

(D) SELECT OBJECT(o) FROM Order o
It means all the Order. However, the question says "which will return all orders that have line items?". So, I think (D) is wrong.
Hi, everyone,

I think that the answers to Question5 on Page363 and
Question12 Page428 provided by the authors have some problem.

The answer to Q5 should be B and D, not only B.

The answer to Q12 should be B, not B and D.

What do you think? Thanks.
Congratulation!

By the way, how do you remember all the tag names and their position in DD?
I think it is too hard to remember!
Hi, Abhishek

How is the real exam comparing with the HFEJB Mock exam?
Hi, everyone,

Page 364, HFEJB, there is a question saying:

What's true for a CMP bean in the ready state?

A. Its ejbLoad() can be called directly after ejbStore.
B. Its ejbStore() can be called directly after a business method.
C. One of its business methods can be called directly after ejbStore.
D. None of the above.


The answer says that load, store and business methods can be called
by the container in any order.
I am confused about that. Can anyone give me an example to explain?


by the way, the answer mentioned (spec: 169), does it means Page169 in
Enterprise JavaBeans Specification Page169?

I cannot find anything
talking about it in the Spec P169. Please help.


Thank you.
I have no ejb-jar.xml file at all. I came out this question when I was doing
some exercise.

By the way, what is J2EE RI? Does it mean J2EE client?

Thank you.
Hi, everyone,

I find that if we want to refer other enterprise bean in one
bean, we lookup it from the context -- lookup("java:comp/env/ejb/XXXX")

But, if we want to get the home stub in the client-side,
we just look it up by only providing the bean name, like, lookup("Advisor").

What's the difference?

Thank you.
No, I cannot understand yet.

Please refer to Page227 HFEJB. When the client calls the create()
on the Home object, EJB Object is created. It has nothing to do with
the ejbCreate() method! Only when the clients invoke the business
methods, the EJB Object is linked with the bean instance.

The container creates the stateless session bean instance without creating
the EJB Object. So, I still think that in ejbCreate() method, it
is impossible to get the reference to bean's EJB object.


Thank you.
Hi,all

Why we can use the SessionContext to get a reference to the EJB Object
in the ejbCreate() of stateless session bean? When the Container invokes ejbCreate(), there are no client yet! The EJB object has not been linked to
the bean. How could we access the EJB object?


I am confused. Please help me.

Thank you.
Which one is system exception?

javax.naming.NamingException, or javax.ejb.NoSuchEntityException

I think they are both system exception, am i right?

Thank you.
Hi, everyone,

I met a question in EJBPlus mock test exam.


Which of the following are true?
Select 2 correct options:
(a) An EJB container must not allow same enterprise bean to be deployed multiple times.
(b) EJB containers must allow remote IIOP invocations on the remote interfaces of session and entity beans.
(c) EJB containers are required to be able to publish EJBHome object references in a CORBA CosNaming service.
(d) EJB containers are not required to provide the implementation of the resource manager connection factory classes for the resource managers that are configured with the EJB Container.
(e) EJB containers must allow all enterprise beans deployed using a single archive file to access each other directly without going through local or remote interfaces.


I am really confused in this question. What does it mean "deploy multiple times", "remote IIOP invocations ", "publish EJBHome object references"?
And how about (d), and (e)?

Thanks a lot.
I see. It is because the Specifications say so.
DataSource is also non-serializable.