Page 1 of 1

Problems compiling Docx4j 2.7.1 Source Code

PostPosted: Mon Dec 26, 2011 11:21 pm
by ridgeBoy
Hi,

I'm working in a company who needs to create dynamic *.docx files. I've reached to run an example with docx4j 2.7.1 jar and Java 6. But the problem is that we are using a Tomcat web server to run the app. The server uses java 1.4.2 which is not compatible with docx4j (this requires java 6 because the Jaxb dependencies).

Now, I'm trying to compile docx4j 2.7.1 sources into my ide (we are using IBM Rational Software Development Platform Versión: 6.0.0 ID de creación: 20041117_2230) whicj is based on Eclipse (I'don't know the version).

My idea is to get a compiled version from docx4j 2.7.1 to get the *.class files and then use RetroTranslator to make them compatible with Java 1.4.2 (and with our server :D).

The files that I've placed like libraries into the project are these

antlr-2.7.7.jar
antlr-runtime-3.3.jar
avalon-framework-api-4.3.1.jar
avalon-framework-impl-4.3.1.jar
commons-codec-1.3.jar
commons-io-1.3.1.jar
commons-lang-2.4.jar
commons-logging-1.1.1.jar
docx4j-2.7.1.jar
fop-1.0.jar
jaxb-api-2.0.jar
poi-3.8-beta4.jar
poi-scratchpad-3.8-beta4.jar
serializer-2.7.1.jar
stringtemplate-3.2.1.jar
wmf2svg-0.9.0.jar
xalan-2.7.1.jar
xml-apis-1.3.04.jar
xmlgraphics-commons-1.4.jar
log4j-1.2.15.jar

And the error that the ide is splashing is at SimplePageMaster.java because the projetc can't find org.plutext.jaxb.xslfo.BackgroundAttachmentType (which gives no problems into the ide).

I've tried to import this file manually, but it did not worked.

Now I'll try to use RetroTransalator with the *.class files contained into the docx4j 2.7.1 jar. If it works, I'll post here.

Why I can't compile the source code? Any ideas? What is my mistake?

Thanx in advance.

Re: Problems compiling Docx4j 2.7.1 Source Code

PostPosted: Tue Dec 27, 2011 11:04 am
by jason
ridgeBoy wrote:And the error that the ide is splashing is at SimplePageMaster.java because the projetc can't find org.plutext.jaxb.xslfo.BackgroundAttachmentType (which gives no problems into the ide).


Sorry, its not quite clear what you mean. You have things configured in your IDE such that it reports no errors?

How are you then creating your jar? Ant, maven or IDE export to jar?

In any case, the problem is that you aren't compiling src/xslfo

Hope this helps, and look forward to hearing whether docx4j works under RetroTranslator :-)

Re: Problems compiling Docx4j 2.7.1 Source Code

PostPosted: Wed Dec 28, 2011 11:53 pm
by ridgeBoy
Hi,

I told my boss all this mess about retro Translator and he doesn't trust third parties utilities (even from SourceForge). So finally we are using legacy Apache POI 3.2 Final jar.

Its behaviour modifying *.doc files is... enough. But we can't install Java 6 (aka Java 1.6) in the server (it's forbidden for us installing any software).

So, thanks for the answer. I am very pleased for the active support to this forum. And the API is amazing (this project remembers me to iText one) and very useful (very very useful, trust me).

Testing docx4j with retrotranslator is something I'll do in my spare time, because I'm sure that someone would like use this API in Java 1.4.x machines.

If it becomes successful, I'll post here.

Thank you ;D