为什么org.geoserver.extension阻止我的Spring Boot应用程序?

问题描述 投票:1回答:2

我尝试将EPSG:900913几何对象转换为EPSG:4326。为此,我使用以下代码:

    CoordinateReferenceSystem targetCRS = CRS.decode("EPSG:4326");
    CoordinateReferenceSystem sourceCRS = CRS.decode("EPSG:900913");

    MathTransform transform = CRS.findMathTransform(sourceCRS, targetCRS, true);

当我执行测试应用程序时,它引发了此异常:

Exception in thread "main" org.opengis.referencing.NoSuchAuthorityCodeException: No code "EPSG:900913" from authority "European Petroleum Survey Group" found for object of type "CoordinateReferenceSystem".
at org.geotools.referencing.factory.AbstractAuthorityFactory.noSuchAuthorityCode(AbstractAuthorityFactory.java:951)
at org.geotools.referencing.factory.epsg.DirectEpsgFactory.createCoordinateReferenceSystem(DirectEpsgFactory.java:2102)

于是搜寻并找到了解决方案:它需要GeoTools的“ WPS扩展”依赖项。因此,我插入了此依赖项:

    <dependency>
        <groupId>org.geoserver.extension</groupId>
        <artifactId>gs-wps-core</artifactId>
        <version>2.8-SNAPSHOT</version>
    </dependency>

奇怪的是,当我使用此依赖项时,我的Spring Boot应用程序被阻止,要求提供这样的用户/密码组合a user/password combination

为什么库会阻止我的整个Web应用程序,如何防止这种奇怪的行为?

