Expand my Community achievements bar.

UserTransaction object & Reader Extensions

Avatar

Former Community Member
Hi - This may be more of a Java question, but I'm hoping someone can help. I have created an EJB web service which will enable PDF document usage rights. Much of the code was taken from a sample on the LiveCycle Developer center.



The web service calls out to a java object (I've called ARES) that sits outside of the stateless EJB object. ARES is the object that places the actual setUsageRights call on the pdfDocument object.



The call to lookup the "Java:comp/UserTransaction" object is failing with the following error: javax.naming.NameNotFoundException: Name "comp/UserTransaction" not found in context "java:".



I've read in various articles that the Java:comp namespace is only available to J2EE components running inside the J2EE container. I've also read that you can install the Application Client Environment on your WAS server to get it to recognize the Java:comp namespace.



Here are what I think my options are... though I'm not sure which is the right approach (if any):



1) Leave the UserTransaction calls out. I'm thinking that maybe since the ARES object is being called from an EJB object with a container transaction type, the UserTransaction calls are unecessary from within the ARES object.



2) Install the Application Client Environment on WAS. I have no idea what the ramifications are.



3) Combine the ARES object into the EJB session bean, rather than it be its own object.



Thanks in advance...



Kari
1 Reply

Avatar

Former Community Member
I'm not an expert on EJB's, but i'd suggest u go with plan #3 since I think plan #1 will not work and plan #2 might be troublesome to get running.



i have that peace of code (ares callss) running inside a servlet and its proven to work



hope it helps !