T
tmaus
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
javax.ejb.EJBLocalHome{
public ManagerInterfaceLocal create() throws
javax.ejb.CreateException;
}
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)
iContext.lookup(_jndiName);
ManagerInterfaceLocal local = localHome.create();
local.executeService(sc);
the error is a class cast exception on the line where we do the lookup
for the jndi name
!!! jndi name is correct !!!
thanks ..
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
javax.ejb.EJBLocalHome{
public ManagerInterfaceLocal create() throws
javax.ejb.CreateException;
}
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)
iContext.lookup(_jndiName);
ManagerInterfaceLocal local = localHome.create();
local.executeService(sc);
the error is a class cast exception on the line where we do the lookup
for the jndi name
!!! jndi name is correct !!!
thanks ..