users@glassfish.java.net

Cannot access resources from a Session Bean

From: <glassfish_at_javadesktop.org>
Date: Fri, 03 Apr 2009 07:55:19 PDT

I have an Enterprise project with a simple EJB jar and a Web app. I have two entity class's and two Local session beans for the corrsponding entities. When I deploy my application on Glassfish, I can access both the session beans directly from a servlet. Now if I include a reference from one session bean to another then I get an error. If its an EJB injection then I get an error on the start up and if its a JNDI lookup I get 'No Oobject bound' RuntimeException.

SessionALocal
SessionBLocal


From a web app I can access both the Session beans independently. if I include a reference for say SessionBLocal to SessionALocal then it fails. I can not use resource injection or JNDI lookup for the Local Reference. What is wierd is that if I create a Remote Interface for SessionB as SessionBRemote then I can reference it from SessionALocal. Only difference is that I had to use the JNDI lookup as conext.lookup("com.test.session.SessionBFacadeRemote");

On the same note I have issues with any JNDI lookups from any session beans with in an EJB jar. For example I created a Mail session using Glassfish admin page. I can access the mail session from a Web app directly via JNID lookp. I can also access it via a regular class file but if I make that class file a session bean then its unable to find the mail session via JNID lookup. I get 'No Object bound' exception.

Servlet -> Mail session works fine.
Servelt -> A Class file in EJB which accesses the Mail session works fine.
Servlet -> seecion bean in EJB which accesses the Mail session doesnt not work.

I am using Glassfish veresion V2UR2

Any thoughts?

Thanks,
Raj
[Message sent by forum member 'rajkoti' (rajkoti)]

http://forums.java.net/jive/thread.jspa?messageID=340479