# How to do a EJB lookup.

**URL:** <https://techcommunity.softwareag.com/t/how-to-do-a-ejb-lookup/57527>\
**Category:** Forum\
**Tags:** Former-Crossvision-Products, Application-Composer\
**Created:** [December 15, 2006, 12:27am UTC](https://techcommunity.softwareag.com/t/how-to-do-a-ejb-lookup/57527 "2006-12-15T00:27:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![stephan](https://avatars.discourse-cdn.com/v4/letter/s/8baadc/32.png) [@stephan](https://techcommunity.softwareag.com/u/stephan)\
**Post date:** [December 15, 2006, 12:27am UTC](https://techcommunity.softwareag.com/t/how-to-do-a-ejb-lookup/57527/1 "2006-12-15T00:27:31Z")

</div>

Hallo!

I’m working with EJB3. I trying to do JDNI lookup from an Application Designer Adapter for a session bean.  
But I get various class not found, class cast exception.  
Can anyone tell me how to do the lookup right?  
Where to put the @remote annotated interfaces, i seems the Application Designers own classloader can’t load them.

Thanks stephan.

I tested this:

@EJB(name=“ejb/ServiceManagementJNDI”) IServiceManagement management;

and that:  
InitialContext ctx = new InitialContext();  
management = (IServiceManagement) ctx.lookup(“ejb/ServiceManagementJNDI”);

I seems to work, but  
java.lang.ClassCastException: de.epoq.dycide2.server.\_IServiceDycideManagement\_Wrapper

java.lang.ClassCastException: de.epoq.dycide2.server.\_IServiceManagement\_Wrapper  
at Test1Adapter.save(Test1Adapter.java:43)  
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)  
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)  
at java.lang.reflect.Method.invoke(Method.java:585)  
at com.softwareag.cis.server.InteractionModel.invokeMethodInternally(

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 2:38pm UTC](https://techcommunity.softwareag.com/t/how-to-do-a-ejb-lookup/57527/2 "2021-04-02T14:38:42Z")

</div>


