Page 1 of 1

pptx4j example Issues

PostPosted: Sat Jul 03, 2010 9:04 am
by tmnt
I am having some issues trying to get the sample HelloWorld pptx4j example running.

I'm using Eclipse, with jdk6, and docx4j nightly build 20100630 jar.

The following gets printed to the console:
log4j:WARN No appenders could be found for logger (org.docx4j.openpackaging.parts.PartName).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
JAXB: RI not present. Trying Java 6 implementation.
JAXB: Using Java 6 implementation.


and then i get:
Thread [main] (Suspended (exception NoClassDefFoundError))
ContextFinder.handleInvocationTargetException(InvocationTargetException) line: not available
ContextFinder.newInstance(String, String, ClassLoader, Map) line: not available
ContextFinder.find(String, String, ClassLoader, Map) line: not available
JAXBContext.newInstance(String, ClassLoader, Map<String,?>) line: not available
JAXBContext.newInstance(String, ClassLoader) line: not available
Context.<clinit>() line: 69
MainPresentationPart(JaxbXmlPart<E>).<init>(PartName) line: 66
MainPresentationPart(JaxbPmlPart<E>).<init>(PartName) line: 75
MainPresentationPart.<init>() line: 47
PresentationMLPackage.createPackage() line: 141
NewPresentation.main(String[]) line: 27


How do I resolve this?

Re: pptx4j example Issues

PostPosted: Sat Jul 03, 2010 2:06 pm
by jason
First, please configure log4j.

When I run that example, I see in part:
Code: Select all
JAXB: Using RI
03.07.2010 12:45:08 *INFO * Context: loading Context jcPML (Context.java, line 68)


org.pptx4j.jaxb.Context does:
Code: Select all
JAXBContext.newInstance("org.pptx4j.pml:org.docx4j.dml:org.docx4j.dml.picture",classLoader );


Do you have src/main/java on your eclipse build path? You need this for org.docx4j.dml:org.docx4j.dml.picture

Your build path should include:

- src/pptx4j/java
- src/main/java
- src/svg
- src/diffx

cheers .. Jason

Re: pptx4j example Issues

PostPosted: Wed Jul 07, 2010 4:08 am
by tmnt
Jason,

Thanks for the quick reply.

I was trying to avoid source and use only the libraries, more specifically a nightly build because 2.3 doesn't have org.pptx.jaxb.context in it (which the example called for).

I just figured out what I was doing wrong. I had forgot to include the supporting jars (ppp and xalen to be exact). I had no clue until I mistakenly clicked 'run' instead of 'debug' in eclipse and it actually gave me more information...go figure.

Thanks again,
Pablo