编辑-依赖树

 +- junit:junit:jar:4.12:test
 |  \- org.hamcrest:hamcrest-core:jar:1.3:test
 +- org.springframework:spring-test:jar:4.1.8.RELEASE:test
 |  \- org.springframework:spring-core:jar:4.1.8.RELEASE:compile
 +- org.apache.httpcomponents:httpclient:jar:4.3.6:compile
 |  +- org.apache.httpcomponents:httpcore:jar:4.3.3:compile
 |  \- commons-codec:commons-codec:jar:1.6:compile
 +- commons-io:commons-io:jar:2.4:compile
 +- org.apache.commons:commons-csv:jar:1.2:compile
 +- org.openstreetmap.osmosis:osmosis-core:jar:0.44.1:compile
 |  +- org.codehaus.woodstox:woodstox-core-lgpl:jar:4.4.1:compile
 |  +- xerces:xercesImpl:jar:2.9.1:compile
 |  +- org.codehaus.woodstox:stax2-api:jar:3.1.4:compile
 |  +- net.sf.jpf:jpf:jar:1.5:compile
 |  |  \- commons-logging:commons-logging:jar:1.0.4:compile
 |  \- org.apache.commons:commons-compress:jar:1.9:compile
 +- org.openstreetmap.osmosis:osmosis-pbf:jar:0.44.1:compile
 |  \- com.google.protobuf:protobuf-java:jar:2.6.1:compile
 +- org.openstreetmap.osmosis:osmosis-pbf2:jar:0.44.1:compile
 +- org.openstreetmap.osmosis:osmosis-osm-binary:jar:0.44.1:compile
 +- org.openstreetmap.osmosis:osmosis-extract:jar:0.44.1:compile
 |  +- org.openstreetmap.osmosis:osmosis-apidb:jar:0.44.1:compile
 |  |  \- mysql:mysql-connector-java:jar:5.1.36:runtime
 |  +- org.openstreetmap.osmosis:osmosis-xml:jar:0.44.1:compile
 |  \- org.openstreetmap.osmosis:osmosis-replication:jar:0.44.1:compile
 |     \- org.openstreetmap.osmosis:osmosis-set:jar:0.44.1:compile
 +- org.openstreetmap.osmosis:osmosis-hstore-jdbc:jar:0.44.1:compile
 |  \- org.postgresql:postgresql:jar:9.4-1201-jdbc4:compile
 +- org.openstreetmap.osmosis:osmosis-dataset:jar:0.44.1:compile
 +- org.openstreetmap.osmosis:osmosis-pgsnapshot:jar:0.44.1:compile
 |  +- org.postgis:postgis-jdbc:jar:1.3.3:compile
 |  +- commons-dbcp:commons-dbcp:jar:1.4:compile
 |  |  \- commons-pool:commons-pool:jar:1.6:compile
 |  \- org.springframework:spring-jdbc:jar:4.1.8.RELEASE:compile
 +- org.springframework.boot:spring-boot-starter-web:jar:1.2.7.RELEASE:compile
 |  +- org.springframework.boot:spring-boot-starter:jar:1.2.7.RELEASE:compile
 |  |  +- org.springframework.boot:spring-boot:jar:1.2.7.RELEASE:compile
 |  |  +- org.springframework.boot:spring-boot-autoconfigure:jar:1.2.7.RELEASE:compile
 |  |  +- org.springframework.boot:spring-boot-starter-logging:jar:1.2.7.RELEASE:compile
 |  |  |  +- org.slf4j:jul-to-slf4j:jar:1.7.12:compile
 |  |  |  +- org.slf4j:log4j-over-slf4j:jar:1.7.12:compile
 |  |  |  \- ch.qos.logback:logback-classic:jar:1.1.3:compile
 |  |  |     \- ch.qos.logback:logback-core:jar:1.1.3:compile
 |  |  \- org.yaml:snakeyaml:jar:1.14:compile
 |  +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.2.7.RELEASE:compile
 |  |  +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.0.28:compile
 |  |  +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.0.28:compile
 |  |  +- org.apache.tomcat.embed:tomcat-embed-logging-juli:jar:8.0.28:compile
 |  |  \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.0.28:compile
 |  +- com.fasterxml.jackson.core:jackson-databind:jar:2.4.6:compile
 |  |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.4.6:compile
 |  |  \- com.fasterxml.jackson.core:jackson-core:jar:2.4.6:compile
 |  +- org.hibernate:hibernate-validator:jar:5.1.3.Final:compile
 |  |  +- javax.validation:validation-api:jar:1.1.0.Final:compile
 |  |  \- com.fasterxml:classmate:jar:1.0.0:compile
 |  +- org.springframework:spring-web:jar:4.1.8.RELEASE:compile
 |  \- org.springframework:spring-webmvc:jar:4.1.8.RELEASE:compile
 |     \- org.springframework:spring-expression:jar:4.1.8.RELEASE:compile
 +- org.springframework.boot:spring-boot-starter-data-jpa:jar:1.2.7.RELEASE:compile
 |  +- org.springframework.boot:spring-boot-starter-aop:jar:1.2.7.RELEASE:compile
 |  |  \- org.aspectj:aspectjweaver:jar:1.8.7:compile
 |  +- org.springframework.boot:spring-boot-starter-jdbc:jar:1.2.7.RELEASE:compile
 |  |  \- org.apache.tomcat:tomcat-jdbc:jar:8.0.28:compile
 |  |     \- org.apache.tomcat:tomcat-juli:jar:8.0.28:compile
 |  +- org.hibernate:hibernate-entitymanager:jar:4.3.6.Final:compile
 |  +- javax.transaction:javax.transaction-api:jar:1.2:compile
 |  +- org.springframework:spring-orm:jar:4.1.8.RELEASE:compile
 |  \- org.springframework:spring-aspects:jar:4.1.8.RELEASE:compile
 +- org.springframework.boot:spring-boot-starter-thymeleaf:jar:1.2.7.RELEASE:compile
 |  +- org.thymeleaf:thymeleaf-spring4:jar:2.1.4.RELEASE:compile
 |  |  \- org.thymeleaf:thymeleaf:jar:2.1.4.RELEASE:compile
 |  |     +- ognl:ognl:jar:3.0.8:compile
 |  |     \- org.unbescape:unbescape:jar:1.1.0.RELEASE:compile
 |  \- nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect:jar:1.2.9:compile
 +- org.springframework.boot:spring-boot-starter-test:jar:1.2.7.RELEASE:test
 |  +- org.mockito:mockito-core:jar:1.10.19:test
 |  |  \- org.objenesis:objenesis:jar:2.1:test
 |  \- org.hamcrest:hamcrest-library:jar:1.3:test
 +- org.springframework.data:spring-data-jpa:jar:1.7.4.RELEASE:compile
 |  +- org.springframework.data:spring-data-commons:jar:1.9.4.RELEASE:compile
 |  +- org.springframework:spring-context:jar:4.1.8.RELEASE:compile
 |  +- org.springframework:spring-aop:jar:4.1.8.RELEASE:compile
 |  |  \- aopalliance:aopalliance:jar:1.0:compile
 |  +- org.springframework:spring-tx:jar:4.1.8.RELEASE:compile
 |  +- org.springframework:spring-beans:jar:4.1.8.RELEASE:compile
 |  +- org.aspectj:aspectjrt:jar:1.8.7:compile
 |  +- org.slf4j:slf4j-api:jar:1.7.12:compile
 |  \- org.slf4j:jcl-over-slf4j:jar:1.7.12:compile
 +- com.google.code.gson:gson:jar:2.3.1:compile
 +- org.hibernate:hibernate-core:jar:4.3.6.Final:compile
 |  +- org.jboss.logging:jboss-logging:jar:3.1.3.GA:compile
 |  +- org.jboss.logging:jboss-logging-annotations:jar:1.2.0.Beta1:compile
 |  +- org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:jar:1.0.0.Final:compile
 |  +- dom4j:dom4j:jar:1.6.1:compile
 |  |  \- xml-apis:xml-apis:jar:1.0.b2:compile
 |  +- org.hibernate.common:hibernate-commons-annotations:jar:4.0.5.Final:compile
 |  +- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:compile
 |  +- org.javassist:javassist:jar:3.18.1-GA:compile
 |  +- antlr:antlr:jar:2.7.7:compile
 |  \- org.jboss:jandex:jar:1.1.0.Final:compile
 +- org.hibernate:hibernate-spatial:jar:4.3:compile
 |  \- com.vividsolutions:jts:jar:1.13:compile
 +- postgresql:postgresql:jar:9.1-901.jdbc4:compile
 +- com.itextpdf:itextpdf:jar:5.5.7:compile
 +- org.geotools:gt-shapefile:jar:15-SNAPSHOT:compile
 |  +- org.geotools:gt-data:jar:15-SNAPSHOT:compile
 |  +- org.jdom:jdom:jar:1.1.3:compile
 |  \- javax.media:jai_core:jar:1.1.3:compile
 +- org.geotools:gt-swing:jar:15-SNAPSHOT:compile
 |  +- org.geotools:gt-referencing:jar:15-SNAPSHOT:compile
 |  |  +- com.googlecode.efficient-java-matrix-library:core:jar:0.26:compile
 |  |  +- org.geotools:gt-metadata:jar:15-SNAPSHOT:compile
 |  |  |  \- org.geotools:gt-opengis:jar:15-SNAPSHOT:compile
 |  |  +- jgridshift:jgridshift:jar:1.0:compile
 |  |  \- net.sf.geographiclib:GeographicLib-Java:jar:1.44:compile
 |  +- org.geotools:gt-render:jar:15-SNAPSHOT:compile
 |  |  +- org.geotools:gt-coverage:jar:15-SNAPSHOT:compile
 |  |  |  +- it.geosolutions.jaiext.affine:jt-affine:jar:1.0.8:compile
 |  |  |  |  +- it.geosolutions.jaiext.iterators:jt-iterators:jar:1.0.8:compile
 |  |  |  |  +- it.geosolutions.jaiext.utilities:jt-utilities:jar:1.0.8:compile
 |  |  |  |  \- it.geosolutions.jaiext.scale:jt-scale:jar:1.0.8:compile
 |  |  |  |     \- it.geosolutions.jaiext.translate:jt-translate:jar:1.0.8:compile
 |  |  |  +- it.geosolutions.jaiext.algebra:jt-algebra:jar:1.0.8:compile
 |  |  |  +- it.geosolutions.jaiext.bandmerge:jt-bandmerge:jar:1.0.8:compile
 |  |  |  +- it.geosolutions.jaiext.bandselect:jt-bandselect:jar:1.0.8:compile
 |  |  |  +- it.geosolutions.jaiext.bandcombine:jt-bandcombine:jar:1.0.8:compile
 |  |  |  +- it.geosolutions.jaiext.border:jt-border:jar:1.0.8:compile
 |  |  |  +- it.geosolutions.jaiext.buffer:jt-buffer:jar:1.0.8:compile
 |  |  |  +- it.geosolutions.jaiext.crop:jt-crop:jar:1.0.8:compile
 |  |  |  +- it.geosolutions.jaiext.lookup:jt-lookup:jar:1.0.8:compile
 |  |  |  +- it.geosolutions.jaiext.mosaic:jt-mosaic:jar:1.0.8:compile
 |  |  |  +- it.geosolutions.jaiext.nullop:jt-nullop:jar:1.0.8:compile
 |  |  |  +- it.geosolutions.jaiext.rescale:jt-rescale:jar:1.0.8:compile
 |  |  |  +- it.geosolutions.jaiext.stats:jt-stats:jar:1.0.8:compile
 |  |  |  +- it.geosolutions.jaiext.warp:jt-warp:jar:1.0.8:compile
 |  |  |  +- it.geosolutions.jaiext.zonal:jt-zonal:jar:1.0.8:compile
 |  |  |  +- it.geosolutions.jaiext.binarize:jt-binarize:jar:1.0.8:compile
 |  |  |  +- it.geosolutions.jaiext.format:jt-format:jar:1.0.8:compile
 |  |  |  +- it.geosolutions.jaiext.colorconvert:jt-colorconvert:jar:1.0.8:compile
 |  |  |  +- it.geosolutions.jaiext.errordiffusion:jt-errordiffusion:jar:1.0.8:compile
 |  |  |  +- it.geosolutions.jaiext.orderdither:jt-orderdither:jar:1.0.8:compile
 |  |  |  +- it.geosolutions.jaiext.colorindexer:jt-colorindexer:jar:1.0.8:compile
 |  |  |  +- it.geosolutions.jaiext.imagefunction:jt-imagefunction:jar:1.0.8:compile
 |  |  |  +- it.geosolutions.jaiext.piecewise:jt-piecewise:jar:1.0.8:compile
 |  |  |  +- it.geosolutions.jaiext.classifier:jt-classifier:jar:1.0.8:compile
 |  |  |  +- it.geosolutions.jaiext.rlookup:jt-rlookup:jar:1.0.8:compile
 |  |  |  \- it.geosolutions.jaiext.vectorbin:jt-vectorbin:jar:1.0.8:compile
 |  |  \- org.geotools:gt-cql:jar:15-SNAPSHOT:compile
 |  \- com.miglayout:miglayout:jar:swing:3.7:compile
 +- org.geotools:gt-epsg-hsql:jar:15-SNAPSHOT:compile
 |  \- org.hsqldb:hsqldb:jar:2.3.3:compile
 \- org.geoserver.extension:gs-wps-core:jar:2.8-SNAPSHOT:compile
    +- org.geoserver:gs-wfs:jar:2.8-SNAPSHOT:compile
    |  +- org.geoserver:gs-main:jar:2.8-SNAPSHOT:compile
    |  |  +- org.geoserver:gs-ows:jar:2.8-SNAPSHOT:compile
    |  |  |  \- xpp3:xpp3:jar:1.1.3.4.O:compile
    |  |  +- commons-beanutils:commons-beanutils:jar:1.9.2:compile
    |  |  +- commons-fileupload:commons-fileupload:jar:1.2.1:compile
    |  |  +- commons-httpclient:commons-httpclient:jar:3.1:compile
    |  |  +- org.freemarker:freemarker:jar:2.3.23:compile
    |  |  +- log4j:log4j:jar:1.2.17:compile
    |  |  +- org.geotools:gt-jdbc:jar:14-SNAPSHOT:compile
    |  |  +- org.geotools:gt-wfs-ng:jar:14-SNAPSHOT:compile
    |  |  |  +- org.geotools:gt-complex:jar:14-SNAPSHOT:compile
    |  |  |  |  \- org.geotools:gt-app-schema-resolver:jar:14-SNAPSHOT:compile
    |  |  |  +- xpp3:xpp3_min:jar:1.1.4c:compile
    |  |  |  \- xmlunit:xmlunit:jar:1.3:compile
    |  |  +- org.geotools:gt-property:jar:14-SNAPSHOT:compile
    |  |  +- org.geotools:gt-wms:jar:14-SNAPSHOT:compile
    |  |  +- com.thoughtworks.xstream:xstream:jar:1.4.7:compile
    |  |  |  \- xmlpull:xmlpull:jar:1.1.3.1:compile
    |  |  +- com.google.code.findbugs:jsr305:jar:2.0.3:compile
    |  |  +- org.geotools:gt-imagemosaic:jar:14-SNAPSHOT:compile
    |  |  |  +- org.geotools:gt-transform:jar:14-SNAPSHOT:compile
    |  |  |  +- org.jaitools:jt-vectorbinarize:jar:1.4.0:compile
    |  |  |  \- net.sf.ehcache:ehcache:jar:1.6.2:compile
    |  |  +- org.springframework.security:spring-security-core:jar:3.2.8.RELEASE:compile
    |  |  +- org.springframework.security:spring-security-web:jar:3.2.8.RELEASE:compile
    |  |  +- org.springframework.security:spring-security-config:jar:3.2.8.RELEASE:compile
    |  |  +- org.jasypt:jasypt:jar:1.8:compile
    |  |  \- org.bouncycastle:bcprov-jdk14:jar:1.46:compile
    |  +- org.geotools.ogc:net.opengis.wfs:jar:14-SNAPSHOT:compile
    |  |  +- org.geotools.ogc:org.w3.xlink:jar:14-SNAPSHOT:compile
    |  |  \- org.geotools.ogc:net.opengis.fes:jar:14-SNAPSHOT:compile
    |  +- org.geotools.xsd:gt-xsd-wfs:jar:14-SNAPSHOT:compile
    |  |  \- org.geotools.xsd:gt-xsd-fes:jar:14-SNAPSHOT:compile
    |  +- org.geotools.xsd:gt-xsd-filter:jar:14-SNAPSHOT:compile
    |  |  \- org.geotools.xsd:gt-xsd-gml2:jar:14-SNAPSHOT:compile
    |  \- net.sf.json-lib:json-lib:jar:jdk15:2.2.3:compile
    |     +- commons-collections:commons-collections:jar:3.2.1:compile
    |     \- net.sf.ezmorph:ezmorph:jar:1.0.6:compile
    +- org.geoserver:gs-wcs2_0:jar:2.8-SNAPSHOT:compile
    |  +- org.geoserver:gs-wcs:jar:2.8-SNAPSHOT:compile
    |  |  +- org.geotools:gt-gtopo30:jar:14-SNAPSHOT:compile
    |  |  \- org.geotools:gt-image:jar:14-SNAPSHOT:compile
    |  +- org.geotools.ogc:net.opengis.wcs:jar:14-SNAPSHOT:compile
    |  \- org.geotools.xsd:gt-xsd-wcs:jar:14-SNAPSHOT:compile
    |     \- org.geotools:gt-xml:jar:14-SNAPSHOT:compile
    |        \- org.apache.xml:xml-commons-resolver:jar:1.2:compile
    +- org.geoserver:gs-wcs1_1:jar:2.8-SNAPSHOT:compile
    |  +- org.geotools.xsd:gt-xsd-gml3:jar:14-SNAPSHOT:compile
    |  +- javax.mail:mail:jar:1.4:compile
    |  \- javax.activation:activation:jar:1.1:compile
    +- org.geoserver:gs-wcs1_0:jar:2.8-SNAPSHOT:compile
    |  \- org.geotools.xsd:gt-xsd-ows:jar:14-SNAPSHOT:compile
    +- org.geotools.ogc:net.opengis.wps:jar:14-SNAPSHOT:compile
    |  +- org.geotools.ogc:net.opengis.ows:jar:14-SNAPSHOT:compile
    |  +- net.java.dev.jsr-275:jsr-275:jar:1.0-beta-2:compile
    |  +- org.eclipse.emf:common:jar:2.6.0:compile
    |  \- org.eclipse.emf:ecore:jar:2.6.1:compile
    +- org.geotools.xsd:gt-xsd-wps:jar:14-SNAPSHOT:compile
    +- org.geotools.xsd:gt-xsd-sld:jar:14-SNAPSHOT:compile
    |  \- org.geotools.xsd:gt-xsd-core:jar:14-SNAPSHOT:compile
    |     +- org.geotools:gt-graph:jar:14-SNAPSHOT:compile
    |     +- picocontainer:picocontainer:jar:1.2:compile
    |     +- commons-jxpath:commons-jxpath:jar:1.3:compile
    |     \- org.eclipse.xsd:xsd:jar:2.6.0:compile
    +- org.geotools:gt-process:jar:14-SNAPSHOT:compile
    |  \- javax.media:jai_imageio:jar:1.1:compile
    +- org.geotools:gt-process-raster:jar:14-SNAPSHOT:compile
    |  +- org.jaitools:jt-zonalstats:jar:1.4.0:compile
    |  +- org.jaitools:jt-rangelookup:jar:1.4.0:compile
    |  +- org.jaitools:jt-contour:jar:1.4.0:compile
    |  |  \- org.jaitools:jt-attributeop:jar:1.4.0:compile
    |  +- org.jaitools:jt-vectorize:jar:1.4.0:compile
    |  \- org.jaitools:jt-utils:jar:1.4.0:compile
    +- org.geotools:gt-process-geometry:jar:14-SNAPSHOT:compile
    +- org.geotools:gt-process-feature:jar:14-SNAPSHOT:compile
    +- org.geotools:gt-arcgrid:jar:14-SNAPSHOT:compile
    |  \- it.geosolutions.imageio-ext:imageio-ext-arcgrid:jar:1.1.12:compile
    |     +- it.geosolutions.imageio-ext:imageio-ext-streams:jar:1.1.12:compile
    |     \- it.geosolutions.imageio-ext:imageio-ext-utilities:jar:1.1.12:compile
    +- org.geotools:gt-geotiff:jar:14-SNAPSHOT:compile
    |  \- it.geosolutions.imageio-ext:imageio-ext-tiff:jar:1.1.12:compile
    |     \- it.geosolutions.imageio-ext:imageio-ext-geocore:jar:1.1.12:compile
    +- org.geotools:gt-geojson:jar:14-SNAPSHOT:compile
    |  +- com.googlecode.json-simple:json-simple:jar:1.1.1:compile
    |  \- commons-lang:commons-lang:jar:2.6:compile
    +- org.geotools:gt-grid:jar:14-SNAPSHOT:compile
    +- com.google.guava:guava:jar:17.0:compile
    +- org.geoserver:gs-platform:jar:2.8-SNAPSHOT:compile
    |  +- javax.servlet:servlet-api:jar:2.5:compile
    |  \- javax.media:jai_codec:jar:1.1.3:compile
    +- org.geotools:gt-api:jar:14-SNAPSHOT:compile
    \- org.geotools:gt-main:jar:14-SNAPSHOT:compile
java spring-boot geoserver geotools
2个回答
3
投票

[很可能,gs-wps-core库取决于Spring Security。如果Spring Boot在类路径上检测到Spring Security,它将使用默认的用户名和密码自动配置(将在应用程序日志中打印出来)。

您可以通过将以下属性添加到application.properties文件来禁用安全配置:

security.basic.enabled=false

1
投票

实际上,您只需要添加一个gt-epsg提供程序的依赖项即可访问GeoTools重新投影代码。最常见的是gt-epsg-hsql,但是如果使用其他HSQL模块,则可能会出现问题。这样,您无需添加仅存在于GeoServer代码中的任何spring模块。

有关问题的更详细说明,请参见georeferencing FAQ

© www.soinside.com 2019 - 2024. All rights reserved.