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

java.lang.IllegalStateException: No GridFS instance defined!

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Major - P3 Major - P3
    • None
    • 3.0.3
    • GridFS
    • None
    • Windows 7 64 bit

    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

            ross@mongodb.com Ross Lawley
            PavanKua Pavan [X]
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: