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

deployproblem passing Handle from Statefull SessionBean

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I want to pass the Handle to a SF SessionBean back to the client. In order to do that I retrieve the javax.ejb.Handle in myServlet by saying getHandle(). Now I want to pass that Handle back to the client. But ... (I use VisualAge 3.5 EE)now for some reason the Handle retrieved is of type com.ibm.ejs.container.SessionHandle and this is not what i expected. Although it works in my test environment it goes wrong when I deploy, because the servlet can not find the "ibm"Handle. Seems like a typical VisualAge problem.
Any suggestions/workarounds??
 
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
If u are talking about the EJB handle then u need to get it from the EJBObject, ie first get lookup the home and then get the bean classes stub refrence ie the EJBObject by create or whatever finder methods u might be using and then from that u do Handle myhandle=myEJBObject.getHandle();
If u are doing it this way then there should not be any problem.
Cheers,
Daman
 
Django Boonman
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes I'm talking about the EJBHandle, I coded something like:
javax.ejb.Handle myhandle = (javax.ejb.Handle)myAccessBean.getEJBRef().getHandle(); This should do the trick (the accessBean is typical VA and the getEJBRef method retrieves the EJBObject), but somehow VA retrieves the wrong type of "IBM"handle and this gives a problem when deploying. It seems that the installation of WebSphere Application Server 3.5 is not correct, because the servlet can not find the com.ibm.ejs.container.SessionHandle class it seems to be using.
Very very annoying because I do not know how to fix this problem.
 
daman sidhu
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Did u try using the handle in the way i recommended u, ie the handle has to be of particular bean instance, i havent used the handle the way you described, so i cant say about that but if you look up the bean home and then the Ejbobject from that , it should work.Do try it out this way and let us know if it works.
Cheers,
Daman
 
Django Boonman
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried it, but no luck. Basically I followed the way you described (and I also tried the way described in the Monson-Haefel EJBbook): lookup the home, get the EJBObject and retrieve its handle by calling getHandle() (This is also the way I described in my earlier postings, the AccessBean is introduced by IBM to make the client programming more easily, it hides this functionality but basically does the same); Still the returned type is of type com.ibm.ejs.container.SessionHandle although the docs say that the getHandle method returns an javax.ejb.Handle.
So to me, this looks like a major bug in VisualAge and one I would like to see solved very quickly (otherwise I see no way to work with Statefull SessionBeans). I am still looking for a way to report this "feature" to IBM.
Thanx, I keep you posted.
 
daman sidhu
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey,
If thats the problem then it definetly is a bug, tell u what ill try out the same thing in my pc and let u know what happens ok.
Cheers,
Daman
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello.
Pay attention.The getHandle returns a class that implements javax.ejb.Handle (thats an interface). The com.ibm....thing is a class that implements the javax.ejb.Handle.
BR,R
 
Razvan Matei
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok.
I had the same problem but in another context. What I suggest you to do is to put the bean (from which you use the handle) to be loaded by the servlet container.Remember, ALL the classes (meaning stubs etc what result from EJB compilation).Put them to be loaded by the servlet container.Let me know if it works.Do not modify your code (just store ejb.getHandle() and then try to get it).
R
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic