HTTP Status 500 - java.lang.RuntimeException: PHP Fatal error: Class ‘com\aspose\slides\Presentation’ not found
Hi Brian,
Any luck? I really need to get this working. I can’t even get the tests working let alone live code.
And just to be clear, the tests directory goes in the JavaBridge directory as in webapps/JavaBridge/Aspose_Slides_Java_for_PHP/tests/index.php?
and I also copy my aspose.slides.x.x.x.jar, 3rd_party directory, and license file into the WEB-INF/lib/directory as well, right?
when I attempt the example:
<?php
namespace Aspose\Slides\IntroductionToPresentation;
require_once("http://localhost:8080/JavaBridge/java/Java.inc");
require_once __DIR__ . '/vendor/autoload.php'; // Autoload files using Composer autoload
use com\aspose\slides\Presentation as Presentation;
use com\aspose\slides\ShapeType as ShapeType;
use com\aspose\slides\FillType as FillType;
use com\aspose\slides\SaveFormat as SaveFormat;
use java\awt\Color as Color;
$pptx = new Presentation();
and when I attempt to use JavaBridge by calling the library directly by calling
$pptx = new Java("com.aspose.slides.Presentation",getcwd()."/Aspose.pptx");
I get:
[Mon Dec 26 22:05:36.228591 2016] [:error] [pid 23325] [client 108.31.189.60:51442] PHP Fatal error: Uncaught [[o:Exception]:"java.lang.Exception: CreateInstance failed: new com.aspose.slides.Presentation([o:PhpParserString]). Cause: java.lang.ClassNotFoundException: com.aspose.slides.Presentation VM: 1.7.0_121@http://java.oracle.com/" at:\n#-37 org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1333)\n#-36 org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167)\n#-35 java.lang.Class.forName0(Native Method)\n#-34 java.lang.Class.forName(Class.java:278)\n#-33 php.java.bridge.Util.classForName(Util.java:1518)\n#-32 php.java.bridge.JavaBridge.CreateObject(JavaBridge.java:445)\n#-31 php.java.bridge.Request.handleRequest(Request.java:458)\n#-30 php.java.bridge.Request.handleOneRequest(Request.java:510)\n#-29 php.java.servlet.PhpJavaServlet.handleLocalConnection(PhpJavaServlet.java:202)\n#-28 php.java.servlet.PhpJavaServlet.handlePut(PhpJavaServlet.java:250)\n#-27 php.java.servlet.PhpJavaServlet.doPut(PhpJavaServlet.java:261)\n#-26 javax.servlet.http.HttpS in http://localhost:8080/JavaBridge/java/Java.inc on line 195
It appears I am not able to access the library in the WEB-INF/lib folder.
Solved it with Stack Overload …
Hi Brian,
It’s good to know that things are working on your end. Please share, we may help you further in this regard.
Many Thanks,