sordonez Posted May 3, 2007 Share Posted May 3, 2007 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 foundat 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 More sharing options...
Teodor Danciu Posted May 3, 2007 Share Posted May 3, 2007 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 More sharing options...
sordonez Posted May 4, 2007 Author Share Posted May 4, 2007 Hi teodor, thanks for your answer. I will try to resolve the problem with the jdt-compiler.jar in the classpathbut 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 More sharing options...
lucianc Posted May 7, 2007 Share Posted May 7, 2007 To load a report from a .jasper file (compiled report file), you would do something likeCode:InputStream jasperResource = this.getClass().getClassLoader() .getResourceAsStream(...);JasperReport report = (JasperReport) JRLoader.loadObject(jasperResource); HTH,Lucian Link to comment Share on other sites More sharing options...
ekr Posted June 19, 2008 Share Posted June 19, 2008 Why does it need this jar on UNIX/Linux? We are having this problem as well. Link to comment Share on other sites More sharing options...
lucianc Posted June 19, 2008 Share Posted June 19, 2008 See this FAQ. If you don't want to use the JDT compiler, make sure that the javac command is available on the process path, or that you have the JDK's tools.jar on the application's classpath. Regards,Lucian Link to comment Share on other sites More sharing options...
ekr Posted June 21, 2008 Share Posted June 21, 2008 Thanks so much for your answer. Link to comment Share on other sites More sharing options...
takCare Posted July 2, 2008 Share Posted July 2, 2008 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now