JQL Query in Confluence "Unable to generate JSON output" for more than one JIRA 5.0.6 Issue
Asked by jhgorse:

JIRA 5.0.6  
Confluence 4.2.6  
Host: ESXi 4.1  
Guest OS: FreeBSD 9.0, openjdk6-b24, Apache 2.2 mod_proxy and name-based virtual host to wiki.domain.tld \& jira.domain.tld

While following these documented processes for inserting the results of a JQL query

* Step 5: <https://confluence.atlassian.com/display/ATLAS/Dragons+Stage+3+-+Install+Confluence#DragonsStage3-InstallConfluence-Step5AddSomeJIRAIssuestoyourConfluencePage>
* <https://confluence.atlassian.com/display/DOC/Inserting+JIRA+Issues>
* <https://confluence.atlassian.com/display/DOC/JIRA+Issues+Macro>

the Jira Issues Macro, such as project = DRA on the Confluence Page never gets past this error message once it attempts to render the page:

**Unable to generate JSON output class java.io.IOException**

The EDIT page properly shows the macro JIRA \| project = DRA. The EDIT and Rendered Page show individual JIRA Issues perfectly, just not the list.

Anonymous access to JIRA Issues does not resolve the issue.

**Below is a snippet of the logs/atlassian-confluence.log:**

```
2012-07-05 11:46:00,949 WARN [http-8090-9] [confluence.extra.jira.JiraIssuesServlet] doGet An IO Exception has been encountered: Unable to generate JSON output -- url: /plugins/servlet/issue-retriever | userName: admin | referer: http://wiki.domain.tld/display/DRA/Dashboardjava.io.IOException: Unable to generate JSON output	at com.atlassian.confluence.extra.jira.JsonFlexigridResponseGenerator.generate(JsonFlexigridResponseGenerator.java:324)	at com.atlassian.confluence.extra.jira.JiraIssuesServlet.getResult(JiraIssuesServlet.java:210)	at com.atlassian.confluence.extra.jira.JiraIssuesServlet.doGet(JiraIssuesServlet.java:120)	at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)... snip...	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)	at java.lang.Thread.run(Thread.java:679)Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1	at java.lang.String.substring(String.java:1949)	at com.atlassian.confluence.extra.jira.JsonFlexigridResponseGenerator.getOutputAsString(JsonFlexigridResponseGenerator.java:269)	at com.atlassian.confluence.extra.jira.JsonFlexigridResponseGenerator.generate(JsonFlexigridResponseGenerator.java:320)	... 132 more
```

Request support for how to further troubleshoot and ultimately resolve the perceived lack of JQL functionality in Confluence.

Cheers,  
Joe

P.S. Please use the same markup/down between Answers Atlassian and Confluence/JIRA from Support.


Answers:
author: jhgorse
body: [Mr. Kazatchkov](https://studio.plugins.atlassian.com/browse/CONFJIRA-226?focusedCommentId=59767&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-59767) correctly identified this as a bug with the default language in JIRA being English (en) as opposed to either English UK (en-uk) or English US (en-us). Apparently, the lack of the "-" character causes this StringIndexOutOfBoundsException.

[Change the default Language in JIRA](https://confluence.atlassian.com/display/JIRA050/Choosing+a+Default+Language#ChoosingaDefaultLanguage-Changingthedefaultlanguage) from English (Default) to English US did the trick for me.

A big thanks to the Atlassian Support Team for identifying the fix! Great job.


author: Mik_P
body: I already have English UK/US but an issue appears with one particular jira-issue.

Any ideas what should I check in current jira-issue to avoid an error?


author: Eric Wang
body: How to fix, the default language is Chinese.

comments: author: Eric Wang
body: How to fix, the default language is Chinese.


Tags: dragonslayer

integration

issue

macro