From: <php...@li...> - 2011-01-14 14:36:16
|
Sorry, i forgot something in the commandline. Anyway, the test installation does not have to be deployed in tomcat. Just go to the war-file and do: java -Xms128m -Xmx128m -cp EchoServer.war TestInstallation Tomcat is not needed for this test program. On Fri, Jan 14, 2011 at 3:30 PM, < php...@li...> wrote: > Hi, > > it tried that already when i fire: > > java -Xms128m -Xmx128m -cp EchoServer.war > > (I renamed the .war to EchoServer before autodeploying). I get only the > java > help context shown like: > > java -Xms128m -Xmx128m -cp EchoServer.war > Usage: java [-options] class [args...] > (to execute a class) > or java [-options] -jar jarfile [args...] > (to execute a jar file) > > where options include: > -d32 use a 32-bit data model if available > > -d64 use a 64-bit data model if available > -server to select the "server" VM > The default VM is server. > > -cp <class search path of directories and zip/jar files> > -classpath <class search path of directories and zip/jar files> > A : separated list of directories, JAR archives, > and ZIP archives to search for class files. > -D<name>=<value> > set a system property > -verbose[:class|gc|jni] > enable verbose output > -version print product version and exit > -version:<value> > require the specified version to run > -showversion print product version and continue > -jre-restrict-search | -jre-no-restrict-search > include/exclude user private JREs in the version search > -? -help print this help message > -X print help on non-standard options > -ea[:<packagename>...|:<classname>] > -enableassertions[:<packagename>...|:<classname>] > enable assertions > -da[:<packagename>...|:<classname>] > -disableassertions[:<packagename>...|:<classname>] > disable assertions > -esa | -enablesystemassertions > enable system assertions > -dsa | -disablesystemassertions > disable system assertions > -agentlib:<libname>[=<options>] > load native agent library <libname>, e.g. -agentlib:hprof > see also, -agentlib:jdwp=help and -agentlib:hprof=help > -agentpath:<pathname>[=<options>] > load native agent library by full pathname > -javaagent:<jarpath>[=<options>] > load Java programming language agent, see > java.lang.instrument > -splash:<imagepath> > show splash screen with specified image > > so something must be different in your ubuntu linux then I the debian lenny > I use. > > -----Original Message----- > From: php...@li... > [mailto:php...@li...] > Sent: Freitag, 14. Januar 2011 13:22 > To: php...@li... > Subject: Re: [Php-java-bridge-users] Installation of JavaBridge causes > problems - what am i missing > > Hello > > you should not type this into the shell: > java "-Xms128m -Xmx256m" > > you should type: > java -Xms128m -Xmx128m -cp JavaBridge.war > > There are no "" in it. Also this memory settings only apply for this java > launch. > You cannot run > java -Xms128m -Xmx128m > and expect that memory settings are applied later when you run a java > program. > > Please try this: > Make sure all java processes are terminated like described before and then > type > java -Xms128m -Xmx128m -cp JavaBridge.war > > David > > > On Fri, Jan 14, 2011 at 12:57 PM, < > php...@li...> wrote: > > > Thx for your help. So I installed php5-cgi which is now in > > /usr/bin/php5-cgi. Also I get more ram into the machine. The setting of > the > > memory limits does not work at all in the command line whatever I put it > > does not work. At least I got something when putting: > > > > java "-Xms128m -Xmx256m" > > Invalid initial heap size: -Xms128m -Xmx256m > > Could not create the Java virtual machine. > > > > But I only get the same message whatever I put there so I hardcoded the > > memory directly into the tomcat and catalina startup script. Something > like > > this: > > > > export CATALINA_OPTS="-Xms16m -Xmx256m" > > export JAVA_OPTS="-Xms16m -Xmx256m" > > > > when running testinstallation these error are thrown: > > > > Starting a simple servlet engine: > > [/usr/lib/jvm/java-6-openjdk/jre/bin/java, > > -jar, /opt/tomcat/webapps/ext/JavaBridge.jar, SERVLET_LOCAL:8080] > > Jan 14 12:34:50 JavaBridge INFO : VM : > > 1.6.0_0@http://java.sun.com/ > > Jan 14 12:34:50 JavaBridge INFO : JavaBridge version : 6.2.1 > > Jan 14 12:34:50 JavaBridge INFO : logFile : > > Jan 14 12:34:50 JavaBridge INFO : default logLevel : 3 > > Jan 14 12:34:50 JavaBridge INFO : socket : > SERVLET_LOCAL:8080 > > Jan 14 12:34:50 JavaBridge INFO : java.ext.dirs : > > /usr/lib/jvm/java-6-openjdk/jre/lib/ext:/usr/java/packages/lib/ext > > Jan 14 12:34:50 JavaBridge INFO : php.java.bridge.base: /root > > Jan 14 12:34:50 JavaBridge INFO : thread pool size : 20 > > Jan 14 12:34:50 JavaBridge INFO : JavaBridgeRunner started on port > > INET_LOCAL:8080 > > Invoking php: [/usr/bin/php-cgi, -n, -d, allow_url_include=On, > > /opt/tomcat/webapps/test.php] > > java.lang.RuntimeException: Could not run PHP ([/usr/bin/php-cgi, -n, -d, > > allow_url_include=On, /opt/tomcat/webapps/test.php]), please check if > > php-cgi is in the path. > > at TestInstallation.start(TestInstallation.java:332) > > at TestInstallation.main(TestInstallation.java:252) > > Caused by: java.io.IOException: Cannot run program "/usr/bin/php-cgi": > > java.io.IOException: error=12, Cannot allocate memory > > at java.lang.ProcessBuilder.start(ProcessBuilder.java:474) > > at java.lang.Runtime.exec(Runtime.java:610) > > at java.lang.Runtime.exec(Runtime.java:526) > > at TestInstallation.start(TestInstallation.java:330) > > ... 1 more > > Caused by: java.io.IOException: java.io.IOException: error=12, Cannot > > allocate memory > > at java.lang.UNIXProcess.<init>(UNIXProcess.java:164) > > at java.lang.ProcessImpl.start(ProcessImpl.java:81) > > at java.lang.ProcessBuilder.start(ProcessBuilder.java:467) > > ... 4 more > > > > So now I think the memory settings are excepted its just a matter of > > finding > > the right settings and I have to also wait for the new ram coming. But > the > > message that php-cgi is not in the path really freaks my out. > > /usr/bin/php-cgi does exist so does /usr/bin/php5-cgi which I tried to > > change directly in the web.xml. but right now am stuck with this error > > message because I don't know where to change anything on top?! I think I > > may > > have to alter the servlet containter for correct php routing but how? > > > > Btw that gives: Php -v > > > > PHP 5.2.6-1+lenny9 with Suhosin-Patch 0.9.6.2 (cli) (built: Aug 4 2010 > > 06:06:53) > > Copyright (c) 1997-2008 The PHP Group > > Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies > > > > Thx for all your help - I think we are getting close > > > > Fra* > > > > > > -----Original Message----- > > From: php...@li... > > [mailto:php...@li...] > > Sent: Freitag, 14. Januar 2011 08:16 > > To: php...@li... > > Subject: Re: [Php-java-bridge-users] Installation of JavaBridge causes > > problems - what am i missing > > > > What does php -v display? > > Am 13.01.2011 15:40 schrieb <php...@li... > >: > > > sorry, of course that command does not use 256 but only 128 MB. > > > I use the same values for Xms and Xmx because it should be faster > > > then continuously allocating more memory. > > > > > > On Thu, Jan 13, 2011 at 3:33 PM, Zagoti Bagon <za...@gm...> > wrote: > > > > > >> Ok, i did some testing for you in a 1 GB virtual machine (virtual box > - > > >> ubuntu). > > >> > > >> The php-java-bridge starts a local servlet container. > > >> But it doesnt stop it. So you should first check that > > >> all java processes have terminated. > > >> > > >> ps -ef | grep java > > >> > > >> if there still is a java process, kill it. > > >> > > >> kill <pid> > > >> (The pid is in the second column of ps -ef) > > >> if this does not help: > > >> kill -9 <pid> > > >> > > >> After that try this: > > >> > > >> java -Xms128m -Xmx128m -cp JavaBridge.war > > >> > > >> If it still complains about php-cgi, then as root: > > >> > > >> apt-get install php5-cgi > > >> > > >> Before you retry check again if the all java processes have > terminated. > > >> > > >> I dont know if 256 M will be enough for your production environment. > > >> > > >> Regards > > >> David > > >> > > >> > > >> On Thu, Jan 13, 2011 at 1:23 PM, < > > >> php...@li...> wrote: > > >> > > >>> Hi, > > >>> > > >>> thx for the help. It's a VPS with 1 GB real memory. I see the problem > > java > > >>> does not let me change its max memory with > > >>> > > >>> java -Xmx512m (unknown identifier) > > >>> > > >>> instead I tried > > >>> > > >>> export JAVA_OPTS="-Xms256m -Xmx512m" > > >>> export CATALINA_OPTS="-Xms256m -Xmx512m" > > >>> > > >>> running the testinstallation produced: > > >>> > > >>> > > >>> Starting a simple servlet engine: > > >>> [/usr/lib/jvm/java-6-openjdk/jre/bin/java, > > >>> -jar, /opt/tomcat/webapps/ext/JavaBridge.jar, SERVLET_LOCAL:8080] > > >>> Jan 13 13:15:45 JavaBridge INFO : VM : > > >>> 1.6.0_0@http://java.sun.com/ > > >>> Jan 13 13:15:45 JavaBridge INFO : JavaBridge version : 6.2.1 > > >>> Jan 13 13:15:45 JavaBridge INFO : logFile : > > >>> Jan 13 13:15:45 JavaBridge INFO : default logLevel : 3 > > >>> Jan 13 13:15:45 JavaBridge INFO : socket : SERVLET_LOCAL:8080 > > >>> Jan 13 13:15:45 JavaBridge INFO : java.ext.dirs : > > >>> /usr/lib/jvm/java-6-openjdk/jre/lib/ext:/usr/java/packages/lib/ext > > >>> Jan 13 13:15:45 JavaBridge INFO : php.java.bridge.base: /root > > >>> Jan 13 13:15:45 JavaBridge INFO : thread pool size : 20 > > >>> Jan 13 13:15:45 JavaBridge INFO : JavaBridgeRunner started on port > > >>> INET_LOCAL:8080 > > >>> Invoking php: [php-cgi, -n, -d, allow_url_include=On, > > >>> /opt/tomcat/webapps/test.php] > > >>> java.lang.RuntimeException: Could not run PHP ([php-cgi, -n, -d, > > >>> allow_url_include=On, /opt/tomcat/webapps/test.php]), please check if > > >>> php-cgi is in the path. > > >>> at TestInstallation.start(TestInstallation.java:332) > > >>> at TestInstallation.main(TestInstallation.java:252) > > >>> Caused by: java.io.IOException: Cannot run program "php-cgi": > > >>> java.io.IOException: error=12, Cannot allocate memory > > >>> at java.lang.ProcessBuilder.start(ProcessBuilder.java:474) > > >>> at java.lang.Runtime.exec(Runtime.java:610) > > >>> at java.lang.Runtime.exec(Runtime.java:526) > > >>> at TestInstallation.start(TestInstallation.java:330) > > >>> ... 1 more > > >>> Caused by: java.io.IOException: java.io.IOException: error=12, Cannot > > >>> allocate memory > > >>> at java.lang.UNIXProcess.<init>(UNIXProcess.java:164) > > >>> at java.lang.ProcessImpl.start(ProcessImpl.java:81) > > >>> at java.lang.ProcessBuilder.start(ProcessBuilder.java:467) > > >>> ... 4 more > > >>> > > >>> And then > > >>> > > >>> Free -m (821 m free, prior it was already up to 1024m full an > leaking) > > >>> > > >>> The question is how much real ram should I install to be safe. Whats > > with > > >>> the message "please check if php-cgi is in the path" > > >>> > > >>> Thx for your help - appreciated > > >>> > > >>> -----Original Message----- > > >>> From: php...@li... > > >>> [mailto:php...@li...] > > >>> Sent: Donnerstag, 13. Januar 2011 09:14 > > >>> To: php...@li... > > >>> Subject: Re: [Php-java-bridge-users] Installation of JavaBridge > causes > > >>> problems - what am i missing > > >>> > > >>> Hello, > > >>> > > >>> i had a similar problem in a different context. I guess your problem > is > > >>> not > > >>> the php-java-bridge. > > >>> On a virtual host you often have very limited memory available. How > > much > > >>> memory did you order for your virtual server? > > >>> > > >>> You can use linux commands like > > >>> free -m > > >>> to find out how your current memory usage is. > > >>> > > >>> Look at your error message. Quite at the start it says: > > >>> > > >>> Caused by: java.io.IOException: Cannot run program > > >>> "/usr/lib/jvm/java-6-openjdk/ > > >>> jre/bin/java": java.io.IOException: error=12, > > >>> Cannot allocate memory > > >>> > > >>> So find out how much memory you have available and then adjust the > > start > > >>> scripts of the php test program and of your tomcat. > > >>> Look for the java options -Xms and -Xmx > > >>> Documentation: > > >>> > > > http://download.oracle.com/javase/6/docs/technotes/tools/solaris/java.html > > >>> > > >>> Also dont run too many jvm instances at the same time. I believe the > > >>> php-java-bridge test programm starts its own jvm, so dont start the > > test > > >>> while tomcat is runing. I think your virtual machine might not have > > enough > > >>> memory for both instances. > > >>> > > >>> Regards, David > > >>> > > >>> > > >>> On Wed, Jan 12, 2011 at 1:55 PM, < > > >>> php...@li...> wrote: > > >>> > > >>> > Please see > > http://php-java-bridge.sourceforge.net/pjb/installation.php > > >>> > > > >>> > With "original software" I mean Java from Oracle and Tomcat from > > Apache. > > >>> > The > > >>> > crap shipped with Debian OS doesn't work. > > >>> > > > >>> > > > >>> > > >>> > > > > > > ---------------------------------------------------------------------------- > > >>> -- > > >>> > Protect Your Site and Customers from Malware Attacks > > >>> > Learn about various malware tactics and how to avoid them. > Understand > > >>> > malware threats, the impact they can have on your business, and how > > you > > >>> > can protect your company and customers by using code signing. > > >>> > http://p.sf.net/sfu/oracle-sfdevnl > > >>> > _______________________________________________ > > >>> > php-java-bridge-users mailing list > > >>> > php...@li... > > >>> > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > > >>> > > > >>> > > >>> > > > > > > ---------------------------------------------------------------------------- > > >>> -- > > >>> Protect Your Site and Customers from Malware Attacks > > >>> Learn about various malware tactics and how to avoid them. Understand > > >>> malware threats, the impact they can have on your business, and how > you > > >>> can protect your company and customers by using code signing. > > >>> http://p.sf.net/sfu/oracle-sfdevnl > > >>> _______________________________________________ > > >>> php-java-bridge-users mailing list > > >>> php...@li... > > >>> https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > > >>> > > >>> > > >>> > > >>> > > > > > > ---------------------------------------------------------------------------- > > -- > > >>> Protect Your Site and Customers from Malware Attacks > > >>> Learn about various malware tactics and how to avoid them. Understand > > >>> malware threats, the impact they can have on your business, and how > you > > >>> can protect your company and customers by using code signing. > > >>> http://p.sf.net/sfu/oracle-sfdevnl > > >>> _______________________________________________ > > >>> php-java-bridge-users mailing list > > >>> php...@li... > > >>> https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > > >>> > > >> > > >> > > > > > > > > > ---------------------------------------------------------------------------- > > -- > > > Protect Your Site and Customers from Malware Attacks > > > Learn about various malware tactics and how to avoid them. Understand > > > malware threats, the impact they can have on your business, and how you > > > can protect your company and customers by using code signing. > > > http://p.sf.net/sfu/oracle-sfdevnl > > > _______________________________________________ > > > php-java-bridge-users mailing list > > > php...@li... > > > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > > > > > > ---------------------------------------------------------------------------- > > -- > > Protect Your Site and Customers from Malware Attacks > > Learn about various malware tactics and how to avoid them. Understand > > malware threats, the impact they can have on your business, and how you > > can protect your company and customers by using code signing. > > http://p.sf.net/sfu/oracle-sfdevnl > > _______________________________________________ > > php-java-bridge-users mailing list > > php...@li... > > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > > > > > > > > > > ---------------------------------------------------------------------------- > -- > > Protect Your Site and Customers from Malware Attacks > > Learn about various malware tactics and how to avoid them. Understand > > malware threats, the impact they can have on your business, and how you > > can protect your company and customers by using code signing. > > http://p.sf.net/sfu/oracle-sfdevnl > > _______________________________________________ > > php-java-bridge-users mailing list > > php...@li... > > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > > > > ---------------------------------------------------------------------------- > -- > Protect Your Site and Customers from Malware Attacks > Learn about various malware tactics and how to avoid them. Understand > malware threats, the impact they can have on your business, and how you > can protect your company and customers by using code signing. > http://p.sf.net/sfu/oracle-sfdevnl > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > > > > ------------------------------------------------------------------------------ > Protect Your Site and Customers from Malware Attacks > Learn about various malware tactics and how to avoid them. Understand > malware threats, the impact they can have on your business, and how you > can protect your company and customers by using code signing. > http://p.sf.net/sfu/oracle-sfdevnl > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > |