• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Enthuware Questio

 
Nikhil Jain
Ranch Hand
Posts: 392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Question1) Which of the following APIs may an enterprise bean developer use without jeopardizing the portability of the enterprise bean?
JMS, JDBC, JAXR, JCA, ADO.

The asnwer should have been JMS, JDBC, JAXR. But enthuware says JMS & JDBC. Why is JAXR not one of the answers.

Question2)
A stateless session bean in package com.enthu.ejpblus contains the following code:

@Stateless
@Local(com.enthu.ejbplus.TellerLocal.class)
public class TellerBean implements com.enthu.ejbplus.TellerLocal {

@EJB
com.enthu.ejbplus.ManagerLocal manager;
//... other valid code
}
Which of the following lookups could be used by a business method of the bean instead of using the instance level manager variable?
(Assume appropriate package and import statements.)

As default name is not given for ejb the look should be done using com.enthu.ejbplus.ManagerLocal/manager right? But the answer says the lookup would be done com.enthu.ejbplus.TellerBean/manager.

thanks

Shashank
 
Nikhil Jain
Ranch Hand
Posts: 392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the answer given is wrong.
 
Nicolas Stern
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Anu,

Regarding your 1.st point, I agree with you - I had the same doubt when I found this question in the Enthuware TestSimulator. The answer provided is wrong - or there is a typo in the question. The specs are clear (Cf. Core Specs, par. 21.1.1 APIs Provided by Container :

The Java EE platform also requires a number of optional packages. The following optional packages are
required to be provided in EJB containers:
� EJB 3.0, including the Java Persistence API
� JTA 1.1
� JMS 1.1
� JavaMail 1.4 (for sending mail only)
� JAF 1.1[99]
� JAXR 1.0
...


hth - cheers - Nic
 
Nicolas Stern
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Regarding your 2. question: look at the specs paragraph 16.5.1.1 - Injection of EJB References:

The following example illustrates how an enterprise bean uses the EJB annotation to reference another enterprise bean. The enterprise bean reference will have the name java:comp/env/com.acme.example.ExampleBean/myCart in the referencing bean�s
naming context, where ExampleBean is the name of the class of the referencing bean and
com.acme.example its package. The target of the reference must be resolved by the Deployer.
package com.acme.example;
@Stateless public class ExampleBean implements Example {
...
@EJB private ShoppingCart myCart;
...
}


Hth - cheers - Nic
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic