NCEAS / metacat

Data repository software that helps researchers preserve, share, and discover data
https://knb.ecoinformatics.org/software/metacat
GNU General Public License v2.0
27 stars 13 forks source link

Issues running a test w/o sudo #1268

Open amoeba opened 6 years ago

amoeba commented 6 years ago

Reporting this here so perhaps others can chime in. @taojing2002 in particular might have the best idea of what's going on.

I'm trying to run tests, particular the SitemapTest. It looks like this error happens on other tests too. When I run:

ant clean runonetest -Dtesttorun=SitemapTest

I get the following error:

[junit] Could not get PropertyService instance in static block: General properties problem while loading properties: Could not save properties: Could not write property file. File: /var/lib/tomcat7/webapps/metacat/WEB-INF/metacat.properties is not writable.
[junit] Test edu.ucsb.nceas.metacattest.SitemapTest FAILED
complete ant output ``` Buildfile: /metacat/build.xml setTomcatCommon: setTomcatNoCommon: config: [echo] *********** set jsdk to /var/lib/tomcat7/lib/servlet-api.jar build-metacat-common: [artifact:mvn] [INFO] Scanning for projects... [artifact:mvn] [INFO] [artifact:mvn] [INFO] ------------------------------------------------------------------------ [artifact:mvn] [INFO] Building metacat-common 2.9.0 [artifact:mvn] [INFO] ------------------------------------------------------------------------ [artifact:mvn] [INFO] [artifact:mvn] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ metacat-common --- [artifact:mvn] [INFO] Deleting /metacat/metacat-common/target [artifact:mvn] [INFO] ------------------------------------------------------------------------ [artifact:mvn] [INFO] BUILD SUCCESS [artifact:mvn] [INFO] ------------------------------------------------------------------------ [artifact:mvn] [INFO] Total time: 0.934s [artifact:mvn] [INFO] Finished at: Thu Jul 26 00:12:46 UTC 2018 [artifact:mvn] [INFO] Final Memory: 4M/15M [artifact:mvn] [INFO] ------------------------------------------------------------------------ [artifact:mvn] [INFO] Scanning for projects... [artifact:mvn] [INFO] [artifact:mvn] [INFO] ------------------------------------------------------------------------ [artifact:mvn] [INFO] Building metacat-common 2.9.0 [artifact:mvn] [INFO] ------------------------------------------------------------------------ [artifact:mvn] [INFO] [artifact:mvn] [INFO] --- maven-resources-plugin:2.6:copy-resources (copy-resources) @ metacat-common --- [artifact:mvn] [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! [artifact:mvn] [INFO] Copying 11 resources [artifact:mvn] [INFO] [artifact:mvn] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ metacat-common --- [artifact:mvn] [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! [artifact:mvn] [INFO] Copying 0 resource [artifact:mvn] [INFO] [artifact:mvn] [INFO] --- maven-compiler-plugin:2.3:compile (default-compile) @ metacat-common --- [artifact:mvn] [WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent! [artifact:mvn] [INFO] Compiling 14 source files to /metacat/metacat-common/target/classes [artifact:mvn] [INFO] [artifact:mvn] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ metacat-common --- [artifact:mvn] [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! [artifact:mvn] [INFO] Copying 2 resources [artifact:mvn] [INFO] [artifact:mvn] [INFO] --- maven-compiler-plugin:2.3:testCompile (default-testCompile) @ metacat-common --- [artifact:mvn] [WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent! [artifact:mvn] [INFO] Compiling 7 source files to /metacat/metacat-common/target/test-classes [artifact:mvn] [INFO] [artifact:mvn] [INFO] --- maven-surefire-plugin:2.10:test (default-test) @ metacat-common --- [artifact:mvn] [INFO] Surefire report directory: /metacat/metacat-common/target/surefire-reports [artifact:mvn] [artifact:mvn] ------------------------------------------------------- [artifact:mvn] T E S T S [artifact:mvn] ------------------------------------------------------- [artifact:mvn] Running edu.ucsb.nceas.metacat.common.SolrServerFactoryTest [artifact:mvn] log4j:WARN No appenders could be found for logger (org.dataone.configuration.Settings). [artifact:mvn] log4j:WARN Please initialize the log4j system properly. [artifact:mvn] log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. [artifact:mvn] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.812 sec [artifact:mvn] Running edu.ucsb.nceas.metacat.common.resourcemap.ResourceMapNamespacesTest [artifact:mvn] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 sec [artifact:mvn] Running edu.ucsb.nceas.metacat.common.query.SolrQueryResponseTransformerTest [artifact:mvn] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.061 sec [artifact:mvn] Running edu.ucsb.nceas.metacat.common.query.EnabledQueryEnginesTest [artifact:mvn] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.006 sec [artifact:mvn] Running edu.ucsb.nceas.metacat.common.query.SolrQueryServiceControllerTest [artifact:mvn] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.248 sec [artifact:mvn] Running edu.ucsb.nceas.metacat.common.query.SolrQueryResponseWriterFactoryTest [artifact:mvn] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 sec [artifact:mvn] [artifact:mvn] Results : [artifact:mvn] [artifact:mvn] Tests run: 10, Failures: 0, Errors: 0, Skipped: 0 [artifact:mvn] [artifact:mvn] [INFO] [artifact:mvn] [INFO] --- maven-jar-plugin:2.2:jar (default-jar) @ metacat-common --- [artifact:mvn] [INFO] Building jar: /metacat/metacat-common/target/metacat-common-2.9.0.jar [artifact:mvn] [INFO] [artifact:mvn] [INFO] --- maven-install-plugin:2.3:install (default-install) @ metacat-common --- [artifact:mvn] [INFO] Installing /metacat/metacat-common/target/metacat-common-2.9.0.jar to /home/vagrant/.m2/repository/edu/ucsb/nceas/metacat/common/metacat-common/2.9.0/metacat-common-2.9.0.jar [artifact:mvn] [INFO] Installing /metacat/metacat-common/pom.xml to /home/vagrant/.m2/repository/edu/ucsb/nceas/metacat/common/metacat-common/2.9.0/metacat-common-2.9.0.pom [artifact:mvn] [INFO] ------------------------------------------------------------------------ [artifact:mvn] [INFO] BUILD SUCCESS [artifact:mvn] [INFO] ------------------------------------------------------------------------ [artifact:mvn] [INFO] Total time: 10.944s [artifact:mvn] [INFO] Finished at: Thu Jul 26 00:12:59 UTC 2018 [artifact:mvn] [INFO] Final Memory: 18M/45M [artifact:mvn] [INFO] ------------------------------------------------------------------------ init: Trying to override old definition of task antlib:org.apache.maven.artifact.ant:dependencies Trying to override old definition of task antlib:org.apache.maven.artifact.ant:install Trying to override old definition of task antlib:org.apache.maven.artifact.ant:deploy Trying to override old definition of task antlib:org.apache.maven.artifact.ant:install-provider Trying to override old definition of task antlib:org.apache.maven.artifact.ant:mvn Trying to override old definition of task antlib:org.apache.maven.artifact.ant:writepom Trying to override old definition of datatype antlib:org.apache.maven.artifact.ant:localRepository Trying to override old definition of datatype antlib:org.apache.maven.artifact.ant:remoteRepository Trying to override old definition of datatype antlib:org.apache.maven.artifact.ant:authentication Trying to override old definition of datatype antlib:org.apache.maven.artifact.ant:proxy Trying to override old definition of task antlib:org.apache.maven.artifact.ant:pom [artifact:dependencies] [WARNING] POM for 'org.ecoinformatics.eml:datamanager:pom:0.9.0:compile' is invalid. [artifact:dependencies] [artifact:dependencies] Its dependencies (if any) will NOT be available to the current build. [artifact:dependencies] [WARNING] POM for 'org.ecoinformatics.eml:datamanager:pom:0.9.0:compile' is invalid. [artifact:dependencies] [artifact:dependencies] Its dependencies (if any) will NOT be available to the current build. clean: [delete] Deleting directory /metacat/build setTomcatCommon: setTomcatNoCommon: config: [echo] *********** set jsdk to /var/lib/tomcat7/lib/servlet-api.jar build-metacat-common: init: resolveDependencies: [echo] Moving Maven dependencies (${dependency.fileset}) to lib/maven [delete] Deleting directory /metacat/lib/maven [copy] Copying 127 files to /metacat/lib/maven prepare: [mkdir] Created dir: /metacat/build [mkdir] Created dir: /metacat/build/src [mkdir] Created dir: /metacat/build/classes [mkdir] Created dir: /metacat/build/docs [mkdir] Created dir: /metacat/build/docs/api [mkdir] Created dir: /metacat/build/tmp [copy] Copying 481 files to /metacat/build/src compile: [javac] /metacat/build.xml:509: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds [javac] Compiling 323 source files to /metacat/build/classes [javac] Note: Some input files use or override a deprecated API. [javac] Note: Recompile with -Xlint:deprecation for details. [javac] Note: Some input files use unchecked or unsafe operations. [javac] Note: Recompile with -Xlint:unchecked for details. giteml: getemlpre2: getemlpre2beta4: geteml2+: getConversionXSL: geteml: jar: [jar] Building jar: /metacat/build/metacat.jar client: [javac] /metacat/build.xml:537: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds clientjar: [jar] Building jar: /metacat/build/metacat-client.jar harvester: [javac] /metacat/build.xml:563: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds [javac] Compiling 11 source files to /metacat/build/classes [javac] Note: Some input files use or override a deprecated API. [javac] Note: Recompile with -Xlint:deprecation for details. [javac] Note: Some input files use unchecked or unsafe operations. [javac] Note: Recompile with -Xlint:unchecked for details. harvesterjar: [jar] Building jar: /metacat/build/harvester.jar testprep: [mkdir] Created dir: /metacat/build/tests [copy] Copying 77 files to /metacat/build/tests [copy] Copying 1 file to /metacat/build/tests [echo] |--test classpath [echo] | | [echo] | |-- /var/lib/tomcat7/lib/servlet-api.jar [echo] | |--/metacat/lib [echo] | |--/metacat/lib/itislib.jar [echo] | |--/metacat/lib/maven-ant-tasks-2.1.0.jar [echo] | |--/metacat/lib/svnClientAdapter.jar [echo] | |--/metacat/lib/svnant.jar [echo] | |--/metacat/lib/svnjavahl.jar [echo] | |--/metacat/lib/lsid_lib/activation.jar [echo] | |--/metacat/lib/lsid_lib/axis-ant.jar [echo] | |--/metacat/lib/lsid_lib/axis-schema.jar [echo] | |--/metacat/lib/lsid_lib/axis.jar [echo] | |--/metacat/lib/lsid_lib/castor-0.9.5.jar [echo] | |--/metacat/lib/lsid_lib/commons-discovery-0.2.jar [echo] | |--/metacat/lib/lsid_lib/commons-discovery.jar [echo] | |--/metacat/lib/lsid_lib/dnsjava-1.3.2.jar [echo] | |--/metacat/lib/lsid_lib/jaxrpc.jar [echo] | |--/metacat/lib/lsid_lib/lsid-client-1.1.1.jar [echo] | |--/metacat/lib/lsid_lib/lsid-server-1.1.1.jar [echo] | |--/metacat/lib/lsid_lib/mail.jar [echo] | |--/metacat/lib/lsid_lib/saaj.jar [echo] | |--/metacat/lib/lsid_lib/soap.jar [echo] | |--/metacat/lib/lsid_lib/wsdl4j-1.5.1.jar [echo] | |--/metacat/lib/maven/activation-1.1.jar [echo] | |--/metacat/lib/maven/ant-1.7.1.jar [echo] | |--/metacat/lib/maven/ant-junit-1.7.1.jar [echo] | |--/metacat/lib/maven/ant-launcher-1.7.1.jar [echo] | |--/metacat/lib/maven/axis-1.4.jar [echo] | |--/metacat/lib/maven/bagit-4.4.jar [echo] | |--/metacat/lib/maven/bcpkix-jdk15on-1.52.jar [echo] | |--/metacat/lib/maven/bcprov-jdk15on-1.52.jar [echo] | |--/metacat/lib/maven/classworlds-1.1.jar [echo] | |--/metacat/lib/maven/commons-beanutils-1.9.2.jar [echo] | |--/metacat/lib/maven/commons-cli-1.0.jar [echo] | |--/metacat/lib/maven/commons-codec-1.4.jar [echo] | |--/metacat/lib/maven/commons-collections-3.2.1.jar [echo] | |--/metacat/lib/maven/commons-collections4-4.0.jar [echo] | |--/metacat/lib/maven/commons-compress-1.3.jar [echo] | |--/metacat/lib/maven/commons-configuration-1.7.jar [echo] | |--/metacat/lib/maven/commons-digester-1.8.1.jar [echo] | |--/metacat/lib/maven/commons-exec-1.0.jar [echo] | |--/metacat/lib/maven/commons-fileupload-1.2.1.jar [echo] | |--/metacat/lib/maven/commons-httpclient-3.1.jar [echo] | |--/metacat/lib/maven/commons-io-2.0.jar [echo] | |--/metacat/lib/maven/commons-jxpath-1.3.jar [echo] | |--/metacat/lib/maven/commons-lang-2.6.jar [echo] | |--/metacat/lib/maven/commons-lang3-3.3.2.jar [echo] | |--/metacat/lib/maven/commons-logging-1.1.1.jar [echo] | |--/metacat/lib/maven/commons-logging-api-1.1.jar [echo] | |--/metacat/lib/maven/commons-net-2.0.jar [echo] | |--/metacat/lib/maven/commons-pool-1.5.3.jar [echo] | |--/metacat/lib/maven/core-renderer-R8.jar [echo] | |--/metacat/lib/maven/cos-05Nov2002.jar [echo] | |--/metacat/lib/maven/d1_common_java-2.3.0.jar [echo] | |--/metacat/lib/maven/d1_libclient_java-2.3.1.jar [echo] | |--/metacat/lib/maven/d1_portal-2.3.1.jar [echo] | |--/metacat/lib/maven/datamanager-0.9.0.jar [echo] | |--/metacat/lib/maven/dom4j-1.6.1.jar [echo] | |--/metacat/lib/maven/easystream-1.2.12.jar [echo] | |--/metacat/lib/maven/ezid-1.0.1.jar [echo] | |--/metacat/lib/maven/foresite-1.0-20150128.210108-2.jar [echo] | |--/metacat/lib/maven/geoapi-2.3-M1.jar [echo] | |--/metacat/lib/maven/geoapi-pending-2.3-M1.jar [echo] | |--/metacat/lib/maven/gt-api-2.6.4.jar [echo] | |--/metacat/lib/maven/gt-data-2.6.4.jar [echo] | |--/metacat/lib/maven/gt-main-2.6.4.jar [echo] | |--/metacat/lib/maven/gt-metadata-2.6.4.jar [echo] | |--/metacat/lib/maven/gt-referencing-2.6.4.jar [echo] | |--/metacat/lib/maven/gt-shapefile-2.6.4.jar [echo] | |--/metacat/lib/maven/guava-r05.jar [echo] | |--/metacat/lib/maven/hazelcast-2.4.1.jar [echo] | |--/metacat/lib/maven/httpclient-4.3.3.jar [echo] | |--/metacat/lib/maven/httpclient-cache-4.3.6.jar [echo] | |--/metacat/lib/maven/httpcore-4.3.2.jar [echo] | |--/metacat/lib/maven/httpmime-4.3.3.jar [echo] | |--/metacat/lib/maven/itext-2.0.8.jar [echo] | |--/metacat/lib/maven/jakarta-regexp-1.4.jar [echo] | |--/metacat/lib/maven/javax.inject-1.jar [echo] | |--/metacat/lib/maven/jaxb-api-2.2.3.jar [echo] | |--/metacat/lib/maven/jaxen-1.1.1.jar [echo] | |--/metacat/lib/maven/jaxrpc-api-1.1.jar [echo] | |--/metacat/lib/maven/jbcrypt-0.3m.jar [echo] | |--/metacat/lib/maven/jcip-annotations-1.0.jar [echo] | |--/metacat/lib/maven/jcl-over-slf4j-1.6.1.jar [echo] | |--/metacat/lib/maven/jdom-1.0.jar [echo] | |--/metacat/lib/maven/jena-arq-2.11.0.jar [echo] | |--/metacat/lib/maven/jena-core-2.11.0.jar [echo] | |--/metacat/lib/maven/jena-iri-1.0.0.jar [echo] | |--/metacat/lib/maven/jena-tdb-1.0.0.jar [echo] | |--/metacat/lib/maven/jibx-run-1.2.4.5.jar [echo] | |--/metacat/lib/maven/joda-time-2.1.jar [echo] | |--/metacat/lib/maven/jsap-2.1.jar [echo] | |--/metacat/lib/maven/json-smart-1.1.1.jar [echo] | |--/metacat/lib/maven/jsr-275-1.0-beta-2.jar [echo] | |--/metacat/lib/maven/jtidy-r938.jar [echo] | |--/metacat/lib/maven/jts-1.10.jar [echo] | |--/metacat/lib/maven/junit-4.8.2.jar [echo] | |--/metacat/lib/maven/log4j-1.2.17.jar [echo] | |--/metacat/lib/maven/lucene-analyzers-3.6.2.jar [echo] | |--/metacat/lib/maven/lucene-core-3.6.2.jar [echo] | |--/metacat/lib/maven/lucene-grouping-3.6.2.jar [echo] | |--/metacat/lib/maven/lucene-highlighter-3.6.2.jar [echo] | |--/metacat/lib/maven/lucene-kuromoji-3.6.2.jar [echo] | |--/metacat/lib/maven/lucene-memory-3.6.2.jar [echo] | |--/metacat/lib/maven/lucene-misc-3.6.2.jar [echo] | |--/metacat/lib/maven/lucene-phonetic-3.6.2.jar [echo] | |--/metacat/lib/maven/lucene-queries-3.6.2.jar [echo] | |--/metacat/lib/maven/lucene-spatial-3.6.2.jar [echo] | |--/metacat/lib/maven/lucene-spellchecker-3.6.2.jar [echo] | |--/metacat/lib/maven/lucene-test-framework-3.6.2.jar [echo] | |--/metacat/lib/maven/mail-1.4.1.jar [echo] | |--/metacat/lib/maven/metacat-common-2.9.0.jar [echo] | |--/metacat/lib/maven/myproxy-logon-3.3.jar [echo] | |--/metacat/lib/maven/ncsa-security-core-3.3.jar [echo] | |--/metacat/lib/maven/ncsa-security-delegation-client-3.3.jar [echo] | |--/metacat/lib/maven/ncsa-security-delegation-common-3.3.jar [echo] | |--/metacat/lib/maven/ncsa-security-delegation-server-3.3.jar [echo] | |--/metacat/lib/maven/ncsa-security-oauth-1.0a-3.3.jar [echo] | |--/metacat/lib/maven/ncsa-security-servlet-3.3.jar [echo] | |--/metacat/lib/maven/ncsa-security-storage-3.3.jar [echo] | |--/metacat/lib/maven/ncsa-security-util-3.3.jar [echo] | |--/metacat/lib/maven/nimbus-jose-jwt-3.1.2.jar [echo] | |--/metacat/lib/maven/oa4mp-client-api-3.3.jar [echo] | |--/metacat/lib/maven/oa4mp-client-loader-oauth1-3.3.jar [echo] | |--/metacat/lib/maven/oaicat-1.5.48.jar [echo] | |--/metacat/lib/maven/oauth-20100527.jar [echo] | |--/metacat/lib/maven/oauth-consumer-20100527.jar [echo] | |--/metacat/lib/maven/oauth-httpclient4-20090617.jar [echo] | |--/metacat/lib/maven/oauth-provider-20100527.jar [echo] | |--/metacat/lib/maven/opencsv-1.8.jar [echo] | |--/metacat/lib/maven/postgresql-8.0-312.jdbc3.jar [echo] | |--/metacat/lib/maven/quartz-1.7.2.jar [echo] | |--/metacat/lib/maven/rome-0.9.jar [echo] | |--/metacat/lib/maven/serializer-2.7.1.jar [echo] | |--/metacat/lib/maven/slf4j-api-1.6.1.jar [echo] | |--/metacat/lib/maven/slf4j-log4j12-1.6.1.jar [echo] | |--/metacat/lib/maven/solr-core-3.6.2.jar [echo] | |--/metacat/lib/maven/solr-solrj-3.6.2.jar [echo] | |--/metacat/lib/maven/solr-test-framework-3.6.2.jar [echo] | |--/metacat/lib/maven/stax-api-1.0-2.jar [echo] | |--/metacat/lib/maven/utilities-2.0.0.jar [echo] | |--/metacat/lib/maven/vecmath-1.3.2.jar [echo] | |--/metacat/lib/maven/wicket-core-6.7.0.jar [echo] | |--/metacat/lib/maven/wicket-request-6.7.0.jar [echo] | |--/metacat/lib/maven/wicket-util-6.7.0.jar [echo] | |--/metacat/lib/maven/wstx-asl-3.2.7.jar [echo] | |--/metacat/lib/maven/xalan-2.7.1.jar [echo] | |--/metacat/lib/maven/xercesImpl-2.7.1.jar [echo] | |--/metacat/lib/maven/xpp3-1.1.3.4.O.jar [echo] | |--/home/vagrant/.m2/repository/edu/ucsb/nceas/utilities/2.0.0/utilities-2.0.0.jar [echo] | |--/home/vagrant/.m2/repository/org/xhtmlrenderer/core-renderer/R8/core-renderer-R8.jar [echo] | |--/home/vagrant/.m2/repository/com/lowagie/itext/2.0.8/itext-2.0.8.jar [echo] | |--/home/vagrant/.m2/repository/net/sf/jtidy/jtidy/r938/jtidy-r938.jar [echo] | |--/home/vagrant/.m2/repository/xerces/xercesImpl/2.7.1/xercesImpl-2.7.1.jar [echo] | |--/home/vagrant/.m2/repository/xalan/xalan/2.7.1/xalan-2.7.1.jar [echo] | |--/home/vagrant/.m2/repository/xalan/serializer/2.7.1/serializer-2.7.1.jar [echo] | |--/home/vagrant/.m2/repository/commons-io/commons-io/2.0/commons-io-2.0.jar [echo] | |--/home/vagrant/.m2/repository/org/apache/httpcomponents/httpclient/4.3.3/httpclient-4.3.3.jar [echo] | |--/home/vagrant/.m2/repository/org/apache/httpcomponents/httpcore/4.3.2/httpcore-4.3.2.jar [echo] | |--/home/vagrant/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar [echo] | |--/home/vagrant/.m2/repository/commons-codec/commons-codec/1.4/commons-codec-1.4.jar [echo] | |--/home/vagrant/.m2/repository/log4j/log4j/1.2.17/log4j-1.2.17.jar [echo] | |--/home/vagrant/.m2/repository/org/ecoinformatics/eml/datamanager/0.9.0/datamanager-0.9.0.jar [echo] | |--/home/vagrant/.m2/repository/gov/loc/bagit/4.4/bagit-4.4.jar [echo] | |--/home/vagrant/.m2/repository/org/apache/commons/commons-compress/1.3/commons-compress-1.3.jar [echo] | |--/home/vagrant/.m2/repository/commons-logging/commons-logging-api/1.1/commons-logging-api-1.1.jar [echo] | |--/home/vagrant/.m2/repository/com/martiansoftware/jsap/2.1/jsap-2.1.jar [echo] | |--/home/vagrant/.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar [echo] | |--/home/vagrant/.m2/repository/jaxen/jaxen/1.1.1/jaxen-1.1.1.jar [echo] | |--/home/vagrant/.m2/repository/jdom/jdom/1.0/jdom-1.0.jar [echo] | |--/home/vagrant/.m2/repository/classworlds/classworlds/1.1/classworlds-1.1.jar [echo] | |--/home/vagrant/.m2/repository/commons-net/commons-net/2.0/commons-net-2.0.jar [echo] | |--/home/vagrant/.m2/repository/org/apache/commons/commons-exec/1.0/commons-exec-1.0.jar [echo] | |--/home/vagrant/.m2/repository/org/dataone/d1_portal/2.3.1/d1_portal-2.3.1.jar [echo] | |--/home/vagrant/.m2/repository/com/nimbusds/nimbus-jose-jwt/3.1.2/nimbus-jose-jwt-3.1.2.jar [echo] | |--/home/vagrant/.m2/repository/net/jcip/jcip-annotations/1.0/jcip-annotations-1.0.jar [echo] | |--/home/vagrant/.m2/repository/net/minidev/json-smart/1.1.1/json-smart-1.1.1.jar [echo] | |--/home/vagrant/.m2/repository/edu/uiuc/ncsa/myproxy/oa4mp-client-api/3.3/oa4mp-client-api-3.3.jar [echo] | |--/home/vagrant/.m2/repository/edu/uiuc/ncsa/security/delegation/ncsa-security-delegation-client/3.3/ncsa-security-delegation-client-3.3.jar [echo] | |--/home/vagrant/.m2/repository/edu/uiuc/ncsa/security/ncsa-security-util/3.3/ncsa-security-util-3.3.jar [echo] | |--/home/vagrant/.m2/repository/commons-cli/commons-cli/1.0/commons-cli-1.0.jar [echo] | |--/home/vagrant/.m2/repository/edu/uiuc/ncsa/security/ncsa-security-core/3.3/ncsa-security-core-3.3.jar [echo] | |--/home/vagrant/.m2/repository/commons-configuration/commons-configuration/1.7/commons-configuration-1.7.jar [echo] | |--/home/vagrant/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar [echo] | |--/home/vagrant/.m2/repository/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar [echo] | |--/home/vagrant/.m2/repository/commons-beanutils/commons-beanutils/1.9.2/commons-beanutils-1.9.2.jar [echo] | |--/home/vagrant/.m2/repository/javax/inject/javax.inject/1/javax.inject-1.jar [echo] | |--/home/vagrant/.m2/repository/edu/uiuc/ncsa/security/delegation/ncsa-security-delegation-common/3.3/ncsa-security-delegation-common-3.3.jar [echo] | |--/home/vagrant/.m2/repository/edu/uiuc/ncsa/security/ncsa-security-storage/3.3/ncsa-security-storage-3.3.jar [echo] | |--/home/vagrant/.m2/repository/edu/uiuc/ncsa/security/ncsa-security-servlet/3.3/ncsa-security-servlet-3.3.jar [echo] | |--/home/vagrant/.m2/repository/junit/junit/4.8.2/junit-4.8.2.jar [echo] | |--/home/vagrant/.m2/repository/edu/uiuc/ncsa/myproxy/oa4mp-client-oauth1/3.3/oa4mp-client-oauth1-3.3.war [echo] | |--/home/vagrant/.m2/repository/edu/uiuc/ncsa/myproxy/oa4mp-client-loader-oauth1/3.3/oa4mp-client-loader-oauth1-3.3.jar [echo] | |--/home/vagrant/.m2/repository/edu/uiuc/ncsa/myproxy/myproxy-logon/3.3/myproxy-logon-3.3.jar [echo] | |--/home/vagrant/.m2/repository/edu/uiuc/ncsa/security/delegation/ncsa-security-oauth-1.0a/3.3/ncsa-security-oauth-1.0a-3.3.jar [echo] | |--/home/vagrant/.m2/repository/edu/uiuc/ncsa/security/delegation/ncsa-security-delegation-server/3.3/ncsa-security-delegation-server-3.3.jar [echo] | |--/home/vagrant/.m2/repository/net/oauth/core/oauth-httpclient4/20090617/oauth-httpclient4-20090617.jar [echo] | |--/home/vagrant/.m2/repository/net/oauth/core/oauth-consumer/20100527/oauth-consumer-20100527.jar [echo] | |--/home/vagrant/.m2/repository/net/oauth/core/oauth/20100527/oauth-20100527.jar [echo] | |--/home/vagrant/.m2/repository/net/oauth/core/oauth-provider/20100527/oauth-provider-20100527.jar [echo] | |--/home/vagrant/.m2/repository/postgresql/postgresql/8.0-312.jdbc3/postgresql-8.0-312.jdbc3.jar [echo] | |--/home/vagrant/.m2/repository/org/dataone/d1_libclient_java/2.3.1/d1_libclient_java-2.3.1.jar [echo] | |--/home/vagrant/.m2/repository/net/sf/jsignature/io-tools/easystream/1.2.12/easystream-1.2.12.jar [echo] | |--/home/vagrant/.m2/repository/org/slf4j/slf4j-api/1.6.1/slf4j-api-1.6.1.jar [echo] | |--/home/vagrant/.m2/repository/javax/mail/mail/1.4.1/mail-1.4.1.jar [echo] | |--/home/vagrant/.m2/repository/javax/activation/activation/1.1/activation-1.1.jar [echo] | |--/home/vagrant/.m2/repository/org/jibx/jibx-run/1.2.4.5/jibx-run-1.2.4.5.jar [echo] | |--/home/vagrant/.m2/repository/joda-time/joda-time/2.1/joda-time-2.1.jar [echo] | |--/home/vagrant/.m2/repository/xpp3/xpp3/1.1.3.4.O/xpp3-1.1.3.4.O.jar [echo] | |--/home/vagrant/.m2/repository/org/bouncycastle/bcpkix-jdk15on/1.52/bcpkix-jdk15on-1.52.jar [echo] | |--/home/vagrant/.m2/repository/org/bouncycastle/bcprov-jdk15on/1.52/bcprov-jdk15on-1.52.jar [echo] | |--/home/vagrant/.m2/repository/org/dataone/d1_common_java/2.3.0/d1_common_java-2.3.0.jar [echo] | |--/home/vagrant/.m2/repository/javax/xml/bind/jaxb-api/2.2.3/jaxb-api-2.2.3.jar [echo] | |--/home/vagrant/.m2/repository/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar [echo] | |--/home/vagrant/.m2/repository/commons-fileupload/commons-fileupload/1.2.1/commons-fileupload-1.2.1.jar [echo] | |--/home/vagrant/.m2/repository/org/apache/httpcomponents/httpmime/4.3.3/httpmime-4.3.3.jar [echo] | |--/home/vagrant/.m2/repository/org/apache/commons/commons-collections4/4.0/commons-collections4-4.0.jar [echo] | |--/home/vagrant/.m2/repository/org/apache/commons/commons-lang3/3.3.2/commons-lang3-3.3.2.jar [echo] | |--/home/vagrant/.m2/repository/commons-digester/commons-digester/1.8.1/commons-digester-1.8.1.jar [echo] | |--/home/vagrant/.m2/repository/org/apache/httpcomponents/httpclient-cache/4.3.6/httpclient-cache-4.3.6.jar [echo] | |--/home/vagrant/.m2/repository/com/googlecode/foresite-toolkit/foresite/1.0-SNAPSHOT/foresite-1.0-SNAPSHOT.jar [echo] | |--/home/vagrant/.m2/repository/org/apache/lucene/lucene-core/3.6.2/lucene-core-3.6.2.jar [echo] | |--/home/vagrant/.m2/repository/org/codehaus/woodstox/wstx-asl/3.2.7/wstx-asl-3.2.7.jar [echo] | |--/home/vagrant/.m2/repository/rome/rome/0.9/rome-0.9.jar [echo] | |--/home/vagrant/.m2/repository/edu/ucsb/nceas/metacat/common/metacat-common/2.9.0/metacat-common-2.9.0.jar [echo] | |--/home/vagrant/.m2/repository/org/apache/solr/solr-core/3.6.2/solr-core-3.6.2.jar [echo] | |--/home/vagrant/.m2/repository/org/apache/solr/solr-solrj/3.6.2/solr-solrj-3.6.2.jar [echo] | |--/home/vagrant/.m2/repository/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar [echo] | |--/home/vagrant/.m2/repository/org/slf4j/jcl-over-slf4j/1.6.1/jcl-over-slf4j-1.6.1.jar [echo] | |--/home/vagrant/.m2/repository/org/apache/lucene/lucene-analyzers/3.6.2/lucene-analyzers-3.6.2.jar [echo] | |--/home/vagrant/.m2/repository/org/apache/lucene/lucene-highlighter/3.6.2/lucene-highlighter-3.6.2.jar [echo] | |--/home/vagrant/.m2/repository/org/apache/lucene/lucene-memory/3.6.2/lucene-memory-3.6.2.jar [echo] | |--/home/vagrant/.m2/repository/org/apache/lucene/lucene-queries/3.6.2/lucene-queries-3.6.2.jar [echo] | |--/home/vagrant/.m2/repository/jakarta-regexp/jakarta-regexp/1.4/jakarta-regexp-1.4.jar [echo] | |--/home/vagrant/.m2/repository/org/apache/lucene/lucene-kuromoji/3.6.2/lucene-kuromoji-3.6.2.jar [echo] | |--/home/vagrant/.m2/repository/org/apache/lucene/lucene-misc/3.6.2/lucene-misc-3.6.2.jar [echo] | |--/home/vagrant/.m2/repository/org/apache/lucene/lucene-phonetic/3.6.2/lucene-phonetic-3.6.2.jar [echo] | |--/home/vagrant/.m2/repository/org/apache/lucene/lucene-spatial/3.6.2/lucene-spatial-3.6.2.jar [echo] | |--/home/vagrant/.m2/repository/org/apache/lucene/lucene-spellchecker/3.6.2/lucene-spellchecker-3.6.2.jar [echo] | |--/home/vagrant/.m2/repository/org/apache/lucene/lucene-grouping/3.6.2/lucene-grouping-3.6.2.jar [echo] | |--/home/vagrant/.m2/repository/com/google/guava/guava/r05/guava-r05.jar [echo] | |--/home/vagrant/.m2/repository/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar [echo] | |--/home/vagrant/.m2/repository/org/slf4j/slf4j-log4j12/1.6.1/slf4j-log4j12-1.6.1.jar [echo] | |--/home/vagrant/.m2/repository/org/apache/solr/solr-test-framework/3.6.2/solr-test-framework-3.6.2.jar [echo] | |--/home/vagrant/.m2/repository/org/apache/lucene/lucene-test-framework/3.6.2/lucene-test-framework-3.6.2.jar [echo] | |--/home/vagrant/.m2/repository/org/apache/ant/ant-junit/1.7.1/ant-junit-1.7.1.jar [echo] | |--/home/vagrant/.m2/repository/org/apache/ant/ant/1.7.1/ant-1.7.1.jar [echo] | |--/home/vagrant/.m2/repository/org/apache/ant/ant-launcher/1.7.1/ant-launcher-1.7.1.jar [echo] | |--/home/vagrant/.m2/repository/edu/ucsb/nceas/ezid/1.0.1/ezid-1.0.1.jar [echo] | |--/home/vagrant/.m2/repository/org/geotools/gt-api/2.6.4/gt-api-2.6.4.jar [echo] | |--/home/vagrant/.m2/repository/com/vividsolutions/jts/1.10/jts-1.10.jar [echo] | |--/home/vagrant/.m2/repository/org/geotools/gt-referencing/2.6.4/gt-referencing-2.6.4.jar [echo] | |--/home/vagrant/.m2/repository/java3d/vecmath/1.3.2/vecmath-1.3.2.jar [echo] | |--/home/vagrant/.m2/repository/commons-pool/commons-pool/1.5.3/commons-pool-1.5.3.jar [echo] | |--/home/vagrant/.m2/repository/org/geotools/gt-metadata/2.6.4/gt-metadata-2.6.4.jar [echo] | |--/home/vagrant/.m2/repository/org/opengis/geoapi/2.3-M1/geoapi-2.3-M1.jar [echo] | |--/home/vagrant/.m2/repository/net/java/dev/jsr-275/jsr-275/1.0-beta-2/jsr-275-1.0-beta-2.jar [echo] | |--/home/vagrant/.m2/repository/org/opengis/geoapi-pending/2.3-M1/geoapi-pending-2.3-M1.jar [echo] | |--/home/vagrant/.m2/repository/org/geotools/gt-data/2.6.4/gt-data-2.6.4.jar [echo] | |--/home/vagrant/.m2/repository/org/geotools/gt-main/2.6.4/gt-main-2.6.4.jar [echo] | |--/home/vagrant/.m2/repository/org/geotools/gt-shapefile/2.6.4/gt-shapefile-2.6.4.jar [echo] | |--/home/vagrant/.m2/repository/com/servlets/cos/05Nov2002/cos-05Nov2002.jar [echo] | |--/home/vagrant/.m2/repository/com/hazelcast/hazelcast/2.4.1/hazelcast-2.4.1.jar [echo] | |--/home/vagrant/.m2/repository/net/sf/opencsv/opencsv/1.8/opencsv-1.8.jar [echo] | |--/home/vagrant/.m2/repository/org/apache/wicket/wicket-core/6.7.0/wicket-core-6.7.0.jar [echo] | |--/home/vagrant/.m2/repository/org/apache/wicket/wicket-util/6.7.0/wicket-util-6.7.0.jar [echo] | |--/home/vagrant/.m2/repository/org/apache/wicket/wicket-request/6.7.0/wicket-request-6.7.0.jar [echo] | |--/home/vagrant/.m2/repository/org/dspace/oaicat/1.5.48/oaicat-1.5.48.jar [echo] | |--/home/vagrant/.m2/repository/org/quartz-scheduler/quartz/1.7.2/quartz-1.7.2.jar [echo] | |--/home/vagrant/.m2/repository/org/apache/axis/axis/1.4/axis-1.4.jar [echo] | |--/home/vagrant/.m2/repository/javax/xml/jaxrpc-api/1.1/jaxrpc-api-1.1.jar [echo] | |--/home/vagrant/.m2/repository/commons-jxpath/commons-jxpath/1.3/commons-jxpath-1.3.jar [echo] | |--/home/vagrant/.m2/repository/org/mindrot/jbcrypt/0.3m/jbcrypt-0.3m.jar [echo] | |--/home/vagrant/.m2/repository/org/apache/jena/jena-tdb/1.0.0/jena-tdb-1.0.0.jar [echo] | |--/home/vagrant/.m2/repository/org/apache/jena/jena-arq/2.11.0/jena-arq-2.11.0.jar [echo] | |--/home/vagrant/.m2/repository/org/apache/jena/jena-core/2.11.0/jena-core-2.11.0.jar [echo] | |--/home/vagrant/.m2/repository/org/apache/jena/jena-iri/1.0.0/jena-iri-1.0.0.jar [echo] | |--/metacat/build/harvester.jar [echo] | |--/metacat/build/metacat-client.jar [echo] | |--/metacat/build/metacat.jar [javac] /metacat/build.xml:1099: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds [javac] Compiling 74 source files to /metacat/build/tests [javac] Note: Some input files use or override a deprecated API. [javac] Note: Recompile with -Xlint:deprecation for details. [javac] Note: Some input files use unchecked or unsafe operations. [javac] Note: Recompile with -Xlint:unchecked for details. [jar] Building jar: /metacat/build/metacat-junittests.jar runonetest: [echo] testtorun: SitemapTest [junit] WARNING: multiple versions of ant detected in path for junit [junit] jar:file:/usr/share/ant/lib/ant.jar!/org/apache/tools/ant/Project.class [junit] and jar:file:/metacat/lib/maven/ant-1.7.1.jar!/org/apache/tools/ant/Project.class [junit] log4j:ERROR setFile(null,true) call failed. [junit] java.io.FileNotFoundException: (No such file or directory) [junit] at java.io.FileOutputStream.open(Native Method) [junit] at java.io.FileOutputStream.(FileOutputStream.java:221) [junit] at java.io.FileOutputStream.(FileOutputStream.java:142) [junit] at org.apache.log4j.FileAppender.setFile(FileAppender.java:294) [junit] at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:165) [junit] at org.apache.log4j.DailyRollingFileAppender.activateOptions(DailyRollingFileAppender.java:223) [junit] at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:307) [junit] at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:172) [junit] at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:104) [junit] at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:842) [junit] at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:768) [junit] at org.apache.log4j.PropertyConfigurator.parseCatsAndRenderers(PropertyConfigurator.java:672) [junit] at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:516) [junit] at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:580) [junit] at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:526) [junit] at org.apache.log4j.LogManager.(LogManager.java:127) [junit] at org.apache.log4j.Logger.getLogger(Logger.java:117) [junit] at edu.ucsb.nceas.metacat.properties.PropertyService.(PropertyService.java:74) [junit] at edu.ucsb.nceas.MCTestCase.(MCTestCase.java:116) [junit] at java.lang.Class.forName0(Native Method) [junit] at java.lang.Class.forName(Class.java:195) [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:335) [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:911) [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:768) [junit] log4j:ERROR Either File or DatePattern options are not set for appender [replication]. [junit] SLF4J: Class path contains multiple SLF4J bindings. [junit] SLF4J: Found binding in [jar:file:/metacat/lib/maven/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class] [junit] SLF4J: Found binding in [jar:file:/home/vagrant/.m2/repository/org/slf4j/slf4j-log4j12/1.6.1/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class] [junit] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. [junit] Could not get PropertyService instance in static block: General properties problem while loading properties: Could not save properties: Could not write property file. File: /var/lib/tomcat7/webapps/metacat/WEB-INF/metacat.properties is not writable. [junit] Running edu.ucsb.nceas.metacattest.SitemapTest [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0.028 sec BUILD SUCCESSFUL Total time: 1 minute 19 seconds ```

This makes sense if I'm right in assuming that the tests are being run from the user I'm initiating ant from (which, in my case, is a user called vagrant). My /var/lib/tomcat7/webapps/metacat/WEB-INF dir has the following privs on metacat.properties:

-rw-r--r--  1 tomcat7 tomcat7 35927 Jul 26 00:07 metacat.properties

Seeing that, I decided to run the above ant command via sudo and, lo and behold, the test ran fine and succeeded.

My setup for running ant and deploying/testing Metacat is an Ubuntu trusty VM running under VirtualBox. Metacat is configured and working fine AFAICT (tested by creating a Data Package). It's just the tests that aren't working.

Any ideas as to why the tests need to be run via sudo and if this is expected behavior?

taojing2002 commented 6 years ago

Hi Bryce. The /var/lib/tomcat7/webapps/metacat/WEB-INF/metacat.properties should be writable by the the user who initialize the junit test. I believe when a file is loaded as a java property file, the file should be writable.

amoeba commented 6 years ago

Thanks for confirming @taojing2002 . Do you know why the JUnit tests need to modify metacat.properties? If we can't avoid it, do you mind if I document this requirement in the testing docs to save others time in the future?