TRAC import error from getValueCountForField

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Symptoms

When importing your TRAC information into JIRA you run into an error stating:

1 "org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getValueCountForField' in class com.atlassian.jira.plugins.importer.imports.config.ValueMappingHelperImpl threw exception class java.lang.NullPointerException : null"

The following appears in the atlassian-jira.log:

1 2 3 4 5 2012-03-16 09:32:05,141 http-8080-1 ERROR user 572x253x1 7eiqcd 127.0.0.1 /secure/admin/views/ImporterFieldMappingsPage!default.jspa [plugins.importer.web.ImporterFieldMappingsPage] com.atlassian.jira.plugins.importer.SQLRuntimeException: Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. 2012-03-16 09:32:05,141 http-8080-1 ERROR user 572x253x1 7eiqcd 127.0.0.1 /secure/admin/views/ImporterFieldMappingsPage!default.jspa [velocity] Method getValueCountForField threw exception for reference $action in template templates/admin/views/common/importerFieldMappingsPage.vm at [26,22] 2012-03-16 09:32:05,141 http-8080-1 ERROR user 572x253x1 7eiqcd 127.0.0.1 /secure/admin/views/ImporterFieldMappingsPage!default.jspa [com.atlassian.velocity.DefaultVelocityManager] MethodInvocationException occurred getting message body from Velocity: java.lang.NullPointerException java.lang.NullPointerException

Cause

Your TRAC import file references the database where TRAC data is stored. JIRA does not have access to the database and as a result will not be able to pull data.

You can diagnose this issue by taking a look at your TRAC export. Unzip the contents and take a look /<trac_unzip>/conf/trac.ini file. You should see a [trac] section with the following type of information.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 [trac] authz_file = authz_module_name = auto_reload = False base_url = http://trac.mytrac.com/trac check_auth_ip = true database = mysql://trac:user@localhost:3306/trac default_charset = iso-8859-15 htdocs_location = ignore_auth_case = false mainnav = wiki,timeline,roadmap,browser,tickets,newticket,search metanav = login,logout,prefs,help,about permission_store = DefaultPermissionStore repository_dir = repository_type = show_email_addresses = false timeout = 20

Resolution

Make sure your JIRA server can communicate with the database server for your TRAC instance. If your database is stored on another server, sql dump and restore the database somewhere that JIRA can reach.

Also make sure you are using the latest MySQL JDBC driver listed here.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.