Cannot log in to Studio when Nexus 3 is in a hang state

Problem Description

Talend Administration Center uses Nexus 3, and you cannot log in to Studio when Nexus is in a hang state. The following window is displayed until you restart Nexus.



Root Cause

When you start Studio, Nexus auto synchronizes with .m2. If Nexus is in a hang state, the synchronization process does not stop.


In this case, a debug trace of nexus.log shows the following error:

2020-02-18 00:32:06,668-0500 DEBUG [qtp1207847155-2976] admin - Unable to acquire connection from main pool, trying overflow
java.lang.IllegalStateException: You have reached maximum pool size for given partition
at com.orientechnologies.orient.core.db.OPartitionedDatabasePool.acquire(
at$ Source)


Nexus 3 uses OrientDB, and when the number of connections exceeds the database max connection pool size, it causes Nexus to hang.



To resolve this issue you need to update the Nexus search script with tx.close() and increase the OrientDB max connection pool size.

  1. To update the search script, log in to the Nexus Repository Manager (http://hostname:8081/) as admin and perform the following:

    1. Click the Server Administration and Configuration button.

    2. Select the API option from the System menu.

    3. Click Update stored script by name.

    4. Enter search in the name box and update the stored script with tx.close() in the body text box.

      If you do not have the search script, you can copy and paste the following updated search script that includes tx.close() after tx.commit():

      { "name": "search", "content": "import; import; import; import groovy.json.JsonOutput; import groovy.json.JsonSlurper; def search = new JsonSlurper().parseText(args);'search arguments: ' + args); def repositoryId = search.repositoryId; def groupId = search.g; def artifactId = search.a; def version = search.v; def data = []; def repo = repository.repositoryManager.get(repositoryId); StorageFacet storageFacet = repo.facet(StorageFacet); def tx = storageFacet.txSupplier().get(); tx.begin(); def builder = Query.builder(); if(groupId != null){ builder.where('group = ').param(groupId); }; if(version != null){ if(builder.hasWhere()){ builder.and('version = ').param(version); }else{ builder.where('version = ').param(version); } }; if(artifactId != null){ artifactId =[artifactId];'artifactId: ' + artifactId); if(builder.hasWhere()){ builder.and('name in ').param(artifactId); }else{ builder.where('name in ').param(artifactId); } }; def query = ;'query: ' + query.getParameters());'query: ' + query.getWhere()); def components = tx.findComponents(query , [repo]); components.each{ ArtifactResult artifact = new ArtifactResult(); artifact.groupId = it.attributes().child('maven2').get('groupId'); artifact.artifactId = it.attributes().child('maven2').get('artifactId'); artifact.version = it.attributes().child('maven2').get('baseVersion'); artifact.extension = it.attributes().child('maven2').get('packaging'); artifact.last_updated = it.lastUpdated(); artifact.description = it.attributes().child('maven2').get('pom_description');'search arguments: ' + it.attributes());'search getProperties: ' + it.getProperties());'search getEntityMetadata: ' + it.getEntityMetadata());'search getMetaPropertyValues: ' + it.getMetaPropertyValues()); data << artifact; }; tx.commit(); tx.close(); return JsonOutput.toJson(data); class ArtifactResult{ String groupId; String artifactId; String version; String extension; String last_updated; String description; } ", "type": "groovy" }
    5. Click the Try it out button to update the script.



  2. Increase the OrientDB max connection pool size.

    1. Edit the file located at C:\Talend\7.x.x\tac\Artifact-Repository-Nexus-3.15.2-01-win64\nexus-3.15.2-01\etc\karaf.

    2. Add the db.pool.max=1000 property as the last line.

    3. Save the file and restart Nexus.

Version history
Revision #:
13 of 13
Last update:
‎05-08-2020 03:35 PM
Updated by: