Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

Extend a Document Protected by Policy Server...

Avatar

Former Community Member
I think I have the right idea, correct me if I am wrong. I apply a policy to a PDF using Acrobat 7. I then want to Reader Extend it but can't do it through the web interface so I write a Servlet. When the Servlet runs I get an error (see below). It is failing on the call to openPDFWithAPS just saying that the operation failed. Basically, I followed the sample given by Adobe for doing a Reader Extension through the API but instead of calling openPDF I call openPDFWithAPS. Am I on the right track? Any idea what the error is? In the server log file I see some failed connections to localhost:1099 (NamingService) but I do not bind my copy of JBoss to locahost, just to a single IP. Is there some call I should change to provide the address for the NamingService?



com.adobe.document.pdf.PDFOperationFailure: IDL:com/adobe/document/pdf/PDFOperationFailure:1.0

at com.adobe.document.pdf.PDFOperationFailureHelper.read(PDFOperationFailureHelper.java:67)

at com.adobe.document.pdf._PDFFactoryStub.openPDFWithAPS(_PDFFactoryStub.java:116)

at com.devx.example.ExtendReaderServlet.setRights(ExtendReaderServlet.java:184)

at com.devx.example.ExtendReaderServlet.service(ExtendReaderServlet.java:48)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:72)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)

at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.invoke(JBossSecurityMgrRealm.java:275)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)

at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)

at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)

at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)

at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)

at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)

at java.lang.Thread.run(Thread.java:534)
6 Replies

Avatar

Former Community Member
Errors from server.log trying APS Proxy to connect to Policy Server.



2005-06-23 15:48:38,046 INFO [com.adobe.service.APSProxyService] Resource Created, APSProxy

2005-06-23 15:48:38,203 INFO [com.adobe.service.APSProxyService] $$$/APSProxyImpl/msg.newAgent=Instantiating new APSProxy

2005-06-23 15:48:38,281 INFO [com.adobe.service.APSProxyService] $$$/APSProxyImpl/msg.config java.naming.provider.url=172.17.1.4:1099

2005-06-23 15:48:38,281 INFO [com.adobe.service.APSProxyService] $$$/APSProxyImpl/msg.config java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces

2005-06-23 15:48:38,281 INFO [com.adobe.service.APSProxyService] $$$/APSProxyImpl/msg.config java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory

2005-06-23 15:48:40,812 WARN [jacorb.poa] rid: 12 opname: GetVoucher invocation: throwable was thrown, null

2005-06-23 15:48:40,812 ERROR [jacorb] org.omg.CORBA.UNKNOWN vmcid: 0x0 minor code: 0 completed: No

at org.jacorb.poa.RequestProcessor.invokeOperation(Unknown Source)

at org.jacorb.poa.RequestProcessor.process(Unknown Source)

at org.jacorb.poa.RequestProcessor.run(Unknown Source)



2005-06-23 15:48:40,921 ERROR [com.adobe.document.PDFManipulation] an unknown exception caused the call to fail

Avatar

Former Community Member
Here is the error in server.log when I use the administrator account in the call to openPDFWithAPS. It is a little different from the one above (above I used the user account of the user who set the policy on the document that I am attempting to open).



2005-06-23 16:37:45,015 INFO [com.adobe.service.APSProxyService] Resource Created, APSProxy

2005-06-23 16:37:45,031 INFO [com.adobe.service.APSProxyService] $$$/APSProxyImpl/msg.newAgent=Instantiating new APSProxy

2005-06-23 16:37:45,046 INFO [com.adobe.service.APSProxyService] $$$/APSProxyImpl/msg.config java.naming.provider.url=172.17.1.4:1099

2005-06-23 16:37:45,046 INFO [com.adobe.service.APSProxyService] $$$/APSProxyImpl/msg.config java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces

2005-06-23 16:37:45,046 INFO [com.adobe.service.APSProxyService] $$$/APSProxyImpl/msg.config java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory

2005-06-23 16:37:45,734 ERROR [com.adobe.service.APSProxyService] com.adobe.edc.sdk.SDKException: No view permission(error code bin: 770, hex: 0x302)

2005-06-23 16:37:45,734 ERROR [com.adobe.service.APSProxyService] 770

2005-06-23 16:37:45,734 ERROR [com.adobe.service.APSProxyService] com.adobe.edc.common.EDCException

at com.adobe.edc.policy.PolicyManagerBean.throwException(PolicyManagerBean.java:605)

at com.adobe.edc.policy.PolicyManagerBean.getVoucher(PolicyManagerBean.java:456)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:324)

at org.jboss.ejb.StatefulSessionContainer$ContainerInterceptor.invoke(StatefulSessionContainer.java:949)

at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:120)

at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)

at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invoke(StatefulSessionInstanceInterceptor.java:273)

at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)

at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:341)

at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:148)

at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)

at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)

at org.jboss.ejb.StatefulSessionContainer.internalInvoke(StatefulSessionContainer.java:416)

at org.jboss.ejb.Container.invoke(Container.java:723)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:324)

at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)

at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)

at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)

at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)

at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:185)

at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)

at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:360)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:324)

at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)

at sun.rmi.transport.Transport$1.run(Transport.java:148)

at java.security.AccessController.doPrivileged(Native Method)

at sun.rmi.transport.Transport.serviceCall(Transport.java:144)

at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)

at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)

at java.lang.Thread.run(Thread.java:534)

at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)

at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)

at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)

at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)

at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:135)

at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:96)

at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)

at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:53)

at org.jboss.proxy.ejb.StatefulSessionInterceptor.invoke(StatefulSessionInterceptor.java:104)

at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:85)

at $Proxy66.getVoucher(Unknown Source)

at com.adobe.service.APSProxyImpl.GetVoucher(APSProxyImpl.java:320)

at com.adobe.service.APSProxyPOATie.GetVoucher(APSProxyPOATie.java:54)

at com.adobe.service.APSProxyPOA._invoke(APSProxyPOA.java:102)

at org.jacorb.poa.RequestProcessor.invokeOperation(Unknown Source)

at org.jacorb.poa.RequestProcessor.process(Unknown Source)

at org.jacorb.poa.RequestProcessor.run(Unknown Source)



2005-06-23 16:37:45,781 ERROR [com.adobe.document.PDFManipulation] an unknown exception caused the call to fail

Avatar

Former Community Member
Was the account that is running your servlet included in the Policy that you created? I am thinking that perhaps the servlet cannot open the PDF because it does not have access to the policy (or not part of it).

Avatar

Former Community Member
I didn't use LDAP, so I would guess, No. Running JBoss on Windows as a service, so it should be running under Local System. Created policy as administrator, attached policy using my own account in the system. The policy allows access by Anonymous.



Tried the call to openPDFWithAPS() with both administrator and my own accounts.

Avatar

Former Community Member
OK, I just thought of looking in the Events view on the Policy Server. I see that when I used either account in my code, and event was logged for a Successful Login and it said the user was authenticated. An event of "View Document" was also logged on each try. For the external user that created the document and assigned the policy, the "View Document" was logged as successful. For the administrator, the "View Document" was logged as "Denied". So it looks like I can get as far as the "View Document" event. At least I know the 2 servers are talking to some degree.

Avatar

Former Community Member
Hi all,



There is post about PKI and Policy server that seems to be answering this dilemma (keep in mind that Reader Extensions actually uses PKI to apply the usage rights...)



Take a look at this post:


jospp, "Can Policy Server supports PKI encryption?" #, 6 Aug 2005 6:37 am



My two cents,

Evangelos