[jboss-user] [EJB 3.0] - Re: java.lan.ClassCastException when casting to remote bean

manemannen do-not-reply at jboss.com
Fri Nov 21 05:21:58 EST 2008


The purpose here was to have self contained war client. I want to run the enterprise application on one jboss server and access it from various other applications located elsewhere.

A little off topic but one thing that is bugging me is all the examples I have reviewed during the search for the remote IF solution is that when people lookup the remote interface they do this on basis on the actual bean name. I also did it in my test since it was easiest and didn't really matter since it was an example to pinpoint the problem (I also included the bean in the jar file which I included in the war). This would not happen in a real case. 

Example:

SimpleStatefulBeanRemote o = (SimpleStatefulBeanRemote) ctx.lookup("simpleserver/" + SimpleStatefulBean.class.getSimpleName() + "/remote");
  | 

I have seen many examples of this and it introduces a dependency from the client to the actual implementation and obsoletes the purpose of interfaces - weird

opinions?


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4191178#4191178

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4191178



More information about the jboss-user mailing list