NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
JAVA Integration


Joined: 18 Mar 2007
Posts: 3
Reply with quote
I am trying to get the PHP Java Bridge working in PHPEd and it doesn't seem to work. Do you know/have an example of how to do this. I can run either PHP v5.16 or v5.21.

Thanks,

Jose
View user's profileFind all posts by josetenSend private message
Veteran

Joined: 24 Jan 2006
Posts: 311
Reply with quote
Hi Jose - PhpED has nothing to do with Java bridge - it works if it is invoked in PHP engine. Which PHP are you using? Thanks!
View user's profileFind all posts by yfaktorSend private message


Joined: 18 Mar 2007
Posts: 3
Reply with quote
I have tried using the both the PHP5.16 that comes with PhpEd and with a fresh d/l of v5.21 from the source files.
View user's profileFind all posts by josetenSend private message
Veteran

Joined: 24 Jan 2006
Posts: 311
Reply with quote
what is the error anyway?
View user's profileFind all posts by yfaktorSend private message


Joined: 18 Mar 2007
Posts: 3
Reply with quote
My configuration:
W2k
Php v5.16
PHPEdit v4.6.3 in debug/server mode
JRE 1.5.10

Using the following I have successfully? performed communication using the bridge:

In a DOS box I run:
java -jar JavaBridge.jar SERVLET_LOCAL:9676

In my php.ini I have no java extension or module information

My Test.php is thus: (I tried using new Java(...) with no difference in results)

<?php

require_once("http://localhost:9676/JavaBridge/java/Java.inc");

$system = new JavaClass('java.lang.System');
$jversion = $system->getProperty('java.version');
// echo 'Java version=' . $jversion . '<br/>';
echo 'Java version=';
echo $jversion;
echo '<br/>';

?>

Result is:

******************************
Java version=[o(String):"1.5.0_10"]
******************************

If I uncomment the line below assignment of $jversion result is:

******************************
Java version=Object id #19
Java version=[o(String):"1.5.0_10"]
******************************

This can't be right!!!


I have also tried to activate the Java Bridge by adding the following to my php.ini:

extension=php_java.dll

and in the module settings section as follows:

[java]
java.home = "C:\Program Files\Java\jre1.5.0_09\bin"
java.java = "C:\Program Files\Java\jre1.5.0_09\bin\javaw.exe"
java.class.path = "C:\Program Files\nusphere\phped\php5\extensions\JavaBridge.jar"
java.library.path = "C:\Program Files\nusphere\phped\php5\extensions"
java.library = "C:\Program Files\Java\jre1.5.0_09\bin\client\jvm.dll"
java.log_level = 2

This causes a memory exception in the following code:

<?php

require_once("c:/java/Java.inc");
$system = new Java('java.lang.System');
$jversion = $system->getProperty('java.version');
echo 'Java version=' . $jversion . '<br/>';

?>

The error is a popup with the title - 'php-cgi.exe - Application Error'
and body - 'The instruction at "ox00d59a1f" referenced memory at "0x0325ce72". The memory could not be "written"' and ok/cancel
View user's profileFind all posts by josetenSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Definitely, it's not a bug in NuSphere product(s).
Feel free to file a report at bugs.php.net

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
PHP Java Bridge *UPDATE / FIXED*


Joined: 05 Sep 2007
Posts: 4
Location: San Diego, CA
Reply with quote
I have a similar problem, however I have PHP JavaBridge working successfully. My mappings *appear* to be ok, however I get a Failed to map "java.inc" in debug mode. I'm not referencing java.inc anywhere in my project!! In fact, this happends on any PHP file I attempt to debug that just echos one line -not using any Java/PHP bridge stuff at all!

Is there something in my PHP.ini I need to provide to satisfy the debugger? This isn't a problem at runtime so it is definately a PhpED debugger issue.

****UPDATE / FIXED****

Looks like I was able to resolve the issue:

I added the PHP JavaBridge zip and source file as a folder on my site both locally and on the remote server in hopes to resolve the missing map to java.inc, although it wasn't in use by my project. That got rid on the "Failed to map" message however, the debugger would just hang waiting for a debug session and then timeout.

Second, I went back to my php.ini file and reordered the extensions to local java.so before dbg.so-5.2.x. By placing dbg.so-5.5.2.x last in the list, and restarting apache2, the problem resolved itself! Hope this helps other users...
View user's profileFind all posts by SteveorevoSend private messageAIM AddressYahoo MessengerMSN Messenger
JAVA Integration
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic