• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Session bean , Local and Remote interface with answer.

 
Ranch Hand
Posts: 637
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As we know that a session bean can avoid implementing the busniess interface by applying say Local or Remote
annotation to the class itself as follows



Question and Answer:
Well this time am answering myself.

1) Does this mean that the bean can get away by not implementing all the methods of the interfaces?

Yes its got away, the bean did not implement method2(). The compiler did not complain, since the bean
never implmented TestRemote interface.

2) What happens if the client invokes the buisness interfaces in the above case, which are not implemented by the session bean?

TestBean is deployed, despite not implmenting the method2().
Now when client invokes method2() the following exception is thrown @ the client side
[java] Exception in thread "main" java.lang.RuntimeException: Could not resolve beanClass method from proxy call
[java] at $Proxy0.method2(Unknown Source)
[java] at com.ejb3inaction.actionbazaar.test.client.TestClient.main(TestClient.java:2
 
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's a little bit freak.
 
author
Posts: 580
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Deepak,

The implemenatation are are using appears to be buggy. The deployer should have caught this problem.

Best regards,
Reza
 
Deepak Jain
Ranch Hand
Posts: 637
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


The implemenatation are are using appears to be buggy. The deployer should have caught this problem.



Hello Rahman,
Its simply a honor getting an opportunity to interact with you.
I could not understand your answer. Are you trying to say that there is a bug in the code or a bug with the Jboss application server.
I am using jboss-4.2.3.GA as my application server.
 
Reza Rahman
author
Posts: 580
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Deepak,

Thanks for the kind words. The priviledge is mine, I am just another developer like you - perhaps with slighly different circumstances...

The application server is buggy, but your code is also not spec compliant. If you want, you could open a JIRA issue for JBoss AS.

Best regards,
Reza
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic