|
From: <php...@li...> - 2010-04-30 04:13:54
|
I got it working now. I wasn't creating the jar file properly. I used the instructions from http://php-java-bridge.sourceforge.net/pjb/desktop-apps.php to create the jar and copied it in WEB-INF/lib like Jost said and it worked!! Thanks a lot Jost! On Thu, Apr 29, 2010 at 10:43 PM, < php...@li...> wrote: > Hi, > > > $systemInfo = new Java("Test"); > > print $systemInfo->foo(); > > Please create a simple JSP: > > <% > out.println(new Test()); > %> > > Once you get this JSP working, your PHP code will be able to access > your Test class, too. Please contact a Java developer if you need any > further help. This is a Java issue, not a PHP/Java Bridge issue. > > > > please tell me how to set the allow_url_include = On option > > If you don't know how to enable it, you'd better leave it off and copy > the Java.inc file to the appropriate place. allow_url_include has > several security issues. > > You can set this option in your PHP ini file. Please see the output of > the phpinfo() function for the location of this file. > > > Regards, > Jost Bökemeier > > > On 4/29/10, php...@li... > <php...@li...> wrote: > > I tried it but it didn't help. I am getting the same error. Also can you > > please tell me how to set the allow_url_include = On option. I tried > writing > > it in the php.ini file but it didn't work > > > > On Thu, Apr 29, 2010 at 9:30 PM, < > > php...@li...> wrote: > > > >> Hi, > >> > >> please create a java archive from your java classes, put the java > >> archive into the WEB-INF/lib directory of your web application file > >> and re-deploy it. > >> > >> Please see http://php-java-bridge.sourceforge.net/pjb/webapp.php or > >> this video > >> > http://php-java-bridge.sourceforge.net/pjb/user-contributed/JavaEchoServer.gif > >> for an example. > >> > >> > >> Regards, > >> Jost Bökemeier > >> > >> > >> On 4/29/10, php...@li... > >> <php...@li...> wrote: > >> > I am working on windows. I am running PHP (5.1.3) scripts on Tomcat > >> > using > >> > PHP/Java bridge. Here is my simple code > >> > > >> > //test.php > >> > <?php > >> > > >> > require_once("java\Java.inc"); > >> > > >> > $systemInfo = new Java("Test"); > >> > print $systemInfo->foo(); > >> > ?> > >> > > >> > Test.class is in the same folder as test.php. But the php file is not > >> able > >> > to locate the test class and I get the following error - > >> > > >> > Fatal error: Uncaught [[o:Exception]:"java.lang.Exception: > >> > CreateInstance failed: new Test. > >> > > >> > If I use a standard class like below. It works - > >> > > >> > > >> > <?php > >> > require_once("java\Java.inc"); > >> > $systemInfo = new Java("java.lang.System"); > >> > print "Total seconds since January 1, 1970: > >> > ".$systemInfo->currentTimeMillis(); > >> > ?> > >> > > >> > What should I do? > >> > > >> > 1)Should I copy my class to the standard location where all Java > classes > >> are > >> > kept. (What is this location?) > >> > > >> > 2) Do some changes in the php.ini file > >> > > >> > ------------------------------------------------------------------------------ > >> > _______________________________________________ > >> > php-java-bridge-users mailing list > >> > php...@li... > >> > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > >> > > >> > >> > >> > ------------------------------------------------------------------------------ > >> _______________________________________________ > >> php-java-bridge-users mailing list > >> php...@li... > >> https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > >> > > > ------------------------------------------------------------------------------ > > _______________________________________________ > > php-java-bridge-users mailing list > > php...@li... > > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > > > > > ------------------------------------------------------------------------------ > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > |