|
From: <php...@li...> - 2009-09-13 22:13:22
|
Here is a little init script I wrote that I use to start/stop a php-
java-bridge standalone instance on my machine.
It took quite a bit of messing around to get all the various pieces
working and robust (ie logging startup failure output to the log file;
properly detecting the PID of java, etc).
I am not 100% confident that the line that launches the bridge is
perfect; so use your own knowledge to correct it. I am talking to Jost
in another thread about it at this time.
JAVA=/path/to/java
JAVA_BRIDGE_PATH=/path/to/JavaBridge.jar
CONTAINER_DIR=/path/to/my/project
#!/bin/zsh
PIDFILE=$CONTAINER_DIR/runtime/jvm.pid
start() {
echo "Starting JVM: "
LOGFILE=$CONTAINER_DIR/log/jvm.log
$JAVA -server -Xmx1200m -Dphp.java.bridge.default_log_level=5 -
jar $JAVA_BRIDGE_PATH SERVLET:9676 2>$LOGFILE 1>$LOGFILE &
echo $! > $PIDFILE
echo "waiting 5s for JVM to finish starting up..."
sleep 5
PID=`cat $PIDFILE`
ps -p $PID > /dev/null
if [ $? = 0 ]; then
echo "Java Bridge VM started in background, detached from
shell. PID=$PID"
exit 0
else
echo "Java Bridge VM failed to start."
exit 1
fi
}
stop() {
pid=`cat $PIDFILE`
echo "Stopping JVM (alleged pid $pid}): "
ps -p `cat $PIDFILE` | grep java
if [ $? = 0 ]; then
kill `cat $PIDFILE`
rm -f $PIDFILE
exit 0
else
echo "PID is not a jvm. Aborting stop."
exit 1
fi
}
case "$1" in
start)
start
;;
stop)
stop
;;
*)
echo $"Usage: runbridge.sh {start|stop}"
exit 1
esac
|
|
From: <php...@li...> - 2009-09-13 22:20:11
|
There is one in the CVS attic.
However, Tomcat or JEE servers are easier to handle, please use them as the
Java back end, if you can. -- these don't have obscure options like SERVLET
or SERVLET_LOCAL either. :)
Regards,
Jost Boekemeier
On Sep 14, 2009 12:13 AM, <php...@li...>
wrote:
Here is a little init script I wrote that I use to start/stop a php-
java-bridge standalone instance on my machine.
It took quite a bit of messing around to get all the various pieces
working and robust (ie logging startup failure output to the log file;
properly detecting the PID of java, etc).
I am not 100% confident that the line that launches the bridge is
perfect; so use your own knowledge to correct it. I am talking to Jost
in another thread about it at this time.
JAVA=/path/to/java
JAVA_BRIDGE_PATH=/path/to/JavaBridge.jar
CONTAINER_DIR=/path/to/my/project
#!/bin/zsh
PIDFILE=$CONTAINER_DIR/runtime/jvm.pid
start() {
echo "Starting JVM: "
LOGFILE=$CONTAINER_DIR/log/jvm.log
$JAVA -server -Xmx1200m -Dphp.java.bridge.default_log_level=5 -
jar $JAVA_BRIDGE_PATH SERVLET:9676 2>$LOGFILE 1>$LOGFILE &
echo $! > $PIDFILE
echo "waiting 5s for JVM to finish starting up..."
sleep 5
PID=`cat $PIDFILE`
ps -p $PID > /dev/null
if [ $? = 0 ]; then
echo "Java Bridge VM started in background, detached from
shell. PID=$PID"
exit 0
else
echo "Java Bridge VM failed to start."
exit 1
fi
}
stop() {
pid=`cat $PIDFILE`
echo "Stopping JVM (alleged pid $pid}): "
ps -p `cat $PIDFILE` | grep java
if [ $? = 0 ]; then
kill `cat $PIDFILE`
rm -f $PIDFILE
exit 0
else
echo "PID is not a jvm. Aborting stop."
exit 1
fi
}
case "$1" in
start)
start
;;
stop)
stop
;;
*)
echo $"Usage: runbridge.sh {start|stop}"
exit 1
esac
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus
on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
php-java-bridge-users mailing list
php...@li...
https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
|
|
From: <php...@li...> - 2009-09-13 22:25:58
|
Easier to handle is relative, no? I have -0- experience running Java
App Servers. This is why I run it standalone; it is plenty fast, has
been very reliable for me, and it's only 1 process to manage, so it's
simple for me to understand. If a java app server has problems, I have
no idea how to easily deal with it...
Is it *bad* to run it standalone? What would I gain by switching?
Alan
On Sep 13, 2009, at 6:19 PM, php-java-bridge-
us...@li... wrote:
> There is one in the CVS attic.
>
> However, Tomcat or JEE servers are easier to handle, please use them
> as the
> Java back end, if you can. -- these don't have obscure options like
> SERVLET
> or SERVLET_LOCAL either. :)
>
> Regards,
> Jost Boekemeier
>
> On Sep 14, 2009 12:13 AM, <php-java-bridge-
> us...@li...>
> wrote:
>
> Here is a little init script I wrote that I use to start/stop a php-
> java-bridge standalone instance on my machine.
>
> It took quite a bit of messing around to get all the various pieces
> working and robust (ie logging startup failure output to the log file;
> properly detecting the PID of java, etc).
>
> I am not 100% confident that the line that launches the bridge is
> perfect; so use your own knowledge to correct it. I am talking to Jost
> in another thread about it at this time.
>
> JAVA=/path/to/java
> JAVA_BRIDGE_PATH=/path/to/JavaBridge.jar
> CONTAINER_DIR=/path/to/my/project
>
>
> #!/bin/zsh
> PIDFILE=$CONTAINER_DIR/runtime/jvm.pid
>
> start() {
> echo "Starting JVM: "
> LOGFILE=$CONTAINER_DIR/log/jvm.log
> $JAVA -server -Xmx1200m -Dphp.java.bridge.default_log_level=5 -
> jar $JAVA_BRIDGE_PATH SERVLET:9676 2>$LOGFILE 1>$LOGFILE &
> echo $! > $PIDFILE
> echo "waiting 5s for JVM to finish starting up..."
> sleep 5
> PID=`cat $PIDFILE`
> ps -p $PID > /dev/null
> if [ $? = 0 ]; then
> echo "Java Bridge VM started in background, detached from
> shell. PID=$PID"
> exit 0
> else
> echo "Java Bridge VM failed to start."
> exit 1
> fi
> }
> stop() {
> pid=`cat $PIDFILE`
> echo "Stopping JVM (alleged pid $pid}): "
> ps -p `cat $PIDFILE` | grep java
> if [ $? = 0 ]; then
> kill `cat $PIDFILE`
> rm -f $PIDFILE
> exit 0
> else
> echo "PID is not a jvm. Aborting stop."
> exit 1
> fi
> }
>
> case "$1" in
> start)
> start
> ;;
> stop)
> stop
> ;;
> *)
> echo $"Usage: runbridge.sh {start|stop}"
> exit 1
> esac
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008
> 30-Day
> trial. Simplify your report design, integration and deployment - and
> focus
> on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now. http://p.sf.net/sfu/bobj-july
> _______________________________________________
> php-java-bridge-users mailing list
> php...@li...
> https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008
> 30-Day
> trial. Simplify your report design, integration and deployment - and
> focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now. http://p.sf.net/sfu/bobj-july
> _______________________________________________
> php-java-bridge-users mailing list
> php...@li...
> https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
|
|
From: <php...@li...> - 2009-09-17 12:57:01
|
[Please excuse the delay] > Easier to handle is relative, no? May be. On Windows and Linux all you need to do is to start the graphical software installer and install tomcat. After that it runs as a standard system service. > Is it *bad* to run it standalone? Not at all. But it may not be as fast as a servlet back end with JAVA_PERSISTENT_SERVLET_CONNECTIONS set to true. The simple servlet engine built into JavaBridge.jar cannot handle persistent connections (it uses http/1.0, not http/1.1). But the standalone socket listener can use persistent connections: java -jar JavaBridge.jar INET_LOCAL:9267 And in your php script or in java.inc set JAVA_HOSTS to "127.0.0.1:9267" and JAVA_SERVLET to false. Regards, Jost Boekemeier On Sep 14, 2009 12:26 AM, <php...@li...> wrote: Easier to handle is relative, no? I have -0- experience running Java App Servers. This is why I run it standalone; it is plenty fast, has been very reliable for me, and it's only 1 process to manage, so it's simple for me to understand. If a java app server has problems, I have no idea how to easily deal with it... Is it *bad* to run it standalone? What would I gain by switching? Alan On Sep 13, 2009, at 6:19 PM, php-java-bridge- us...@li... wrote: > There is one in the CVS attic. > > However, Tomcat or JEE serv... |
|
From: <php...@li...> - 2009-09-17 13:05:24
|
Ok cool, thanks I'll try the INET_LOCAL as well! I think last time I tried INET_LOCAL I didn't also do JAVA_SERVLET=false which probably is why it didn't work. I'd imagine it affects the way the client tries to communicate with the back-end. Alan On Sep 17, 2009, at 8:56 AM, php-java-bridge- us...@li... wrote: > [Please excuse the delay] > >> Easier to handle is relative, no? > > May be. On Windows and Linux all you need to do is to start the > graphical > software installer and install tomcat. After that it runs as a > standard > system service. > >> Is it *bad* to run it standalone? > > Not at all. But it may not be as fast as a servlet back end with > JAVA_PERSISTENT_SERVLET_CONNECTIONS set to true. > > The simple servlet engine built into JavaBridge.jar cannot handle > persistent > connections (it uses http/1.0, not http/1.1). But the standalone > socket > listener can use persistent connections: > > java -jar JavaBridge.jar INET_LOCAL:9267 > > And in your php script or in java.inc set JAVA_HOSTS to > "127.0.0.1:9267" and > JAVA_SERVLET to false. > > Regards, > Jost Boekemeier > > On Sep 14, 2009 12:26 AM, <php-java-bridge- > us...@li...> > wrote: > > Easier to handle is relative, no? I have -0- experience running Java > App Servers. This is why I run it standalone; it is plenty fast, has > been very reliable for me, and it's only 1 process to manage, so it's > simple for me to understand. If a java app server has problems, I have > no idea how to easily deal with it... > > Is it *bad* to run it standalone? What would I gain by switching? > > Alan > > On Sep 13, 2009, at 6:19 PM, php-java-bridge- > > us...@li... wrote: > There is one in the CVS attic. > > > > However, Tomcat or JEE serv... > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry® Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart > your > developing skills, take BlackBerry mobile applications to market and > stay > ahead of the curve. Join us from November 9-12, 2009. Register > now! > http://p.sf.net/sfu/devconf > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users |
|
From: <php...@li...> - 2009-09-17 13:22:42
|
JAVA_SERVLET false is a new feature in Java.inc 5.5.2. In earlier Java.inc versions you had to write a callback function "java_get_default_channel()", please see the NEWS file for details. On Sep 17, 2009 3:06 PM, <php...@li...> wrote: Ok cool, thanks I'll try the INET_LOCAL as well! I think last time I tried INET_LOCAL I didn't also do JAVA_SERVLET=false which probably is why it didn't work. I'd imagine it affects the way the client tries to communicate with the back-end. Alan On Sep 17, 2009, at 8:56 AM, php-java-bridge- us...@li... wrote: > [Please excuse the delay] > >> Easier to handle is relative, n... > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry® Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart > your > developing skills, take BlackBerry mobile applications to market and > stay > ahead of the curve. Join us from November 9-12, 2009. Register > now! > http://p.sf.net/sfu/devconf > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users-----------------------------... Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ php-java-bridge-users mailing list php...@li... https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users |
|
From: <php...@li...> - 2009-09-26 21:01:43
|
Jost- I just upgraded to the 5.5.2 version and the Java.inc file somehow breaks my own autoload handler. I tried debugging it a little bit, but the Java.inc file has essentially no whitespace making it really hard to figure out what's going on. Is there a copy of that file somewhere that has reasonable indentation and code style for debugging purposes? Alan On Sep 17, 2009, at 8:56 AM, php-java-bridge- us...@li... wrote: > [Please excuse the delay] > >> Easier to handle is relative, no? > > May be. On Windows and Linux all you need to do is to start the > graphical > software installer and install tomcat. After that it runs as a > standard > system service. > >> Is it *bad* to run it standalone? > > Not at all. But it may not be as fast as a servlet back end with > JAVA_PERSISTENT_SERVLET_CONNECTIONS set to true. > > The simple servlet engine built into JavaBridge.jar cannot handle > persistent > connections (it uses http/1.0, not http/1.1). But the standalone > socket > listener can use persistent connections: > > java -jar JavaBridge.jar INET_LOCAL:9267 > > And in your php script or in java.inc set JAVA_HOSTS to > "127.0.0.1:9267" and > JAVA_SERVLET to false. > > Regards, > Jost Boekemeier > > On Sep 14, 2009 12:26 AM, <php-java-bridge- > us...@li...> > wrote: > > Easier to handle is relative, no? I have -0- experience running Java > App Servers. This is why I run it standalone; it is plenty fast, has > been very reliable for me, and it's only 1 process to manage, so it's > simple for me to understand. If a java app server has problems, I have > no idea how to easily deal with it... > > Is it *bad* to run it standalone? What would I gain by switching? > > Alan > > On Sep 13, 2009, at 6:19 PM, php-java-bridge- > > us...@li... wrote: > There is one in the CVS attic. > > > > However, Tomcat or JEE serv... > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry® Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart > your > developing skills, take BlackBerry mobile applications to market and > stay > ahead of the curve. Join us from November 9-12, 2009. Register > now! > http://p.sf.net/sfu/devconf > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users |
|
From: <php...@li...> - 2009-09-27 04:43:59
|
Hi, > [something] breaks my own autoload handler Both __autoload() and spl_autoload_register(null) are broken by design. If you use either, you wrote a bug. Please see the PHP documentation for details. > and code style for debugging purposes? Just require JavaBridge.inc from the src.zip (within the documentation zip download). Regards, Jost Boekemeier On Sep 26, 2009 11:02 PM, <php...@li...> wrote: Jost- I just upgraded to the 5.5.2 version and the Java.inc file somehow breaks my own autoload handler. I tried debugging it a little bit, but the Java.inc file has essentially no whitespace making it really hard to figure out what's going on. Is there a copy of that file somewhere that has reasonable indentation and code style for debugging purposes? Alan On Sep 17, 2009, at 8:56 AM, php-java-bridge- us...@li... wrote: > [Please excuse the delay] > >> Easier to handle is relative, n... > ------------------------------------------------------------------------------ > Come build with u... > http://p.sf.net/sfu/devconf > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users-----------------------------... Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event y... http://p.sf.net/sfu/devconf _______________________________________________ php-java-bridge-users mailing list php...@li... https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users |
|
From: <php...@li...> - 2009-09-27 14:38:01
|
>> [something] breaks my own autoload handler > > Both __autoload() and spl_autoload_register(null) are broken by > design. If > you use either, you wrote a bug. Please see the PHP documentation for > details. Ah ok I had forgotten that I never upgraded my framework to use spl_autoload_register instead of __autoload. Just did that and now it's working again. Will try the new bridge version shortly. Thanks! Alan |