dbarra / xdocreport

Automatically exported from code.google.com/p/xdocreport
1 stars 0 forks source link

Unable to find resource presentation.xml - new in version 0.9.8+ #311

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
We were successfully using version 0.9.7. We attempted to upgrade to 0.9.8 to 
get support for tables w/in pptx. (Table support ticket: 
https://code.google.com/p/xdocreport/issues/detail?id=122)
All I did was update my pom versions from 0.9.7 to 0.9.8. I then redeployed, 
using the same template that was working before.

Now, when we try to produce the pptx, we get this error:
[ +/- ] Exception: Unable to find resource 
'fr.opensagres.xdocreport.document.pptx.PPTXReport@6d4f3dfa!ppt/presentation.xml
'
org.apache.velocity.exception.ResourceNotFoundException
Stack Trace:
org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceMa
nagerImpl.java:474)
org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceMan
agerImpl.java:352)
org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:153
3)
org.apache.velocity.app.VelocityEngine.getTemplate(VelocityEngine.java:392)
fr.opensagres.xdocreport.template.velocity.internal.VelocityTemplateEngine.proce
ssWithCache(VelocityTemplateEngine.java:88)
fr.opensagres.xdocreport.template.AbstractTemplateEngine.process(AbstractTemplat
eEngine.java:111)
fr.opensagres.xdocreport.template.AbstractTemplateEngine.process(AbstractTemplat
eEngine.java:83)
fr.opensagres.xdocreport.document.AbstractXDocReport.processTemplateEngine(Abstr
actXDocReport.java:747)
fr.opensagres.xdocreport.document.AbstractXDocReport.process(AbstractXDocReport.
java:499)
fr.opensagres.xdocreport.document.AbstractXDocReport.process(AbstractXDocReport.
java:465)
......

I've tried the latest release as well, version 1.0.2, with the same results.
Here is the relevant portions of our pom:
        <dependency>
            <groupId>org.apache.velocity</groupId>
            <artifactId>velocity-tools</artifactId>
            <version>2.0</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>org.apache.velocity</groupId>
            <artifactId>velocity</artifactId>
            <version>1.7</version>
        </dependency>
        <dependency>
            <groupId>fr.opensagres.xdocreport</groupId>
            <artifactId>fr.opensagres.xdocreport.core</artifactId>
            <version>0.9.8</version>
        </dependency>
        <dependency>
            <groupId>fr.opensagres.xdocreport</groupId>
            <artifactId>fr.opensagres.xdocreport.template.velocity</artifactId>
            <version>0.9.8</version>
        </dependency>
        <dependency>
            <groupId>fr.opensagres.xdocreport</groupId>
            <artifactId>fr.opensagres.xdocreport.converter</artifactId>
            <version>0.9.8</version>
        </dependency>
        <dependency>
            <groupId>fr.opensagres.xdocreport</groupId>
            <artifactId>fr.opensagres.xdocreport.document.pptx</artifactId>
            <version>0.9.8</version>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>12.0</version>
        </dependency>
        <dependency>
            <groupId>org.docx4j</groupId>
            <artifactId>docx4j</artifactId>
            <version>2.8.1</version>
        </dependency>

Original issue reported on code.google.com by jaysell...@gmail.com on 30 Sep 2013 at 5:14

GoogleCodeExporter commented 8 years ago
Hi,

Please attach your pptx + java main + pojo which causes the problem.

Thank's.

Regard's Angelo

Original comment by angelo.z...@gmail.com on 30 Sep 2013 at 6:36

GoogleCodeExporter commented 8 years ago
Not easy for me to separate out the sensitive code from the open unfortunately. 
But as I'm comparing 0.9.7 to 0.9.8 and debugging through code, it appears that 
0.9.7 includes XDocReportEntryResourceLoader in the initialization of 
ResourceManager where 0.9.8 does not. I'm about to step further into the 
RuntimeServices which feeds into the ResourceManager.  I shall report back.

Original comment by jaysell...@gmail.com on 30 Sep 2013 at 9:08

GoogleCodeExporter commented 8 years ago
Found it, VelocityTemplateEngine changed.

0.9.7 auto-registers "resource.loader" in the getVelocityEngineProperties 
method.
0.9.8 uses velocity.properties file that is passed in by the project/user/etc.

This method is no longer around:
    public synchronized Properties getVelocityEngineProperties()
    {
        if ( velocityEngineProperties != null )
        {
            return velocityEngineProperties;
        }
        velocityEngineProperties = new Properties();

        // Initialize properties to use XDocReportEntryResourceLoader to
        // load template from entry name of XDocArchive.
        velocityEngineProperties.setProperty( "resource.loader", "file, class, jar ,report" );
        velocityEngineProperties.setProperty( "report.resource.loader.class",
                                              XDocReportEntryResourceLoader.class.getName() );
        velocityEngineProperties.setProperty( "report.resource.loader.cache", "true" );
        velocityEngineProperties.setProperty( "report.resource.loader.modificationCheckInterval", "1" );

.......
}

Original comment by jaysell...@gmail.com on 30 Sep 2013 at 10:38

GoogleCodeExporter commented 8 years ago
Many thank's to have debugging and find the problem.

Perhaps you have a custom velocity.properties in your classpath which disable 
teh XDocReport resources loader.

I have commited a fix for that 
http://code.google.com/p/xdocreport/source/detail?r=b07878fb1db6e35cfae3f58e421d
63f0bc732153

Tell me if it works with your case.

Regards Angelo

Original comment by angelo.z...@gmail.com on 1 Oct 2013 at 8:51

GoogleCodeExporter commented 8 years ago

Original comment by angelo.z...@gmail.com on 18 Feb 2014 at 2:16

GoogleCodeExporter commented 8 years ago
Issue 237 has been merged into this issue.

Original comment by angelo.z...@gmail.com on 18 Feb 2014 at 2:16