Kettle6.0连接MongoDB报错

配置好mongodb连接之后,点击预览报下面的错:

报错:

java.lang.NoClassDefFoundError: javax/crypto/spec/PBEKeySpec
at com.mongodb.DBPort ScramSha1Authenticator S c r a m S h a 1 A u t h e n t i c a t o r ScramSha1SaslClient.Hi(DBPort.java:822)
at com.mongodb.DBPort ScramSha1Authenticator S c r a m S h a 1 A u t h e n t i c a t o r ScramSha1SaslClient.computeClientFinalMessage(DBPort.java:747)
at com.mongodb.DBPort ScramSha1Authenticator S c r a m S h a 1 A u t h e n t i c a t o r ScramSha1SaslClient.evaluateChallenge(DBPort.java:681)
at com.mongodb.DBPort SaslAuthenticator.authenticate(DBPort.java:904)atcom.mongodb.DBPort.authenticate(DBPort.java:432)atcom.mongodb.DBPort.checkAuth(DBPort.java:443)atcom.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:289)atcom.mongodb.DBTCPConnector.call(DBTCPConnector.java:269)atcom.mongodb.DBCollectionImpl.find(DBCollectionImpl.java:84)atcom.mongodb.DBCollectionImpl.find(DBCollectionImpl.java:66)atcom.mongodb.DBCursor.check(DBCursor.java:498)atcom.mongodb.DBCursor.hasNext(DBCursor.java:621)atcom.mongodb.DBCursor.hasNext(DBCursor.java:657)atorg.pentaho.mongo.wrapper.cursor.DefaultCursorWrapper.hasNext(DefaultCursorWrapper.java:34)atorg.pentaho.di.trans.steps.mongodbinput.MongoDbInput.processRow(MongoDbInput.java:89)atorg.pentaho.di.trans.step.RunThread.run(RunThread.java:62)atjava.lang.Thread.run(Thread.java:745)Causedby:java.lang.ClassNotFoundException:javax.crypto.spec.PBEKeySpecnotfoundbyorg.mongodb.mongojavadriver[59]atorg.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)atorg.apache.felix.framework.BundleWiringImpl.access S a s l A u t h e n t i c a t o r . a u t h e n t i c a t e ( D B P o r t . j a v a : 904 ) a t c o m . m o n g o d b . D B P o r t . a u t h e n t i c a t e ( D B P o r t . j a v a : 432 ) a t c o m . m o n g o d b . D B P o r t . c h e c k A u t h ( D B P o r t . j a v a : 443 ) a t c o m . m o n g o d b . D B T C P C o n n e c t o r . i n n e r C a l l ( D B T C P C o n n e c t o r . j a v a : 289 ) a t c o m . m o n g o d b . D B T C P C o n n e c t o r . c a l l ( D B T C P C o n n e c t o r . j a v a : 269 ) a t c o m . m o n g o d b . D B C o l l e c t i o n I m p l . f i n d ( D B C o l l e c t i o n I m p l . j a v a : 84 ) a t c o m . m o n g o d b . D B C o l l e c t i o n I m p l . f i n d ( D B C o l l e c t i o n I m p l . j a v a : 66 ) a t c o m . m o n g o d b . D B C u r s o r . c h e c k ( D B C u r s o r . j a v a : 498 ) a t c o m . m o n g o d b . D B C u r s o r . h a s N e x t ( D B C u r s o r . j a v a : 621 ) a t c o m . m o n g o d b . D B C u r s o r . h a s N e x t ( D B C u r s o r . j a v a : 657 ) a t o r g . p e n t a h o . m o n g o . w r a p p e r . c u r s o r . D e f a u l t C u r s o r W r a p p e r . h a s N e x t ( D e f a u l t C u r s o r W r a p p e r . j a v a : 34 ) a t o r g . p e n t a h o . d i . t r a n s . s t e p s . m o n g o d b i n p u t . M o n g o D b I n p u t . p r o c e s s R o w ( M o n g o D b I n p u t . j a v a : 89 ) a t o r g . p e n t a h o . d i . t r a n s . s t e p . R u n T h r e a d . r u n ( R u n T h r e a d . j a v a : 62 ) a t j a v a . l a n g . T h r e a d . r u n ( T h r e a d . j a v a : 745 ) C a u s e d b y : j a v a . l a n g . C l a s s N o t F o u n d E x c e p t i o n : j a v a x . c r y p t o . s p e c . P B E K e y S p e c n o t f o u n d b y o r g . m o n g o d b . m o n g o − j a v a − d r i v e r [ 59 ] a t o r g . a p a c h e . f e l i x . f r a m e w o r k . B u n d l e W i r i n g I m p l . f i n d C l a s s O r R e s o u r c e B y D e l e g a t i o n ( B u n d l e W i r i n g I m p l . j a v a : 1532 ) a t o r g . a p a c h e . f e l i x . f r a m e w o r k . B u n d l e W i r i n g I m p l . a c c e s s 400(BundleWiringImpl.java:75)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
… 17 more

解决办法:

目录:data-integration\system\karaf\etc\config.properties

文件中下部有一行 org.osgi.framework.bootdelegation=(一堆参数)
在末尾处加上 ,javax.crypto,javax.crypto.*
Mongo就可以正常连接读取数据了。

你可能感兴趣的:(数据库,mongodb)