Error while importing from mysql to mongodb

22 views
Skip to first unread message

Minhaj Mehmood

unread,
May 16, 2014, 11:16:11 PM5/16/14
to sql-to-nosql-i...@googlegroups.com
Hi

I've mysql db structure as bellow:

Hotel
==

Hotel Facilities
====

Facility

====


And my db-data-config file looks like:
<dataConfig>

    <dataSource driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost/rdbms_test" user="root" password="" batch-size="-1"/>
   
    <document>
       <entity name="hotel" pk="id" query="select * from hotel">
 <field column="id" name="id" type="long"/>
 <field column="hotel_name" name="hotel_name" type="string"/>    
         

          <entity name="hotel_facilities" query="select FACILITY_ID from hotel_facilities where hotel_id='${hotel.id}'">
        <entity name="facility" query="select facility_code from facility where id='${hotel_facilities.FACILITY_ID}'">
                  <field column="facility_code" name="facility_code" type="string" />
              </entity>
         </entity>


  </entity>   
    </document>
</dataConfig>

When i run the run.sh i get following error:

May 17, 2014 7:10:02 AM net.sathis.export.sql.DocBuilder getFields
INFO: Parameter Map is: {hotel.id=167890, hotel.hotel_name=Orlando Marriott Lake Mary}
May 17, 2014 7:10:02 AM net.sathis.export.sql.DocBuilder getFields
INFO: Parameter Map is: {hotel.id=167890, hotel_facilities.facility_id=1, hotel.hotel_name=Orlando Marriott Lake Mary}
May 17, 2014 7:10:02 AM net.sathis.export.sql.DocBuilder getFields
INFO: Parameter Map is: {hotel.id=167890, hotel_facilities.facility_id=1, hotel.hotel_name=Orlando Marriott Lake Mary}
java.lang.NullPointerException
at java.util.regex.Matcher.quoteReplacement(Matcher.java:598)
at net.sathis.export.sql.DocBuilder.getFields(DocBuilder.java:210)
at net.sathis.export.sql.DocBuilder.getFields(DocBuilder.java:219)
at net.sathis.export.sql.DocBuilder.execute(DocBuilder.java:139)
at net.sathis.export.sql.DataImporter.doFullImport(DataImporter.java:174)
at net.sathis.export.sql.DataImporter.doDataImport(DataImporter.java:93)
at net.sathis.export.sql.SQLToNoSQLImporter.main(SQLToNoSQLImporter.java:19)
May 17, 2014 7:10:02 AM net.sathis.export.sql.DocBuilder getFields
INFO: Parameter Map is: {hotel.id=167891, hotel.hotel_name=Le Pacifique - Nouvata Parc}

Let me know if anyone has any clue about this error?

Regards

M
Reply all
Reply to author
Forward
0 new messages