2015년 1월 9일 금요일

The parsing error from BsonDocument to JsonReader

I have to work the MongoDB C# Driver and Json.Net.

This sources installed from Nuget.

And i made a function of deserializer.  It is as follows:

public static T ConvertTo<T>(this JsonSerializer serializer, BsonDocument bson)
{
    using (var jsonReader = new JTokenReader(JToken.Parse(bson.ToJson())))
    {
        jsonReader.DateTimeZoneHandling = DateTimeZoneHandling.Local;
        var result = serializer.Deserialize<T>(jsonReader);
        return result;
    }
}

But.. The problem of parsing error occurs when BsonDocument to JsonReader coverting.

"_id" : ObjectId("54ab8b06d05efe1e5063941f") => String
"date" : ISODate("2015-01-06T07:13:09.993Z") => DateTime

ObjectId and ISODate types are not converted.

I would like to know a solution for this.


How to measure the performance of Mongodb Database?

Kindly any one help me in understanding the performance metrics for mongodb. I am unable to measure it. Kindly give ur feedback, if u ve idea regarding this?



It would help to know what you're trying to measure and why you think you can't.

MongoDB ships with some tools (mongostat and mongotop) to see real time metrics. You can use MMS monitoring to collect and view historical data.


2015년 1월 7일 수요일

passing lambda expression to collection.Find(...)

I'm following the instructions at the github page and am using what I understand to be the latest version (1.9.2.235)


var list = await collection.Find(x => x.Name == "Jack")

This does not compile for me. The only arguments to find I can see are IMongoQuery. Are the docs out of date or is something else wrong??



The github page is referring to what is in master. To use this code, you'll need to build the driver from master or pull it from our build feed. 

However, the 1.x  branch (which includes 1.9.2.235) has a quickstart for it as well: https://github.com/mongodb/mongo-csharp-driver/tree/v1.x.



thank you. so to confirm, the code in master (and the docs) is *ahead* of the 1.9.2 (nuget) build? Do you typically update nuget after a stable version is published?



The code in master is ahead of the 1.9.2. You can find a tag for 1.9.2 which gives the exact source snapshot of it.

There are some RCs that are also published, 1.10.0-rc1 for example. The code in master is also ahead of those. You can get master build fields here: https://www.myget.org/gallery/mongodb. Any 2.0.0 build is from master.


duplicate key error index when doing an upsert

I have some (C#) code that upserts a bunch of documents as follows:

        public void UpsertByProductID(IEnumerable<Product> documents)
        {
            if (documents.Any())
            {
                var query = Query.In("Attributes.Product ID", documents.Select(x => BsonValue.Create(x["Product ID"])));
                productsCollection.Remove(query, RemoveFlags.None, WriteConcern.Acknowledged); 
                productsCollection.InsertBatch(documents);
            }
        }

And I'm regularly getting the following error:

WriteConcern detected an error ''. (Response was { "err" : "E11000 duplicate key error index: skubrain.Product.$Attributes.Product ID_1  dup key: { : null }", "code" : 11000, "n" : 0, "connectionId" : 11, "ok" : 1.0 }).

There is (obviously) a unique index defined on the  Attributes.Product ID field. However as far as I can tell, from the above logic, it shouldn't be possible for this code to cause this write concern error... it is specifically deleting any documents that match the Attributes.Product ID of the documents being inserted before performing the insert. 

Any ideas?



I'm regularly getting the following error:

WriteConcern detected an error ''. (Response was { "err" : "E11000 duplicate key error index: mydatabase.Product.$Attributes.Product ID_1  dup key: { : null }", "code" : 11000, "n" : 0, "connectionId" : 11, "ok" : 1.0 }).

There is (obviously) a unique index defined on the  Attributes.Product ID field. However as far as I can tell, from the above logic, it shouldn't be possible for this code to cause this write concern error... it is specifically deleting any documents that match the Attributes.Product ID of the documents being inserted before performing the insert. 

The duplicate key error indicates that the issue is with "null" values for "Attributes.Product ID".

If a document doesn't have a value for the field in a unique index, the index entry will be null unless the index is both unique and sparse:

In a non-sparse unique index, that means that only one document in the collection can have a null/missing value.

I would check that your documents either always include the "Attributes.Product ID" field, or drop and recreate the unique index as unique & sparse if the "Product ID" is not always present.



OK so I've got no idea why the bulk insert didn't work but I've basically worked around it for the time with a loop that upserts documents individually:


       public void UpsertByProductID(IEnumerable<Product> documents)
        {
            if (documents.Any())
            {
                foreach (var doc in documents)
                    try
                    {
                        var query = Query.EQ("Attributes.Product ID", BsonValue.Create(doc["Product ID"]));
                        var existing = FindOne(query);
                        if (existing != null)
                            doc.Id = existing.Id;
                        Update(
                            query, 
                            Update<Product>.Replace(doc), 
                            UpdateFlags.Upsert
                            );
                    }
                    catch (Exception ex)
                    {
                        ex.Data["Json"] = doc.ToJson();
                        throw ex;
                    }
            }
        }

It's a bit more wordy that my original code but it has the incomparable advantage that it works...



I noticed that as well... however the error message was erroneous in that respect since:

a) the index was defined as sparse and
b) none of the documents being inserted had a null or otherwise blank (e.g. whitespace) value for Attributes.Product ID. 

