• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem in accessing Local Entity Beans from Session using WSAD  RSS feed

 
Sriram T
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am using WSAD for developing EJBs. I have created an EntityBean(CMP) and Session Bean(Stateless).

I have created the references using the References tab.

I am using Code Snippet to create the Local EJB.

Here is the code for my session bean......

private final static String STATIC_Test_typeLocalHome_REF_NAME =
"ejb/Test_type";
private final static Class STATIC_Test_typeLocalHome_CLASS =
Test_typeLocalHome.class;

Test_typeLocalHome aTest_typeLocalHome =
(Test_typeLocalHome) ServiceLocatorManager.getLocalHome(
STATIC_Test_typeLocalHome_REF_NAME,
STATIC_Test_typeLocalHome_CLASS);
Test_typeLocal aTest_typeLocal = null;
try {
if (aTest_typeLocalHome != null)
aTest_typeLocal =
aTest_typeLocalHome.create(
Test_type_id,
name,
ts,
ts,
flag,
flag,
ts,
ts);
status = "Success";
} catch (javax.ejb.CreateException ce) {
// TODO Auto-generated catch block
ce.printStackTrace();
}


I get the following error :

[12/1/04 12:06:41:691 PST] 74c382ff SystemOut O Entered addPageGroupTypes
[12/1/04 12:06:41:691 PST] 74c382ff SystemOut O Trying to get PageGroupType Home...
[12/1/04 12:06:41:741 PST] 74c382ff SystemErr R javax.naming.NameNotFoundException: Name "comp/env/ejb/Test_type" not found in context "java:".
[12/1/04 12:06:41:741 PST] 74c382ff SystemErr R at com.ibm.ws.naming.ipbase.NameSpace.lookupInternal(NameSpace.java:1009)
[12/1/04 12:06:41:741 PST] 74c382ff SystemErr R at com.ibm.ws.naming.ipbase.NameSpace.lookup(NameSpace.java:920)
[12/1/04 12:06:41:741 PST] 74c382ff SystemErr R at com.ibm.ws.naming.urlbase.UrlContext.lookup(UrlContext.java:1211)
[12/1/04 12:06:41:741 PST] 74c382ff SystemErr R at com.ibm.ws.naming.urlbase.UrlContext.lookup(UrlContext.java:1203)
[12/1/04 12:06:41:741 PST] 74c382ff SystemErr R at com.ibm.ws.naming.urlbase.UrlContext.lookup(UrlContext.java:1257)
[12/1/04 12:06:41:741 PST] 74c382ff SystemErr R at javax.naming.InitialContext.lookup(InitialContext.java:359)


I have tried many ways but couldn't succeed. Someone please help me, coz Our project is in crucial stage and I am struggling with this problem.

I appreciate your help.

Thanks,
ST
 
Sriram T
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kyle,

I was looking at your previous messages which say that Local EJBs can be referenced by java:comp/env....

But its not working in my case. I am not sure what is the problem.. Please help...

R javax.naming.NameNotFoundException: Name "comp/env/ejb/Test_type" not found in context "java:".
[12/1/04 12:48:19:874 PST] 29b707d6 SystemErr R at com.ibm.ws.naming.ipbase.NameSpace.lookupInternal(NameSpace.java:1009)
[12/1/04 12:48:19:874 PST] 29b707d6 SystemErr R
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!