Hi, I am attempting to write a custom DataImportHandler transformer and am having trouble with the proper deployment into SOLR 4.4.0 running on Tomcat 7.0.
These are the steps I have followed: 1. I used a watered-down version of the TrimTransformer code given in the DIHCustomTransformer Wiki (http://wiki.apache.org/solr/DIHCustomTransformer): --------------------------------------- import java.util.Map; import java.util.Date; public class TrimTransformer { public Object transformRow(Map<String, Object> row) { return row; } } --------------------------------------- So, essentially, the transformer does nothing: it merely takes the row and returns it as is. Nonetheless, it is not working, which implies the problem is not with the code itself. 2. I compiled the above code using a free, bare-bones Java IDE called Dr. Java (http://www.drjava.org), and then exported the compiled code as a JAR to a file named CustomTransformers.jar. 3. I took CustomTransformers.jar and placed it into the folder: C:/solr/lib. This is the folder in which I see many other JAR files, including solr-dataimporthandler-4.4.0.jar. 4. I made a single modification in my data-config.xml file: I changed the line: (A) transformer="HTMLStripTransformer,RegexTransformer" to: (B) transformer="HTMLStripTransformer,RegexTransformer,TrimTransformer" When the line is as shown in (A), everything works fine. When it is as shown in (B), I receive the error: "Indexing failed. Rolled back all changes" upon running the Dataimport module from the SOLR admin panel. This implies that the data import engine is either not picking up TrimTransformer at all, or that there is something wrong with TrimTransformer as I have deployed it. 5. By the way, I tried re-loading the SOLR core, to no avail, and I also tried calling the transformer by the names: lib.TrimTransformer solr.lib.TrimTransformer each time, reloading the core -- all to no avail. Finally, to zero in on the error, I am attempting to index only a single XML fileat the moment. Once again, this file is accepted into the index when TrimTransformer is not mentioned in data-config.xml and the indexing fails with the error if it is mentioned. Any help would be greatly appreciated! And please let me know if I should provide any more information. Thanks, Michael