Solved

PHP-Java-Bridge Installation Error

Posted on 2006-11-14
3
1,789 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

717 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