From: <php...@li...> - 2012-05-17 12:18:30
|
Can someone provide insight into importing a Java jar into a PHP application ? I am trying to instantiate an object I developed called SubscriberTrace which is packed in a Java jar. I have the ST.jar file located in the JavaBridge/java directory. I get the following error: javax.servlet.ServletException: java.lang.RuntimeException: PHP Fatal error: Uncaught [[o:Exception]:"java.lang.Exception: CreateInstance failed: new com.ctl.mplslab.iptv.SubscriberTrace. Cause: java.lang.ClassNotFoundException: com.ctl.mplslab.iptv.SubscriberTrace VM: 1.6.0_22@http://java.sun.com/" at: #-10 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387) <?php require_once("java/Java.inc"); use java\lang\String as JString; use java\util\ArrayList as JList; class String extends JString { function toString () { return "hello " . parent::toString(); } } $str = new String("Java"); $list = new JList(); $list->add (java_closure($str)); $list->add ("from PHP"); $ar = java_values ($list->toArray()); $channels = new Java("com.ctl.mplslab.iptv.SubscriberTrace"); #echo $channels->getChannels("6126643068"); foreach($ar as $entry) echo "$entry<br>\n" ?> ________________________________ This communication is the property of CenturyLink and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments. |