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

java.lang.IllegalStateException: No GridFS instance defined!

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

      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++;
      }

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

              Created:
              Updated:
              Resolved: