Page 1 of 1

docx4j and Jira: problems in dependencies?

PostPosted: Mon Sep 02, 2013 9:50 pm
by sormariano
Hello,
I posted the same question in Atlassian forum. Then I solved it by myself but I want to know now if am I doing something wrong with dependencies.
I created a standalone application using docx4j and all was working.
Then I needed to insert in into Jira and I created my plugin.
After some environment problems (I had to exclude xml-apis) to let the plugin start, I had problems in context declaration: It was always null and I got
Code: Select all
org.docx4j.openpackaging.exceptions.InvalidFormatException: Bad [Content_Types].xml


Then I put in my pom.xml

Code: Select all
<dependency>
    <groupId>javax.xml.bind</groupId>
    <artifactId>jaxb-api</artifactId>
    <version>2.1</version>
</dependency>
<dependency>
    <groupId>com.sun.xml.bind</groupId>
    <artifactId>jaxb-impl</artifactId>
    <version>2.1.3</version>
</dependency>


and all was ok. Now I'm using Java 7 and in docx4j pom.xml these two dependencies are commented and there is a note to uncomment them if using Java 5

Where is the problem? Am I doing something wrong? And why the standalone application worked without these dependencies?

Thank you in advance

Re: docx4j and Jira: problems in dependencies?

PostPosted: Mon Sep 02, 2013 10:17 pm
by jason
Java 6 and 7 include JAXB, so you shouldn't need an additional JAXB implementation on your class path.

What version of docx4j are you using?

Does JIRA run in an app server? If so, which one?

Re: docx4j and Jira: problems in dependencies?

PostPosted: Mon Sep 02, 2013 11:42 pm
by sormariano
I used the docx4j 2.8.1 and I'm running the Jira bundled installation; here is the log of starting Jira

Code: Select all
     JIRA Build                                    : 6.0.1
     JIRA Installation Type                        : Standalone
     Application Server                            : Apache Tomcat/7.0.29 - Servlet API 3.0
     Java Version                                  : 1.7.0_15 - Oracle Corporation

Re: docx4j and Jira: problems in dependencies?

PostPosted: Mon Sep 02, 2013 11:48 pm
by sormariano
By the way I said that the same code, used as standalone application works perfectly with no additional dependency
The only difference is that as standalone application I compiled it from the "Build" menu in eclipse, while now, as jira plugin, I'm using maven.
Then, after having verified that I got the document file I needed, I tried to make it work as jira plugin but I had the problems I reported.