views:

43

answers:

0

So I've been googling (and searching here) for about 2 days trying to figure this out and I've had no success.

I have a linux server setup with Apache2.2, Tomcat6, and PHP/Jave bridge. I've followed the instructions on the javabridge site to install and do their samples, which work fine. This consists of downloading the JavaBridge.war file and putting into the tomcat webapps directory. JavaBridge.war gets automatically unpackaged in the same folder. I copy that folder over to my apache2.2 folder, and then I can access the samples from my browser just like I would any other page.

If I understand what I've read correctly, I should be able to take a JavaBridgeTemplate.war package and add whatever .jar's to the WEB-INF/lib/ directory, copy it to the tomcat webapps directory, and I should be able to access the java class in my php code. Unfortunately, I just get "... CreateInstance failed: new com.itextpdf.text.Document. Cause: java.lang.ClassNotFoundException ... " in the browser.

I'm trying to just load a class from the itext.jar file that the php/java bridge site mentions here: java web apps. I was trying to use my own code, but it failed the same way and I wanted to see if maybe I was packaging something wrong.

Here is what my php looks like (everything up to "$myClass..." works):

<?php
require_once("/opt/apache-tomcat-6.0.29/webapps/extest/java/Java.inc");
$System = java("java.lang.System");
echo $System->getProperties();

echo "<br><br>";

$myClass = new java("com.itextpdf.text.Document");

?>

I've checked inside the itext.jar and verified that com/itextpdf/text/document is there. Any help would be appreciated, this is driving me nuts.