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

Will Hunt

+ Follow
since Jul 18, 2004
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Will Hunt

Parag thanks for the wonderful advice and I appreciate your time.
I have both the Web component and business component developer certification (1.4 & 1.3) respectively. So I was more leaning towards with J2EE 1.3. When you say some of them have done with J2EE 1.1 or 1.2 is there an option when you do this, or you just mean the people who have done recently?
Hi couple of beginner questions, any help is greatly appreciated.

1. I was going through the certification available on the web and I couldn't figure out which version of J2EE they are talking about. I browsed through FAQ page on this site, not much help.

2. about the books, any suggestions or place to start.

Thank you
Which is true when a remote client receives an exception from an EJB invocation?

A The exception cannot be from the java.rmi package.
B The client might be able to re-invoke the method successfully.
C The exception cannot be a system exception.
D If the client is associated with a transaction, the transaction will have been rolled back.

What exception is he talking about any idea ?
I am not sure, according to SUN the answer is C. So I was thinking may be it is typo on their side and it is EJBException.
Because you have to declare or deal with the RemoteException on the clint side , if it is a remote client.
Which is true when an entity bean's client receives a java.rmi.RemoteException?

A The client must be local.
B A checked exception was propagated from the bean.
C The client is not required to handle or declare the exception.
D This exception can never occur if the client is in a transaction.

What would be the answer and why ?
interface EJBMetaData is intended to be used by the tools for obtaining the information about the bean. There is very little you can do systematically as a bean provider using that interface.

I guess in the book when they say there is Reflection API, for the container it is there but not for the bean provider.

You are right when you say Reflection API is denied in the spec, but that is for bean provider contract.

Hope this helps.
Which method can be invoked when a stateful session bean is in the method ready state but not in a transaction?

A ejbCreate()
B afterBegin()
C ejbActivate()
D afterCompletion()
E beforeCompletion()

This is one of the question in the sun's practice exam. Accroding to them the answer is B.

But isn't the afterBegin() method invoked by the container method after it starts a transaction ?

Or is there a better explanation for the answer
In the HFE book, Chapert 4 Mock exam question answer on page 252 says according to Spec on page 72, Container can throw java.rmi.RemoteException.

But the Spec says only the subclass of RemoteException, NoSuchObjectException can be thrown, Can someone clarify this please.

Thank you.
This is one of the questions in the sun practice exams. It says answer is D, which makes sense. Even though you have the sessionContext reference, only you can call non-transaction related methods. Since they all throw IllegalStateException when called in a non tx method and all the SessionBean interface run in unspecified Tx, it can only be business method in BMT.
From which method in a stateless session bean can the begin method be called?

A. the setSessionContext method in a CMT demarcated bean
B. the ejbRemove method in a BMT demarcated bean
C. a business method in a CMT demarcated bean
D. a business method in a BMT demarcated bean
No 2 is a requirement. So you should have no arg Constructor, but how it got there is not the question. Whether compilers puts it or you write it, it doesn't matter, you should have it.

So you should select 2 as an answer.
Like you said, you don't declare them in your CMP Entity Bean class , they are there because of abstract getters and setters.

You don't define the fields, you just declare the abstract getters and setters for them.
According to EJB specification Page 197, the return type of ejbCreate()
should be primary key class, which must provide suitable implementation of hashCode() and equals(Object) methods.

So that will rule out primitives, it can be wrapper classes though.