Solved

PHP-Java-Bridge Installation Error

Posted on 2006-11-14
3
1,717 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.

760 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now