|
From: <php...@li...> - 2008-02-21 20:53:20
|
I followed the instructions in INSTALL.STANDALONE documentation. When i Compile my file this is the error i get in eclipse
Parsing Error: http://localhost:8081/JavaBridge/java/Java.inc line 54 - syntax error, unexpected T_NEW
My java class
import java.util.*;
import java.text.*;
import java.math.*;
public class Hello {
public static final String JAVABRIDGE_PORT="8081";
static final php.java.bridge.JavaBridgeRunner runner =
php.java.bridge.JavaBridgeRunner.getRequiredInstance(JAVABRIDGE_PORT);
public Hello(){
SayHello();
}
public static void main(String[] args) {
Hello hell = new Hello();
//do nothing - this will keep us from getting a compile error
}
public void SayHello() {
Date today = new Date();
System.out.println( "Hello Geek here is the java date and time: " + today);
}
}
My php file
SayHello();
?>
_________________________________________________________________
|
|
From: <php...@li...> - 2008-02-21 23:08:38
|
I am running java 1.6 by the way
----------------------------------------
> To: php...@li...
> Date: Thu, 21 Feb 2008 16:53:18 -0400
> From: php...@li...
> Subject: [Php-java-bridge-users] Parsing error php/java brodje in java.inc
>
>
> I followed the instructions in INSTALL.STANDALONE documentation. When i Compile my file this is the error i get in eclipse
>
> Parsing Error: http://localhost:8081/JavaBridge/java/Java.inc line 54 - syntax error, unexpected T_NEW
>
>
> My java class
>
> import java.util.*;
> import java.text.*;
> import java.math.*;
>
> public class Hello {
> public static final String JAVABRIDGE_PORT="8081";
> static final php.java.bridge.JavaBridgeRunner runner =
> php.java.bridge.JavaBridgeRunner.getRequiredInstance(JAVABRIDGE_PORT);
>
> public Hello(){
> SayHello();
> }
> public static void main(String[] args) {
> Hello hell = new Hello();
>
> //do nothing - this will keep us from getting a compile error
> }
> public void SayHello() {
> Date today = new Date();
>
> System.out.println( "Hello Geek here is the java date and time: " + today);
> }
>
>
> }
>
>
> My php file
>
> SayHello();
> ?>
> _________________________________________________________________
>
>
> -------------------------------------------------------------------------
> 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
_________________________________________________________________
|
|
From: <php...@li...> - 2008-02-22 13:12:18
|
Hi,
> Parsing Error: http://localhost:8081/JavaBridge/java/Java.inc line 54 - syntax error, unexpected
> T_NEW
Line 54 is:
throw new java_IllegalStateException("java_autoload called more than once");
any modern PHP implementation should be able to parse the above code.
Which PHP implementation and which PHP version do you use?
Regards,
Jost Boekemeier
Machen Sie Yahoo! zu Ihrer Startseite. Los geht's:
http://de.yahoo.com/set
|
|
From: <php...@li...> - 2008-02-22 15:07:26
|
You were right. Eclipse was using older version of php. I swithed to new version 5.2.5 with java/php bridge 5.1.0. This is the error i get now Content-type: text/html Fatal error: Uncaught [[o:Exception]:"java.lang.Exception: CreateInstance failed: new Hello. Cause: java.lang.ClassNotFoundException: Hello VM: 1.6.0_03@http://java.sun.com/" at: #-17 java.net.URLClassLoader$1.run(URLClassLoader.java:200) #-16 java.security.AccessController.doPrivileged(Native Method) #-15 java.net.URLClassLoader.findClass(URLClassLoader.java:188) #0 http://localhost:8082/JavaBridge/java/Java.inc(259): java_ThrowExceptionProxyFactory->getProxy(1, NULL, false) #1 http://localhost:8082/JavaBridge/java/Java.inc(411): java_Arg->getResult(false) #2 http://localhost:8082/JavaBridge/java/Java.inc(414): java_Client->getWrappedResult(false) #3 http://localhost:8082/JavaBridge/java/Java.inc(596): java_Client->getInternalResult() #4 http://localhost:8082/JavaBridge/java/Java.inc(1952): java_Client->createObject('Hello', Array) #5 /home/kiran/Eclipseworkspace/Experiment/src/testjava.php(5): Java->Java('Hello') #6 {main}] thrown in http://localhost:8082/JavaBridge/java/Java.inc on line 222 ---------------------------------------- > Date: Fri, 22 Feb 2008 14:12:18 +0100 > To: php...@li... > From: php...@li... > Subject: Re: [Php-java-bridge-users] Parsing error php/java brodje in java.inc > > Hi, > >> Parsing Error: http://localhost:8081/JavaBridge/java/Java.inc line 54 - syntax error, unexpected >> T_NEW > > Line 54 is: > > throw new java_IllegalStateException("java_autoload called more than once"); > > any modern PHP implementation should be able to parse the above code. > > > Which PHP implementation and which PHP version do you use? > > > Regards, > Jost Boekemeier > > > > Machen Sie Yahoo! zu Ihrer Startseite. Los geht's: > http://de.yahoo.com/set > > ------------------------------------------------------------------------- > 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 _________________________________________________________________ |
|
From: <php...@li...> - 2008-02-23 11:58:13
|
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
|
|
From: <php...@li...> - 2008-02-24 05:54:58
|
I am just trying to call a java function with in PHP (not PHP with in Java). I don't want any j2ee container or tomcat so I am using the stand alone one with the instructions in INSTALL.STANDALONE which produces the errors. Any solution > 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 _________________________________________________________________ |
|
From: <php...@li...> - 2008-02-24 11:10:04
|
Hi,
> INSTALL.STANDALONE which produces the errors.
I don't think so.
> Any solution
Please see my last mail, which describes the mistake you've made.
Regards,
Jost Boekemeier
Heute schon einen Blick in die Zukunft von E-Mails wagen? www.yahoo.de/mail
|
|
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
_________________________________________________________________
|
|
From: <php...@li...> - 2008-02-25 09:17:43
|
Hi, if you follow the documentation, you won't get this error. Again, this problem happens because you have started some application on port 8081. If you still have problems with the PHP/Java Bridge or with the documentation, please open a problem report, please use http://sourceforge.net/tracker/?func=add&group_id=117793&atid=679233. Regards, Jost Boekemeier Lesen Sie Ihre E-Mails jetzt einfach von unterwegs. www.yahoo.de/go |