Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JAXBException when loading a .docx file #24

Closed
nanocom opened this issue Jul 31, 2012 · 4 comments
Closed

JAXBException when loading a .docx file #24

nanocom opened this issue Jul 31, 2012 · 4 comments

Comments

@nanocom
Copy link
Contributor

nanocom commented Jul 31, 2012

Hi, I'm having an exception when loading a .docx file.
I tried to open a newly created .docx file, the stack didn't show up.
I deleted everything in the .docx file that made the stack happen, and the stack was still there. Watched the underlying xml, and word keeps a relation on the footer even when I ask to delete it. I think the footer is the problematic part.
If I open the document twice, the stack doesn't appear the second time.
Any ideas?
Might be related to this issue: #19
Here is the stack:

ERROR , Cannot initialize context
javax.xml.bind.JAXBException: "org.plutext.jaxb.xmldsig" doesnt contain ObjectFactory.class or jaxb.index
at com.sun.xml.internal.bind.v2.ContextFactory.createContext(ContextFactory.java:186)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:128)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:290)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:372)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:337)
at org.docx4j.jaxb.Context.(Context.java:97)
at org.docx4j.openpackaging.contenttype.ContentTypeManager.parseContentTypesFile(ContentTypeManager.java:658)
at org.docx4j.openpackaging.io.LoadFromZipNG.process(LoadFromZipNG.java:206)
at org.docx4j.openpackaging.io.LoadFromZipNG.get(LoadFromZipNG.java:193)
at org.docx4j.openpackaging.packages.OpcPackage.load(OpcPackage.java:301)
at org.docx4j.openpackaging.packages.OpcPackage.load(OpcPackage.java:245)
at org.docx4j.openpackaging.packages.OpcPackage.load(OpcPackage.java:195)
at org.docx4j.openpackaging.packages.OpcPackage.load(OpcPackage.java:178)
at org.docx4j.openpackaging.packages.WordprocessingMLPackage.load(WordprocessingMLPackage.java:172)

@nanocom
Copy link
Contributor Author

nanocom commented Jul 31, 2012

Edit: I deleted manually the relation to the footer, still having the problem.
I thing it's related to the stylesWithEffects.xml relation.
Edit: Now I've put exactly the same word/_rels/document.xml.rels in both documents, still having the issue.

@nanocom
Copy link
Contributor Author

nanocom commented Jul 31, 2012

And below is the exact difference between both word/stylesWithEffects.xml : the problematic document is the same as the "normal" one, except that it adds those styles (note that I have a french Word).
Please note that I always get the same warning when opening this document: WARN newPartForContentType, DefaultPart used for part '/word/stylesWithEffects.xml' of content type 'application/vnd.ms-word.stylesWithEffects+xml'

<w:style w:type="paragraph" w:styleId="En-tte">
    <w:name w:val="header"/>
    <w:basedOn w:val="Normal"/>
    <w:link w:val="En-tteCar"/>
    <w:uiPriority w:val="99"/>
    <w:unhideWhenUsed/>
    <w:rsid w:val="00185AA3"/>
    <w:pPr>
      <w:tabs>
        <w:tab w:val="center" w:pos="4536"/>
        <w:tab w:val="right" w:pos="9072"/>
      </w:tabs>
      <w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
    </w:pPr>
  </w:style>
  <w:style w:type="character" w:customStyle="1" w:styleId="En-tteCar">
    <w:name w:val="En-tête Car"/>
    <w:basedOn w:val="Policepardfaut"/>
    <w:link w:val="En-tte"/>
    <w:uiPriority w:val="99"/>
    <w:rsid w:val="00185AA3"/>
  </w:style>
  <w:style w:type="paragraph" w:styleId="Pieddepage">
    <w:name w:val="footer"/>
    <w:basedOn w:val="Normal"/>
    <w:link w:val="PieddepageCar"/>
    <w:uiPriority w:val="99"/>
    <w:unhideWhenUsed/>
    <w:rsid w:val="00185AA3"/>
    <w:pPr>
      <w:tabs>
        <w:tab w:val="center" w:pos="4536"/>
        <w:tab w:val="right" w:pos="9072"/>
      </w:tabs>
      <w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
    </w:pPr>
  </w:style>
  <w:style w:type="character" w:customStyle="1" w:styleId="PieddepageCar">
    <w:name w:val="Pied de page Car"/>
    <w:basedOn w:val="Policepardfaut"/>
    <w:link w:val="Pieddepage"/>
    <w:uiPriority w:val="99"/>
    <w:rsid w:val="00185AA3"/>
  </w:style>
  <w:style w:type="table" w:styleId="Grilledutableau">
    <w:name w:val="Table Grid"/>
    <w:basedOn w:val="TableauNormal"/>
    <w:uiPriority w:val="59"/>
    <w:rsid w:val="00E9410D"/>
    <w:pPr>
      <w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
    </w:pPr>
    <w:tblPr>
      <w:tblInd w:w="0" w:type="dxa"/>
      <w:tblBorders>
        <w:top w:val="single" w:sz="4" w:space="0" w:color="auto"/>
        <w:left w:val="single" w:sz="4" w:space="0" w:color="auto"/>
        <w:bottom w:val="single" w:sz="4" w:space="0" w:color="auto"/>
        <w:right w:val="single" w:sz="4" w:space="0" w:color="auto"/>
        <w:insideH w:val="single" w:sz="4" w:space="0" w:color="auto"/>
        <w:insideV w:val="single" w:sz="4" w:space="0" w:color="auto"/>
      </w:tblBorders>
      <w:tblCellMar>
        <w:top w:w="0" w:type="dxa"/>
        <w:left w:w="108" w:type="dxa"/>
        <w:bottom w:w="0" w:type="dxa"/>
        <w:right w:w="108" w:type="dxa"/>
      </w:tblCellMar>
    </w:tblPr>
  </w:style>
  <w:style w:type="character" w:styleId="Marquedecommentaire">
    <w:name w:val="annotation reference"/>
    <w:basedOn w:val="Policepardfaut"/>
    <w:uiPriority w:val="99"/>
    <w:semiHidden/>
    <w:unhideWhenUsed/>
    <w:rsid w:val="00AE47AD"/>
    <w:rPr>
      <w:sz w:val="16"/>
      <w:szCs w:val="16"/>
    </w:rPr>
  </w:style>
  <w:style w:type="paragraph" w:styleId="Commentaire">
    <w:name w:val="annotation text"/>
    <w:basedOn w:val="Normal"/>
    <w:link w:val="CommentaireCar"/>
    <w:uiPriority w:val="99"/>
    <w:semiHidden/>
    <w:unhideWhenUsed/>
    <w:rsid w:val="00AE47AD"/>
    <w:pPr>
      <w:spacing w:line="240" w:lineRule="auto"/>
    </w:pPr>
    <w:rPr>
      <w:sz w:val="20"/>
      <w:szCs w:val="20"/>
    </w:rPr>
  </w:style>
  <w:style w:type="character" w:customStyle="1" w:styleId="CommentaireCar">
    <w:name w:val="Commentaire Car"/>
    <w:basedOn w:val="Policepardfaut"/>
    <w:link w:val="Commentaire"/>
    <w:uiPriority w:val="99"/>
    <w:semiHidden/>
    <w:rsid w:val="00AE47AD"/>
    <w:rPr>
      <w:sz w:val="20"/>
      <w:szCs w:val="20"/>
    </w:rPr>
  </w:style>
  <w:style w:type="paragraph" w:styleId="Objetducommentaire">
    <w:name w:val="annotation subject"/>
    <w:basedOn w:val="Commentaire"/>
    <w:next w:val="Commentaire"/>
    <w:link w:val="ObjetducommentaireCar"/>
    <w:uiPriority w:val="99"/>
    <w:semiHidden/>
    <w:unhideWhenUsed/>
    <w:rsid w:val="00AE47AD"/>
    <w:rPr>
      <w:b/>
      <w:bCs/>
    </w:rPr>
  </w:style>
  <w:style w:type="character" w:customStyle="1" w:styleId="ObjetducommentaireCar">
    <w:name w:val="Objet du commentaire Car"/>
    <w:basedOn w:val="CommentaireCar"/>
    <w:link w:val="Objetducommentaire"/>
    <w:uiPriority w:val="99"/>
    <w:semiHidden/>
    <w:rsid w:val="00AE47AD"/>
    <w:rPr>
      <w:b/>
      <w:bCs/>
      <w:sz w:val="20"/>
      <w:szCs w:val="20"/>
    </w:rPr>
  </w:style>
  <w:style w:type="paragraph" w:styleId="Textedebulles">
    <w:name w:val="Balloon Text"/>
    <w:basedOn w:val="Normal"/>
    <w:link w:val="TextedebullesCar"/>
    <w:uiPriority w:val="99"/>
    <w:semiHidden/>
    <w:unhideWhenUsed/>
    <w:rsid w:val="00AE47AD"/>
    <w:pPr>
      <w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
    </w:pPr>
    <w:rPr>
      <w:rFonts w:ascii="Tahoma" w:hAnsi="Tahoma" w:cs="Tahoma"/>
      <w:sz w:val="16"/>
      <w:szCs w:val="16"/>
    </w:rPr>
  </w:style>
  <w:style w:type="character" w:customStyle="1" w:styleId="TextedebullesCar">
    <w:name w:val="Texte de bulles Car"/>
    <w:basedOn w:val="Policepardfaut"/>
    <w:link w:val="Textedebulles"/>
    <w:uiPriority w:val="99"/>
    <w:semiHidden/>
    <w:rsid w:val="00AE47AD"/>
    <w:rPr>
      <w:rFonts w:ascii="Tahoma" w:hAnsi="Tahoma" w:cs="Tahoma"/>
      <w:sz w:val="16"/>
      <w:szCs w:val="16"/>
    </w:rPr>
  </w:style>

@plutext
Copy link
Owner

plutext commented Jul 31, 2012

Does your pom contain:

    <dependency>
        <groupId>org.plutext</groupId>
        <artifactId>jaxb-xmldsig-core</artifactId>
        <version>1.0.0</version>
    </dependency>

@nanocom
Copy link
Contributor Author

nanocom commented Aug 1, 2012

My app is not using Maven, and I had forgottent this dep, thanks!

@nanocom nanocom closed this as completed Aug 1, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants