Tag Archives: Java

PHP/Java bridge

I have recently tried the PHP/Java bridge and I must say I was pleasantly surprised. Installation took only 5 minutes and it works like a charme. The examples bundled with the application show some very nice usage examples.

Just a few things I noticed :

  • In Tomcat 5, the bridge doesn’t seem too stable. In some situations (exceptions), the Tomcat server just shuts down. I have upgraded to Tomcat 6 and the problem hasn’t occured since.
  • If you run your PHP code in apache, and Java in Tomcat, you could encounter the problem that the Java.inc file cannot be included :
    because the ‘allow_url_include‘ setting is disabled in PHP. I solved this by copying the Java.inc and JavaProxy.php files to the PHP server, including them the usual way :
    You can then set the location of the java bridge in your PHP code :

    define('JAVA_HOSTS', 'localhost:8090');
    define('JAVA_SERVLET', "JavaBridge");

Creating a thread dump in Eclipse

I’ve been trying to generate a thread dump in Eclipse, figuring out why an ant build wouldn’t stop running after all junit tests were finished. The JDK1.5 had some tools for showing a thread dump, but they seem to be deprecated and I couldn’t find any alternatives.

In the end the solution was simple… Run Eclipse with the eclipsec.exe (on windows obviously – don’t know if there are similar executables on other OS’es) instead of eclipse.exe. This will leave the console running, where you can do the well-known ctrl-break combination for generating the dump.