Plugin system and java SPI

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Plugin system and java SPI

Andrea Antonello
Hi developers,
I am having issues with code using the java service provider interface
inside of gvSIG. Basically everything fails and extensions are not
found.

Is there something in particular I need to do to be able to use them.
I am quite sure I saw some gvSIG code using SPIs.

Thanks for any hint,
Regards,
Andrea

_______________________________________________
gvSIG-desktop-devel mailing list
http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel
Reply | Threaded
Open this post in threaded view
|

Re: Plugin system and java SPI

César Martínez
Hi Andrea,

Can you be more specific about what you intend to perform and how does it exactly fails?

Regards,

César


2016-08-16 9:53 GMT+02:00 andrea antonello <[hidden email]>:
Hi developers,
I am having issues with code using the java service provider interface
inside of gvSIG. Basically everything fails and extensions are not
found.

Is there something in particular I need to do to be able to use them.
I am quite sure I saw some gvSIG code using SPIs.

Thanks for any hint,
Regards,
Andrea

_______________________________________________
gvSIG-desktop-devel mailing list
http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel



--

_______________________________________________
gvSIG-desktop-devel mailing list
http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel
Reply | Threaded
Open this post in threaded view
|

Re: Plugin system and java SPI

Andrea Antonello
Hi Cesar,
thanks for your reply.

> Can you be more specific about what you intend to perform and how does it
> exactly fails?

Yes. Inside the JGrasstools plugins I use a lot of geotools project
classes. Geotools uses SPIs to check which providers are available.
More about integration with other apps is here:
http://docs.geotools.org/stable/userguide/welcome/application.html

The problem is that all SPI lookups fail, and I am not able to
understand why or how the plugin system of gvSIG is somehow blocking
them.

Do you have any idea?

Regards,
Andrea



>
> Regards,
>
> César
>
>
> 2016-08-16 9:53 GMT+02:00 andrea antonello <[hidden email]>:
>>
>> Hi developers,
>> I am having issues with code using the java service provider interface
>> inside of gvSIG. Basically everything fails and extensions are not
>> found.
>>
>> Is there something in particular I need to do to be able to use them.
>> I am quite sure I saw some gvSIG code using SPIs.
>>
>> Thanks for any hint,
>> Regards,
>> Andrea
>>
>> _______________________________________________
>> gvSIG-desktop-devel mailing list
>> http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel
>
>
>
>
> --
> SCOLAB
> http://scolab.es
>
> _______________________________________________
> gvSIG-desktop-devel mailing list
> http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel

_______________________________________________
gvSIG-desktop-devel mailing list
http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel
Reply | Threaded
Open this post in threaded view
|

Re: Plugin system and java SPI

César Martínez
Maybe the problem is related with the different Geotools versions in use.

gvSIG is using a very old version of Geotool as a dependence of the CRS library, which may become the one used in your plugin despite you provide a newer version. I think this can only happen if you declare a dependence from your plugin to the CRS plugin (in the plugin's config.xml).

Another cause may be that you are not correctly declaring Geotools dependencies and thus some jar(s) are not deployed to your plugin lib folder. You must declare the dependency on the pom.xml and also on assembly/gvsig-plugin-package.xml (in order to get them deployed).

I hope this helps.

César


2016-08-16 11:35 GMT+02:00 andrea antonello <[hidden email]>:
Hi Cesar,
thanks for your reply.

> Can you be more specific about what you intend to perform and how does it
> exactly fails?

Yes. Inside the JGrasstools plugins I use a lot of geotools project
classes. Geotools uses SPIs to check which providers are available.
More about integration with other apps is here:
http://docs.geotools.org/stable/userguide/welcome/application.html

The problem is that all SPI lookups fail, and I am not able to
understand why or how the plugin system of gvSIG is somehow blocking
them.

Do you have any idea?

Regards,
Andrea



>
> Regards,
>
> César
>
>
> 2016-08-16 9:53 GMT+02:00 andrea antonello <[hidden email]>:
>>
>> Hi developers,
>> I am having issues with code using the java service provider interface
>> inside of gvSIG. Basically everything fails and extensions are not
>> found.
>>
>> Is there something in particular I need to do to be able to use them.
>> I am quite sure I saw some gvSIG code using SPIs.
>>
>> Thanks for any hint,
>> Regards,
>> Andrea
>>
>> _______________________________________________
>> gvSIG-desktop-devel mailing list
>> http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel
>
>
>
>
> --
> SCOLAB
> http://scolab.es
>
> _______________________________________________
> gvSIG-desktop-devel mailing list
> http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel

_______________________________________________
gvSIG-desktop-devel mailing list
http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel



--

_______________________________________________
gvSIG-desktop-devel mailing list
http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel
Reply | Threaded
Open this post in threaded view
|

Re: Plugin system and java SPI

Andrea Antonello
> Maybe the problem is related with the different Geotools versions in use.

This has been a problem in the past, but I exclude all the old
geotools dependencies with exclusion filters in the poms.

> gvSIG is using a very old version of Geotool as a dependence of the CRS
> library, which may become the one used in your plugin despite you provide a
> newer version. I think this can only happen if you declare a dependence from
> your plugin to the CRS plugin (in the plugin's config.xml).

Yes, this "should" not be a problem any more.

> Another cause may be that you are not correctly declaring Geotools
> dependencies and thus some jar(s) are not deployed to your plugin lib
> folder. You must declare the dependency on the pom.xml and also on
> assembly/gvsig-plugin-package.xml (in order to get them deployed).

I have these dependencies all properly set. In fact I tried to
exchange a geotools reprojection code using SPIs with the manual code
to do the projection and using geotools libraries, and that works. So
I am assuming that the classpath is properly set, the classes are all
available.

But I will double-check this once more to see if you have a point here, thanks.

> I hope this helps.

Discussing this sure helps thank you. If you have other ideas, they
are welcome. I am quite desperate, since I have a huge contribution of
modules and tools that I want to get into gvSIG.

Andrea


>
> César
>
>
> 2016-08-16 11:35 GMT+02:00 andrea antonello <[hidden email]>:
>>
>> Hi Cesar,
>> thanks for your reply.
>>
>> > Can you be more specific about what you intend to perform and how does
>> > it
>> > exactly fails?
>>
>> Yes. Inside the JGrasstools plugins I use a lot of geotools project
>> classes. Geotools uses SPIs to check which providers are available.
>> More about integration with other apps is here:
>> http://docs.geotools.org/stable/userguide/welcome/application.html
>>
>> The problem is that all SPI lookups fail, and I am not able to
>> understand why or how the plugin system of gvSIG is somehow blocking
>> them.
>>
>> Do you have any idea?
>>
>> Regards,
>> Andrea
>>
>>
>>
>> >
>> > Regards,
>> >
>> > César
>> >
>> >
>> > 2016-08-16 9:53 GMT+02:00 andrea antonello <[hidden email]>:
>> >>
>> >> Hi developers,
>> >> I am having issues with code using the java service provider interface
>> >> inside of gvSIG. Basically everything fails and extensions are not
>> >> found.
>> >>
>> >> Is there something in particular I need to do to be able to use them.
>> >> I am quite sure I saw some gvSIG code using SPIs.
>> >>
>> >> Thanks for any hint,
>> >> Regards,
>> >> Andrea
>> >>
>> >> _______________________________________________
>> >> gvSIG-desktop-devel mailing list
>> >> http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel
>> >
>> >
>> >
>> >
>> > --
>> > SCOLAB
>> > http://scolab.es
>> >
>> > _______________________________________________
>> > gvSIG-desktop-devel mailing list
>> > http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel
>>
>> _______________________________________________
>> gvSIG-desktop-devel mailing list
>> http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel
>
>
>
>
> --
> SCOLAB
> http://scolab.es
>
> _______________________________________________
> gvSIG-desktop-devel mailing list
> http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel

_______________________________________________
gvSIG-desktop-devel mailing list
http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel
Reply | Threaded
Open this post in threaded view
|

Re: Plugin system and java SPI

Andrea Antonello
PS: the interesting thing is that I noticed the problem only debugging.

The exceptions I get are a stackoverflow, which I am not able to explain:

null'.
ERROR [AWT-EventQueue-0] (NotificationManager.java:90) - Error de la
applicacion.
Es conveniente que salga de la aplicación

null
java.lang.StackOverflowError
at java.lang.StringCoding$StringEncoder.encode(StringCoding.java:304)
at java.lang.StringCoding.encode(StringCoding.java:344)
at java.lang.String.getBytes(String.java:918)
at java.io.UnixFileSystem.getBooleanAttributes0(Native Method)
at java.io.UnixFileSystem.getBooleanAttributes(UnixFileSystem.java:242)
at java.io.File.exists(File.java:819)
at sun.misc.URLClassPath$FileLoader.getResource(URLClassPath.java:1245)
at sun.misc.URLClassPath$FileLoader.findResource(URLClassPath.java:1212)
at sun.misc.URLClassPath$1.next(URLClassPath.java:240)
at sun.misc.URLClassPath$1.hasMoreElements(URLClassPath.java:250)
at java.net.URLClassLoader$3$1.run(URLClassLoader.java:601)
at java.net.URLClassLoader$3$1.run(URLClassLoader.java:599)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader$3.next(URLClassLoader.java:598)
at java.net.URLClassLoader$3.hasMoreElements(URLClassLoader.java:623)
at sun.misc.CompoundEnumeration.next(CompoundEnumeration.java:45)
at sun.misc.CompoundEnumeration.hasMoreElements(CompoundEnumeration.java:54)
at sun.misc.CompoundEnumeration.next(CompoundEnumeration.java:45)
at sun.misc.CompoundEnumeration.hasMoreElements(CompoundEnumeration.java:54)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:392)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
...




On Tue, Aug 16, 2016 at 12:09 PM, andrea antonello
<[hidden email]> wrote:

>> Maybe the problem is related with the different Geotools versions in use.
>
> This has been a problem in the past, but I exclude all the old
> geotools dependencies with exclusion filters in the poms.
>
>> gvSIG is using a very old version of Geotool as a dependence of the CRS
>> library, which may become the one used in your plugin despite you provide a
>> newer version. I think this can only happen if you declare a dependence from
>> your plugin to the CRS plugin (in the plugin's config.xml).
>
> Yes, this "should" not be a problem any more.
>
>> Another cause may be that you are not correctly declaring Geotools
>> dependencies and thus some jar(s) are not deployed to your plugin lib
>> folder. You must declare the dependency on the pom.xml and also on
>> assembly/gvsig-plugin-package.xml (in order to get them deployed).
>
> I have these dependencies all properly set. In fact I tried to
> exchange a geotools reprojection code using SPIs with the manual code
> to do the projection and using geotools libraries, and that works. So
> I am assuming that the classpath is properly set, the classes are all
> available.
>
> But I will double-check this once more to see if you have a point here, thanks.
>
>> I hope this helps.
>
> Discussing this sure helps thank you. If you have other ideas, they
> are welcome. I am quite desperate, since I have a huge contribution of
> modules and tools that I want to get into gvSIG.
>
> Andrea
>
>
>>
>> César
>>
>>
>> 2016-08-16 11:35 GMT+02:00 andrea antonello <[hidden email]>:
>>>
>>> Hi Cesar,
>>> thanks for your reply.
>>>
>>> > Can you be more specific about what you intend to perform and how does
>>> > it
>>> > exactly fails?
>>>
>>> Yes. Inside the JGrasstools plugins I use a lot of geotools project
>>> classes. Geotools uses SPIs to check which providers are available.
>>> More about integration with other apps is here:
>>> http://docs.geotools.org/stable/userguide/welcome/application.html
>>>
>>> The problem is that all SPI lookups fail, and I am not able to
>>> understand why or how the plugin system of gvSIG is somehow blocking
>>> them.
>>>
>>> Do you have any idea?
>>>
>>> Regards,
>>> Andrea
>>>
>>>
>>>
>>> >
>>> > Regards,
>>> >
>>> > César
>>> >
>>> >
>>> > 2016-08-16 9:53 GMT+02:00 andrea antonello <[hidden email]>:
>>> >>
>>> >> Hi developers,
>>> >> I am having issues with code using the java service provider interface
>>> >> inside of gvSIG. Basically everything fails and extensions are not
>>> >> found.
>>> >>
>>> >> Is there something in particular I need to do to be able to use them.
>>> >> I am quite sure I saw some gvSIG code using SPIs.
>>> >>
>>> >> Thanks for any hint,
>>> >> Regards,
>>> >> Andrea
>>> >>
>>> >> _______________________________________________
>>> >> gvSIG-desktop-devel mailing list
>>> >> http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel
>>> >
>>> >
>>> >
>>> >
>>> > --
>>> > SCOLAB
>>> > http://scolab.es
>>> >
>>> > _______________________________________________
>>> > gvSIG-desktop-devel mailing list
>>> > http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel
>>>
>>> _______________________________________________
>>> gvSIG-desktop-devel mailing list
>>> http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel
>>
>>
>>
>>
>> --
>> SCOLAB
>> http://scolab.es
>>
>> _______________________________________________
>> gvSIG-desktop-devel mailing list
>> http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel

_______________________________________________
gvSIG-desktop-devel mailing list
http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel
Reply | Threaded
Open this post in threaded view
|

Re: Plugin system and java SPI

César Martínez
It looks as if there is a cross dependence on some of the plugin(s) you are creating/using, which is creating a loop when loading them (meaning that plugin A depends on B and plugin B depends on A). Or a bug on the gvSIG plugin loading classes otherwise.

Maybe you can see the plugins involved on the loop when debugging, this should provide some hint.

César

2016-08-16 12:17 GMT+02:00 andrea antonello <[hidden email]>:
PS: the interesting thing is that I noticed the problem only debugging.

The exceptions I get are a stackoverflow, which I am not able to explain:

null'.
ERROR [AWT-EventQueue-0] (NotificationManager.java:90) - Error de la
applicacion.
Es conveniente que salga de la aplicación

null
java.lang.StackOverflowError
at java.lang.StringCoding$StringEncoder.encode(StringCoding.java:304)
at java.lang.StringCoding.encode(StringCoding.java:344)
at java.lang.String.getBytes(String.java:918)
at java.io.UnixFileSystem.getBooleanAttributes0(Native Method)
at java.io.UnixFileSystem.getBooleanAttributes(UnixFileSystem.java:242)
at java.io.File.exists(File.java:819)
at sun.misc.URLClassPath$FileLoader.getResource(URLClassPath.java:1245)
at sun.misc.URLClassPath$FileLoader.findResource(URLClassPath.java:1212)
at sun.misc.URLClassPath$1.next(URLClassPath.java:240)
at sun.misc.URLClassPath$1.hasMoreElements(URLClassPath.java:250)
at java.net.URLClassLoader$3$1.run(URLClassLoader.java:601)
at java.net.URLClassLoader$3$1.run(URLClassLoader.java:599)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader$3.next(URLClassLoader.java:598)
at java.net.URLClassLoader$3.hasMoreElements(URLClassLoader.java:623)
at sun.misc.CompoundEnumeration.next(CompoundEnumeration.java:45)
at sun.misc.CompoundEnumeration.hasMoreElements(CompoundEnumeration.java:54)
at sun.misc.CompoundEnumeration.next(CompoundEnumeration.java:45)
at sun.misc.CompoundEnumeration.hasMoreElements(CompoundEnumeration.java:54)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:392)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
at org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
...




On Tue, Aug 16, 2016 at 12:09 PM, andrea antonello
<[hidden email]> wrote:
>> Maybe the problem is related with the different Geotools versions in use.
>
> This has been a problem in the past, but I exclude all the old
> geotools dependencies with exclusion filters in the poms.
>
>> gvSIG is using a very old version of Geotool as a dependence of the CRS
>> library, which may become the one used in your plugin despite you provide a
>> newer version. I think this can only happen if you declare a dependence from
>> your plugin to the CRS plugin (in the plugin's config.xml).
>
> Yes, this "should" not be a problem any more.
>
>> Another cause may be that you are not correctly declaring Geotools
>> dependencies and thus some jar(s) are not deployed to your plugin lib
>> folder. You must declare the dependency on the pom.xml and also on
>> assembly/gvsig-plugin-package.xml (in order to get them deployed).
>
> I have these dependencies all properly set. In fact I tried to
> exchange a geotools reprojection code using SPIs with the manual code
> to do the projection and using geotools libraries, and that works. So
> I am assuming that the classpath is properly set, the classes are all
> available.
>
> But I will double-check this once more to see if you have a point here, thanks.
>
>> I hope this helps.
>
> Discussing this sure helps thank you. If you have other ideas, they
> are welcome. I am quite desperate, since I have a huge contribution of
> modules and tools that I want to get into gvSIG.
>
> Andrea
>
>
>>
>> César
>>
>>
>> 2016-08-16 11:35 GMT+02:00 andrea antonello <[hidden email]>:
>>>
>>> Hi Cesar,
>>> thanks for your reply.
>>>
>>> > Can you be more specific about what you intend to perform and how does
>>> > it
>>> > exactly fails?
>>>
>>> Yes. Inside the JGrasstools plugins I use a lot of geotools project
>>> classes. Geotools uses SPIs to check which providers are available.
>>> More about integration with other apps is here:
>>> http://docs.geotools.org/stable/userguide/welcome/application.html
>>>
>>> The problem is that all SPI lookups fail, and I am not able to
>>> understand why or how the plugin system of gvSIG is somehow blocking
>>> them.
>>>
>>> Do you have any idea?
>>>
>>> Regards,
>>> Andrea
>>>
>>>
>>>
>>> >
>>> > Regards,
>>> >
>>> > César
>>> >
>>> >
>>> > 2016-08-16 9:53 GMT+02:00 andrea antonello <[hidden email]>:
>>> >>
>>> >> Hi developers,
>>> >> I am having issues with code using the java service provider interface
>>> >> inside of gvSIG. Basically everything fails and extensions are not
>>> >> found.
>>> >>
>>> >> Is there something in particular I need to do to be able to use them.
>>> >> I am quite sure I saw some gvSIG code using SPIs.
>>> >>
>>> >> Thanks for any hint,
>>> >> Regards,
>>> >> Andrea
>>> >>
>>> >> _______________________________________________
>>> >> gvSIG-desktop-devel mailing list
>>> >> http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel
>>> >
>>> >
>>> >
>>> >
>>> > --
>>> > SCOLAB
>>> > http://scolab.es
>>> >
>>> > _______________________________________________
>>> > gvSIG-desktop-devel mailing list
>>> > http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel
>>>
>>> _______________________________________________
>>> gvSIG-desktop-devel mailing list
>>> http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel
>>
>>
>>
>>
>> --
>> SCOLAB
>> http://scolab.es
>>
>> _______________________________________________
>> gvSIG-desktop-devel mailing list
>> http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel

_______________________________________________
gvSIG-desktop-devel mailing list
http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel



--

_______________________________________________
gvSIG-desktop-devel mailing list
http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel
Reply | Threaded
Open this post in threaded view
|

Re: Plugin system and java SPI

Andrea Antonello
> It looks as if there is a cross dependence on some of the plugin(s) you are
> creating/using, which is creating a loop when loading them (meaning that
> plugin A depends on B and plugin B depends on A). Or a bug on the gvSIG
> plugin loading classes otherwise.

This is interesting... you really mean plugins or libraries?

Regarding the plugins, there should be no way for me to create a cross
dependency.

If you are talking about libraries... I am not sure.

Either way, it looks like it could be something like what you are describing.

> Maybe you can see the plugins involved on the loop when debugging, this
> should provide some hint.

Do you have a suggestion about how to proceed with that? I don't
really have a clear idea about how to keep track of this...

Thanks,
Andrea


>
> César
>
> 2016-08-16 12:17 GMT+02:00 andrea antonello <[hidden email]>:
>>
>> PS: the interesting thing is that I noticed the problem only debugging.
>>
>> The exceptions I get are a stackoverflow, which I am not able to explain:
>>
>> null'.
>> ERROR [AWT-EventQueue-0] (NotificationManager.java:90) - Error de la
>> applicacion.
>> Es conveniente que salga de la aplicación
>>
>> null
>> java.lang.StackOverflowError
>> at java.lang.StringCoding$StringEncoder.encode(StringCoding.java:304)
>> at java.lang.StringCoding.encode(StringCoding.java:344)
>> at java.lang.String.getBytes(String.java:918)
>> at java.io.UnixFileSystem.getBooleanAttributes0(Native Method)
>> at java.io.UnixFileSystem.getBooleanAttributes(UnixFileSystem.java:242)
>> at java.io.File.exists(File.java:819)
>> at sun.misc.URLClassPath$FileLoader.getResource(URLClassPath.java:1245)
>> at sun.misc.URLClassPath$FileLoader.findResource(URLClassPath.java:1212)
>> at sun.misc.URLClassPath$1.next(URLClassPath.java:240)
>> at sun.misc.URLClassPath$1.hasMoreElements(URLClassPath.java:250)
>> at java.net.URLClassLoader$3$1.run(URLClassLoader.java:601)
>> at java.net.URLClassLoader$3$1.run(URLClassLoader.java:599)
>> at java.security.AccessController.doPrivileged(Native Method)
>> at java.net.URLClassLoader$3.next(URLClassLoader.java:598)
>> at java.net.URLClassLoader$3.hasMoreElements(URLClassLoader.java:623)
>> at sun.misc.CompoundEnumeration.next(CompoundEnumeration.java:45)
>> at
>> sun.misc.CompoundEnumeration.hasMoreElements(CompoundEnumeration.java:54)
>> at sun.misc.CompoundEnumeration.next(CompoundEnumeration.java:45)
>> at
>> sun.misc.CompoundEnumeration.hasMoreElements(CompoundEnumeration.java:54)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:392)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> ...
>>
>>
>>
>>
>> On Tue, Aug 16, 2016 at 12:09 PM, andrea antonello
>> <[hidden email]> wrote:
>> >> Maybe the problem is related with the different Geotools versions in
>> >> use.
>> >
>> > This has been a problem in the past, but I exclude all the old
>> > geotools dependencies with exclusion filters in the poms.
>> >
>> >> gvSIG is using a very old version of Geotool as a dependence of the CRS
>> >> library, which may become the one used in your plugin despite you
>> >> provide a
>> >> newer version. I think this can only happen if you declare a dependence
>> >> from
>> >> your plugin to the CRS plugin (in the plugin's config.xml).
>> >
>> > Yes, this "should" not be a problem any more.
>> >
>> >> Another cause may be that you are not correctly declaring Geotools
>> >> dependencies and thus some jar(s) are not deployed to your plugin lib
>> >> folder. You must declare the dependency on the pom.xml and also on
>> >> assembly/gvsig-plugin-package.xml (in order to get them deployed).
>> >
>> > I have these dependencies all properly set. In fact I tried to
>> > exchange a geotools reprojection code using SPIs with the manual code
>> > to do the projection and using geotools libraries, and that works. So
>> > I am assuming that the classpath is properly set, the classes are all
>> > available.
>> >
>> > But I will double-check this once more to see if you have a point here,
>> > thanks.
>> >
>> >> I hope this helps.
>> >
>> > Discussing this sure helps thank you. If you have other ideas, they
>> > are welcome. I am quite desperate, since I have a huge contribution of
>> > modules and tools that I want to get into gvSIG.
>> >
>> > Andrea
>> >
>> >
>> >>
>> >> César
>> >>
>> >>
>> >> 2016-08-16 11:35 GMT+02:00 andrea antonello
>> >> <[hidden email]>:
>> >>>
>> >>> Hi Cesar,
>> >>> thanks for your reply.
>> >>>
>> >>> > Can you be more specific about what you intend to perform and how
>> >>> > does
>> >>> > it
>> >>> > exactly fails?
>> >>>
>> >>> Yes. Inside the JGrasstools plugins I use a lot of geotools project
>> >>> classes. Geotools uses SPIs to check which providers are available.
>> >>> More about integration with other apps is here:
>> >>> http://docs.geotools.org/stable/userguide/welcome/application.html
>> >>>
>> >>> The problem is that all SPI lookups fail, and I am not able to
>> >>> understand why or how the plugin system of gvSIG is somehow blocking
>> >>> them.
>> >>>
>> >>> Do you have any idea?
>> >>>
>> >>> Regards,
>> >>> Andrea
>> >>>
>> >>>
>> >>>
>> >>> >
>> >>> > Regards,
>> >>> >
>> >>> > César
>> >>> >
>> >>> >
>> >>> > 2016-08-16 9:53 GMT+02:00 andrea antonello
>> >>> > <[hidden email]>:
>> >>> >>
>> >>> >> Hi developers,
>> >>> >> I am having issues with code using the java service provider
>> >>> >> interface
>> >>> >> inside of gvSIG. Basically everything fails and extensions are not
>> >>> >> found.
>> >>> >>
>> >>> >> Is there something in particular I need to do to be able to use
>> >>> >> them.
>> >>> >> I am quite sure I saw some gvSIG code using SPIs.
>> >>> >>
>> >>> >> Thanks for any hint,
>> >>> >> Regards,
>> >>> >> Andrea
>> >>> >>
>> >>> >> _______________________________________________
>> >>> >> gvSIG-desktop-devel mailing list
>> >>> >> http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel
>> >>> >
>> >>> >
>> >>> >
>> >>> >
>> >>> > --
>> >>> > SCOLAB
>> >>> > http://scolab.es
>> >>> >
>> >>> > _______________________________________________
>> >>> > gvSIG-desktop-devel mailing list
>> >>> > http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel
>> >>>
>> >>> _______________________________________________
>> >>> gvSIG-desktop-devel mailing list
>> >>> http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel
>> >>
>> >>
>> >>
>> >>
>> >> --
>> >> SCOLAB
>> >> http://scolab.es
>> >>
>> >> _______________________________________________
>> >> gvSIG-desktop-devel mailing list
>> >> http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel
>>
>> _______________________________________________
>> gvSIG-desktop-devel mailing list
>> http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel
>
>
>
>
> --
> SCOLAB
> http://scolab.es
>
> _______________________________________________
> gvSIG-desktop-devel mailing list
> http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel

_______________________________________________
gvSIG-desktop-devel mailing list
http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel
Reply | Threaded
Open this post in threaded view
|

Re: Plugin system and java SPI

César Martínez


2016-08-16 13:13 GMT+02:00 andrea antonello <[hidden email]>:
> It looks as if there is a cross dependence on some of the plugin(s) you are
> creating/using, which is creating a loop when loading them (meaning that
> plugin A depends on B and plugin B depends on A). Or a bug on the gvSIG
> plugin loading classes otherwise.

This is interesting... you really mean plugins or libraries?


I mean plugin dependences (as declared in config.xml file). I guess this can only happen if you have more than 1 plugin.

 

Regarding the plugins, there should be no way for me to create a cross
dependency.

If you are talking about libraries... I am not sure.

Either way, it looks like it could be something like what you are describing.

> Maybe you can see the plugins involved on the loop when debugging, this
> should provide some hint.

Do you have a suggestion about how to proceed with that? I don't
really have a clear idea about how to keep track of this...


If you set a breakpoint on  org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397), you should be able to see which plugin(s) are causing the error. Of course this might not be possible depending on how you are executing gvSIG.

Sorry, I don't have any more clue to provide.

César

 

Thanks,
Andrea


>
> César
>
> 2016-08-16 12:17 GMT+02:00 andrea antonello <[hidden email]>:
>>
>> PS: the interesting thing is that I noticed the problem only debugging.
>>
>> The exceptions I get are a stackoverflow, which I am not able to explain:
>>
>> null'.
>> ERROR [AWT-EventQueue-0] (NotificationManager.java:90) - Error de la
>> applicacion.
>> Es conveniente que salga de la aplicación
>>
>> null
>> java.lang.StackOverflowError
>> at java.lang.StringCoding$StringEncoder.encode(StringCoding.java:304)
>> at java.lang.StringCoding.encode(StringCoding.java:344)
>> at java.lang.String.getBytes(String.java:918)
>> at java.io.UnixFileSystem.getBooleanAttributes0(Native Method)
>> at java.io.UnixFileSystem.getBooleanAttributes(UnixFileSystem.java:242)
>> at java.io.File.exists(File.java:819)
>> at sun.misc.URLClassPath$FileLoader.getResource(URLClassPath.java:1245)
>> at sun.misc.URLClassPath$FileLoader.findResource(URLClassPath.java:1212)
>> at sun.misc.URLClassPath$1.next(URLClassPath.java:240)
>> at sun.misc.URLClassPath$1.hasMoreElements(URLClassPath.java:250)
>> at java.net.URLClassLoader$3$1.run(URLClassLoader.java:601)
>> at java.net.URLClassLoader$3$1.run(URLClassLoader.java:599)
>> at java.security.AccessController.doPrivileged(Native Method)
>> at java.net.URLClassLoader$3.next(URLClassLoader.java:598)
>> at java.net.URLClassLoader$3.hasMoreElements(URLClassLoader.java:623)
>> at sun.misc.CompoundEnumeration.next(CompoundEnumeration.java:45)
>> at
>> sun.misc.CompoundEnumeration.hasMoreElements(CompoundEnumeration.java:54)
>> at sun.misc.CompoundEnumeration.next(CompoundEnumeration.java:45)
>> at
>> sun.misc.CompoundEnumeration.hasMoreElements(CompoundEnumeration.java:54)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:392)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> at
>> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> ...
>>
>>
>>
>>
>> On Tue, Aug 16, 2016 at 12:09 PM, andrea antonello
>> <[hidden email]> wrote:
>> >> Maybe the problem is related with the different Geotools versions in
>> >> use.
>> >
>> > This has been a problem in the past, but I exclude all the old
>> > geotools dependencies with exclusion filters in the poms.
>> >
>> >> gvSIG is using a very old version of Geotool as a dependence of the CRS
>> >> library, which may become the one used in your plugin despite you
>> >> provide a
>> >> newer version. I think this can only happen if you declare a dependence
>> >> from
>> >> your plugin to the CRS plugin (in the plugin's config.xml).
>> >
>> > Yes, this "should" not be a problem any more.
>> >
>> >> Another cause may be that you are not correctly declaring Geotools
>> >> dependencies and thus some jar(s) are not deployed to your plugin lib
>> >> folder. You must declare the dependency on the pom.xml and also on
>> >> assembly/gvsig-plugin-package.xml (in order to get them deployed).
>> >
>> > I have these dependencies all properly set. In fact I tried to
>> > exchange a geotools reprojection code using SPIs with the manual code
>> > to do the projection and using geotools libraries, and that works. So
>> > I am assuming that the classpath is properly set, the classes are all
>> > available.
>> >
>> > But I will double-check this once more to see if you have a point here,
>> > thanks.
>> >
>> >> I hope this helps.
>> >
>> > Discussing this sure helps thank you. If you have other ideas, they
>> > are welcome. I am quite desperate, since I have a huge contribution of
>> > modules and tools that I want to get into gvSIG.
>> >
>> > Andrea
>> >
>> >
>> >>
>> >> César
>> >>
>> >>
>> >> 2016-08-16 11:35 GMT+02:00 andrea antonello
>> >> <[hidden email]>:
>> >>>
>> >>> Hi Cesar,
>> >>> thanks for your reply.
>> >>>
>> >>> > Can you be more specific about what you intend to perform and how
>> >>> > does
>> >>> > it
>> >>> > exactly fails?
>> >>>
>> >>> Yes. Inside the JGrasstools plugins I use a lot of geotools project
>> >>> classes. Geotools uses SPIs to check which providers are available.
>> >>> More about integration with other apps is here:
>> >>> http://docs.geotools.org/stable/userguide/welcome/application.html
>> >>>
>> >>> The problem is that all SPI lookups fail, and I am not able to
>> >>> understand why or how the plugin system of gvSIG is somehow blocking
>> >>> them.
>> >>>
>> >>> Do you have any idea?
>> >>>
>> >>> Regards,
>> >>> Andrea
>> >>>
>> >>>
>> >>>
>> >>> >
>> >>> > Regards,
>> >>> >
>> >>> > César
>> >>> >
>> >>> >
>> >>> > 2016-08-16 9:53 GMT+02:00 andrea antonello
>> >>> > <[hidden email]>:
>> >>> >>
>> >>> >> Hi developers,
>> >>> >> I am having issues with code using the java service provider
>> >>> >> interface
>> >>> >> inside of gvSIG. Basically everything fails and extensions are not
>> >>> >> found.
>> >>> >>
>> >>> >> Is there something in particular I need to do to be able to use
>> >>> >> them.
>> >>> >> I am quite sure I saw some gvSIG code using SPIs.
>> >>> >>
>> >>> >> Thanks for any hint,
>> >>> >> Regards,
>> >>> >> Andrea
>> >>> >>
>> >>> >> _______________________________________________
>> >>> >> gvSIG-desktop-devel mailing list
>> >>> >> http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel
>> >>> >
>> >>> >
>> >>> >
>> >>> >
>> >>> > --
>> >>> > SCOLAB
>> >>> > http://scolab.es
>> >>> >
>> >>> > _______________________________________________
>> >>> > gvSIG-desktop-devel mailing list
>> >>> > http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel
>> >>>
>> >>> _______________________________________________
>> >>> gvSIG-desktop-devel mailing list
>> >>> http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel
>> >>
>> >>
>> >>
>> >>
>> >> --
>> >> SCOLAB
>> >> http://scolab.es
>> >>
>> >> _______________________________________________
>> >> gvSIG-desktop-devel mailing list
>> >> http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel
>>
>> _______________________________________________
>> gvSIG-desktop-devel mailing list
>> http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel
>
>
>
>
> --
> SCOLAB
> http://scolab.es
>
> _______________________________________________
> gvSIG-desktop-devel mailing list
> http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel

_______________________________________________
gvSIG-desktop-devel mailing list
http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel



--

_______________________________________________
gvSIG-desktop-devel mailing list
http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel
Reply | Threaded
Open this post in threaded view
|

Re: Plugin system and java SPI

Andrea Antonello
Hi Cesar,

[...]
> If you set a breakpoint on
> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397),
> you should be able to see which plugin(s) are causing the error. Of course
> this might not be possible depending on how you are executing gvSIG.

I was afraid I would need the source code to work on this, but you were right.

A simple check there made me notice that there is a geotools versions conflict.
the really ugly thing is that there are libs that are in the release
without a version info attached.

Look at these:
./lib/flib-jcalendar-unknown.jar
./gvSIG/extensiones/org.gvsig.geoprocess.app.mainplugin/lib/jama-unknown.jar
./gvSIG/extensiones/org.gvsig.projection.app.jcrs/lib/gt2-main-unknown.jar
./gvSIG/extensiones/org.gvsig.catalog.extension/lib/amic-util-unknown.jar
./gvSIG/extensiones/org.gvsig.geoprocess.app.sextante/lib/gishur_x-unknown.jar
./gvSIG/extensiones/org.gvsig.geoprocess.app.sextante/lib/gishur_core-unknown.jar
./gvSIG/extensiones/org.gvsig.scripting.app.mainplugin/scripting/lib/cssutils/tests/test_cssunknownrule.py
./gvSIG/extensiones/org.gvsig.scripting.app.mainplugin/scripting/lib/cssutils/css/cssunknownrule.py
./gvSIG/extensiones/org.gvsig.app.mainplugin/lib/jsi-unknown.jar
./gvSIG/extensiones/org.gvsig.app.mainplugin/lib/zql-unknown.jar

