Category Archives: Uncategorized

Nexus: Remote host closed connection during handshake

If you have below exception, you should probably update Maven to a newer version!

Caused by: org.apache.maven.artifact.deployer.ArtifactDeploymentException: Faile
d to retrieve remote metadata nl:parent:1.18-SNAPSHO
T/maven-metadata.xml: Could not transfer metadata nl:parent:1.18-SNAPSHOT/maven-metadata.xml from/to corporateRepo (https://maven.company.nl/nexus/content/repositories/rib-snapshot): Remote host closed connectio
n during handshake
at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(Def
aultArtifactDeployer.java:141)
at org.apache.maven.plugin.deploy.AbstractDeployMojo.deploy(AbstractDepl
oyMojo.java:171)
at org.apache.maven.plugin.deploy.DeployMojo.deployProject(DeployMojo.ja
va:242)
… 22 more
Caused by: org.sonatype.aether.deployment.DeploymentException: Failed to retriev
e remote metadata nl:parent:1.18-SNAPSHOT/maven-meta
data.xml: Could not transfer metadata nl:parent:1.18
-SNAPSHOT/maven-metadata.xml from/to corporateRepo (https://maven.company.nl/ne
xus/content/repositories/rib-snapshot): Remote host closed connection during han
dshake
at org.sonatype.aether.impl.internal.DefaultDeployer.upload(DefaultDeplo
yer.java:403)
at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeplo
yer.java:256)
at org.sonatype.aether.impl.internal.DefaultDeployer.deploy(DefaultDeplo
yer.java:211)
at org.sonatype.aether.impl.internal.DefaultRepositorySystem.deploy(Defa
ultRepositorySystem.java:443)
at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(Def
aultArtifactDeployer.java:137)
… 24 more
Caused by: org.sonatype.aether.transfer.MetadataTransferException: Could not tra
nsfer metadata nl.company.gict.rib.emandates:parent:1.18-SNAPSHOT/maven-metadat
a.xml from/to corporateRepo (https://maven.company.nl/nexus/content/repositorie
s/rib-snapshot): Remote host closed connection during handshake
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$3.wrap(W
agonRepositoryConnector.java:930)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$3.wrap(W
agonRepositoryConnector.java:920)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.
run(WagonRepositoryConnector.java:669)
at org.sonatype.aether.util.concurrency.RunnableErrorForwarder$1.run(Run
nableErrorForwarder.java:60)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
utor.java:908)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:931)
at java.lang.Thread.run(Thread.java:773)
Caused by: org.apache.maven.wagon.TransferFailedException: Remote host closed co
nnection during handshake
at org.apache.maven.wagon.shared.http4.AbstractHttpClientWagon.fillInput
Data(AbstractHttpClientWagon.java:799)
at org.apache.maven.wagon.StreamWagon.getInputStream(StreamWagon.java:11
6)
at org.apache.maven.wagon.StreamWagon.getIfNewer(StreamWagon.java:88)
at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:61)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.
run(WagonRepositoryConnector.java:601)
… 4 more
Caused by: javax.net.ssl.SSLHandshakeException: Remote host closed connection du
ring handshake
at com.ibm.jsse2.SSLSocketImpl.a(SSLSocketImpl.java:412)
at com.ibm.jsse2.SSLSocketImpl.h(SSLSocketImpl.java:643)
at com.ibm.jsse2.SSLSocketImpl.a(SSLSocketImpl.java:529)
at com.ibm.jsse2.k.write(k.java:3)
at org.apache.maven.wagon.providers.http.httpclient.impl.io.AbstractSess
ionOutputBuffer.flushBuffer(AbstractSessionOutputBuffer.java:131)
at org.apache.maven.wagon.providers.http.httpclient.impl.io.AbstractSess
ionOutputBuffer.flush(AbstractSessionOutputBuffer.java:138)
at org.apache.maven.wagon.providers.http.httpclient.impl.AbstractHttpCli
entConnection.doFlush(AbstractHttpClientConnection.java:270)
at org.apache.maven.wagon.providers.http.httpclient.impl.AbstractHttpCli
entConnection.flush(AbstractHttpClientConnection.java:275)
at org.apache.maven.wagon.providers.http.httpclient.impl.conn.AbstractCl
ientConnAdapter.flush(AbstractClientConnAdapter.java:197)
at org.apache.maven.wagon.providers.http.httpclient.protocol.HttpRequest
Executor.doSendRequest(HttpRequestExecutor.java:258)
at org.apache.maven.wagon.providers.http.httpclient.protocol.HttpRequest
Executor.execute(HttpRequestExecutor.java:123)
at org.apache.maven.wagon.providers.http.httpclient.impl.client.DefaultR
equestDirector.tryExecute(DefaultRequestDirector.java:645)
at org.apache.maven.wagon.providers.http.httpclient.impl.client.DefaultR
equestDirector.execute(DefaultRequestDirector.java:464)
at org.apache.maven.wagon.providers.http.httpclient.impl.client.Abstract
HttpClient.execute(AbstractHttpClient.java:820)
at org.apache.maven.wagon.providers.http.httpclient.impl.client.Abstract
HttpClient.execute(AbstractHttpClient.java:754)
at org.apache.maven.wagon.shared.http4.AbstractHttpClientWagon.execute(A
bstractHttpClientWagon.java:674)
at org.apache.maven.wagon.shared.http4.AbstractHttpClientWagon.fillInput
Data(AbstractHttpClientWagon.java:793)
… 8 more
Caused by: java.io.EOFException: SSL peer shut down incorrectly
at com.ibm.jsse2.b.a(b.java:200)
at com.ibm.jsse2.SSLSocketImpl.a(SSLSocketImpl.java:209)
… 24 more

Nexus – java.io.EOFException: No content to map to Object due to end of input

Sometimes this issue occurs when restarting Nexus [my version is 2.0.5].

The following steps to clean Nexus mostly help to get it up and running again

# Clear archetype-metadata.xml
– Goto /sonatype-work/nexus/storage
– perform the following command “rm **/*/archetype-metadata.xml

# Clear repository-metadata.xml
– Goto /sonatype-work/nexus/storage
– perform the following command “rm **/*/repository-metadata.xml

# Clean .nexus/attributes directories with size 0
– Goto /sonatype-work/nexus/storage
– perform the following command “find . -type f -size 0 |xargs rm”

After this, restart the service via ” sudo service nexus restart”

Jira and a Reverse proxy

You might have a similar issue: when you want to install Jira, the default port for web servers (80) is already occupied.  Therefore you have to install Jira under a less common port. Due to company restrictions this port might be blocked due to safety reasons.

Solution: setup a reverse proxy. In this example we have Jira running on <example ip>:9004 which we want to make available through http://atlassian.<example>.com/jira

First step is to configure the base url in Jira (“Administration” -> “General Configuration”) to the value of “http://atlassian.<example>.com/jira”

Second step is to configure the apache server [httpd.conf]

LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so
LoadModule headers_module /usr/lib/apache2/modules/mod_headers.so

ProxyPass /jira http://<example ip>:9004/jira
ProxyPassReverse /jira http://<example ip>:9004/jira

Step 3 is to restart the apache server

Now you will see that most functionality of Jira is already available through “http://atlassian.<example>.com/jira”. For example gadgets will not work yet because of the REST interface. Now the following error will be given

com.atlassian.gadgets.dashboard.internal.diagnostics.UrlHostnameMismatchException: Detected URL hostname, '<example ip>', does not match expected hostname, 'atlassian.<example>.nl'
	at com.atlassian.gadgets.dashboard.internal.diagnostics.Diagnostics.checkExpectedHostname(Diagnostics.java:71)
	at com.atlassian.gadgets.dashboard.internal.diagnostics.Diagnostics.check(Diagnostics.java:32)
	at com.atlassian.gadgets.dashboard.internal.diagnostics.DiagnosticsServlet.executeDiagnostics(DiagnosticsServlet.java:93)
	at com.atlassian.gadgets.dashboard.internal.diagnostics.DiagnosticsServlet.doPost(DiagnosticsServlet.java:61)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
	at com.atlassian.plugin.servlet.DelegatingPluginServlet.service(DelegatingPluginServlet.java:42)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
	at com.atlassian.plugin.servlet.ServletModuleContainerServlet.service(ServletModuleContainerServlet.java:52)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)

To fix this, one additional step needs to be performed.

Step 4 is to change <jira installation directory>\conf\server.xml in which to add the proxyName and proxyPort attribute

<Connector port="9004" proxyName="atlassian.gjdb.nl" proxyPort="80"

and set the path to the value of “jira”

<Context path="/jira" docBase="${catalina.home}/atlassian-jira" reloadable="false" useHttpOnly="true">

Step 5 – the final one – is to restart Jira