0

I'm a developer Opentext and i need know how can download a file from content server Opentext from app Java. I have this code:

int nodeID = _id_code_document;
OutputStream os = new FileOutputStream(new File(PATHFILE+NAMEFILE));
DataHandler file= fContent.downloadContent(nodeID + "");
file.writeTo(os);

Where:

  1. Content is a instance of ContentService service of Opentext (les-services/services/ContentService).
  2. PATHFILE+NAMEFILE is the ubication and name of file.
  3. _id_code_document is document id.

When this code run appear this error:

    javax.xml.ws.soap.SOAPFaultException: CacheUtil: Could not load requested cache object: 2986 (V{<'SEGMENTBLOB'>})
        at com.sun.xml.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:188)
        at com.sun.xml.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:116)
        at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:119)
        at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:89)
        at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:118)
        at com.sun.proxy.$Proxy40.downloadContent(Unknown Source)
Caused by: javax.xml.ws.soap.SOAPFaultException: CacheUtil: Could not load requested cache object: 2986 (V{<'SEGMENTBLOB'>})
    at com.opentext.livelink.service.core.ExceptionUtil.throwSOAPFaultException(ExceptionUtil.java:162)
    at com.opentext.livelink.service.core.ContentService_JAXWS.downloadContent(ContentService_JAXWS.java:156)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.sun.xml.ws.api.server.InstanceResolver$1.invoke(InstanceResolver.java:246)
    at com.sun.xml.ws.server.InvokerTube$2.invoke(InvokerTube.java:146)
    at com.sun.xml.ws.server.sei.EndpointMethodHandler.invoke(EndpointMethodHandler.java:257)
    at com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:93)
    at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:598)
    at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:557)
    at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:542)
    at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:439)
    at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:243)
    at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:471)
    at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
    at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:135)
    at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServletDelegate.java:129)
    at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:160)
    at com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java:75)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:643)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
    at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:879)
    at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:617)
    at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1774)
    at java.lang.Thread.run(Unknown Source)

Anyone know how can resolve this?

Thx 4 advance!

Andrew Barber
  • 39,603
  • 20
  • 94
  • 123
Roldanhollow
  • 105
  • 5
  • 16
  • You should specify which interface you're using (Content Web Services, REST API, LAPI, Enterprise Webservices?) and which Content Server version you're accessing (CS 10, CS 10.5?). Then you should post a piece of code which somebody can compile and run on its machine. If the code is long, then put it into Pastebin. Then you com e back and ask again - and you shall be helped. – Steffen Roller Mar 13 '14 at 03:01

2 Answers2

0

I guess you just want to save the file, you can use this:

URL website = new URL("Path to your file on the server");
ReadableByteChannel rbc = Channels.newChannel(website.openStream());
FileOutputStream fos = new FileOutputStream("Path to where you want to save the file");
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);

This has been answered before: How to download and save a file from Internet using Java?

Community
  • 1
  • 1
0

the error you got is generated from the code samples that opentext provided. make sure that the contentserviceclient is using a contentserviceclient.otauthentication, as in the provided code they are using the documentmanagementclient.otauthentication, i modified it and the code is working great :)

Abd H.
  • 3
  • 2
  • It can't be answer. If you are facing any issue then either you can leave a comment (for that you require at least 50 reputation) or ask a new question. – Paresh Mayani Jun 06 '14 at 12:19