I initially tried replacing the bulk insert with a loop that used FindAndModify to individually upsert each of the documents and I was still getting the error... so I knew exactly which document had caused the error. Something was really odd about it. If I took the JSON for that document and simply did a find in MongoVue for any documents matching the index fields, I was getting nothing back. Also, if I performed the Upsert from within MongoVue everything went swimmingly.

I suspect then that it might be an issue with the C# driver. In any event, using Update (with upsert = true) instead of FindAndModify appears to have resolved the issue for the time being.


Course M102 starts tomorrow?

Newbie signs up for dba course that is slated to begin tomorrow.  I see no entry point into the class.  I've not received any emails with directions.  How does one begin the course? The about page doesn't mention anything on the entry point or a how to: https://university.mongodb.com/courses/M102/about  



If you go to university.mongodb.com and sign in using the button in the upper right, then, after signing in, hit the My Courses button that should show up where the Sign In button used to be, do you see M102 listed under your courses? If you click on the course title, it should take you to the released course content once the course begins.

If you don't see M102 listed there, can you re-register for it on https://university.mongodb.com/courses/M102/about?



If you click on the course title, it should take you to the released course content once the course begins.

Thanks, Will.

Yes, I get to the course title that I'm registered for, but when I click on the course title it sends me to the "about" page you posted.  You seem to indicate that information about how to attend the class doesn't get posted until the class starts. The FAQ on the "about" page probably should have a bullet to indicate how to take the class, even if it's just in general, like "Don't look for how to take the class until the class starts."  or "Come back here after the class start time to get the youtube url to enter the class."

The "about" pages says this:

Next Session

06 Jan 2015 at 17:00 UTC
24 Feb 2015 at 17:00 UTC
You are registered for this course.
It just doesn't say how to attend the class anywhere.



Hi, Raymond. Great idea to include a statement telling those who register to return to the course page once the course begins in order to begin. We will do that. Once the course opens you will see a "View Courseware" button on the course page that will enable you to enter the course.

I do want to clarify, however. As the FAQ on the course page states, you do not need to be available at a particular time of day to attend the course. The course is composed of pre-recorded video segments and weekly homework assignments. You may watch the videos and complete the homework at any time during the week that material is released.


toring xml files in mongodb

I have a use case that I need help from you all. I have xml data roughly around 50 terabytes to start with supplied through some external source and then every day additional xml data will be around 1 - 2 terabytes roughly to be stored to mongodb. Ultimate aim is to query the xml data in some web app and throw an analytics dashboard. Like top 10 products, top 10 routes etc. As mongodb native format is json , is it a viable option to convert this many xml data to json or can I just store the whole xml data as it is with the transformation.

Any suggestions with the storing part and the querying part. Also please let me know if there are say 50 million such documents how much the query time would be to do joins .



You will want to convert the XML to JSON/BSON; otherwise, it won't be possible to do any reasonable queries. It's difficult to say much more than that about your questions because we have so little information. Can you be more specific about

- what the XML looks like
- what the use case is for the dashboard- what specific analytics do you want?

You will want to design the transformed JSON/BSON documents to fit your use case, especially given the large quantity of data that you have. MongoDB doesn't do join. Joins must be done application side. You should design the documents to make large-scale joins unnecessary, or necessary only for rare queries that you're willing to wait for.


renaming a collection using the c++ driver

Could anyone provide an example of how I can rename a Mongodb collection using the C++ driver? 



