• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

First EJB - Stateless session bean

 
Ranch Hand
Posts: 763
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Application Server : BEA Web Logic 10.3
EJB 2.0


Hi,

I am new to EJB technology.

i have created my first Stateless Session Bean. Written Home and Component Interface and below is my DD which is in MATA-INF folder.



i have created ejb jar and deployed it in web logic server. on the web logic console it is showing the EJB State as Active however as you can see in the attached image the type of application is is showing as library... should it be EJB ?

I have also written one client for testing the EJB.

below is my client code



but i am getting below exception

Stacktrace



Can anybody tell me what's wrong in my application ???
ejb1.JPG
[Thumbnail for ejb1.JPG]
 
Ranch Hand
Posts: 247
Eclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you make JNDI mapping to the EJB bean?...
 
Jigar Naik
Ranch Hand
Posts: 763
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes there is a little progress.

previously i was deploying only jar file to the web logic server. now i came to know that ejb needs to be in EAR file. so now i am confirm that the bean has been deployed to the web server. I can see the JNDI Name on web logic server.

but still having the same error.

My client application is simply a java project which contains the weblogic.jar wlclient.jar api.jar in class path. and my ejb jar file.

One thing i am wondering is that... i am not able to any stubs in my application. there is just three class files.

1. EJB
2. home interface
3. component interface.

so when will the stubs gets created, and where will i be able to see the stubs ??? Who will use stubs ?

 
Ram Narayan.M
Ranch Hand
Posts: 247
Eclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh Oh!!! Your client does not know where JNDI is...

You should specify where the JNDI Service is running...

InitialContext is unable to get the whereabouts of JNDI... You should specify that...

You can do either by specifying "jndi.properties" file keeping it in parallel where Client program is...

Otherwise, create Properties object and pass the Properties object to InitialContext Constructor like this



The above code example is for JBOSS JNDI Service... Likewise, check it for WEB-LOGIC and map like this...

Then the Client can able to get the stubs from the server...
 
Jigar Naik
Ranch Hand
Posts: 763
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes i have noticed that and have passed properties object containing the location and factory for web logic server to InitialContext.

Now i am getting NameNotFoundException. And i have doubt that it has to do something with stubs only.

Ram Narayan.M wrote:
Then the Client can able to get the stubs from the server...



What does it mean ??? Can you please explain it in detail ???

 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic