Error: java.lang.IllegalStateException: Duplicate key topic-id-1.dita
See original GitHub issueIf in a *.ditamap file a *.dita file that contains <keyword keyref="..."/>
is referenced more than twice then dita-ot-2.4.1 fails with following error: Error: java.lang.IllegalStateException: Duplicate key
topic-id-1.dita
Steps to reproduce:
- Create following files:
map.ditamap:
<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "dtd/map.dtd">
<map title="Error: java.lang.IllegalStateException: Duplicate key topic-id-1.dita">
<topicref href="topic.dita"/>
<topicref href="topic.dita"/>
<topicref href="topic.dita"/>
<keydef keys="VAR">
<topicmeta><keywords><keyword>value</keyword></keywords></topicmeta>
</keydef>
</map>
topic.dita:
<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN" "dtd/concept.dtd">
<concept id="topic-id">
<title>Topic</title>
<shortdesc>Lorem ipsum</shortdesc>
<conbody><p><keyword keyref="VAR"/></p></conbody>
</concept>
- Run dita-ot:
dita -f html5 -i map.ditamap
Results:
- Actual: no output is generated; processing fails with following error:
Error: java.lang.IllegalStateException: Duplicate key topic-1.dita
- Expected: in out/ at least the files index.html and topic.html should be created (see #2363 if the files topic-1.html and topic-2.html should also be created)
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Java 8 toMap IllegalStateException Duplicate Key
The pramodh's answer is good if you want to map your value to 1. But in case you don't want to always map...
Read more >IllegalStateException: Duplicate key error Virtual Agent
It is present in a different model. - There are no duplicate script variables. - There are no duplicate Intents. Though the topic...
Read more >"java.lang.IllegalStateException: Duplicate key [name=网店 ...
This issue is caused because the ENUM language that was used earlier is missing. Solution.
Read more >Internal error: (java.lang.IllegalStateException) Duplicate key
Internal error: (java.lang.IllegalStateException) Duplicate key ... Update: The exception has disappeared after right click on parent pom.xml -> Maven -> Reimport ...
Read more >Indexing failed for Entity - Caused by: java.lang ...
Summary. The reindex fails due to the following exception: java.lang.IllegalStateException: Duplicate key 3 ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The fix proposed by @raducoravu would work around the null pointer, but would not fix the underlying issue. The duplicates need to be detected earlier on.
The code in the adjustResourceRenames could be re-written to accept duplicates in the created map like: