Hi Frank,

This is just a stab in the dark...

Are you using this plugin: http://zenjava.com/javafx/maven/ ?  And if
so are you also using it to build an executable jar ?

The error dump looks like it might be an SPI problem which can happen
with GeoTools when module jars are combined into a single uber-jar
without taking care to merge the META-INF/services entries properly.

There is more info about this, although not in the context of JavaFX, here:
http://docs.geotools.org/latest/userguide/faq.html#how-do-i-create-an-executable-jar-for-my-geotools-app

Michael


On 26 November 2013 08:48, Frank van der Hulst <drifter.fr...@gmail.com> wrote:
> Hi all,
> I'm new to this list, but have been using Geotools with Netbeans and JavaFX2
> for some time.
>
> Recently I upgraded to Netbeans v7.4 and JDK 1.7u45 and rebuilt my Mapping
> project to use the newly available Maven/JavaFX Application project type.
> Previously I had kludged up a link to the JavaFX runtime jar in an ordinary
> Maven/Java Application project. That worked, but didn't allow use of the
> JavaFX GUI builder. Now when I run my app, it crashes. :(
>
> This happens on both Windows 7.0 and Ubuntu Linux.
>
> I've tried with various versions of GeoTools from 9.2 through 10.2, without
> any change.
>
> I've tried re-installing Netbeans & Java. No joy.
>
> I've simplified things down as much as possible, to the point where I've
> added one reference to GeoTools in the default project:package
> com.mycompany.mavenproject2;
>
> import java.net.MalformedURLException;
> import java.net.URL;
> import java.util.ResourceBundle;
> import javafx.event.ActionEvent;
> import javafx.fxml.FXML;
> import javafx.fxml.Initializable;
> import javafx.scene.control.Label;
> import org.geotools.data.FileDataStore;
> import org.geotools.data.shapefile.ShapefileDataStore;
>
> public class FXMLController implements Initializable {
>
>     @FXML
>     private Label label;
>
>     @FXML
>     private void handleButtonAction(ActionEvent event) {
>         System.out.println("You clicked me!");
>         try {
>             FileDataStore store = new ShapefileDataStore(new
> URL("file:/C:/Users/frankv/Documents/Mapping/Output/XCSoar/Airstrip.shp"));
>         } catch (MalformedURLException ex) {
>             throw new RuntimeException(ex);
>         }
>         label.setText("Hello World!");
>     }
>
>     @Override
>     public void initialize(URL url, ResourceBundle rb) {
>         // TODO
>     }
> }
>
>
> When this gets executed in the Maven/JavaFX2 application, I get this output:
>
> Nov 26, 2013 9:56:00 AM org.geotools.factory.FactoryRegistry scanForPlugins
> WARNING: Can't load a service for category "FilterFactory". Cause is
> "ServiceConfigurationError: org.opengis.filter.FilterFactory: Provider
> org.geotools.filter.FilterFactoryImpl not a subtype".
> java.util.ServiceConfigurationError: org.opengis.filter.FilterFactory:
> Provider org.geotools.filter.FilterFactoryImpl not a subtype
>     at java.util.ServiceLoader.fail(ServiceLoader.java:231)
>     at java.util.ServiceLoader.access$300(ServiceLoader.java:181)
>     at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:369)
>     at java.util.ServiceLoader$1.next(ServiceLoader.java:445)
>     at
> org.geotools.factory.FactoryRegistry.register(FactoryRegistry.java:826)
>     at
> org.geotools.factory.FactoryRegistry.scanForPlugins(FactoryRegistry.java:772)
>     at
> org.geotools.factory.FactoryRegistry.scanForPluginsIfNeeded(FactoryRegistry.java:805)
>     at
> org.geotools.factory.FactoryRegistry.getUnfilteredProviders(FactoryRegistry.java:230)
>     at
> org.geotools.factory.FactoryRegistry.getServiceImplementation(FactoryRegistry.java:430)
>     at
> org.geotools.factory.FactoryRegistry.getServiceProvider(FactoryRegistry.java:365)
>     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
> org.geotools.factory.CommonFactoryFinder.getFilterFactory2(CommonFactoryFinder.java:390)
>     at
> org.geotools.factory.CommonFactoryFinder.getFilterFactory2(CommonFactoryFinder.java:404)
>     at org.geotools.data.DataUtilities.<clinit>(DataUtilities.java:200)
>     at org.geotools.data.shapefile.ShpFiles.exists(ShpFiles.java:1023)
>     at org.geotools.data.shapefile.ShpFiles.init(ShpFiles.java:185)
>     at org.geotools.data.shapefile.ShpFiles.<init>(ShpFiles.java:142)
>     at
> org.geotools.data.shapefile.ShapefileDataStore.<init>(ShapefileDataStore.java:200)
>     at
> org.geotools.data.shapefile.ShapefileDataStore.<init>(ShapefileDataStore.java:172)
>     at
> org.geotools.data.shapefile.ShapefileDataStore.<init>(ShapefileDataStore.java:162)
>     at
> com.mycompany.mavenproject2.FXMLController.handleButtonAction(FXMLController.java:22)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>     at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>     at java.lang.reflect.Method.invoke(Method.java:606)
>     at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:75)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>     at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>     at java.lang.reflect.Method.invoke(Method.java:606)
>     at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:279)
>     at
> javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(FXMLLoader.java:1444)
>     at
> com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:69)
>     at
> com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:217)
>     at
> com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:170)
>     at
> com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:38)
>     at
> com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:37)
>     at
> com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
>     at
> com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
>     at
> com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
>     at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:53)
>     at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:28)
>     at javafx.event.Event.fireEvent(Event.java:171)
>     at javafx.scene.Node.fireEvent(Node.java:6867)
>     at javafx.scene.control.Button.fire(Button.java:179)
>     at
> com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:193)
>     at
> com.sun.javafx.scene.control.skin.SkinBase$4.handle(SkinBase.java:336)
>     at
> com.sun.javafx.scene.control.skin.SkinBase$4.handle(SkinBase.java:329)
>     at
> com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:64)
>     at
> com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:217)
>     at
> com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:170)
>     at
> com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:38)
>     at
> com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:37)
>     at
> com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
>     at
> com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
>     at
> com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
>     at
> com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
>     at
> com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
>     at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:53)
>     at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:33)
>     at javafx.event.Event.fireEvent(Event.java:171)
>     at javafx.scene.Scene$MouseHandler.process(Scene.java:3311)
>     at javafx.scene.Scene$MouseHandler.process(Scene.java:3151)
>     at javafx.scene.Scene$MouseHandler.access$1900(Scene.java:3106)
>     at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1563)
>     at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2248)
>     at
> com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:250)
>     at
> com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:173)
>     at java.security.AccessController.doPrivileged(Native Method)
>     at
> com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:292)
>     at com.sun.glass.ui.View.handleMouseEvent(View.java:530)
>     at com.sun.glass.ui.View.notifyMouse(View.java:924)
>     at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
>     at
> com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:17)
>     at com.sun.glass.ui.win.WinApplication$3$1.run(WinApplication.java:67)
>     at java.lang.Thread.run(Thread.java:744)
>
> I'm guessing this is some kind of dependency issue, so I tried starting with
> a minimal set of dependencies in my POM, and added all the gt- dependencies
> one by one. No joy.
>
> I've Googled around and found other people have reported problems similar to
> this in the past (e.g.
> https://sourceforge.net/mailarchive/forum.php?thread_name=C20306514FDF4FBFAC54AA8C20A90630%40gmail.com&forum_name=geotools-gt2-users),
> but I can't find a solution.
>
> I don't think I have accidentally combined jars from two versions of
> GeoTools, and don't think my environment is using class loaders or anything
> unusual, although its possible that in my kludging around earlier I did
> something like that.
>
> Frank
>
>
> ------------------------------------------------------------------------------
> Shape the Mobile Experience: Free Subscription
> Software experts and developers: Be at the forefront of tech innovation.
> Intel(R) Software Adrenaline delivers strategic insight and game-changing
> conversations that shape the rapidly evolving mobile landscape. Sign up now.
> http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
> _______________________________________________
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>

------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to