Skip to content

NullPointerException in ShpGeoResourceInfo while executing search in SearchView #678

Open

Description

@fgdrf

What I did:

  • add natruralearth dataset 10m-admin-0-countries.shp to map
  • opened Search View and typed "countries" into search field
  • exectued search, the following exception has been logged, nothing else happens:
!ENTRY org.locationtech.udig.catalog 4 0 2022-02-02 16:12:19.856
!MESSAGE Could not search in resource:C:\dev\data\testdata\10m-admin-0-countries.shp#10m-admin-0-countries
!STACK 0
java.lang.NullPointerException
	at java.net.URI$Parser.parse(URI.java:3042)
	at java.net.URI.<init>(URI.java:588)
	at org.locationtech.udig.catalog.internal.shp.ShpGeoResourceInfo.getSchema(ShpGeoResourceInfo.java:96)
	at org.locationtech.udig.catalog.internal.CatalogImpl.check(CatalogImpl.java:818)
	at org.locationtech.udig.catalog.internal.CatalogImpl.check(CatalogImpl.java:828)
	at org.locationtech.udig.catalog.internal.CatalogImpl.search(CatalogImpl.java:733)
	at org.locationtech.udig.catalog.ui.search.SearchView.searchImplementation(SearchView.java:513)
	at org.locationtech.udig.ui.SearchPart$1.run(SearchPart.java:530)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

Obviously doesn't have the the FeatureType a namespace set.

Activity

  1. fgdrf commented on Feb 2, 2022

    @fgdrf
    ContributorAuthor

    After a debug-session it looks like that the ShpServiceExtension does't set ShapefileDataStoreFactory.NAMESPACEP.key in parameter map which leads to a Name-Object without a namespace.

    Not sure why but the ShpGeoResourceInfo.getSchema(ShpGeoResourceInfo.java:96) does not handle null correctly, I guess I'll try to fix both ends.

  2. added 4 commits that reference this issue on Feb 7, 2022
  3. linked a pull request that will close this issue[#678] fixes NPE using SearchView #680on Feb 7, 2022
  4. changed the title [-]NullPointerException in ShpGeoResourceInfor while executing search in SearchView[/-] [+]NullPointerException in ShpGeoResourceInfo while executing search in SearchView[/+] on Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions