Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > open jndi connection to unknown bean

Thread Tools

open jndi connection to unknown bean

Posts: n/a
hi there..
im actually running into a problem i do not find any solution for ...

the problem:

i have a class doing nothing more than to delegate request from the
controller layer to the business components. this means that the class
itself is called by every request from the controller layer.
the controller layer provides a service identifier ..
the service identifier is taken by the delegator class ...
their corresponding bean is calculated
and the delegator tries to setup the connection to the bean ..

each bean .. well .. better manager ejb .. implements the
managerInterface ..
which exposes a single method called executeService.
this is the only important method for each manager bean.

my problem is that im not able to setup a connection to the manager
class ..
the jndi name is found ... thats shure ..
but i always receive a cast exception ...

i provide you some snipplets from my code ..
perhaps you can help ..

public interface ManagerInterface {

public ServiceCollector executeService(ServiceCollector sc)
throws NoServiceProvidedException, ServiceNotAvailableException;

public interface ManagerInterfaceLocalHome extends

public ManagerInterfaceLocal create() throws

public interface ManagerInterfaceLocal extends ManagerInterface,
EJBLocalObject {}

------------ manager bean implementing the executeService method ----
public class GameManagerBean implements SessionBean,ManagerInterface{

* @ejb.interface-method view-type = "local"
public ServiceCollector executeService(ServiceCollector sc)
throws NoServiceProvidedException, ServiceNotAvailableException {

------ delegator ejb trying to setup a connection to a manager bean
InitialContext iContext = new InitialContext();

ManagerInterfaceLocalHome localHome = (ManagerInterfaceLocalHome)

ManagerInterfaceLocal local = localHome.create();


the error is a class cast exception on the line where we do the lookup
for the jndi name
!!! jndi name is correct !!!

thanks ..
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can you statically derive an EJB3 bean's portable JNDI name? Tom Anderson Java 0 04-22-2011 08:54 PM
JNDI and Bean need help shoa Java 2 06-03-2005 09:04 AM
why use ENC JNDI (java:comp/env) instead of JNDI name ? Mick Java 2 02-23-2005 12:50 PM
Need Help with Hibernate - "Not binding factory to JNDI, no JNDI name configured" Mike S Java 0 09-16-2004 09:58 PM
To bean or not to bean... Benjamin Stewart Java 0 06-30-2003 12:34 AM