Jump to content

JRAntCompileTask not works from Jasper 3.1.x


prkothan

Recommended Posts

 Hi,

We are currently using ant task (net.sf.jasperreports.ant.JRAntCompileTask) to compile out 150 more reports. And we are migrating from 2.0.5.  Ant task works properly with 2.0.5 and 3.1.0. But its doesn't works with Jasper reports 3.5.0.

And it doesn't works for the version 3.1.1 or greater.  But we able to compile the reports programmatically using java file or via ireports. And its run properly while generating reports. Just ant task compilation is not working.

We are getting following exception.

 jasper-report:


      [jrc] 20:05:59,639 DEBUG sax:1249 - setDocumentLocator(com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser$LocatorProxy@1117a20)

      [jrc] 20:05:59,639 DEBUG sax:1283 - startDocument()

      [jrc] 20:06:00,030 DEBUG sax:1318 - startElement(,jasperReport,jasperReport)

      [jrc] 20:06:00,046 DEBUG Digester:1325 -   Pushing body text ''

      [jrc] 20:06:00,046 DEBUG Digester:1344 -   New match='jasperReport'

      [jrc] 20:06:00,046 DEBUG Digester:1359 -   Fire begin() for FactoryCreateRule[className=net.sf.jasperreports.engine.xml.JasperDesignFactory, attributeName=null]

      [jrc] 20:06:00,046 DEBUG Digester:486 - [FactoryCreateRule]{jasperReport} New factory net.sf.jasperreports.engine.xml.JasperDesignFactory

      [jrc] 20:06:00,046 ERROR Digester:1363 - Begin event threw exception

      [jrc] java.lang.ClassNotFoundException: net.sf.jasperreports.engine.xml.JasperDesignFactory

    



Post Edited by Prasanna Kothandaraman at 04/16/09 12:29
Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

 Identified the cause, but issue is not resolved.

Cause is, from Jasper 3.1.1, 

JRXMLDesignFactory.java has enabled usage of contextClassLoader in the method configureDigester.

digester.setUseContextClassLoader(true);

 

As described in below links,  Ant doesn't set the context classloader before invoking a task. 

http://webui.sourcelabs.com/ant/issues/36717

https://issues.apache.org/bugzilla/show_bug.cgi?id=36717

https://issues.apache.org/bugzilla/show_bug.cgi?id=15018

And this should be taken care by customTask (JRAntCompileTask).  Actually execute() method set the contextClassLoader, still its not sufficient.

Please reply.

 

Regards,

Prasanna

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...