For now, I am sending this parameter in the constructor while instantiating the class, but the class is not performing what it is intended to do, though also not giving error any more.
Now I have set the classpath on the server to the JasperReports' project's .jar
Now I want to ask is DO I really have to java_require this jar in my PHP script,
because If I remove this jar from the java_require statement, it gives me this error
Fatal error: Uncaught [o(Exception):"java.lang.Exception: CreateInstance failed: new GenReport(o(Request$PhpParserString)). Cause: java.lang.ClassNotFoundException: Unresolved external reference: java.lang.NoClassDefFoundError: net/sf/jasperreports/engine/JRException. -- Unable to call constructor because it or one of its parameters refer to the mentioned external class which is not available in the current "java_require()" path. Please check the path and the SEL and File permissions and remember that all interconnected classes must be loaded with a single java_require() call, i.e. use java_require("foo.jar;bar.jar") instead of java_require("foo.jar"); java_require("bar.jar"). Please check the Java Bridge log file for details."] thrown in C:\Program Files\Apache Group\Apache2\htdocs\Testing\Ashish\ITOnline_admin\callRepGen.php on line 7
these are java errors, not php errors. it looks like you've tried to call a function called genReport which doesn't exist.
and the bit about uncaught exceptions means that you need to use try and catch statements. try asking in a java forum about these errors and you might get a little more help
I obtained a sample code from the Internet that creates the JasperReports through PHP, but that too is giving a lot of errors.
Please hep me out of this situation :-
java stack trace: java.lang.Exception: Invoke failed: [c(JasperCompileManager)]->compileReport((String)o(String)). Cause: net.sf.jasperreports.engine.JRException: http:\localhost\Testing\Ashish\testing.jrxml (The filename, directory name, or volume label syntax is incorrect) at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:171) at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:151) at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:142) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at php.java.bridge.JavaBridge.Invoke(JavaBridge.java:1019) at php.java.bridge.Request.handleRequest(Request.java:467) at php.java.bridge.Request.handleRequests(Request.java:493) at php.java.bridge.JavaBridge.run(JavaBridge.java:209) at php.java.bridge.ThreadPool$Delegate.run(ThreadPool.java:29) Caused by: net.sf.jasperreports.engine.JRException: http:\localhost\Testing\Ashish\testing.jrxml (The filename, directory name, or volume label syntax is incorrect) ... 12 more Caused by: java.io.FileNotFoundException: http:\localhost\Testing\Ashish\testing.jrxml (The filename, directory name, or volume label syntax is incorrect) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.(FileInputStream.java:106) at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:166) ... 11 more
And my directory structure is totally perfect, i.e. my xml file is residing at the right position.
two backslashes results in a single backslash because it is an escapement character, but as tim says backslash is not used in a well-formed URL; only forward slashes are.