Solved

PHP-Java-Bridge Installation Error

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
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.

863 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

28 Experts available now in Live!

Get 1:1 Help Now