Page 1 of 1

javax.xml.bind.PropertyException: name: com.sun.xml.internal

PostPosted: Thu Aug 16, 2012 9:08 pm
by anil_ah
Hi Jason,
i had checked out the code from branch 2.7.1 i was able to create the build using ant script.
but for 2.7.0 i was not able to make the build as dependecaies are not getting resolved.

so now i am using docx4j-.2.7.1 as per gitHub version available

That NPE has gone by manipulating hasCode method

i have two jar file in in my application for JAXB jaxb-impl-2.2.jar,jaxb-api-2.2.jar and JAVA 1.6.

i am getting the following error
Code: Select all
[2012-08-16 17:32:51,464][org.docx4j.jaxb.Context][ERROR][http-10008-1] [PANIC! No suitable JAXB implementation available]
[2012-08-16 17:32:54,730][org.docx4j.jaxb.Context][INFO][http-10008-1] [loading Context jc]
[2012-08-16 17:33:03,777][org.docx4j.jaxb.Context][INFO][http-10008-1] [loaded com.sun.xml.bind.v2.runtime.JAXBContextImpl .. loading others ..]
[2012-08-16 17:33:04,480][org.docx4j.jaxb.Context][INFO][http-10008-1] [.. others loaded ..]
[2012-08-16 17:33:04,542][org.docx4j.openpackaging.contenttype.ContentTypeManager][INFO][http-10008-1] [Detected WordProcessingML package ]
[2012-08-16 17:33:04,589][org.docx4j.openpackaging.parts.Part][INFO][http-10008-1] [/_rels/.rels]
[2012-08-16 17:33:04,589][org.docx4j.openpackaging.parts.relationships.RelationshipsPart][DEBUG][http-10008-1] [
]



javax.xml.bind.PropertyException: name: com.sun.xml.internal.bind.namespacePrefixMapper value: org.docx4j.jaxb.NamespacePrefixMapperSunInternal@16be8a0
        at javax.xml.bind.helpers.AbstractMarshallerImpl.setProperty(AbstractMarshallerImpl.java:338)
        at com.sun.xml.bind.v2.runtime.MarshallerImpl.setProperty(MarshallerImpl.java:533)
        at org.docx4j.jaxb.NamespacePrefixMapperUtils.getPrefixMapper(NamespacePrefixMapperUtils.java:53)
        at org.docx4j.jaxb.Context.<clinit>(Context.java:54)
        at org.docx4j.openpackaging.contenttype.ContentTypeManager.parseContentTypesFile(ContentTypeManager.java:643)
        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:225)
        at org.docx4j.openpackaging.packages.OpcPackage.load(OpcPackage.java:210)
        at org.docx4j.openpackaging.packages.WordprocessingMLPackage.load(WordprocessingMLPackage.java:184)



please find the attached log file for details.

please suggest how to resolve this

Thanks in Advance

Regards
Anil :cry:

Re: javax.xml.bind.PropertyException: name: com.sun.xml.inte

PostPosted: Thu Aug 16, 2012 9:43 pm
by jason
If you are using a Java 6 which ships with JAXB included, the only way to use the JAXB reference implementation is by using the endorsed directory mechanism.

Either of the following should work:

(1) remove your jars jaxb-impl-2.2.jar,jaxb-api-2.2.jar (in which case you'll be using the Java internal JAXB), or

(1) remove your jars jaxb-impl-2.2.jar,jaxb-api-2.2.jar from your path, and place them in an endorsed dir (in which case you'll be using the reference impl)

Re: javax.xml.bind.PropertyException: name: com.sun.xml.inte

PostPosted: Fri Aug 17, 2012 12:09 am
by anil_ah
hi Jason,
As u r Aware that i am facing this issue,since last two week,
but with same set up i never come across this bug,but when today i replaced the docx4j jar only ,it start happening

Any Idea for this?

(is github veriosn directory 2.7.1 is the docx4j-2.8.0)? as i put this build in my application today.

Earlier it was directory 2.7.0.



Regards
ANil

Re: javax.xml.bind.PropertyException: name: com.sun.xml.inte

PostPosted: Fri Aug 17, 2012 9:43 am
by jason
Did you try my advice? If so, what happened?

That 2.7.1 branch contains https://github.com/plutext/docx4j/commi ... 58a#docx4j which is probably why the behaviour is a bit different.

https://github.com/plutext/docx4j/blob/ ... Utils.java is better, so you could substitute that.

Is there anything stopping you from using docx4j 2.8.0 ?

(I'd feel more motivated to assist you, if you were trying to use the current release. With the older releases, you are pretty much on your own, given that you are not paying for support)

I should probably create a branch on github for 2.8.0, but in the meantime, the easiest way to get the 2.8.0 source code is from http://search.maven.org/remotecontent?f ... ources.jar

Re: javax.xml.bind.PropertyException: name: com.sun.xml.inte

PostPosted: Fri Aug 17, 2012 2:55 pm
by anil_ah
Hi Jason,
I could not try endorsed directory mechanism as this problem is Happeing on SIT environment on Webshphere.
we will check with Inrfa or Was Admin Team to do that. and will share with you.

However i will go with NamespacePrefixMapperUtils change and try.



Regards
Anil

Re: javax.xml.bind.PropertyException: name: com.sun.xml.inte

PostPosted: Fri Aug 17, 2012 5:20 pm
by jason
If you are going to try the NamespacePrefixMapperUtils change, there is no need to trouble your SIT teams (at least until you've tried that..)