Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem in accessing Local Entity Beans from Session using WSAD

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Live a little! The night is young! And we have umbrellas in our drinks! This umbrella has a tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic