Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Got an IllegalStateException during a loopback in Singleton

 
Himai Minh
Ranch Hand
Posts: 1398
8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a singleton, that makes a direct loopback method call via SessionContext.getBuinsessObject. It works:


But when I tried to make the indirect loopback call via another Singleton, instead of getting an IllegalLoopBackException, I got an illegalStateException:



Caused by: java.lang.IllegalStateException: Invalid business interface : interface com.ivan.scbcd6.SLSBALocal for ejb SLSBB
at com.sun.ejb.containers.AbstractSessionContextImpl.getBusinessObject(AbstractSessionContextImpl.java:202)
at com.ivan.scbcd6.SLSBB.method2(SLSBB.java:17)

 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Posts: 2778
174
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You didn't have an indirect loopback call from the SLSBB bean. You should inject SLSBA inside SLSBB and call from SLSBB.method2() another method on (the injected) SLSBA (e.g. method3).
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!