Search code examples
springmavenantdspace

Unable to disable Google Analytics via Spring to address DS-2718 (failed GA connections prevent file downloads) when building DSpace 5.3 with Mirage 2


I'm working on a fresh installation of stock DSpace 5.3 (Windows Server 2012, Tomcat 8.0, Maven 3.2.5, Ant 1.9.6). This particular instance will be a dark archive without Google Analytics enabled; we don't currently have a GA account or analytics key, although we plan to register one eventually for a separate public-facing instance.

As per the problem described in JIRA ticket DS-2718, DSpace hangs with the following message in dspace.log when I attempt to download a bitstream:

2015-10-20 09:52:02,324 INFO org.apache.http.impl.execchain.RetryExec @ I/O exception (java.net.SocketException) caught when processing request to {s}->https://www.google-analytics.com:443: Network is unreachable: connect

2015-10-20 09:52:02,324 INFO org.apache.http.impl.execchain.RetryExec @ Retrying request to {s}->https://www.google-analytics.com:443

Since we won't be using GA on this instance, disabling it in Spring is a good workaround until the issue is resolved. As per the instructions, I commented out the Google Analytics entry in dspace-5.3-src-release\dspace-xmlui\src\main\webapp\WEB-INF\spring\applicationContext.xml, disabled Tomcat and rebuilt DSpace. An initial attempt running mvn package -Dmirage2.on=true still produced the problem, so I tried a "ground up" rebuild:

cd d:\dspace-5.3-src-release\dspace
mvn clean package -U -Dmirage2.on=true
[successful build]
cd d:\dspace-5.3-src-release\dspace\target\dspace-installer
ant update
[successful update]
[copy webapps to Tomcat 8.0\webapps and start Tomcat]

Even after the rebuild, however, I'm still getting the same error, with the same java.net.SocketException in dspace.log.

Not sure why this isn't working. Have I missed a step or setting in the rebuild process so that the change to applicationContext.xml isn't being applied?

FWIW, I tried grepping for "google" in dspace-5.3-src-release\dspace-xmlui-mirage2 to see if this could be a Mirage 2 problem, but I don't see anything that looks relevant.


Solution

  • The issue resolved itself after I ran mvn clean -Dmirage2.on=true in both [dspace-src] and [dspace-src]\dspace. I'm guessing that the issue originated on our end due to someone running a maven build from the wrong directory.

    I've also removed the default key from dspace-defaults.cfg as suggested. Everything's now working.