This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Lookup problem for Stateful session EJB with EXTENDED persistance context Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Lookup problem for Stateful session EJB with EXTENDED persistance context" Watch "Lookup problem for Stateful session EJB with EXTENDED persistance context" New topic
Author

Lookup problem for Stateful session EJB with EXTENDED persistance context

Arjun Patil
Greenhorn

Joined: Jun 17, 2010
Posts: 1
Hi,
I'm doing lookup for Stateful session EJB with EXTENDED persistance context from JSP..

code as follows...
<%
BandServiceRemote serviceRemote=null;

try{
InitialContext context=new InitialContext();
serviceRemote=(BandServiceRemote)context.lookup("Band#"+BandServiceRemote.class.getName());
}catch(Exception e){
System.out.println("Error accoured");
e.printStackTrace();
}
%>

i'm getting following exception during lookup...

"Caused by: java.lang.IllegalStateException: Extended Persistence Contexts can only be invoked from within the context of the stateful session bean that declares the Extended Persistence Context."

&, if i remove the Extended persistance context, then look happens successfully...


Can you guys help me in understanding what is going wrong???

thanks.
 
wood burning stoves
 
subject: Lookup problem for Stateful session EJB with EXTENDED persistance context
 
Similar Threads
EntityManager question
Error when trying to use an extended persistence context in EJB 3
SLSB Transaction scoped EntityManager calling SFSB Extended EntityManager
Why use Stateful session bean as opposed to a HTTP session ?
Persistence Context scope and type