2013-04-03 48 views
1

我试图用java连接的MongoDB,但我得到以下异常的MongoDB与Java

Apr 3, 2013 10:55:41 AM com.sun.jersey.spi.container.ContainerResponse mapMappableContainerException 
SEVERE: The exception contained within MappableContainerException could not be mapped to a response, re-throwing to the HTTP container java.lang.NoClassDefFoundError: com/mongodb/DB 
at prime.task.TaskServices.save(TaskServices.java:49) 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
at java.lang.reflect.Method.invoke(Unknown Source) 
at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60) 

如果妳有人告诉我如何解决这个问题,它会非常有帮助,我

+0

你在你的类路径蒙戈的Java驱动程序。看起来像不存在 –

+0

我包括使用Eclipse中的构建路径包括mongo-java-driver-2.10.1.jar。我能够看到该地点的所有课程 – Ramesh

回答

1

它接缝你IDE没有正确引用mongodb java驱动程序,请尝试使用不同的驱动程序版本,清除eclipse项目,或者在不同的工作区中创建项目,或者在控制台add -cp命令行参数中手动运行项目。

问候, Moacy