Search code examples
javadspaceoai

java.net.UnknownHostException harvest Dspace collection


I'm trying to harvest a collection in Dspace. I'm behind a proxy, I configured the system proxy and the Dspace proxy:

#### Proxy Settings ######
# uncomment and specify both properties if proxy server required
# proxy server for external http requests - use regular hostname without port number
http.proxy.host = 127.0.0.1

# port number of proxy server
http.proxy.port = 3131

I created a collection and set the harvest parameters:

1. I marked the collection for harvest
2. OAI Provider: http://<the_site_url>/oai/request
3. OAI Id: col_DICT_35

I executed in the terminal:

/dspace/bin/dspace harvest -g -S http://<the_site_url>/oai/request -i col_DICT_35

And the log file say:

org.dspace.harvest.OAIHarvester @ Collections ready for immediate harvest: [44]

But when i try:

/dspace/bin/dspace harvest -r -e [email protected] -c <local_collection_handle>

I have the error:

java.net.UnknownHostException: <the_site_url>
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    at java.net.Socket.connect(Socket.java:589)
    at java.net.Socket.connect(Socket.java:538)
    at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:211)
    at sun.net.www.http.HttpClient.New(HttpClient.java:308)
    at sun.net.www.http.HttpClient.New(HttpClient.java:326)
    at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1169)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1105)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:999)
    at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:933)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1513)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)
    at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
    at ORG.oclc.oai.harvester2.verb.HarvesterVerb.harvest(HarvesterVerb.java:209)
    at ORG.oclc.oai.harvester2.verb.HarvesterVerb.<init>(HarvesterVerb.java:183)
    at ORG.oclc.oai.harvester2.verb.Identify.<init>(Identify.java:48)
    at org.dspace.harvest.OAIHarvester.oaiGetDateGranularity(OAIHarvester.java:794)
    at org.dspace.harvest.OAIHarvester.runHarvest(OAIHarvester.java:250)
    at org.dspace.app.harvest.Harvest.runHarvest(Harvest.java:425)
    at org.dspace.app.harvest.Harvest.main(Harvest.java:175)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:226)
    at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:78)

Any help ? Thanks in advance.


Solution

  • I configure the JAVA proxy settings in $JAVA_HOME/jre/lib/net.properties and work perfect !