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

Error compiling report java source files


sordonez

Recommended Posts

Hi I´m trying to compile a report in this way

 

JasperReport report = JasperCompileManager.compileReport(this.getClass().getClassLoader().getResourceAsStream(resumenCorteComite.xml));

 

that instruction run well in a OC4J Container in Windows xp but when I try to run this one in a OC4J Container in a Solaris I get the follow error:

 

Caused by: java.io.IOException: javac: not found

at java.lang.UNIXProcess.forkAndExec(Native Method)

at java.lang.UNIXProcess.<init>(UNIXProcess.java:52)

at java.lang.Runtime.execInternal(Native Method)

at java.lang.Runtime.exec(Runtime.java:566)

at java.lang.Runtime.exec(Runtime.java:491)

at java.lang.Runtime.exec(Runtime.java:457)

at net.sf.jasperreports.engine.design.JRJavacCompiler.compileClasses(JRJavacCompiler.java:62)

 

14:03:23,138 ERROR

net.sf.jasperreports.engine.JRException:

Error compiling report java source files :

/ias/j2ee/home/resumenCorteComite_1177956202947_79853.java

 

Please anyBody can help me?

 

Thank a lot

Link to comment
Share on other sites

  • Replies 7
  • Created
  • Last Reply

Top Posters In This Topic

Hi,

 

Just put the jdt-compiler.jar in the classpath of you application. You can find it in the /lib directory of the JR distribution package.

But first of all, I would make sure I really need to compile report templates at runtime. Usually you don't, as you can deploy *.jasper files as part of you application JAR files. Only when dealing with dynamic report templates you need runtime report compilation, but that is rather a rare occurrence.

 

I hope this helps.

Teodor

Link to comment
Share on other sites

Hi teodor, thanks for your answer. I will try to resolve the problem with the jdt-compiler.jar in the classpath

but I create my reports using:

 

JasperReport report =

JasperCompileManager.compileReport(this.getClass().getClassLoader() .getResourceAsStream(resumenCorteComite.xml));

 

JasperFillManager.fillReport(report, parameters, connection);

 

How can I create my object JasperReport using just the .jasper?

 

thanks again.

Link to comment
Share on other sites

To load a report from a .jasper file (compiled report file), you would do something like

Code:

InputStream jasperResource = this.getClass().getClassLoader() .getResourceAsStream(...);
JasperReport report = (JasperReport) JRLoader.loadObject(jasperResource);

 

HTH,

Lucian

Link to comment
Share on other sites

  • 1 year later...
  • 2 weeks later...

Error compiling the report Java source.

java.lang.NoClassDefFoundError: org/eclipse/jdt/internal/compiler/env/INameEnvironment at it.businesslogic.ireport.IReportCompiler.run(IReportCompiler.java:576) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: org.eclipse.jdt.internal.compiler.env.INameEnvironment 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 java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) ... 2 more

Compilation running time: 32.

**********************************************

 

I was interrupted by this error in iReport software when i try to compile my .jrxml file in iReport.

 

Plz help sir

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