Win a copy of Spring Boot in Practice this week in the Spring forum!
  • 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
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

How to - stateful session bean

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
when I call entity bean from stateful session bean it gives me error:ClassNotfoundException...
my entity bean is in package A, statefulbean is in package B and both packages are in project P.
If anyone can tell me how to call if i'm wrong..
thanks in advance
 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you can't just call a bean from the other.
you have to step through the usual procedure, looking it up (or use the servicelocator pattern to receive a reference to the bean) via JNDI.
to do so you need to add a bean reference to the deployment descriptors.
i don't know for sure, but in the j2ee tutorial you should find more infos about it:
http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/J2eeTutorialTOC.html
 
Manish Kamat
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i've given ejb-ref-name but still it gives error.
my weblogic-ejb-jar.xml is as follows:
<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>project.packageA</ejb-name>
...
<reference-descriptor>
<ejb-reference-description>
<ejb-ref-name>project.packageB</ejb-ref-name>
<jndi-name>project.packageB</jndi-name>
</ejb-reference-description>
</reference-descriptor>
<jndi-name>project.packageA</jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>
anything wrong in ref given by me?
i'm looking up for entity bean from seesion bean usual way
e.g. ctx.lookup("project.packageB")
please correct me if I'm wrong...
 
Maximilian Trenks
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sorry, i am no weblogic expert, but you can post your question in the weblogic forum here on javaranch.com:
https://coderanch.com/forums/f-40/BEA-Weblogic
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic