This discussion is archived
4 Replies Latest reply: Apr 16, 2010 1:03 PM by frank.closheim RSS

InputStream failure

666879 Newbie
Currently Being Moderated
does anybody know why would the createDocumentDefinition method fail if I use InputStream as source file?


Item docDef = fileM.createDocumentDefinition(
new NamedValue[] {
ClientUtils.newNamedValue(Attributes.NAME, sourceFilename),
ClientUtils.newNamedValue(
Options.CONTENTSTREAM, sourceFile),
}, null);
  • 1. Re: InputStream failure
    666879 Newbie
    Currently Being Moderated
    I still couldn't figure this out even with every log turned on to the finest detail. Working with Oracle support was the biggest waste of my time. They won't help you with this type of issues. They will remind your about the finest detail in the license agreement when you downloaded the devkit, "use it at your own risk". And the document they created for their freakiest api is no where near what developers would use in real life. Yea, they have some examples. Trying using them in real world. Yes they give some ideas and that's all. If you want to do serious development, you are basically on your own.
  • 2. Re: InputStream failure
    frank.closheim Newbie
    Currently Being Moderated
    Hi saidul,

    what exactly is your problem? What is the exception you are getting Client side, and Server side (application.log) ?

    I used this method in one of my applications as well and had no problems:

    File docFile = new File(doc);
    FileInputStream is = new FileInputStream(docFile);

    ...

    NamedValue[] nv =
    new NamedValue[] { new NamedValue(Attributes.NAME, newName),
    new NamedValue(Options.CONTENTSTREAM, is) };

    // Create Document Definitions
    Item docDef = fm.createDocumentDefinition(nv, null);

    Regards,
    Frank
  • 3. Re: InputStream failure
    666879 Newbie
    Currently Being Moderated
    I think the issue is related to something in the configuration, not sure where though. On the server side/application log shows the following and as for front end I get error 500

    content: Servlet error
    javax.servlet.ServletException: internal error: required attributes missing
    at oracle.ifs.protocols.dav.ecm.EcmDavServlet.doDocumentGetOrHead(EcmDavServlet.java:2405)
    at oracle.ifs.protocols.dav.ecm.EcmDavServlet.doGetOrHead(EcmDavServlet.java:2287)
    at oracle.ifs.protocols.dav.ecm.EcmDavServlet.doGet(EcmDavServlet.java:1187)
    at oracle.ifs.protocols.dav.DavServlet.processRequest(DavServlet.java:2614)
    at oracle.ifs.protocols.dav.ecm.EcmDavServlet.processRequest(EcmDavServlet.java:3616)
    at oracle.ifs.protocols.dav.DavServlet.processRequest(DavServlet.java:2396)
    at oracle.ifs.protocols.dav.DavServlet.service(DavServlet.java:2361)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.3.0)].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
    at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
    at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.3.0)].server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
    at oracle.ifs.fdk.http.HttpServerManager.doFilter(HttpServerManager.java:103)
    at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.3.0)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:670)
    at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.3.0)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:341)
    at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.3.0)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:816)
    at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.3.0)].server.http.AJPRequestHandler.run(AJPRequestHandler.java:231)
    at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.3.0)].server.http.AJPRequestHandler.run(AJPRequestHandler.java:136)
    at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.3.0)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
    at java.lang.Thread.run(Thread.java:534)
  • 4. Re: InputStream failure
    frank.closheim Newbie
    Currently Being Moderated
    Are you writing a web-service client or in-process app (i.e. EventHandler)?

    Although the Javadoc is stating: "+Options.CONTENTSTREAM is only available for in-process clients (such as EventHandler implementations); it is not available for remote clients (over web services).+" I have a code that is working with the InputStream via WebServices.

    - Is your code failing on the createDocumentDefinition() method or the createDocument() method afterwards?
    - Is there any required categories configured on your target folder?
    - Any workflows configured on your target folder?
    - What do you mean with error 500 on front end? How is your code executed?
    - Have you tried using the Options.CONTENTSTREAM with the createDocument() method? Does this throw the same error?
    - What is your CDB version and what Devkit are you using with it?
    - From the logs I can see you are using AS 10.1.2.3.0. CDB ships with AS 10.1.2.0.2. Have you upgraded your system?

    Regards,
    Frank

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points