• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
  • paul wheaton
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Rob Spoor
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:

an exception question.

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

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

Meng Tan
 
See ya later boys, I think I'm in love. Oh wait, she's just a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic