Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-1911

java.lang.IllegalStateException: No GridFS instance defined!

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Won't Fix
    • Affects Version/s: 3.0.3
    • Fix Version/s: None
    • Component/s: GridFS
    • Labels:
      None
    • Environment:
      Windows 7 64 bit
    • Sprint:
      Java Sprint 23

      Description

      GridFS is failing to write the file. After creating a GridFS class and storing few files to mongodb. I am trying to read it back.

      DBCursor cursor = fs.getFileList();
      int count=0;
      while(cursor.hasNext()){

      GridFSDBFile object = (GridFSDBFile)cursor.next();
      final InputStream is = object.getInputStream();
      System.out.println("is to "+is.toString());
      try

      { //destination = Paths.get("C:\\drls\\test"+count+".drl"); //Files.copy(is, destination); object.writeTo("C:\\drls\\test"+count+".drl"); }

      catch (IOException e)

      { // TODO Auto-generated catch block e.printStackTrace(); }

      count++;
      }

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: