You can subscribe to this list here.
| 2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(6) |
Oct
(6) |
Nov
(8) |
Dec
(2) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
(19) |
Feb
(15) |
Mar
(10) |
Apr
(8) |
May
(7) |
Jun
(9) |
Jul
(13) |
Aug
(31) |
Sep
(111) |
Oct
(52) |
Nov
(72) |
Dec
(42) |
| 2006 |
Jan
(21) |
Feb
(32) |
Mar
(33) |
Apr
(24) |
May
(15) |
Jun
(40) |
Jul
(32) |
Aug
(19) |
Sep
(38) |
Oct
(37) |
Nov
(63) |
Dec
(37) |
| 2007 |
Jan
(18) |
Feb
(39) |
Mar
(69) |
Apr
(49) |
May
(71) |
Jun
(59) |
Jul
(71) |
Aug
(85) |
Sep
(46) |
Oct
(14) |
Nov
(25) |
Dec
(56) |
| 2008 |
Jan
(24) |
Feb
(77) |
Mar
(104) |
Apr
(44) |
May
(41) |
Jun
(11) |
Jul
(31) |
Aug
(59) |
Sep
(44) |
Oct
(86) |
Nov
(66) |
Dec
(93) |
| 2009 |
Jan
(88) |
Feb
(41) |
Mar
(49) |
Apr
(135) |
May
(22) |
Jun
(31) |
Jul
(60) |
Aug
(71) |
Sep
(76) |
Oct
(18) |
Nov
(52) |
Dec
(20) |
| 2010 |
Jan
(8) |
Feb
(50) |
Mar
(35) |
Apr
(48) |
May
(46) |
Jun
(84) |
Jul
(38) |
Aug
(61) |
Sep
(51) |
Oct
(31) |
Nov
(17) |
Dec
(18) |
| 2011 |
Jan
(51) |
Feb
(14) |
Mar
(17) |
Apr
(23) |
May
(15) |
Jun
(11) |
Jul
(5) |
Aug
(5) |
Sep
(15) |
Oct
(8) |
Nov
(5) |
Dec
(25) |
| 2012 |
Jan
(2) |
Feb
(4) |
Mar
(6) |
Apr
(9) |
May
(27) |
Jun
(32) |
Jul
(36) |
Aug
(10) |
Sep
(16) |
Oct
(3) |
Nov
(13) |
Dec
(7) |
| 2013 |
Jan
(1) |
Feb
(4) |
Mar
|
Apr
(1) |
May
|
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(4) |
Oct
(2) |
Nov
(1) |
Dec
|
| 2014 |
Jan
|
Feb
|
Mar
(2) |
Apr
(1) |
May
(2) |
Jun
(9) |
Jul
(5) |
Aug
(2) |
Sep
(4) |
Oct
|
Nov
|
Dec
|
| 2015 |
Jan
(3) |
Feb
(2) |
Mar
(4) |
Apr
(3) |
May
(1) |
Jun
(2) |
Jul
|
Aug
(2) |
Sep
(5) |
Oct
(1) |
Nov
|
Dec
|
| 2016 |
Jan
|
Feb
(5) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(5) |
Sep
(3) |
Oct
|
Nov
|
Dec
|
| 2017 |
Jan
(6) |
Feb
|
Mar
|
Apr
(10) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
|
| 2018 |
Jan
(2) |
Feb
(5) |
Mar
|
Apr
|
May
(1) |
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
| 2021 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2023 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
|
1
|
2
(1) |
3
(1) |
|
4
|
5
(3) |
6
(6) |
7
(6) |
8
(10) |
9
(6) |
10
|
|
11
(5) |
12
(5) |
13
(1) |
14
|
15
(2) |
16
(2) |
17
(4) |
|
18
(3) |
19
(3) |
20
(7) |
21
(5) |
22
(7) |
23
(1) |
24
(4) |
|
25
|
26
(3) |
27
(2) |
28
(1) |
29
|
30
|
31
|
|
From: <php...@li...> - 2009-01-20 22:36:05
|
Hi, > 1) Is it possible to test whether a Java bridge is running? Yes. Please see the API documentation for details (http://php-java-bridge.sourceforge.net/pjb/docs/php-api/index.html) > 2) If not 1), what happens if i try to start another bridge > on the 9200 port? It will terminate immediately if port 9200 is already in use. > 3) Is there an explicit way of shutting down the bridge? Yes, see the posted example for details (http://php-java-bridge.sourceforge.net/pjb/examples/source.php?source=startJava.php). Regards, Jost Boekemeier |
|
From: <php...@li...> - 2009-01-20 22:30:50
|
Hi, > How can I use the PHP-Java Bridge to connect PHP to MySQL > using the JNDI connection? Please see the MySQL API for details. An example is here: http://dev.mysql.com/doc/refman/5.0/en/connector-j-usagenotes-basic.html#connector-j-examples-connection-drivermanager > $dbh = mysql_connect("java:comp/env/jdbc/TestDB") Mamma mia... :) If you want to access the driver from a EJB session bean, please see our EJB example (http://php-java-bridge.sourceforge.net/pjb/examples/source.php?source=documentClient.php) how to access a session bean. Regards, Jost Boekemeier |
|
From: <php...@li...> - 2009-01-20 16:25:27
|
As a follow up to "connect PHP and MySQL using JNDI & PHP-Java Bridge"
Thanks Dan,
I understand what you are saying. I have been thinking about trying that method too.
I made some progress with the JDBC/PHP using this code:
<?php
require_once ("java/Java.inc");
$drivermanager = new JavaClass('java.sql.DriverManager');
$conn1 = $drivermanager->getConnection("jdbc:mysql://localhost:3306/javatest?user=javauser&password=javadude") or die("Unable to connect to MySQL");
print $conn1;
echo '<br /><br />';
mysql_select_db("javatest", $conn1) or die('Could not connect: ' . mysql_error());
$result = mysql_query("SELECT id, foo, bar FROM testdata");
while ($row = mysql_fetch_array($result)) {
print "ID:".$row{'id'}." Name:".$row{'foo'}."
".$row{'bar'}."<br>";
}
mysql_close($conn1);
?>
This code returns "com.mysql.jdbc.JDBC4Connection@17351735
Could not connect: "
However if I remove $conn1 from this line:
mysql_select_db("javatest", $conn1) or die('Could not connect: ' . mysql_error());
to get this line:
mysql_select_db("javatest") or die('Could not connect: ' . mysql_error());
I get the error:
com.mysql.jdbc.JDBC4Connection@4bd04bd0
Could not connect: Access denied for user 'root'@'localhost' (using password: NO)
I think this indicates that the problem is with the mysql_select_db() function. I don't know whether I've coded this correctly seeing as I am suing JDBC. Maybe someone knows?
Anyway, going down the Java route may be difficult as I know nothing about Java really.
Anyway, if I do ahead and write the Java code, would I compile it as a *.jar file? Or would I compile it as a *.class file and use it as a servlet??
I'm guessing as a *.jar file so then the data within it can be called in PHP?
I'm still wondering though, would the SQL queries have to be coded in Java? Or could they be coded in PHP once the connection is established - the only reason I ask is because i am kind of up to that point already with my code above....I have a connection but the database cannot be selected?
rgs J
This message has been scanned for viruses by MailControl - www.mailcontrol.com
|
|
From: <php...@li...> - 2009-01-20 15:56:06
|
Hi,
If it were me, I would use some kind of data access layer written in
java. So the java data access layer would deal with the JNDI and
database statements, and php would just call it.
$userdao = new Java("com.foo.dao.UserDAO");
$userdao->addUser("dan","moore");
The UserDAO class would have an addUser method that would do all the
database manipulations.
I know that is not exactly what you are asking, but that is the way I'd
do this.
You might be able to return a jdbc connection across the php java bridge
as well. Have a java class get the connection from JNDI, and then run
normal JDBC commands against that connection.
$connmanager = new Java("com.foo.manager.ConnectionManager");
$stmt = $connmanager->createStatement("select * from users");
... more jdbc
I don't know if it is possible to get what is essentially a JDBC
connection from JNDI and treat it as a php db connection (which is what
the code you have below does).
Dan
On 1/20/2009 4:12 AM, php...@li... wrote:
> Hi there,
>
> I have deployed the JavaBridge war file into my Tomcat backend.
>
> I have successfully connected JSP to MySQL using MySQL Connector / J using JNDI (which is configured in the Tomcat server.xml and web.xml files).
>
> How can I use the PHP-Java Bridge to connect PHP to MySQL using the JNDI connection?
>
> I have tried this PHP code to call the JNDI connection jdbc/TestDB:
> <?php
>
> require_once("java/Java.inc");
>
> $dbh = mysql_connect("java:comp/env/jdbc/TestDB")
>
> ?>
>
> But i receive the error:
>
> Warning - mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Unknown MySQL server host 'java' (1)
>
> Is what I am trying to achieve possible with the PHP-Java Bridge? Do I need to require more than the java/Java.inc file in my code?
>
> If you could you supply me with or point me to the correct code to achieve this connection I would be most grateful.
>
> Kind regards
>
>
> This message has been scanned for viruses by MailControl - www.mailcontrol.com
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> SourcForge Community
> SourceForge wants to tell your story.
> http://p.sf.net/sfu/sf-spreadtheword
> _______________________________________________
> php-java-bridge-users mailing list
> php...@li...
> https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
|
|
From: <php...@li...> - 2009-01-20 11:25:26
|
Hi there,
I have deployed the JavaBridge war file into my Tomcat backend.
I have successfully connected JSP to MySQL using MySQL Connector / J using JNDI (which is configured in the Tomcat server.xml and web.xml files).
How can I use the PHP-Java Bridge to connect PHP to MySQL using the JNDI connection?
I have tried this PHP code to call the JNDI connection jdbc/TestDB:
<?php
require_once("java/Java.inc");
$dbh = mysql_connect("java:comp/env/jdbc/TestDB")
?>
But i receive the error:
Warning - mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Unknown MySQL server host 'java' (1)
Is what I am trying to achieve possible with the PHP-Java Bridge? Do I need to require more than the java/Java.inc file in my code?
If you could you supply me with or point me to the correct code to achieve this connection I would be most grateful.
Kind regards
This message has been scanned for viruses by MailControl - www.mailcontrol.com
|
|
From: <php...@li...> - 2009-01-19 23:02:57
|
Hi all, for a PHP application I'm building, under certain circumstances I need to communicate to a java backend (not always). Therefore, I only need to use the bridge on occasions and wish to minimize the time the bridge is actually running. >From the doc I gathered that I can use a cmd like 'java -jar JavaBridge.jar LOCAL:9200 3 JavaBridge.log' to start the bridge. Called from php this would allow me to start the bridge. However, I would only want to do this once, since for all subsequent communication I would want to use the existing bridge. Also, at some point I would want to shut down the bridge. My questions are therefore: 1) Is it possible to test whether a Java bridge is running? 2) If not 1), what happens if i try to start another bridge on the 9200 port? This is simply ignored? Or is some error given? 3) Is there an explicit way of shutting down the bridge? Thanks for anyone who has some insight in this. Cheers, Bart |
|
From: <php...@li...> - 2009-01-19 19:12:56
|
Hello!
With a dictionary for example.
Isn't it possible to simply use $this when a method is invoked from Java?!?
Peter
|
|
From: <php...@li...> - 2009-01-19 16:15:19
|
Hi,
> How should java_values() be able to "unwrap" the
> proxy
by fetching the PHP object.
> > However you can always access your PHP object through
> other mechanisms.
> Any hint how?
With a dictionary for example.
> What's the meaning of "5" and "6"
Two proposed predicates, see the PROTOCOL.TXT. However, these will probably never be implemented.
Regards,
Jost Bökemeier
|
|
From: <php...@li...> - 2009-01-18 18:38:54
|
Hi Jost, > Do you want to resolve the parameter or the argument? > I assume you want to unwrap the wrapped PHP object. > It might be a good idea to extend java_values() this way. I think in order to avoid confusion between "argument" and "parameter", I would say I want to "unwrap" the wrapped PHP object. But: invokeA() is called with a $Proxy0-object (ID v="4") How should java_values() be able to "unwrap" the proxy in order to get the actual PHP object which has been wrapped before using java_closure() resulting in an object with ID v="3"? It is not clear to me how this "ID-mapping" should work!? > However you can always access your PHP object through other mechanisms. Any hint how? What I already tried on the Java-side is to get a handle on the object that has been created with java_closure(). But I could not find out how to come from the $Proxy0-object to the PhpProcedure (which I assume is the one which has ID v="3" which I'm looking for). Other question regarding Java.inc: invokeBegin() is defined like this: function invokeBegin($object, $method) but called so: $client->protocol->invokeBegin(0, "makeClosure", "5", "6"); What's the meaning of "5" and "6" if invokeBegin() can only accept 2 parameters? Regards Jürgen -----Ursprüngliche Nachricht----- Von: php...@li... [mailto:php...@li...] Gesendet: Samstag, 18. Januar 2009 15:21 An: php...@li... Betreff: Re: [Php-java-bridge-users] How to wrap two PHP objects asjavaclosures,and in Java call a method on the first closure with the secondclosureas parameter? > Why shouldn't it be possible to resolve the actual > parameter $b to the actual PHP-object directly on the > PHP-side without going back to Java? Do you want to resolve the parameter or the argument? I assume you want to unwrap the wrapped PHP object. It might be a good idea to extend java_values() this way. However you can always access your PHP object through other mechanisms. Regards, Jost Bökemeier |
|
From: <php...@li...> - 2009-01-18 15:21:46
|
> Why shouldn't it be possible to resolve the actual
> parameter $b to the actual PHP-object directly on the
> PHP-side without going back to Java?
Do you want to resolve the parameter or the argument? I assume you want to unwrap the wrapped PHP object. It might be a good idea to extend java_values() this way.
However you can always access your PHP object through other mechanisms.
Regards,
Jost Bökemeier
|
|
From: <php...@li...> - 2009-01-18 10:34:47
|
Hi Jost,
> "But I don't understand why you insist using your own test case..."
Sorry, that I didn't explain yet:
The actual reason is that my whole setup is different (which maybe of interest for as well):
I don't use a web environment at all.
I have my PHP script in a file and call PHP from the command line.
Java-Bridge is running standalone.
So, the initiator for all communication is PHP (and not Java using the script engine like you do).
It didn't work at the beginning, but after modyfing Java.inc (e.g. changing ports 8080 to 9267, creating SimpleHandler instead of HttpHandler) it worked.
At the beginning I thought that my code should be understandable/reproducable for you.
But after I realized that in order to do so, you have to modify Java.inc, it seems clear to me, that no one may have done it like this before.
Anyway, I understood something from your latest reply:
With "use the same procedure as above" you meant use it in PHP instead of Java, like this:
> String classA = "class A{function toString(){return '::A';} function invokeA($b){java('java.lang.reflect.Proxy')->getInvocationHandler($b)->invoke($b, "invokeB", array());}}\n";
(this wasn't the case in your first example)
I also think these two lines are not necessary anymore:
> interface IA { public void invokeA(IB ccb); };
> interface IB { public void invokeB(); };
My test case now works (also without the two lines above) - thanks so far.
But still my general question is not answered:
Why shouldn't it be possible to resolve the actual parameter $b to the actual PHP-object directly on the PHP-side without going back to Java?
I thought that if you call java_closure($b) and later a method gets invoked on $b then the bridge first resolves $b and the method gets invoked directly on the PHP-object $b.
Is there any way to avoid this round-trip?
Regards Jürgen
-----Ursprüngliche Nachricht-----
Von: php...@li... [mailto:php...@li...]
Gesendet: Samstag, 17. Januar 2009 19:45
An: php...@li...
Betreff: Re: [Php-java-bridge-users] How to wrap two PHP objects asjavaclosures,and in Java call a method on the first closure with the secondclosureas parameter?
Hi Juergen,
I really don't understand the problem. I have posted a test case which does what you want.
I do understand that you don't have the information to resolve the type, so that you must call the methods through the reflection API.
But I don't understand why you insist using your own test case, which cannot work, because you confuse the proxy with the invocation handler.
-------------------------------------
package test;
import java.io.ByteArrayOutputStream;
import java.io.Closeable;
import java.io.OutputStreamWriter;
import javax.script.Invocable;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
public class TestGetInterface {
/**
* @param args
*/
public static void main(String[] args) throws Throwable {
//System.setProperty("php.java.bridge.default_log_file", "");
//System.setProperty("php.java.bridge.default_log_level", "3");
new TestGetInterface().doWork();
}
private ScriptEngine scriptEngine;
String classA = "class A{function toString(){return '::A';} function invokeA($b){java('java.lang.reflect.Proxy')->getInvocationHandler($b)->invoke($b, "invokeB", array());}}\n";
String classB = "class B{function toString(){return '::B';} function invokeB(){echo '::B';}}\n";
String test = "<?php "+classA+classB+" $thiz=java_context()->getAttribute('thiz');\n$thiz->call(java_closure(new A()), java_closure(new B())); ?>";
private void doWork() throws Throwable {
scriptEngine = new ScriptEngineManager().getEngineByName("php-invocable");
scriptEngine.put("thiz", this);
ByteArrayOutputStream out;
OutputStreamWriter writer;
scriptEngine.getContext().setWriter(writer = new OutputStreamWriter(out = new ByteArrayOutputStream()));
scriptEngine.eval(test);
((Closeable)scriptEngine).close();
writer.close();
if(!"::B".equals(out.toString())) {
System.err.println("test failed");
System.exit(1);
}
System.out.println("test okay");
System.exit(0);
}
interface IA { public void invokeA(IB ccb); };
interface IB { public void invokeB(); };
public void call(Object $cca, Object $ccb) throws Throwable {
((php.java.bridge.PhpProcedure)java.lang.reflect.Proxy.getInvocationHandler($cca)).invoke($cca, "invokeA", new Object[]{$ccb});
}
}
--------------
> So, what did you mean with "use the same procedure as above"?
Use the Java reflection API. The above example shows how to do this in PHP and in Java.
Regards,
Jost Boekemeier
|
|
From: <php...@li...> - 2009-01-17 19:02:51
|
Hi Juergen,
I really don't understand the problem. I have posted a test case which does what you want.
I do understand that you don't have the information to resolve the type, so that you must call the methods through the reflection API.
But I don't understand why you insist using your own test case, which cannot work, because you confuse the proxy with the invocation handler.
-------------------------------------
package test;
import java.io.ByteArrayOutputStream;
import java.io.Closeable;
import java.io.OutputStreamWriter;
import javax.script.Invocable;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
public class TestGetInterface {
/**
* @param args
*/
public static void main(String[] args) throws Throwable {
//System.setProperty("php.java.bridge.default_log_file", "");
//System.setProperty("php.java.bridge.default_log_level", "3");
new TestGetInterface().doWork();
}
private ScriptEngine scriptEngine;
String classA = "class A{function toString(){return '::A';} function invokeA($b){java('java.lang.reflect.Proxy')->getInvocationHandler($b)->invoke($b, "invokeB", array());}}\n";
String classB = "class B{function toString(){return '::B';} function invokeB(){echo '::B';}}\n";
String test = "<?php "+classA+classB+" $thiz=java_context()->getAttribute('thiz');\n$thiz->call(java_closure(new A()), java_closure(new B())); ?>";
private void doWork() throws Throwable {
scriptEngine = new ScriptEngineManager().getEngineByName("php-invocable");
scriptEngine.put("thiz", this);
ByteArrayOutputStream out;
OutputStreamWriter writer;
scriptEngine.getContext().setWriter(writer = new OutputStreamWriter(out = new ByteArrayOutputStream()));
scriptEngine.eval(test);
((Closeable)scriptEngine).close();
writer.close();
if(!"::B".equals(out.toString())) {
System.err.println("test failed");
System.exit(1);
}
System.out.println("test okay");
System.exit(0);
}
interface IA { public void invokeA(IB ccb); };
interface IB { public void invokeB(); };
public void call(Object $cca, Object $ccb) throws Throwable {
((php.java.bridge.PhpProcedure)java.lang.reflect.Proxy.getInvocationHandler($cca)).invoke($cca, "invokeA", new Object[]{$ccb});
}
}
--------------
> So, what did you mean with "use the same procedure as above"?
Use the Java reflection API. The above example shows how to do this in PHP and in Java.
Regards,
Jost Boekemeier
|
|
From: <php...@li...> - 2009-01-17 18:45:33
|
Hi,
> $ccb is and has been your Proxy$0, so how can the same
> object have two object numbers?
Not really. The return value of java_closure() is resolved lazily. A PhpProcedureProxy becomes an InvocationHandler + Proxy$xxx when a Java procedure or setter is called.
In other words Java always sees the Proxy$xx and the PhpProcedure associated with it.
> I think he wants you to use the reflection API.
Yes. You need to retrieve the InvocationHandler and call its method.
Regards,
Jost Boekemeier
|
|
From: <php...@li...> - 2009-01-17 18:25:19
|
Hello!
If I pass $ccb, however, I also get a new object to PHP (again v="4"
$ccb is and has been your Proxy$0, so how can the same object have two object numbers? (note that you wrap your proxy, but the wrapped object is still the same).
So, what did you mean with "use the same procedure as above"?
I think he wants you to use the reflection API.
Peter
|
|
From: <php...@li...> - 2009-01-17 10:11:21
|
Hi Jost,
in one of your previous responses you wrote:
> cca.invokeA(ccb);
> is equivalent to:
> ((PhpProcedure)Proxy.getInvocationHandler($cca))).invoke($cca, "invokeA", new Object[]{ccb});
> Note the ccb, it has been resolved using the interface IB.
> If you want to invoke it dynamically, too, use the same procedure as above.
So, because of your last statement I passed ccb instead of $ccb.
If I pass $ccb, however, I also get a new object to PHP (again v="4" instead of v="3") which is the $Proxy0 now,
and this one does also not understand method invokeB() (resulting in a java.lang.NoSuchMethodException).
So, what did you mean with "use the same procedure as above"?
(I believe that if I'd resolve ccb using the interface IB - as you did in your example - then it might work.
But this is exactly what I want to avoid:
Java should be agnostic of whatever method I want to invoke in PHP.
The method name should just be passed onto Java and the method be invoked dynamically.
Otherwise I would always have to provide all these methods as Java interfaces before I could call them.
And this would shoot down all the dynamics of PHP here.)
But I think I start to understand where the general contradiction is,
so let me try to draw a sequence diagram in pseudo code in order to explain
what I believe you expect it to behave and what I actually expected.
You probably see it like this:
PHP Java
--------------------------------------------
0 (before here closures have been created already)
1 $c->call($a, $b)
2 call($cca, $ccb)
3 => cca = getInvocationHandler($cca)
4 => cca.invoke( $cca, "invokeA", $ccb )
5 $a.invokeA($b)
6 => $b.invokeB()
7 $ccb.invokeB()
8 $b.invokeB()
9 => echo '::B'
(and that is the same whether I replace $ccb by ccb or not)
Whereas what I'd expect is:
....
5 $a.invokeA($b)
6 => $b.invokeB() // no Java call here!
9 => echo '::B'
To put that into prosa:
I want $a to call invokeB() on $b WITHOUT going back to Java (that's why I expect v="3" to get passed to PHP).
But it seems to me that you expect that invokeB() is always invoked through Java.
Is this correct?
Is this by intention?
Is there any way for me to achieve what I want?
(Because when I know that invokeB() is just to be invoked on $b on the PHP-side why should I take the overhead of going back through Java again?)
Regards Jürgen
-----Ursprüngliche Nachricht-----
Von: php...@li... [mailto:php...@li...]
Gesendet: Montag, 12. Januar 2009 14:38
An: php...@li...
Betreff: Re: [Php-java-bridge-users] How to wrap two PHP objects as javaclosures,and in Java call a method on the first closure with the secondclosure as parameter?
Hi Juergen,
> public void call(Object $cca, Object $ccb) {
> cca.invoke( $cca, "invokeA", new Object[]{ ccb
> So, the PhpProcedure passed to invokeA() is a new one.
yes, obviously. ccb != $ccb. However, why is this a problem?
> (which in turn causes invokeB() to fail...) Did I find a bug here?
What do you mean with causes invokeB() to fail? The test case I've attached in my previous mail runs correctly, invokeB() correctly returned the string ::B, so I don't see the problem.
Regards,
Jost Boekemeier
|
|
From: <php...@li...> - 2009-01-16 17:07:36
|
Hi,
> java.class.path=>:/home/tomcat/bin/bootstrap.jar
That's the bootstrap loader, yes.
> Should this not be set to so that it using
> java.class.path=>:/home/tomcat/webapps/JavaBridge/WEB-INF/lib/JavaBridge.jar
> ?
No. Java has no module system, so that application containers such as Tomcat must work around this problem.
Regards,
Jost Boekemeier
|
|
From: <php...@li...> - 2009-01-16 13:42:11
|
Hi, When I auto-deploy the JavaBridge.war file to tomcat/webapps and view the test.php page that shows the all the variables for PHP setup, and then the Java infromation at the very bottom, I noticed that the following: java.class.path=>:/home/tomcat/bin/bootstrap.jar Should this not be set to so that it using java.class.path=>:/home/tomcat/webapps/JavaBridge/WEB-INF/lib/JavaBridge.jar ? Or the path where the JavaBridge.jar file is located? I'm not sure whether using the bootstrap.jar will affect anything, will it? regards This message has been scanned for viruses by MailControl - www.mailcontrol.com |
|
From: <php...@li...> - 2009-01-15 15:26:26
|
Hi,
> I'm using java_context to register java objects during
objects stored in the JSR223 ENGINE_SCOPE are subject to garbage collection when the JSR 223 script engine terminates.
Regards,
Jost Boekemeier
|
|
From: <php...@li...> - 2009-01-15 02:31:38
|
Hi, I'm using java_context to register java objects during execution of a php script. I was wondering whether the bridge cleans up registered java objects after the script ends? Or should their disposal be done explicitly? Thanks already for any clarification, Bart |
|
From: <php...@li...> - 2009-01-13 14:35:48
|
=> http://php-java-bridge.sourceforge.net/pjb/examples/source.php?source=startJava.php |
|
From: <php...@li...> - 2009-01-12 23:14:47
|
Hi all, I have a very simple stand alone java App. It is not a client/server application and I call it from command line and it takes 1 or 2 seconds to finish. Now I want to call it from PHP and the way I found was using system() and exec() PHP function. The bad new is now it takes more than 4 seconds to execute. Since every time I call it from PHP the JVM is started and fished I think java bridge can help me in some way. How Java Bridge can help me to call this java app from PHP? Does the performance is improved? saludos, |
|
From: <php...@li...> - 2009-01-12 16:19:29
|
Hi Jost, I'm sorry, I was sloppy in my email. What worked was: $reportBody = getReportBody(); $reportBody = java_values($reportBody); ... processing ... What didn't work (on one server, but did work on the other for reasons unknown to me) was: $reportBody = getReportBody(); ... processing ... Hope this helps. Dan On 1/12/2009 7:09 AM, php...@li... wrote: > Hi, > > did I understand this correctly that > > $reportBody = java_values(getReportBody()); > > doesn't work but > > $reportBody = getReportBody(); > $reportBody = java_values($reportBody); > > does? > > If that's the case, you have found a bug in the PHP evaluator. > > > Regards, > Jost Boekemeier > > > > > > ------------------------------------------------------------------------------ > Check out the new SourceForge.net Marketplace. > It is the best place to buy or sell services for > just about anything Open Source. > http://p.sf.net/sfu/Xq1LFB > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users |
|
From: <php...@li...> - 2009-01-12 14:21:18
|
Hello!
=> ID now passed back is "4" instead of "3"!
Object #4 is the invocation handler, object #3 a Proxy. You have passed back the invocation handler instead of the proxy, see here:
PhpProcedure ccb = (PhpProcedure)Proxy.getInvocationHandler($ccb);
try {
cca.invoke( $cca, "invokeA", new Object[]{ ccb } );
} catch (AbortException ae) {
Peter
|
|
From: <php...@li...> - 2009-01-12 14:09:14
|
Hi,
did I understand this correctly that
$reportBody = java_values(getReportBody());
doesn't work but
$reportBody = getReportBody();
$reportBody = java_values($reportBody);
does?
If that's the case, you have found a bug in the PHP evaluator.
Regards,
Jost Boekemeier
|
|
From: <php...@li...> - 2009-01-12 13:37:53
|
Hi Juergen,
> public void call(Object $cca, Object $ccb) {
> cca.invoke( $cca, "invokeA", new Object[]{ ccb
> So, the PhpProcedure passed to invokeA() is a new one.
yes, obviously. ccb != $ccb. However, why is this a problem?
> (which in turn causes invokeB() to fail...)
> Did I find a bug here?
What do you mean with causes invokeB() to fail? The test case I've attached in my previous mail runs correctly, invokeB() correctly returned the string ::B, so I don't see the problem.
Regards,
Jost Boekemeier
|