How to add org.eclipse.birt.php.birtengine.BirtEngine class to JavaBridge?-Collection of common programming errors

I’m running a test using Apache+PHP, Tomcat and JavaBridge to try to load BIRT and render a document. This is the PHP file:


Once I access it through Apache+PHP i receive the following error:


Fatal error: Uncaught [[o:Exception]:"java.lang.Exception: ReferenceClass failed: new org.eclipse.birt.php.birtengine.BirtEngine. Cause: java.lang.ClassNotFoundException: org.eclipse.birt.php.birtengine.BirtEngine VM: 1.7.0_04@http://java.oracle.com/" at: #-10 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1438) #-9 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1284) #-8 java.lang.Class.forName0(Native Method) #-7 java.lang.Class.forName(Unknown Source) #-6 php.java.bridge.Util.classForName(Util.java:1518) #-5 php.java.bridge.JavaBridge.CreateObject(JavaBridge.java:445) #-4 php.java.bridge.Request.handleRequest(Request.java:444) #-3 php.java.bridge.Request.handleRequests(Request.java:500) #-2 php.java.bridge.http.ContextRunner.run(ContextRunner.java:145) #-1 php.java.bridge.ThreadPool$Delegate.run(ThreadPool.java:60) #0 http://127.0.0.1:8081/Bridge/java/Java.inc(232): java_ThrowExceptionProxyFactory->getProxy(3, 'org.apache.cata...', 'T', false) #1 http://127. in http://127.0.0.1:8081/Bridge/java/Java.inc on line 195

127.0.0.1:8081 is Tomcat server. It seems it isn’t able to find “org.eclipse.birt.php.birtengine.BirtEngine” class. I copied birt-runtime-3_7_2/lib folder’s contents to JavaBridge’s WEB-INF/lib but it doesn’t help. I’ve tried searching for the answer on various sites, but the only one, I think actualy the same problem with no answer is here: LINK. Does anyone know a solution to this problem or how to make that JavaBridge would see that class?

  1. I’m not certain require_once takes URL as parameters. Have you tried an absolute path to the file instead? Mine looks like this: “C:/Program Files/Apache Software Foundation/Tomcat 7.0/webapps/JavaBridge/java/Java.inc” and it works.

    Also, you might want to look at this article which details the proper configuration steps:

    http://www.birt-exchange.org/org/devshare/deploying-birt-reports/743-calling-birt-from-php/

    Anyway, best of luck to you, I know I lost quite a few hair when I had to do this configuration.

Originally posted 2013-12-02 20:57:28.