Henrik Wingerei created SOLR-5597:
-------------------------------------

             Summary: ClassCastException occurs when importing CLOB-fields 
using SqlEntityProcessor and SortedMapBackedCache
                 Key: SOLR-5597
                 URL: https://issues.apache.org/jira/browse/SOLR-5597
             Project: Solr
          Issue Type: Bug
          Components: contrib - DataImportHandler
    Affects Versions: 4.6
            Reporter: Henrik Wingerei


Using the SqlEntityProcessor with the SortedMapBackedCache as cache 
implementation, gives the following ClassCastException when trying to import a 
field of type oracle.sql.CLOB.

2014-01-02 09:32:19,143 [ERROR] [Thread-54] Exception in entity : 
<field-name>:java.lang.ClassCastException: oracle.sql.CLOB cannot be cast to 
java.lang.Comparable
        at java.util.TreeMap.getEntry(TreeMap.java:325)
        at java.util.TreeMap.get(TreeMap.java:255)
        at 
org.apache.solr.handler.dataimport.SortedMapBackedCache.add(SortedMapBackedCache.java:61)
        at 
org.apache.solr.handler.dataimport.DIHCacheSupport.populateCache(DIHCacheSupport.java:124)
        at 
org.apache.solr.handler.dataimport.DIHCacheSupport.getSimpleCacheData(DIHCacheSupport.java:199)
        at 
org.apache.solr.handler.dataimport.DIHCacheSupport.getCacheData(DIHCacheSupport.java:147)
        at 
org.apache.solr.handler.dataimport.EntityProcessorBase.getNext(EntityProcessorBase.java:129)
        at 
org.apache.solr.handler.dataimport.SqlEntityProcessor.nextRow(SqlEntityProcessor.java:75)
        at 
org.apache.solr.handler.dataimport.EntityProcessorWrapper.nextRow(EntityProcessorWrapper.java:243)
        at 
org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:469)
        at 
org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:495)
        at 
org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:408)
        at 
org.apache.solr.handler.dataimport.DocBuilder.doFullDump(DocBuilder.java:323)
        at 
org.apache.solr.handler.dataimport.DocBuilder.execute(DocBuilder.java:231)
        at 
org.apache.solr.handler.dataimport.DataImporter.doFullImport(DataImporter.java:411)
        at 
org.apache.solr.handler.dataimport.DataImporter.runCmd(DataImporter.java:476)
        at 
org.apache.solr.handler.dataimport.DataImporter$1.run(DataImporter.java:457)
-- org.apache.solr.handler.dataimport.EntityProcessorWrapper

It seems that this occurs because the SortedMapBackedCache uses a 
java.util.TreeMap as the underlying cache, and TreeMap requires that all 
elements implements the java.lang.Comparable interface. However oracle.sql.CLOB 
does not implement Comparable and the import fails when the TreeMap 
implementation tries to cast the element to a Comparable (this occurs on line 
325 in TreeMap.java - java version 1.6.0_33).



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to