From: <php...@li...> - 2009-11-05 18:44:07
|
Hello, I've having some trouble with Drupal recognizing my php-java bridge. My goal is to install sheetnode w/ XLS import/export, and I've followed the instructions detailed here: http://drupal.org/project/sheetnode I'm using Java JRE6: $ java -version java version "1.6.0_16" Java(TM) SE Runtime Environment (build 1.6.0_16-b01) Java HotSpot(TM) Server VM (build 14.2-b01, mixed mode) And using php version 5.2.6 I've installed the php/java bridge using the instructions detailed here: http://php-java-bridge.sourceforge.net/pjb/installation.php I've installed Tomcat (version 5.5.27), and moved the war file into my webapps directory. I'm using virtualhosts, so I have a symlink from the virtual host's root to the JavaBridge webapp directory. I can run the examples on the page just fine, so it looks like the PHP/Java bridge works. It just seems that Drupal for some reason cannot recognize it. In Drupal, when I try to install the php/java bridge module I get this error message: (Currently using PHP/Java Bridge extension PHP/Java Bridge extension is NOT loaded in php.ini. Please install it.) This seems to indicate that I need to install some kind of php extension, like "java.so", but such a file is not included in the PHP/JavaBridge download. In fact the FAQs here http://php-java-bridge.sourceforge.net/pjb/FAQ.html say: > How do I enable the Java extension in my php.ini file? > > A Java extension does not exist, so you can't enable it. > > The VM Bridge is a network protocol, it requires a running Java VM, for > example the servlet container Apache/Tomcat. Or, if you want to call PHP > libraries from Java, a running PHP container, e.g. Apache or IIS. > So there's no extension, I just have to be running a Java Virtual Machine. As mentioned before, I am running Tomcat, and do have JavaBridge running. However, somehow Drupal doesn't seem to recognize that it exists. Wondering where to go from here. Please send me any recommendations. Thanks |
From: <php...@li...> - 2009-11-05 20:08:24
|
Hi, yes, I saw it. The PHP/Java Bridge development process took more than 6 years. During this time some things changed; the new PHP/Zend object system became stable, eliminating the need for a dedicated java.so/php_java.dll and global java.ini file (or a php.ini file with java declarations in it). The proposed PHP namespace separator has changed, too. Instead of new org_poi_something(...) PHP 5.3 wants you to use a backslash instead: java_autoload("poi.jar"); new org\poi\something(...); The underscore syntax has been removed in bridge version 5.5.4. -- Publishing poi and lucene examples using the underscore syntax and then silently removing it was certainly a mistake. I will revert this change. Your code with the underscore will work again in version 5.5.4.1. The third problem I see is that PHP developers don't understand Java's immature library handling. We have tried to solve this problem by introducing special java_require($libs) and java_autoload($libs) procedures. But these special procedures cannot fix Java's fundamental flaw, so we have removed them from the documentation and recommend Tomcat or some JEE container instead (so that the PermGenSpace and NoClassDefFound errors go to the JEE container developers, not to us). To avoid the mentioned issues, please deploy JavaBridge.war or JavaBridgeTemplate.war to a JEE server or servlet engine, remove all legacy java.so/php_java.dll and php.ini, and then require() Java.inc directly from the back end. > I do have JavaBridge running. However, somehow > Drupal doesn't seem to recognize that it exists. Well, the communication goes through the HTTP URL connection you have used to fetch the Java.inc. If your script uses <?php require("http://localhost:8080/JavaBridge/java/Java.inc"); ... all further communication uses the back end at localhost:8080/JavaBridge. It's really that simple. Just get rid of the old php.ini cruft. :) Regards, Jost Boekemeier On 5 Nov 2009 19:45, <php...@li...> wrote: Hello, I've having some trouble with Drupal recognizing my php-java bridge. My goal is to install sheetnode w/ XLS import/export, and I've followed the instructions detailed here: http://drupal.org/project/sheetnode I'm using Java JRE6: $ java -version java version "1.6.0_16" Java(TM) SE Runtime Environment (build 1.6.0_16-b01) Java HotSpot(TM) Server VM (build 14.2-b01, mixed mode) And using php version 5.2.6 I've installed the php/java bridge using the instructions detailed here: http://php-java-bridge.sourceforge.net/pjb/installation.php I've installed Tomcat (version 5.5.27), and moved the war file into my webapps directory. I'm using virtualhosts, so I have a symlink from the virtual host's root to the JavaBridge webapp directory. I can run the examples on the page just fine, so it looks like the PHP/Java bridge works. It just seems that Drupal for some reason cannot recognize it. In Drupal, when I try to install the php/java bridge module I get this error message: (Currently using PHP/Java Bridge extension PHP/Java Bridge extension is NOT loaded in php.ini. Please install it.) This seems to indicate that I need to install some kind of php extension, like "java.so", but such a file is not included in the PHP/JavaBridge download. In fact the FAQs here http://php-java-bridge.sourceforge.net/pjb/FAQ.html say: > How do I enable the Java extension in my php.ini file? > > A Java extension does not exist, so you can't enable it. > > The VM Bridge is a network protocol, it requires a running Java VM, for > example the servlet container Apache/Tomcat. Or, if you want to call PHP > libraries from Java, a running PHP container, e.g. Apache or IIS. > So there's no extension, I just have to be running a Java Virtual Machine. As mentioned before, I am running Tomcat, and do have JavaBridge running. However, somehow Drupal doesn't seem to recognize that it exists. Wondering where to go from here. Please send me any recommendations. Thanks ------------------------------------------------------------------------------ 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-11-06 00:06:04
|
Thanks Jost. Sorry for the spam. My message was getting moderated because I was "not a member", and I thought it was because I wasn't a sourceforge member, so I joined that, sent the message again, still got moderated, and that's when I realized I had to be a member of the list. Sorry for the newbiness :) Just to clarify, I'm not writing an application in Java that I'm going to use in PHP, at least not explicitly. I suppose that that's essentially what Drupal does. To use sheetnode, I suppose I need Java functionality and that's why I need the php/java bridge and the php/java bridge drupal module. I understand that I'd need the include: require_once(" http://localhost:8080/JavaBridge/java/Java.inc"); if I were writing a php app that was using Java functionality, however, I'm not sure how Drupal is supposed to use this include. I tried including it at the top of drupal's index.php file and in the php_java_bridge.module file, but still see the "PHP/Java Bridge extension is not loaded" error. So I'm not really sure what to do... not sure if the include should go somewhere else, or if it's needed at all. Thanks On Thu, Nov 5, 2009 at 3:08 PM, <php...@li... > wrote: > Hi, > > yes, I saw it. > > The PHP/Java Bridge development process took more than 6 years. > > During this time some things changed; the new PHP/Zend object system became > stable, eliminating the need for a dedicated java.so/php_java.dll and > global > java.ini file (or a php.ini file with java declarations in it). > > The proposed PHP namespace separator has changed, too. Instead of > > new org_poi_something(...) > > PHP 5.3 wants you to use a backslash instead: > > java_autoload("poi.jar"); > new org\poi\something(...); > > The underscore syntax has been removed in bridge version 5.5.4. -- > Publishing poi and lucene examples using the underscore syntax and then > silently removing it was certainly a mistake. I will revert this change. > Your code with the underscore will work again in version 5.5.4.1. > > The third problem I see is that PHP developers don't understand Java's > immature library handling. We have tried to solve this problem by > introducing special java_require($libs) and java_autoload($libs) > procedures. > But these special procedures cannot fix Java's fundamental flaw, so we have > removed them from the documentation and recommend Tomcat or some JEE > container instead (so that the PermGenSpace and NoClassDefFound errors go > to > the JEE container developers, not to us). > > To avoid the mentioned issues, please deploy JavaBridge.war or > JavaBridgeTemplate.war to a JEE server or servlet engine, remove all legacy > java.so/php_java.dll and php.ini, and then require() Java.inc directly > from > the back end. > > > I do have JavaBridge running. However, somehow > > Drupal doesn't seem to recognize that it exists. > > Well, the communication goes through the HTTP URL connection you have used > to fetch the Java.inc. If your script uses > > <?php > require("http://localhost:8080/JavaBridge/java/Java.inc"); > ... > > all further communication uses the back end at > > localhost:8080/JavaBridge. > > It's really that simple. Just get rid of the old php.ini cruft. :) > > Regards, > Jost Boekemeier > > On 5 Nov 2009 19:45, <php...@li...> wrote: > > Hello, > > I've having some trouble with Drupal recognizing my php-java bridge. My > goal is to install sheetnode w/ XLS import/export, and I've followed the > instructions detailed here: > > http://drupal.org/project/sheetnode > > I'm using Java JRE6: > > $ java -version > java version "1.6.0_16" > Java(TM) SE Runtime Environment (build 1.6.0_16-b01) > Java HotSpot(TM) Server VM (build 14.2-b01, mixed mode) > > And using php version 5.2.6 > > > I've installed the php/java bridge using the instructions detailed here: > > http://php-java-bridge.sourceforge.net/pjb/installation.php > > I've installed Tomcat (version 5.5.27), and moved the war file into my > webapps directory. I'm using virtualhosts, so I have a symlink from the > virtual host's root to the JavaBridge webapp directory. I can run the > examples on the page just fine, so it looks like the PHP/Java bridge works. > It just seems that Drupal for some reason cannot recognize it. > > In Drupal, when I try to install the php/java bridge module I get this > error > message: > > (Currently using PHP/Java Bridge extension PHP/Java Bridge extension is NOT > loaded in php.ini. Please install it.) > This seems to indicate that I need to install some kind of php extension, > like "java.so", but such a file is not included in the PHP/JavaBridge > download. In fact the FAQs here > http://php-java-bridge.sourceforge.net/pjb/FAQ.html say: > > > How do I enable the Java extension in my php.ini file? > > > > A Java extension does not exist, so you can't enable it. > > > > The VM Bridge is a network protocol, it requires a running Java VM, for > > example the servlet container Apache/Tomcat. Or, if you want to call PHP > > libraries from Java, a running PHP container, e.g. Apache or IIS. > > > So there's no extension, I just have to be running a Java Virtual Machine. > As mentioned before, I am running Tomcat, and do have JavaBridge running. > However, somehow Drupal doesn't seem to recognize that it exists. > > Wondering where to go from here. Please send me any recommendations. > > Thanks > > ------------------------------------------------------------------------------ > 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-11-06 06:11:19
|
> My message was getting moderated because I was > "not a member", and I thought it was because I > wasn't a sourceforge member, so I joined that, sent > the message again, still got moderated, and that's > when I realized I had to be a member of the list. > Sorry for the newbiness Can you please post the complete error message? This mailing list is run by sf.net staff. If an error message isn't precise, we should file a bug report. > supposed to use this include. I tried including it at > the top of drupal's index.php file and in the > php_java_bridge.module file, but still see the"PHP >/Java Bridge extension is not loaded" error So I'm not > really sure what to do... not sure if the include > should go s Isn't it possible to simply search and remove the above check? An "extension" is obsolete since bridge version 3.2.1, published 3 years ago. But since I don't know Drupal, I can't help either. Regards, Jost Boekemeier On 6 Nov 2009 01:07, <php...@li...> wrote: Thanks Jost. Sorry for the spam. My message was getting moderated because I was "not a member", and I thought it was because I wasn't a sourceforge member, so I joined that, sent the message again, still got moderated, and that's when I realized I had to be a member of the list. Sorry for the newbiness :) Just to clarify, I'm not writing an application in Java that I'm going to use in PHP, at least not explicitly. I suppose that that's essentially what Drupal does. To use sheetnode, I suppose I need Java functionality and that's why I need the php/java bridge and the php/java bridge drupal module. I understand that I'd need the include: require_once(" http://localhost:8080/JavaBridge/java/Java.inc"); if I were writing a php app that was using Java functionality, however, I'm not sure how Drupal is supposed to use this include. I tried including it at the top of drupal's index.php file and in the php_java_bridge.module file, but still see the "PHP/Java Bridge extension is not loaded" error. So I'm not really sure what to do... not sure if the include should go somewhere else, or if it's needed at all. Thanks On Thu, Nov 5, 2009 at 3:08 PM, <php...@li... > wrote: > Hi, > > yes, I saw it. > > The PHP/Java Bridge development process took more than 6 year... |
From: <php...@li...> - 2009-11-06 07:49:19
|
hello, php...@li... schrieb: [...] > Isn't it possible to simply search and remove the above check? An > "extension" is obsolete since bridge version 3.2.1, published 3 years ago. ooopps, nice to know, din't catch that either. ;) > But since I don't know Drupal, I can't help either. Fot the OP: I had a quick look at the code of the mentioned drupal extension. Please try to change the following lines in php_java_bridge.install from the drupal extension: // $extension = extension_loaded('java'); $extension = TRUE; That could do the trick. [...] Greets, Peter |
From: <php...@li...> - 2009-11-06 20:51:14
|
All, thanks for all the replies. Peter - this was just what I needed. I think the php/java bridge module for Drupal is basically still designed to check for the extension even though it's no longer needed. I commented out the check for the extension, and now it loads properly. Everything looks good from php/java bridge point of view. My xls spreadsheets aren't getting imported, but looks like that's a different issue. Thanks for all the help everybody! On Fri, Nov 6, 2009 at 2:33 AM, <php...@li... > wrote: > hello, > > php...@li... schrieb: > [...] > > Isn't it possible to simply search and remove the above check? An > > "extension" is obsolete since bridge version 3.2.1, published 3 years > ago. > > ooopps, nice to know, din't catch that either. ;) > > > But since I don't know Drupal, I can't help either. > > Fot the OP: > I had a quick look at the code of the mentioned drupal extension. Please > try to change the following lines in php_java_bridge.install from the > drupal extension: > > // $extension = extension_loaded('java'); > $extension = TRUE; > > That could do the trick. > > [...] > > Greets, > Peter > > > ------------------------------------------------------------------------------ > 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-11-06 07:54:19
|
Hello Jost, first of all, thx for clarification and all the great work you have put into this. php...@li... schrieb: > Hi, [...] > During this time some things changed; the new PHP/Zend object system became > stable, eliminating the need for a dedicated java.so/php_java.dll and global > java.ini file (or a php.ini file with java declarations in it). but then why does "make install" and/or "install.sh" from CVS sources still put 'JavaBridge.jar, JavaBridge.war, java.so, php-script.jar, RunJavaBridge and script-api.jar' into my PHP installations lib dir (/usr/lib/php5/20060613/)? Reading your comment and understanding more and more about the usage of pjb(php java bridge) it seems like all of these are not needed in the php installation where I want to use java. > The proposed PHP namespace separator has changed, too. Instead of [...] > To avoid the mentioned issues, please deploy JavaBridge.war or > JavaBridgeTemplate.war to a JEE server or servlet engine, remove all legacy > java.so/php_java.dll and php.ini, and then require() Java.inc directly from > the back end. with back end you refer to the php application here? >> I do have JavaBridge running. However, somehow >> Drupal doesn't seem to recognize that it exists. > > Well, the communication goes through the HTTP URL connection you have used > to fetch the Java.inc. If your script uses > > <?php > require("http://localhost:8080/JavaBridge/java/Java.inc"); > ... > > all further communication uses the back end at > > localhost:8080/JavaBridge. waow, I didn't spot this "autoconfiguration feature" yet. Seems like a very cool and nice idea! This however requires "allow-url-fopen". Would this be required anyway, or just here to include "Java.inc"? I have seen the "make install / install.sh" put Java.inc into my pear directory. So for me Java.inc is on the include path already. :-> > It's really that simple. Just get rid of the old php.ini cruft. :) At least in the source distribution/CVS there are quite a few files with peaces of documentation of all different scenarios and considering the evolving history of pjb it is just not that easy to understand what one has to do with the recent version to set it up properly. I am fully aware that using CVS/sources one has to expect trouble, so I am not complaining! ;) Thx and Greets, Peter |
From: <php...@li...> - 2009-11-06 08:41:52
|
> but then why does "make install" ... still put java.so, RunJavaBridge, ... I was too lazy to remove them. I will clean up the CVS when I have some time. > these are not needed in the php installation where I > want to use java Exactly. All you need to access java libraries from PHP is a Java web application containing JavaBridge.jar and php-servlet.jar deployed on some server on the intranet (or even the internet). -- You can even start a local Java daemon from your php script by setting JAVA_HOSTS to some integer and JAVA_SERVLET to false. But such a standalone daemon is difficult to log unless you set up log4j. > with back end you refer to the php application here? The Java container running the JavaBridge.war application. -- In a typical n-tier setup PHP is the front-end, handling client requests. > s however requires "allow-url- fopen". Would t If I have some time I will fix fopen so that it can fetch and cache scripts from a local URL by default. In the meantime please adjust JAVA_HOSTS and JAVA_SERVLET, if necessary (they default to localhost:8080 and /JavaBridge/JavaBridge.phpjavabridge) and include Java.inc from the file system. Regards, Jost Boekemeier On 6 Nov 2009 08:54, <php...@li...> wrote: Hello Jost, first of all, thx for clarification and all the great work you have put into this. php...@li... schrieb: > Hi, [...] > During this time some things changed; the new PHP/Zend object system became > stable, eliminating ... but then why does "make install" and/or "install.sh" from CVS sources still put 'JavaBridge.jar, JavaBridge.war, java.so, php-script.jar, RunJavaBridge and script-api.jar' into my PHP installations lib dir (/usr/lib/php5/20060613/)? Reading your comment and understanding more and more about the usage of pjb(php java bridge) it seems like all of these are not needed in the php installation where I want to use java. > The proposed PHP namespace separator has changed, too. Instead of [...] > To avoid the mentioned issues, please deploy JavaBridge.war or > JavaBridgeTemplate.war to a JEE s... with back end you refer to the php application here? >> I do have JavaBridge running. However, somehow >> Drupal doesn't seem to recognize that it exist... waow, I didn't spot this "autoconfiguration feature" yet. Seems like a very cool and nice idea! This however requires "allow-url-fopen". Would this be required anyway, or just here to include "Java.inc"? I have seen the "make install / install.sh" put Java.inc into my pear directory. So for me Java.inc is on the include path already. :-> > It's really that simple. Just get rid of the old php.ini cruft. :) At least in the source distribution/CVS there are quite a few files with peaces of documentation of all different scenarios and considering the evolving history of pjb it is just not that easy to understand what one has to do with the recent version to set it up properly. I am fully aware that using CVS/sources one has to expect trouble, so I am not complaining! ;) Thx and Greets, Peter ------------------------------------------------------------------------------ Let Crystal Reports ... |