我无法正确设置Php-Java Bridge设置.
我会解释我做了什么.
>我的网站是纯PHP
>对于我们的支付交易流程,我们需要设置一个php-java桥
>我按照此链接设置了桥梁PHP-JAVA BRIDGE INSTALATION.
>在这里,我了解到我需要一个私有的jvm来安装这个桥.
>所以我使用我的c-panel在Private JVM中安装了apache-tomcat-6.0.14.安装后,它要求我将域映射到私有JVM.所以我将我的域example.com(这是唯一可用的选项)映射到它.
>然后它要求启用从Apache Web服务器到我的Java应用程序服务器的流量重定向(有一个复选框,我点击它)
>最后它要求我部署WAR文件(JavaBridge.WAR是我的文件)并且everthing似乎很好
>现在当我去http://example.com/JavaBridge/时,我可以看到javabridge示例,它运行正常.
到现在为止还挺好
现在我的问题从这里开始,当我尝试从php访问java类文件.我创建了一个示例test.php,并将以下代码放入其中.
require_once("http://example.com:portnumber/JavaBridge/java/Java.inc");
$System = java("java.lang.System");
echo $System->getProperties(); //This Part echo's correctly and shows the data so it means i can access Java.inc Correctly
$path_e24class = getcwd(). '/e24PaymentPipe.class'; //This part fails both test.php and java class file e24PaymentPipe.class are in the same directory in publich_html folder
java_require($path_e24class);
$pipe = new Java("e24PaymentPipe");
$pipe->setAction("1");
?>
我的站点内容位于public_html文件夹中,WAR文件部署在私有jvm中.
这些是我收到的错误消息.
1) Warning: java_require() not supported anymore. Please use tomcat or jee hot deployment instead
Fatal error: Uncaught [[o:Exception]:"java.lang.Exception: CreateInstance failed: new e24PaymentPipe. Cause: java.lang.ClassNotFoundException: e24PaymentPipe VM: 1.6.0_22@http://java.sun.com/" at: #-10
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358) #-9
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204) #-8
java.lang.Class.forName0(Native Method) #-7
java.lang.Class.forName(Class.java:247) #-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:458) #-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://example.com:portnumber/JavaBridge/java/Java.inc(232): java_ThrowExceptionProxyFactory->getProxy(3, 'java.util.Prope...', 'T', false) #1
最后我对java不太了解.所以我被困在这里不知道该怎么做.