• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Session bean , Local and Remote interface with answer.

 
Deepak Jain
Ranch Hand
Posts: 637
  • Mark post as helpful
  • send pies
  • 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
 
Mellon Sun
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's a little bit freak.
 
Reza Rahman
author
Ranch Hand
Posts: 580
5
  • Mark post as helpful
  • send pies
  • 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
  • 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
Ranch Hand
Posts: 580
5
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic