?
Solved

PHP-Java-Bridge Installation Error

Posted on 2006-11-14
3
Medium Priority
?
1,874 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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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 i…
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

650 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