File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

an exception question.

 
Praveena Gupta
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On which line is the exception thown?
According my thinking, the excepption is thrown at line 16 getEJBHome() as this method returns remote Home,and when this method is called and the bean does not have a remote home "illigal State Exception " is thrown.

Please correct if i am wrong.


Given an interface:


@Local
public interface MyI {
public Set go(Set s);
}

Given an excerpt from a stateful session bean that implements this business interface:


9. @Stateful
10. @TransactionAttribute(TransactionAttributeType.REQUIRED)
11. public class MyStatefulBean implements MyI {
12. @Resource SessionContext ctx;
13. public Set go(Set s) {
14. ctx.getRollbackOnly();
15. ctx.getEJBOjbect();
16. ctx.getEJBHome();
17. throw new Exception("Will I, won't I?");
18. }
50. }

No deployment descriptor is used. Which statement is correct?

An exception is thrown on line 14.
An exception is thrown on line 15.
An exception is thrown on line 16.
An exception is thrown on line 17.
 
Meng Tan
Ranch Hand
Posts: 115
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

My thinking is line 15. The bean does not have a EJB 2.1 remote interface.

Meng Tan
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic