Solved

PHP-Java-Bridge Installation Error

Posted on 2006-11-14
3
1,733 Views
Last Modified: 2013-12-13
Hi,

I downloaded php-java-bridge and copied Java classes (in PHP files) from the package.  I omitted the JavaBridge.war, JavaBridge.jar, and php_java.dll, because I only want to run it using pure PHP classes (as noted in the documentation).

And I created a file (testJava.php) to test the Java calling function.  The script is below:

<?php
  require_once("lib/java/Java.php");
  $string = new Java("java.lang.String", "HelloWorld");
  echo $string;
?>

Where Java.php contains Java class declaration, etc.

After I run it on http://localhost/testJava.php, I found the following error message:

"Warning: fsockopen() [function.fsockopen]: unable to connect to 127.0.0.1:8080 (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. ) in C:\root\java\Protocol.php on line 269

Could not connect to the J2EE server.

Please start it, for example with the command: "java -Dphp.java.bridge.default_log_level=3 -Dphp.java.bridge.default_log_file="" -Dphp.java.bridge.promiscuous=true -classpath JavaBridge.jar php.java.bridge.JavaBridgeRunner 8080".

Error message: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (10060)"

So, it mentioned that it could not connect to J2EE server and was unable to connect to 127.0.0.1:8080.

Any idea of why this is happening?  Do I need to setup the J2EE server somewhere?  (Btw I have JRE installed)

Any other ideas are appreciated.
0
Comment
Question by:SWB-Consulting
3 Comments
 
LVL 48

Accepted Solution

by:
hernst42 earned 500 total points
ID: 17980082
I guess you don't need to setup a J2EE-Sever, just run on your windows server in a shell

java -Dphp.java.bridge.default_log_level=3 -Dphp.java.bridge.default_log_file="" -Dphp.java.bridge.promiscuous=true -classpath JavaBridge.jar php.java.bridge.JavaBridgeRunner 8080

with the installed jre. This is the background process needed to execute java-classes via php. Have you tried this?
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Wordpress Plugin - Search From Action to Another Plugin file 13 47
MySql and Apache/PHP Error Reporting 2 26
Loop through multiple arrays 13 27
Presenting past 6 months bug 7 25
Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question