You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by PMulido <ma...@barcap.com> on 2013/06/29 00:50:32 UTC

MongoDB component found but TypeConverter is NoClassDefFoundError

I have a weird issue happening with the mongodb component.  I have an XML
Camel route that has a to endpoint configured as a mongodb insert.  

<convertBodyTo type="java.lang.String"/>

<to
uri="mongodb:MongoConn?database=xyzdb&amp;collection=xyzcoll&amp;operation=insert&amp;createCollection=true"
/>


When I run it, I get a TypeConversionException due to
java.lang.NoClassDefFoundError.

/ 'org.apache.camel.component.mongodb.CamelMongoDbException: 
    org.apache.camel.TypeConversionException: 
      Error during type conversion from type: java.lang.String to the
required type: com.mongodb.DBObject with value     {transaction_type=1, .... 
} 
due java.lang.NoClassDefFoundError: Could not initialize class
org.apache.camel.component.mongodb.converters.MongoDbBasicConverters'/


The odd thing is looking a the log entries show that the mongodb component
is found via DefaultComponentResolver: 
 
/main] DefaultComponentResolver       DEBUG Found component: mongodb via
type: org.apache.camel.component.mongodb.MongoDbComponent via:
META-INF/services/org/apache/camel/component/mongodb/





 'org.apache.camel.component.mongodb.CamelMongoDbException: 
    org.apache.camel.TypeConversionException: 
      Error during type conversion from type: java.lang.String to the
required type: com.mongodb.DBObject with value     {transaction_type=1, .... 
} 
due java.lang.NoClassDefFoundError: Could not initialize class
org.apache.camel.component.mongodb.converters.MongoDbBasicConverters'


2013-06-28 17:59:30 ERROR DeadLetterChannel:145 - Failed delivery for 
(MessageId:
null_destination__ID_c3e2d840c1c4d7f34040404040404040cb92602db4337825 on
ExchangeId:
ID-nykdsr10956-intranet-barcapint-com-43505-1372456759481-1-195). On
delivery attempt: 0 caught:
org.apache.camel.component.mongodb.CamelMongoDbException:
org.apache.camel.TypeConversionException: Error during type conversion from
type: java.lang.String to the required type: com.mongodb.DBObject with value
{ ...} due java.lang.NoClassDefFoundError: 
Could not initialize class
org.apache.camel.component.mongodb.converters.MongoDbBasicConverters



main] SpringCamelContext             DEBUG Using ComponentResolver:
org.apache.camel.impl.DefaultComponentResolver@66869470 to resolve component
with name: mongodb
main] DefaultComponentResolver       DEBUG Found component: mongodb in
registry: null
main] DefaultComponentResolver       DEBUG Found component: mongodb via
type: org.apache.camel.component.mongodb.MongoDbComponent via:
META-INF/services/org/apache/camel/component/mongodb


main] DefaultManagementAgent         DEBUG Registered MBean with ObjectName:
org.apache.camel:context=nykdsr10956.intranet.barcapint.com/dtccCamelContext,type=components,name="mongodb

main] DefaultComponent               DEBUG Creating endpoint
uri=[mongodb://MongoConn?collection=confirms&createCollection=true&database=dtcc&operation=insert],
path=[MongoConn]
main] IntrospectionSupport           DEBUG Configured property: collection
on bean: Endpoint[mongodb://MongoConn?......... 
main] IntrospectionSupport           DEBUG Configured property:
createCollection on bean: Endpoint[mongodb://MongoConn?.......
main] IntrospectionSupport           DEBUG Configured property: database on
bean: Endpoint[mongodb://MongoConn?......... 
main] IntrospectionSupport           DEBUG Configured property: operation on
bean: Endpoint[mongodb://MongoConn?..............
main] IntrospectionSupport           DEBUG Configured property:
mongoConnection on bean: Endpoint[mongodb://MongoConn?..........

main] SpringCamelContext             DEBUG
mongodb://MongoConn?collection=confirms ..........

main] MongoDbEndpoint                INFO  Initialising MongoDb endpoint:
Endpoint[mongodb://MongoConn? ..........
main] MongoDbEndpoint                INFO  MongoDb component initialised and
endpoint bound to MongoDB collection with the following paramters. Address
list: [/127.0.0.1:30001], Db: ..........  
main] MongoDbProducer                DEBUG Starting producer:
Producer[mongodb://MongoConn?collection=confirms ........ 
[




--
View this message in context: http://camel.465427.n5.nabble.com/MongoDB-component-found-but-TypeConverter-is-NoClassDefFoundError-tp5734974.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: MongoDB component found but TypeConverter is NoClassDefFoundError

Posted by PMulido <ma...@barcap.com>.
Camel 2.11.0 using camel-mongodb-2.11.0.jar.

The odd thing is that I can do a "get" from mongodb.  It's when the
TypeConverters are being invoked that the error is happening.



--
View this message in context: http://camel.465427.n5.nabble.com/MongoDB-component-found-but-TypeConverter-is-NoClassDefFoundError-tp5734974p5735039.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: MongoDB component found but TypeConverter is NoClassDefFoundError

Posted by Christian Müller <ch...@gmail.com>.
Which version of Camel do you use?

Best,
Christian

Sent from a mobile device
Am 29.06.2013 08:26 schrieb "PMulido" <ma...@barcap.com>:

> I have a weird issue happening with the mongodb component.  I have an XML
> Camel route that has a to endpoint configured as a mongodb insert.
>
> <convertBodyTo type="java.lang.String"/>
>
> <to
>
> uri="mongodb:MongoConn?database=xyzdb&amp;collection=xyzcoll&amp;operation=insert&amp;createCollection=true"
> />
>
>
> When I run it, I get a TypeConversionException due to
> java.lang.NoClassDefFoundError.
>
> / 'org.apache.camel.component.mongodb.CamelMongoDbException:
>     org.apache.camel.TypeConversionException:
>       Error during type conversion from type: java.lang.String to the
> required type: com.mongodb.DBObject with value     {transaction_type=1,
> ....
> }
> due java.lang.NoClassDefFoundError: Could not initialize class
> org.apache.camel.component.mongodb.converters.MongoDbBasicConverters'/
>
>
> The odd thing is looking a the log entries show that the mongodb component
> is found via DefaultComponentResolver:
>
> /main] DefaultComponentResolver       DEBUG Found component: mongodb via
> type: org.apache.camel.component.mongodb.MongoDbComponent via:
> META-INF/services/org/apache/camel/component/mongodb/
>
>
>
>
>
>  'org.apache.camel.component.mongodb.CamelMongoDbException:
>     org.apache.camel.TypeConversionException:
>       Error during type conversion from type: java.lang.String to the
> required type: com.mongodb.DBObject with value     {transaction_type=1,
> ....
> }
> due java.lang.NoClassDefFoundError: Could not initialize class
> org.apache.camel.component.mongodb.converters.MongoDbBasicConverters'
>
>
> 2013-06-28 17:59:30 ERROR DeadLetterChannel:145 - Failed delivery for
> (MessageId:
> null_destination__ID_c3e2d840c1c4d7f34040404040404040cb92602db4337825 on
> ExchangeId:
> ID-nykdsr10956-intranet-barcapint-com-43505-1372456759481-1-195). On
> delivery attempt: 0 caught:
> org.apache.camel.component.mongodb.CamelMongoDbException:
> org.apache.camel.TypeConversionException: Error during type conversion from
> type: java.lang.String to the required type: com.mongodb.DBObject with
> value
> { ...} due java.lang.NoClassDefFoundError:
> Could not initialize class
> org.apache.camel.component.mongodb.converters.MongoDbBasicConverters
>
>
>
> main] SpringCamelContext             DEBUG Using ComponentResolver:
> org.apache.camel.impl.DefaultComponentResolver@66869470 to resolve
> component
> with name: mongodb
> main] DefaultComponentResolver       DEBUG Found component: mongodb in
> registry: null
> main] DefaultComponentResolver       DEBUG Found component: mongodb via
> type: org.apache.camel.component.mongodb.MongoDbComponent via:
> META-INF/services/org/apache/camel/component/mongodb
>
>
> main] DefaultManagementAgent         DEBUG Registered MBean with
> ObjectName:
> org.apache.camel:context=
> nykdsr10956.intranet.barcapint.com/dtccCamelContext,type=components,name=
> "mongodb
>
> main] DefaultComponent               DEBUG Creating endpoint
>
> uri=[mongodb://MongoConn?collection=confirms&createCollection=true&database=dtcc&operation=insert],
> path=[MongoConn]
> main] IntrospectionSupport           DEBUG Configured property: collection
> on bean: Endpoint[mongodb://MongoConn?.........
> main] IntrospectionSupport           DEBUG Configured property:
> createCollection on bean: Endpoint[mongodb://MongoConn?.......
> main] IntrospectionSupport           DEBUG Configured property: database on
> bean: Endpoint[mongodb://MongoConn?.........
> main] IntrospectionSupport           DEBUG Configured property: operation
> on
> bean: Endpoint[mongodb://MongoConn?..............
> main] IntrospectionSupport           DEBUG Configured property:
> mongoConnection on bean: Endpoint[mongodb://MongoConn?..........
>
> main] SpringCamelContext             DEBUG
> mongodb://MongoConn?collection=confirms ..........
>
> main] MongoDbEndpoint                INFO  Initialising MongoDb endpoint:
> Endpoint[mongodb://MongoConn? ..........
> main] MongoDbEndpoint                INFO  MongoDb component initialised
> and
> endpoint bound to MongoDB collection with the following paramters. Address
> list: [/127.0.0.1:30001], Db: ..........
> main] MongoDbProducer                DEBUG Starting producer:
> Producer[mongodb://MongoConn?collection=confirms ........
> [
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/MongoDB-component-found-but-TypeConverter-is-NoClassDefFoundError-tp5734974.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>