|
From: <php...@li...> - 2008-02-25 02:37:03
|
According to the last mail. The exception was by an application listening on port 8081. That application is JavaBridge.rar. The INSTALL.J2SE document describes how to call a php function from java but I need to call java function from PHP which is described in INSTALL.STANDALONE. I need that to be working.
This is the desciption in the document (INSTALL.STANDALONE). The bolted text is what i want to achieve. Hope I was clear this time.
* Extract the JavaBridge.jar library from JavaBridge.war, for example
with the command:
java -classpath JavaBridge.war TestInstallation
* Add the following 3 lines to the main class of your non-J2EE
application:
public static final String JAVABRIDGE_PORT="8087";
static final php.java.bridge.JavaBridgeRunner runner =
php.java.bridge.JavaBridgeRunner.getRequiredInstance(JAVABRIDGE_PORT);
* Add JavaBridge.jar to the main library of you non-J2EE
application. This can be done by adding the following line to your
application's META-INF/MANIFEST.MF:
Class-Path: JavaBridge.jar
It is also possible to simply merge all files into your non-J2EE
application..
* Start your non-J2EE application.
Call your Java methods from PHP
-------------------------------
* Use the following code to call methods:
<?php require_once("http://localhost:8087/JavaBridge/java/Java.inc"); $myClass = new java("com.my.non.j2ee.application.MyClass"); $myClass->myMethod(...);
> > Date: Sat, 23 Feb 2008 12:58:13 +0100
> > To: php...@li...
> > From: php...@li...
> > Subject: Re: [Php-java-bridge-users] Parsing error php/java brodje in java.inc
> > > > Hi,
> >
> > > java/php bridge 5.1.0. This is the error i get now
> > > Fatal error: Uncaught [[o:Exception]:"java.lang.Exception: CreateInstance failed: new Hello.
> >
> > the above message means that the application listening on port 8081, whatever it may be, cannot
> > find the class Hello.
> >
> > Note that PHP almost certainly does not connect to your Java app, unless you manage to run PHP
> > within the ~100ms timeframe your Java application is listening on port 8081, if at all.
> >
> > Furthermore, if you want to run PHP apps from Java, you should probably take a look at the JSR223
> > interface instead, please see the INSTALL.J2SE document for details.
> >
> >
> > Regards,
> > Jost Boekemeier
> >
> >
> >
> > Heute schon einen Blick in die Zukunft von E-Mails wagen? www.yahoo.de/mail
> >
> > -------------------------------------------------------------------------
> > This SF.net email is sponsored by: Microsoft
> > Defy all challenges. Microsoft(R) Visual Studio 2008.
> > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> > _______________________________________________
> > php-java-bridge-users mailing list
> > php...@li...
> > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
>
> _________________________________________________________________
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> php-java-bridge-users mailing list
> php...@li...
> https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
_________________________________________________________________
|