and somewhere that unknown version geotools lib falls into the game,
messing with the SPIs.

Thanks for your support, I will dig deeper to see if something can be done.

Cheers,
Andrea



>
> Sorry, I don't have any more clue to provide.
>
> César
>
>
>>
>>
>> Thanks,
>> Andrea
>>
>>
>> >
>> > César
>> >
>> > 2016-08-16 12:17 GMT+02:00 andrea antonello
>> > <[hidden email]>:
>> >>
>> >> PS: the interesting thing is that I noticed the problem only debugging.
>> >>
>> >> The exceptions I get are a stackoverflow, which I am not able to
>> >> explain:
>> >>
>> >> null'.
>> >> ERROR [AWT-EventQueue-0] (NotificationManager.java:90) - Error de la
>> >> applicacion.
>> >> Es conveniente que salga de la aplicación
>> >>
>> >> null
>> >> java.lang.StackOverflowError
>> >> at java.lang.StringCoding$StringEncoder.encode(StringCoding.java:304)
>> >> at java.lang.StringCoding.encode(StringCoding.java:344)
>> >> at java.lang.String.getBytes(String.java:918)
>> >> at java.io.UnixFileSystem.getBooleanAttributes0(Native Method)
>> >> at java.io.UnixFileSystem.getBooleanAttributes(UnixFileSystem.java:242)
>> >> at java.io.File.exists(File.java:819)
>> >> at sun.misc.URLClassPath$FileLoader.getResource(URLClassPath.java:1245)
>> >> at
>> >> sun.misc.URLClassPath$FileLoader.findResource(URLClassPath.java:1212)
>> >> at sun.misc.URLClassPath$1.next(URLClassPath.java:240)
>> >> at sun.misc.URLClassPath$1.hasMoreElements(URLClassPath.java:250)
>> >> at java.net.URLClassLoader$3$1.run(URLClassLoader.java:601)
>> >> at java.net.URLClassLoader$3$1.run(URLClassLoader.java:599)
>> >> at java.security.AccessController.doPrivileged(Native Method)
>> >> at java.net.URLClassLoader$3.next(URLClassLoader.java:598)
>> >> at java.net.URLClassLoader$3.hasMoreElements(URLClassLoader.java:623)
>> >> at sun.misc.CompoundEnumeration.next(CompoundEnumeration.java:45)
>> >> at
>> >>
>> >> sun.misc.CompoundEnumeration.hasMoreElements(CompoundEnumeration.java:54)
>> >> at sun.misc.CompoundEnumeration.next(CompoundEnumeration.java:45)
>> >> at
>> >>
>> >> sun.misc.CompoundEnumeration.hasMoreElements(CompoundEnumeration.java:54)
>> >> at
>> >>
>> >> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:392)
>> >> at
>> >>
>> >> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> >> at
>> >>
>> >> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> >> at
>> >>
>> >> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> >> at
>> >>
>> >> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> >> at
>> >>
>> >> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> >> at
>> >>
>> >> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> >> at
>> >>
>> >> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> >> at
>> >>
>> >> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> >> at
>> >>
>> >> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> >> at
>> >>
>> >> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> >> at
>> >>
>> >> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> >> at
>> >>
>> >> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> >> at
>> >>
>> >> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> >> at
>> >>
>> >> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> >> at
>> >>
>> >> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> >> at
>> >>
>> >> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> >> at
>> >>
>> >> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> >> at
>> >>
>> >> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> >> at
>> >>
>> >> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> >> at
>> >>
>> >> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> >> at
>> >>
>> >> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> >> at
>> >>
>> >> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> >> at
>> >>
>> >> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> >> at
>> >>
>> >> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> >> at
>> >>
>> >> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> >> at
>> >>
>> >> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> >> at
>> >>
>> >> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> >> at
>> >>
>> >> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> >> at
>> >>
>> >> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> >> at
>> >>
>> >> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> >> at
>> >>
>> >> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> >> at
>> >>
>> >> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> >> at
>> >>
>> >> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> >> at
>> >>
>> >> org.gvsig.andami.plugins.PluginClassLoader.getResources(PluginClassLoader.java:397)
>> >> ...
>> >>
>> >>
>> >>
>> >>
>> >> On Tue, Aug 16, 2016 at 12:09 PM, andrea antonello
>> >> <[hidden email]> wrote:
>> >> >> Maybe the problem is related with the different Geotools versions in
>> >> >> use.
>> >> >
>> >> > This has been a problem in the past, but I exclude all the old
>> >> > geotools dependencies with exclusion filters in the poms.
>> >> >
>> >> >> gvSIG is using a very old version of Geotool as a dependence of the
>> >> >> CRS
>> >> >> library, which may become the one used in your plugin despite you
>> >> >> provide a
>> >> >> newer version. I think this can only happen if you declare a
>> >> >> dependence
>> >> >> from
>> >> >> your plugin to the CRS plugin (in the plugin's config.xml).
>> >> >
>> >> > Yes, this "should" not be a problem any more.
>> >> >
>> >> >> Another cause may be that you are not correctly declaring Geotools
>> >> >> dependencies and thus some jar(s) are not deployed to your plugin
>> >> >> lib
>> >> >> folder. You must declare the dependency on the pom.xml and also on
>> >> >> assembly/gvsig-plugin-package.xml (in order to get them deployed).
>> >> >
>> >> > I have these dependencies all properly set. In fact I tried to
>> >> > exchange a geotools reprojection code using SPIs with the manual code
>> >> > to do the projection and using geotools libraries, and that works. So
>> >> > I am assuming that the classpath is properly set, the classes are all
>> >> > available.
>> >> >
>> >> > But I will double-check this once more to see if you have a point
>> >> > here,
>> >> > thanks.
>> >> >
>> >> >> I hope this helps.
>> >> >
>> >> > Discussing this sure helps thank you. If you have other ideas, they
>> >> > are welcome. I am quite desperate, since I have a huge contribution
>> >> > of
>> >> > modules and tools that I want to get into gvSIG.
>> >> >
>> >> > Andrea
>> >> >
>> >> >
>> >> >>
>> >> >> César
>> >> >>
>> >> >>
>> >> >> 2016-08-16 11:35 GMT+02:00 andrea antonello
>> >> >> <[hidden email]>:
>> >> >>>
>> >> >>> Hi Cesar,
>> >> >>> thanks for your reply.
>> >> >>>
>> >> >>> > Can you be more specific about what you intend to perform and how
>> >> >>> > does
>> >> >>> > it
>> >> >>> > exactly fails?
>> >> >>>
>> >> >>> Yes. Inside the JGrasstools plugins I use a lot of geotools project
>> >> >>> classes. Geotools uses SPIs to check which providers are available.
>> >> >>> More about integration with other apps is here:
>> >> >>> http://docs.geotools.org/stable/userguide/welcome/application.html
>> >> >>>
>> >> >>> The problem is that all SPI lookups fail, and I am not able to
>> >> >>> understand why or how the plugin system of gvSIG is somehow
>> >> >>> blocking
>> >> >>> them.
>> >> >>>
>> >> >>> Do you have any idea?
>> >> >>>
>> >> >>> Regards,
>> >> >>> Andrea
>> >> >>>
>> >> >>>
>> >> >>>
>> >> >>> >
>> >> >>> > Regards,
>> >> >>> >
>> >> >>> > César
>> >> >>> >
>> >> >>> >
>> >> >>> > 2016-08-16 9:53 GMT+02:00 andrea antonello
>> >> >>> > <[hidden email]>:
>> >> >>> >>
>> >> >>> >> Hi developers,
>> >> >>> >> I am having issues with code using the java service provider
>> >> >>> >> interface
>> >> >>> >> inside of gvSIG. Basically everything fails and extensions are
>> >> >>> >> not
>> >> >>> >> found.
>> >> >>> >>
>> >> >>> >> Is there something in particular I need to do to be able to use
>> >> >>> >> them.
>> >> >>> >> I am quite sure I saw some gvSIG code using SPIs.
>> >> >>> >>
>> >> >>> >> Thanks for any hint,
>> >> >>> >> Regards,
>> >> >>> >> Andrea
>> >> >>> >>
>> >> >>> >> _______________________________________________
>> >> >>> >> gvSIG-desktop-devel mailing list
>> >> >>> >> http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel
>> >> >>> >
>> >> >>> >
>> >> >>> >
>> >> >>> >
>> >> >>> > --
>> >> >>> > SCOLAB
>> >> >>> > http://scolab.es
>> >> >>> >
>> >> >>> > _______________________________________________
>> >> >>> > gvSIG-desktop-devel mailing list
>> >> >>> > http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel
>> >> >>>
>> >> >>> _______________________________________________
>> >> >>> gvSIG-desktop-devel mailing list
>> >> >>> http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >> --
>> >> >> SCOLAB
>> >> >> http://scolab.es
>> >> >>
>> >> >> _______________________________________________
>> >> >> gvSIG-desktop-devel mailing list
>> >> >> http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel
>> >>
>> >> _______________________________________________
>> >> gvSIG-desktop-devel mailing list
>> >> http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel
>> >
>> >
>> >
>> >
>> > --
>> > SCOLAB
>> > http://scolab.es
>> >
>> > _______________________________________________
>> > gvSIG-desktop-devel mailing list
>> > http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel
>>
>> _______________________________________________
>> gvSIG-desktop-devel mailing list
>> http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel
>
>
>
>
> --
> SCOLAB
> http://scolab.es
>
> _______________________________________________
> gvSIG-desktop-devel mailing list
> http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel

_______________________________________________
gvSIG-desktop-devel mailing list
http://joinup.ec.europa.eu/mailman/listinfo/gvsig-desktop-devel