connecting php and java via a javabridge port in openshift

跟風遠走 提交于 2019-12-08 07:03:04

问题


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.


回答1:


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).



来源:https://stackoverflow.com/questions/38478878/connecting-php-and-java-via-a-javabridge-port-in-openshift

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!