简体   繁体   中英

connecting php and java via a javabridge port in openshift

On my locahost I am able to connect my php server codes to a java base code running on my netbeans via a javabridge imported class. The code for the java is below

public class Listener {

 public static final String JAVABRIDGE_PORT = "xxxx";//8080
static final php.java.bridge.JavaBridgeRunner runner =
        php.java.bridge.JavaBridgeRunner.getInstance(JAVABRIDGE_PORT);
/**
 * @param args the command line arguments
 * @throws java.lang.InterruptedException
 */
public static void main(String[] args) throws InterruptedException {
    // TODO code application logic here

    runner.waitFor();
    System.exit(0);
    }

}

but now am moving to this cool hosting site openshift for production and I need to do the same exact thing. My confusion is what application do I use in my openshift to run my java code. A couple of options I see available are JBOSS and TOMCAT but not sure how to go about this and with little research I know both applications are java EE for running java in web applications but is it the right tool for me or is there something else.

Going by this diagram ( http://php-java-bridge.sourceforge.net/pjb/ ) it looks like what you need to do is create two applications on openshift. One for the php code (using the php cartridge) and one for the java code (using one of the servlet or application containers) and then configure the Java bridge to know where your Java application is hosted (what it's url is).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM