Using I-net Report Server with PHP JavaBridge

  Kiến thức lập trình

I have an ubuntu server with apache2 and PHP installed. I also have JavaBridge installed and working with other java libraries in some of my PHP code. I have downloaded debian/ubuntu version of the server and the SDK from the inet website
I installed the .deb file on my server, but did not know what to do with the SDK really.

When I try to use java() calls in my code I can get

require_once DRUPAL_ROOT . '/libraries/JavaBridge/java/Java.inc';
print_r(java_values(java("java.lang.System")->getProperties()));

to work fine, but

$inet_engine = new java('inet.report.Engine(inet.report.Engine.EXPORT_PDF)');

gives me the following error.

An Java exception has occurred: [[o:Exception]:”java.lang.Exception: CreateInstance failed: new inet.report.Engine(inet.report.Engine.EXPORT_PDF). Cause: java.lang.ClassNotFoundException: inet.report.Engine(inet.report.Engine.EXPORT_PDF) VM: 1.8.0_292@http://java.oracle.com/” at:
#-38 org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1291)
#-37 org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
#-36 java.lang.Class.forName0(Native Method)
#-35 java.lang.Class.forName(Class.java:348)
#-34 php.java.bridge.Util.classForName(Util.java:1587)
#-33 php.java.bridge.JavaBridge.CreateObject(JavaBridge.java:391)
#-32 php.java.bridge.Request.handleRequest(Request.java:458)
#-31 php.java.bridge.Request.handleRequests(Request.java:500)
#-30 php.java.servlet.PhpJavaServlet.handleHttpConnection(PhpJavaServlet.java:169)
#-29 php.java.servlet.PhpJavaServlet.handlePut(PhpJavaServlet.java:185)
#-28 php.java.servlet.PhpJavaServlet.doPut(PhpJavaServlet.java:194)
….

I assume I need to make the .jar libraries available to JavaBridge server side somehow, but don’t know what I need to do to make that happen. Can anyone help? I would also just love to know if anyone has done this before, using JavaBridge to create PDF reports from .RPT files using inet report server.

Not to complicate the question, but I would be interested in suggestions about better ways to accomplish creating PDF from crystal RPT file as well, if that is allowed. Maybe just message me somehow? I am planning to pass JSON data along and not be connected to a Database exactly, so that might affect possible solutions.

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT