Jump to content
We've recently updated our Privacy Statement, available here ×

Problem with tJava


zardi

Recommended Posts

Hi,

I’m a newbie in JasperETL. I create a simple ETL-Job with
only one component of type tJava. The code of the tJava component is :

net.sf.jasperreports.engine
      .JasperCompileManager
      .compileReportToFile("<path_to_Jasper_jrxml_file>");

net.sf.jasperreports.engine
      .data.JRXmlDataSource xmlDataSource =
new net.sf.jasperreports.engine
      .data.JRXmlDataSource("<path_to_xml_datasource>", "<select_expression>");

net.sf.jasperreports.engine
      .JasperFillManager.fillReportToFile("<path_to_jasper_file> ",
                                           new java.util.HashMap(), xmlDataSource);


On executing, the job breaks with an exception

java.lang.NoClassDefFoundError: net/sf/jasperreports/engine/JRDataSource
Caused by: java.lang.ClassNotFoundException: net.sf.jasperreports.engine.JRDataSource
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Exception in thread "main"


On debuging, the job starts, but breaks with another exception


Exception in thread "Thread-0" java.lang.NoClassDefFoundError: org/apache/xpath/CachedXPathAPI
    at net.sf.jasperreports.engine.util.xml.XalanXPathExecuter.<init>(XalanXPathExecuter.java:49)
    at net.sf.jasperreports.engine.util.xml.XalanXPathExecuterFactory.getXPathExecuter(XalanXPathExecuterFactory.java:43)
    at net.sf.jasperreports.engine.util.xml.JRXPathExecuterUtils.getXPathExecuter(JRXPathExecuterUtils.java:89)
    at net.sf.jasperreports.engine.data.JRXmlDataSource.<init>(JRXmlDataSource.java:189)
    at net.sf.jasperreports.engine.data.JRXmlDataSource.<init>(JRXmlDataSource.java:235)
    at test.test1.test1.tJava_1Process(test1.java:142)
    at test.test1.test1$1.run(test1.java:302)


Adding the JasperReports libraries to the Java classpath has no effects. What's wrong with my example?

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

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...