我有一个Geoscript库,可以读取上传的shapefile,然后将其转换为WKT。这在我将库上传到lib目录时有效,但是当我从Maven中将其拉入时,我得到了一个sax冲突。有谁知道解决方案?
这是错误
|错误执行脚本时出错清除:加载器约束违规:解析重写方法时“org.apache.tools.ant.helper.ProjectHelper2 $ RootHandler.setDocumentLocator(Lorg / xml / sax / Locator;)V”类加载器(org /的实例)当前类的codehaus / groovy / grails / cli / support / GrailsRootLoader)org / apache / tools / ant / helper / ProjectHelper2 $ RootHandler及其超类加载器(实例),对于类型andler.setDocumentLocator具有不同的Class对象(Lorg / xml / sax / Locator;)签名中使用的V(注意:堆栈跟踪已被过滤。使用--verbose查看整个跟踪。)
答案 0 :(得分:2)
这表现为Grails错误,即GRAILS-9331。您应该能够排除违规库,但Grails忽略了这一点。 Grails修复,尚未可用,实际上似乎没有解决这个问题,它只是在类加载时忽略org.xml。这是间接修复,似乎仍然错误加载xml-apis库。理想的解决方案是:
compile ('org.geoscript:geoscript-groovy:1.0-SNAPSHOT') {
excludes "xml-apis","xml-apis-ext","xercesImpl","xalan"
}
Grails错误阻止了它的工作。 我将排除列表和依赖项加载到Gradle中,并为1.0-SNAPSHOT生成依赖项列表。这个白名单可以代替'org.geoscript:geoscript-groovy:1.0-SNAPSHOT'
compile("bouncycastle:bcmail-jdk14:138",
"bouncycastle:bcprov-jdk14:138",
"bouncycastle:bctsp-jdk14:138",
"com.googlecode.json-simple:json-simple:1.1",
"com.h2database:h2:1.1.119",
"com.lowagie:itext:2.1.7",
"com.miglayout:miglayout:3.7",
"com.vividsolutions:jts:1.12",
"commons-collections:commons-collections:3.2.1",
"commons-dbcp:commons-dbcp:1.3",
"commons-io:commons-io:2.0.1",
"commons-jxpath:commons-jxpath:1.3",
"commons-logging:commons-logging:1.1.1",
"commons-pool:commons-pool:1.5.4",
"hsqldb:hsqldb:1.8.0.10",
"it.geosolutions.imageio-ext:imageio-ext-tiff:1.1.5",
"it.geosolutions.imageio-ext:imageio-ext-utilities:1.1.5",
"java3d:vecmath:1.3.2",
"javax.media:jai_codec:1.1.3",
"javax.media:jai_core:1.1.3",
"javax.media:jai_imageio:1.1",
"jdom:jdom:1.0",
"jfree:eastwood:1.1.1-20090908",
"jfree:jcommon:1.0.13",
"jfree:jfreechart:1.0.10",
"jgridshift:jgridshift:1.0",
"junit:junit:4.5",
"mysql:mysql-connector-java:5.1.17",
"net.java.dev.jsr-275:jsr-275:1.0-beta-2",
"net.sf.opencsv:opencsv:2.0",
"net.sourceforge.hatbox:hatbox:1.0.b7"
) {
transitive = false
}
compile("org.apache.avalon.framework:avalon-framework-api:4.3.1",
"org.apache.avalon.framework:avalon-framework-impl:4.3.1",
"org.apache.xmlgraphics:batik-anim:1.7",
"org.apache.xmlgraphics:batik-awt-util:1.7",
"org.apache.xmlgraphics:batik-bridge:1.7",
"org.apache.xmlgraphics:batik-css:1.7",
"org.apache.xmlgraphics:batik-dom:1.7",
"org.apache.xmlgraphics:batik-ext:1.7",
"org.apache.xmlgraphics:batik-gvt:1.7",
"org.apache.xmlgraphics:batik-js:1.7",
"org.apache.xmlgraphics:batik-parser:1.7",
"org.apache.xmlgraphics:batik-script:1.7",
"org.apache.xmlgraphics:batik-svg-dom:1.7",
"org.apache.xmlgraphics:batik-svggen:1.7",
"org.apache.xmlgraphics:batik-transcoder:1.7",
"org.apache.xmlgraphics:batik-util:1.7",
"org.apache.xmlgraphics:batik-xml:1.7",
"org.apache.xmlgraphics:fop:0.94",
"org.apache.xmlgraphics:xmlgraphics-commons:1.2",
"org.bouncycastle:bcmail-jdk14:1.38",
"org.bouncycastle:bcprov-jdk14:1.38",
"org.bouncycastle:bctsp-jdk14:1.38",
"org.eclipse.emf:common:2.6.0",
"org.eclipse.emf:ecore:2.6.1",
"org.eclipse.xsd:xsd:2.6.0",
"org.geoscript:geocss_2.9.1:0.7.4",
"org.geoscript:geoscript-groovy:1.0-SNAPSHOT",
"org.geotools.jdbc:gt-jdbc-h2:8.4",
"org.geotools.jdbc:gt-jdbc-mysql:8.4",
"org.geotools.jdbc:gt-jdbc-postgis:8.4",
"org.geotools.jdbc:gt-jdbc-spatialite:8.4"
) {
transitive = false
}
compile("org.geotools.ogc:net.opengis.fes:8.4",
"org.geotools.ogc:net.opengis.ows:8.4",
"org.geotools.ogc:net.opengis.wfs:8.4",
"org.geotools.ogc:org.w3.xlink:8.4",
"org.geotools.xsd:gt-xsd-core:8.4",
"org.geotools.xsd:gt-xsd-fes:8.4",
"org.geotools.xsd:gt-xsd-filter:8.4",
"org.geotools.xsd:gt-xsd-gml2:8.4",
"org.geotools.xsd:gt-xsd-gml3:8.4",
"org.geotools.xsd:gt-xsd-ows:8.4",
"org.geotools.xsd:gt-xsd-wfs:8.4",
"org.geotools:gt-api:8.4",
"org.geotools:gt-brewer:8.4",
"org.geotools:gt-charts:8.4",
"org.geotools:gt-coverage:8.4",
"org.geotools:gt-cql:8.4",
"org.geotools:gt-data:8.4",
"org.geotools:gt-epsg-hsql:8.4",
"org.geotools:gt-geojson:8.4",
"org.geotools:gt-graph:8.4",
"org.geotools:gt-grid:8.4",
"org.geotools:gt-jdbc:8.4",
"org.geotools:gt-main:8.4",
"org.geotools:gt-metadata:8.4",
"org.geotools:gt-opengis:8.4",
"org.geotools:gt-process-feature:8.4",
"org.geotools:gt-process-geometry:8.4",
"org.geotools:gt-process:8.4",
"org.geotools:gt-property:8.4",
"org.geotools:gt-referencing:8.4",
"org.geotools:gt-render:8.4"
) {
transitive = false
}
compile("org.geotools:gt-shapefile:8.4",
"org.geotools:gt-svg:8.4",
"org.geotools:gt-swing:8.4",
"org.jaitools:jt-utils:1.3.0",
"org.jaitools:jt-zonalstats:1.3.0",
"org.json:json:20090211",
"org.opengeo:geodb:0.7-RC2",
"org.scala-lang:scala-library:2.9.1",
"picocontainer:picocontainer:1.2",
"postgresql:postgresql:8.4-701.jdbc3"
) {
transitive = false
}
非常详细,但在Grails 2.1.0中可以正常运行