通过openshift中的javabridge端口连接php和java [英] connecting php and java via a javabridge port in openshift

查看:168
本文介绍了通过openshift中的javabridge端口连接php和java的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的locahost上,我能够通过javabridge导入的类将我的php服务器代码连接到运行在我的netbeans上的java基本代码。 java的代码低于

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);
    }

}

但现在我正在转向这个酷主机网站 openshift 用于制作,我需要做同样的事情。我的困惑是我在openshift中使用什么应用程序来运行我的java代码。我看到的几个选项是 JBOSS TOMCAT 但不知道如何解决这个问题并且很少研究我知道这两个应用程序都是用于在Web应用程序中运行java的java EE,但对我来说它是正确的工具还是还有别的东西。

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.

推荐答案

按此图表( http://php-java-bridge.sourceforge.net/pjb/) )看起来你需要做的就是在openshift上创建两个应用程序。一个用于php代码(使用php盒),一个用于java代码(使用其中一个servlet或应用程序容器),然后配置Java桥以了解Java应用程序的托管位置(它的URL是什么)。

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

这篇关于通过openshift中的javabridge端口连接php和java的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