The C++ driver does not currently offer an explicit helper method to invoke the renameCollection command. However, you can issue all database commands honored by the server (see http://docs.mongodb.org/manual/reference/command/) by using the DBClientWithCommands::runCommand method (declared in mongo/client/dbclientinterface.h).

For the specific parameters for the renameCollection command, see http://docs.mongodb.org/manual/reference/command/renameCollection/


2015년 1월 6일 화요일

[AngularJS] Filtering geojson change dynamically in table and on map

Right now i try to figure out how to make geojson filter with ng-model search

I know that geojson has attribute filter, so my question is how should it be done ? I assume there is no way to do simple geojson | filter:search, so it should be done on the side of angular?

I found good solution but it works only with mapbox, it is possible to do something like below with leaflet-angular-directive?

<mapbox map-id="examples.map-i86l3621" lat="11.403569" lng="8.329453" zoom="3">
    <div ng-repeat="hf in hf_directory |filter:search"> <marker lat="{{hf.geometry.coordinates[1]}}" lng="{{hf.geometry.coordinates[0]}}" color="#39cccc">    </marker>    </div>
</mapbox>

I use simple filtering 
<input ng-model="search.properties.Primary_Name" placeholder="Primary Name" >

<tr ng-repeat="hf in hf_directory| filter:search">

My Template:

<leaflet id="map" center="center" defaults="defaults" geojson="geojson">

</leaflet>

I use leaflet-angular-directive and it looks like this:
    
var AppMapDirectory = angular.module('DirectoryAppMap', ['ngResource', 'leaflet-directive']);
AppMapDirectory.factory("Directory", function($resource) {
   return $resource("json/result.json", {}, {
       get: {
           method: "GET",           cache: true       }
   });});


AppMapDirectory.controller("DirectoryMapList", ["$scope", "Directory", "$filter", function($scope, Directory, $filter) {




    Directory.get(function(data) {

       $scope.hf_directory = data.features;

        function onEachFeature(feature, layer) {
                layer.bindPopup("<b>Name:</b> " + feature.properties.Name +
                    "<br><b>Category:" + feature.properties.Category +
                    "<br>Primary Name:" + feature.properties.Primary_Name + "");            }


         angular.extend($scope, {
           geojson: {

               onEachFeature: onEachFeature,               data: $scope.hf_directory           }

       });

       });

    angular.extend($scope, {
        defaults: {
            tileLayer: "https://dnv9my2eseobd.cloudfront.net/v3/foursquare.map-ikj05elx/{z}/{x}/{y}.png",            maxZoom: 14,            minZoom: 1        },        center: {
            lat: 8.1238,            lng: 11.8777,            zoom: 2        }
    });





Actually i wrote simple filter function for geojson, but maybe somebody could show me direction how to make that this function will work together with input ng-model search?
The  way as i did it is not dynamic

function filter(feature) {
    return feature.properties.PrimaryName == "somename";
}

         angular.extend($scope, {
           geojson: {
              onEachFeature: onEachFeature,               data: $scope.hf_directory,               filter:filter           }

       });


[tokumx-user] find or fineOne slow

Could you send us:

db.collection.findOne()
db.collection.find().explain()
db.collection.findOne().explain()
db.collection.getIndexes()

on all shards, and from mongos














Lost database using monggodb

Hello. I'm having a problem with my web project. I'm using MongoDB2.6.5 and have the following problem: Some of my data Province lostfor unknown reasons.
Looking forward to the help soon.



Hello. I'm having a problem with my web project. I'm using MongoDB2.6.5 and have the following problem: Some of my data Province lostfor unknown reasons.
Looking forward to the help soon.

Hi,


We're going to need more details to try to help. What do you mean by "lost" (deleted? can't find?) and what exactly has been lost (an entire database, some fields in your documents, some documents, ..)?



I removed MongoDB from Windows Service by using "mongod --remove", and then "mongod --repair". But when I restart the db, all the databases have lost except for "local". Could you please help me? 



I removed MongoDB from Windows Service by using "mongod --remove", and then "mongod --repair". But when I restart the db, all the databases have lost except for "local". Could you please help me? Thank you.

Hi,

Removing the service with `mongod --remove` does not delete any data files.

How did you restart mongod -- from the command line, or by reinstalling as a service? I suspect you either used a different dbpath or didn't specify one (so the Windows default of "c:\data\db" was used). The "local' database is automatically created with a capped collection "startup_log".

If you're not sure if there was a different dbpath previously, I would try searching for any directories with "local.ns" (namespace file for the "local" database). The data directory should include other files for each database: a name space file (<database>.ns) and 1 or more  files named like <database>.0, <database.1>, etc.


DB access[Read/Write] slow

Our Mongo DB version : 2.4.3
Mongo Java driver : 2.11.3


process1:
slaveok=false

we are reading and writing to db1, the load is approx 100 hits/ seconds.

process2:

slaveok=false
we are reading and writing to db2, the load is approx 10 hits/ seconds.

But whenever the process1 is running process2 also taking more time to respond.

Note : All collections in db1 and db2 are not sharded.Each db has 40 collections and maximum document for a collection is 400,000.

My question is that DB level lock may slow down the collection owned DB [db1], but why the db2 based process is getting slow?

And also Please help me to take the longterm solution for this problem?

Shall I shard all collection in db1 and db2?
Shall I make the slaveok=true? [but it'll give stale data]?
Does Mongo db upgrade give any solution for this?


[casbah] Casbah 2.8.0-RC1 released

The 2.8.0-RC1 Casbah (Scala) Driver has been released. 

This is a release candidate and as such is not recommended for production use.  

This is the second release candidate adds support for the latest MongoDB 2.8 release candidate. Please review the change log athttps://github.com/mongodb/casbah/blob/2.8.0-RC1/src/sphinx/changelog.rst#changes-in-version-280-rc1

As always, please let us know if you have any problems by opening an issue at https://jira.mongodb.org/browse/CASBAH or posting any issues / questions here.


[mongodb-csharp] Unable to connect to server X.X.X.X:YYYY: Invalid credential for database 'admin'..

I recently updated from version 1.7.0 to the prerelease of 1.9. Now when I try to run my project, I get the following error:

    Unable to connect to server X.X.X.X:YYYY: Invalid credential for database 'admin'..

where the server and port are actual vaules rather than X/Y.

When I revert to version 1.7, everything works fine. Version 1.7.1 also works. Version 1.8.0 manifests the error.
What has changed?  How do I fix this? What other issues am i going to run up against in upgrading? Where can I find an upgrade guide for the csharp driver?



The way credentials are parsed out of the connection string are different, starting in 1.8.  There are some warnings about this in the docs.

I assume your credentials are for a specific database other than admin?  If so, you'll need to specify the database in your connection string.  Consult the official connection string documentation: http://docs.mongodb.org/manual/reference/connection-string/



Thanks for your response. I looked at the documentation and cannot see a problem with my connection string. Here is the format I am using:
    mongodb://myname:mypass@24.24.24.24:24242
This should be valid according to the docs



I see the problem. Thanks for your response. 

What other things should I watch out for in the upgrade? Is there an upgrade guide?



There are release notes for 1.8, 1.8.1, 1.8.2, and 1.8.3.  We also have some for 1.9.  You can read those for the gist of what has happened since 1.7.

Other than that, there aren't many other breaking changes unless you were using conventions heavily in your codebase.  If you were, things mostly should continue to work and as long as your tests pass, everything is ok.



i also had this problem

this cn work fine:
"mongodb://userr:pass@address:27017/dbapplications?slaveOk=true;readPreference=nearest;replicaSet=test1;minPoolSize=50";


Lost data using mongodb

Hello. I'm having a problem with my web project. I'm using MongoDB2.6.5 and have the following problem: Some of my data Province lostfor unknown reasons.
Looking forward to the help soon.


2015년 1월 5일 월요일

[bottlepy] Viewing using a JavaScript library

Trying to use bottle to view / navigate through a combination of yaml / DBMS data in a python project.

So I set up the bottle project in a separate directory and really like the simplicity of bottle.

Just wondering - what is a good rich UI integration layer to use with bottle and what tye of directory structure I could have.

I have a main file called Controller.py to route requests and other subdirs underneath for additional python modules.

What would be a good JavaScript library to be used to create nice HTML5/CSS interfaces with - to be able to click and send req/res back through bottle?

Eg. would MeteorJS not be too heavy? How would PolymerJS work? Any and all suggestions towars lightweight and elegance would be much appreciated.


[bottlepy] port forwarding on vagrant for bottle

I am trying out some of the bottle coding.

I write a service (in a Vagrant environment, thus virtual machine) andon localhost:3000 I can see the output.

However as I am running in Vagrant (guest) and the port 3000 isforwarded into host as 3000 as well.

However when I try localhost:3000 from host, I get the error:
http: error: ConnectionError: HTTPConnectionPool(host='localhost', port=3000): Max retries exceeded with url: / (Caused by <class 'socket.error'>: [Errno 104] Connection reset by peer)

I am trying out some things in a Go web development environment and a JavaScript framework as well. They can hit the forwarded ports in guest from host - no problem. Even 3000.

However, it seems can't get there from bottle or even flask, from host:3000 to guest:3000 - even though 3000 is forwarded.

My file is Controller.py - does the naming convention or directory structure matter?

Please let me know if any suggestions.


2015년 1월 4일 일요일

Instead of timeout error - The MongoCursor object has not been correctly initialized by its constructor

I use php driver in a cli php script. I have a find() query that takes a long time to complete ( ~1000 ms).

I receive the error "The MongoCursor object has not been correctly initialized by its constructor".
When I increase socketTimeoutMS the error disappear,

 so instead of MongoCursorTimeoutException or MongoExecutionTimeoutException I got a general error.
Isn't that a problem? 



Yes, this looks like a problem. Can you please first update to the
latest driver version (1.5.8) and if the issue still persists, file a
bug report at https://jira.mongodb.org/browse/PHP ? Please include a
full reproducible case if you can - including data and a script.


[mongodb-csharp] Replicaset with mongodb and C#

 i am begineer to mongodb..any one has idea how to use replicaset in code behind ?
 i have configure replica set but now i have no idea how to work that.


How to load second dropdown list frommongodb collection after first dropdown list is changed

I have floor collection in mongodb. floor have name and room no. i was write a php query within html drop down box for list out the floor name .query is
<select class="select">
  <?php
$collection = $db->floors;
$cursor = $collection->find();
  if($cursor){ 
  foreach($cursor as $rec){
echo"\n";?>
<option>  <?php echo $rec['name']; ?> </option>
<?php }
                                         }
    ?> 
  </select>
now i want select room list based ob floor name

this html form is display the room no list
<label class="col-sm-4 control-label">Room Number</label>
<div class="col-sm-8">
<select class="select">
<option>01</option>
<option>02</option>
<option>03</option>
<option>04</option>
</select>
</div>

how can i write a query for selection room no . pls anyone help me.advancein thanks



This is a wrong mailing list for this kind of questions. You may want to check on StackOverflow for answers. 


populating from mongodb to jtable

i dont know how many keys the documents have...so i make a program like..
 private void showresultsActionPerformed(java.awt.event.ActionEvent evt) {                                            
       
        
        Object dbs=db.getSelectedItem();
        Object colls=coll.getSelectedItem();
      String  distances=distance.getText();
      String skillss=skills.getText();
      
       
        MongoClient m = null;
        try {
            m=new MongoClient();
                        
        } catch (UnknownHostException ex) {
            Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex);
        }
      DB dbv = m.getDB((String) dbs);
      DBCollection collv = dbv.getCollection((String) colls);
      
     DBObject doc = collv.findOne();
         Set<String> keys= doc.keySet();
         
        DBCursor cursor=collv.find();
        
     String[] columnnames=keys.toArray(new String[keys.size()]);
     DefaultTableModel tb=new DefaultTableModel(columnnames,0);
     while(cursor.hasNext()) {
              DBObject obj = cursor.next();
            int i;
              for(i=0;i<columnnames.length;i++)
              {
                  Object a = obj.get(columnnames[i]);
              tb.addColumn(columnnames[i], (Object[]) a);
              } 
                             
     }
      main.setModel(tb);
     
    }                                           

to fill jtable with mongo data..but upon clicking  button this error happens:----

Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: org.bson.types.ObjectId cannot be cast to [Ljava.lang.Object;
at NewJFrame.showresultsActionPerformed(NewJFrame.java:217)
at NewJFrame.access$100(NewJFrame.java:12)
at NewJFrame$2.actionPerformed(NewJFrame.java:74)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.java:6516)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3320)
at java.awt.Component.processEvent(Component.java:6281)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Component.dispatchEventImpl(Component.java:4872)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Component.dispatchEvent(Component.java:4698)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
at java.awt.Container.dispatchEventImpl(Container.java:2273)
at java.awt.Window.dispatchEventImpl(Window.java:2719)
at java.awt.Component.dispatchEvent(Component.java:4698)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:735)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:708)
at java.awt.EventQueue$4.run(EventQueue.java:706)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:705)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: org.bson.types.ObjectId cannot be cast to [Ljava.lang.Object;
at NewJFrame.showresultsActionPerformed(NewJFrame.java:217)
at NewJFrame.access$100(NewJFrame.java:12)
at NewJFrame$2.actionPerformed(NewJFrame.java:74)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.java:6516)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3320)
at java.awt.Component.processEvent(Component.java:6281)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Component.dispatchEventImpl(Component.java:4872)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Component.dispatchEvent(Component.java:4698)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
at java.awt.Container.dispatchEventImpl(Container.java:2273)
at java.awt.Window.dispatchEventImpl(Window.java:2719)
at java.awt.Component.dispatchEvent(Component.java:4698)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:735)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:708)
at java.awt.EventQueue$4.run(EventQueue.java:706)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:705)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
BUILD SUCCESSFUL (total time: 7 seconds)

can someone tell me why..i have imported import org.bson.types.ObjectId;