Can anyone help me out of this exception.

In a geotools query program i am using

Filter filter = CQL.toFilter("CONTAINS(the_geom,POINT(-115.56,67.567))");

and when am running the program using spark(sbt) ..it is throwing exception as follows can anyone help me....

Exception in thread "main" org.geotools.factory.FactoryNotFoundException: No factory of kind "FilterFactory" found. at org.geotools.factory.FactoryRegistry.getServiceProvider(FactoryRegistry.java:375) at org.geotools.factory.FactoryCreator.getServiceProvider(FactoryCreator.java:145) at org.geotools.factory.CommonFactoryFinder.lookup(CommonFactoryFinder.java:346) at org.geotools.factory.CommonFactoryFinder.getFilterFactory(CommonFactoryFinder.java:300) at geocode.feature.FeatureExtraction.findShapefile(FeatureExtraction.java:64) at geocode.batch.GeocodeMain$.main(GeocodeMain.scala:33) at geocode.batch.GeocodeMain.main(GeocodeMain.scala) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:672) at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:180)

at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:205) at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:120) at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)


2 Answers 2


This (and other similar errors) always means that you forgot to add a jar to your runtime classpath (and probably your build). To be sure which one is missing I'd need to see your mvn pom.xml but I suspect it is either gt-cql or possibly gt-main or gt-api.

You might also like to read my blog post discussing how to find which jar to look in for a class using joops.


For me this issue got resolved, when we passed all three geotools library as jars (--jars) in spark-submit

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.