About Question enthuware.oce-ejbd.v6.2.381 :

Moderator: admin

Post Reply
ETS User

About Question enthuware.oce-ejbd.v6.2.381 :

Post by ETS User »

The fourth answer (which is one of the two correct ones) is this:
com.abc.SLSBean and java:global/mybeans/SLSBean
and it has the following explanation:
The CLASSNAME must be the remote interface because the given SLSBean exposes only the remote interface. ...
According to the explanation, shouldn't the answer be like this:
com.abc.SLSBeanRemote and java:global/mybeans/SLSBean
?

admin
Site Admin
Posts: 10384
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.oce-ejbd.v6.2.381 :

Post by admin »

This option should be marked as incorrect. Thanks for the feedback!

PedroKowalski
Posts: 25
Joined: Thu Aug 04, 2011 10:36 am
Contact:

Re: About Question enthuware.oce-ejbd.v6.2.381 :

Post by PedroKowalski »

Howdy!

One more thing. Right now the correct answer is:
com.abc.SLSBeanRemote and java:global/mybeans/SLSBean!com.abc.SLSBeanRemote
while at the beginning you can read:
A stateless session bean named SLSBean is packaged in a stand alone ejb-jar named mybeans.jar and is deployed in a container. SLSBean implements a remote interface named SLSRemote. Both - the bean and the remote interface - are in package com.abc.
So I guess that to preserve the correct answer, the beginning of the question should be changed from SLSRemote to SLSBeanRemote, right?

Cheers!

admin
Site Admin
Posts: 10384
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.oce-ejbd.v6.2.381 :

Post by admin »

Yest, it should be changed. Fixed.

thanks for the feedback!

rkbansal83
Posts: 33
Joined: Sat Nov 24, 2012 8:52 am
Contact:

Re: About Question enthuware.oce-ejbd.v6.2.381 :

Post by rkbansal83 »

code snippet in the question seems to have typo

public void onMessage(Message inMessage) {
TextMessage msg = null;

try {
...
InitialContext ctx = new InitialContext();

//Use SLSBean
CLASSNAME slsBean = (CLASSNAME) ctx.lookup("NAME");
...

} catch (Exception e) {
e.printStackTrace();
}
}


Why NAME is given in double qoutes in lookup call . it gives the sense as if NAME is hard coded string not the variable.

admin
Site Admin
Posts: 10384
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.oce-ejbd.v6.2.381 :

Post by admin »

NAME is indeed hardcoded. The question asks you to replace it with one of the options.

HTH,
Paul.

Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests