You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(6) |
Oct
(6) |
Nov
(8) |
Dec
(2) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(19) |
Feb
(15) |
Mar
(10) |
Apr
(8) |
May
(7) |
Jun
(9) |
Jul
(13) |
Aug
(31) |
Sep
(111) |
Oct
(52) |
Nov
(72) |
Dec
(42) |
2006 |
Jan
(21) |
Feb
(32) |
Mar
(33) |
Apr
(24) |
May
(15) |
Jun
(40) |
Jul
(32) |
Aug
(19) |
Sep
(38) |
Oct
(37) |
Nov
(63) |
Dec
(37) |
2007 |
Jan
(18) |
Feb
(39) |
Mar
(69) |
Apr
(49) |
May
(71) |
Jun
(59) |
Jul
(71) |
Aug
(85) |
Sep
(46) |
Oct
(14) |
Nov
(25) |
Dec
(56) |
2008 |
Jan
(24) |
Feb
(77) |
Mar
(104) |
Apr
(44) |
May
(41) |
Jun
(11) |
Jul
(31) |
Aug
(59) |
Sep
(44) |
Oct
(86) |
Nov
(66) |
Dec
(93) |
2009 |
Jan
(88) |
Feb
(41) |
Mar
(49) |
Apr
(135) |
May
(22) |
Jun
(31) |
Jul
(60) |
Aug
(71) |
Sep
(76) |
Oct
(18) |
Nov
(52) |
Dec
(20) |
2010 |
Jan
(8) |
Feb
(50) |
Mar
(35) |
Apr
(48) |
May
(46) |
Jun
(84) |
Jul
(38) |
Aug
(61) |
Sep
(51) |
Oct
(31) |
Nov
(17) |
Dec
(18) |
2011 |
Jan
(51) |
Feb
(14) |
Mar
(17) |
Apr
(23) |
May
(15) |
Jun
(11) |
Jul
(5) |
Aug
(5) |
Sep
(15) |
Oct
(8) |
Nov
(5) |
Dec
(25) |
2012 |
Jan
(2) |
Feb
(4) |
Mar
(6) |
Apr
(9) |
May
(27) |
Jun
(32) |
Jul
(36) |
Aug
(10) |
Sep
(16) |
Oct
(3) |
Nov
(13) |
Dec
(7) |
2013 |
Jan
(1) |
Feb
(4) |
Mar
|
Apr
(1) |
May
|
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(4) |
Oct
(2) |
Nov
(1) |
Dec
|
2014 |
Jan
|
Feb
|
Mar
(2) |
Apr
(1) |
May
(2) |
Jun
(9) |
Jul
(5) |
Aug
(2) |
Sep
(4) |
Oct
|
Nov
|
Dec
|
2015 |
Jan
(3) |
Feb
(2) |
Mar
(4) |
Apr
(3) |
May
(1) |
Jun
(2) |
Jul
|
Aug
(2) |
Sep
(5) |
Oct
(1) |
Nov
|
Dec
|
2016 |
Jan
|
Feb
(5) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(5) |
Sep
(3) |
Oct
|
Nov
|
Dec
|
2017 |
Jan
(6) |
Feb
|
Mar
|
Apr
(10) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
|
2018 |
Jan
(2) |
Feb
(5) |
Mar
|
Apr
|
May
(1) |
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2021 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2023 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <php...@li...> - 2010-06-23 13:11:43
|
Hi Jost Boekemeier and people from ajbodc@....! First, Excuse for my English. and I don´t speak and not write in Spanish! First I change my loader.php file on line 112 to 114 for load the classes immediately. Second I try access the joomla, he init ok, transfer the request to installation url, but not finish the response for my browser, I try with Eclipse Browser, Chrome and Firefox. The response is infinity. But I put on code a error_log function where I show on log the result of JResponse::toString() in form showed bellow, I change echo to print, and too try use flush() function, but nothing work.: /** * RETURN THE RESPONSE */ $data= JResponse::toString(); error_log(strlen($data)); print($data); ?> Thanks Carlos Delfino. |
From: <php...@li...> - 2010-06-23 09:12:21
|
Hello, After further testing, it might actually be a network issue, but I don't understand it. The server is located on the local network. The web browsers on the company computers are set to work through the company's proxy. With the proxy, I can reach and run any of the Java applications without any problem. /JavaBridge/jsr223.jsp can be reached as I mentionned in my previous post, but all the .php files cannot be reached at all. When I disable the proxy, the Java applications are still available, and my Php application works too. But disabling the proxy is not a viable solution, and I don't have any admin rights to set up the network differently. That's why I would like to make it work connected through the proxy. So I tried to rename index.php into index.phtml. What I get is a uninterpreted php file (the text content of my php file. seems normal since the phtml extension is not mapped). Then I opened /JavaBridge/WEB-INF/web.xml and replaced <servlet-mapping> <servlet-name>PhpCGIServlet</servlet-name> <url-pattern>*.php</url-pattern> </servlet-mapping> by <servlet-mapping> <servlet-name>PhpCGIServlet</servlet-name> <url-pattern>*.phtml</url-pattern> </servlet-mapping> Then I tried to open index.phtml, but could not reach it. Can you confirm that the PhpCGIServlet mapping is only necessary in the JavaBridge/WEB-INF/web.xml ? I haven't added it in the main tomcat web.xml as I haven't found anything in the documentation that mentioned it. (Edit : I just tried to add it, but no changes). What I don't really understand is that when I am on the server and use localhost as my server address, it works great, so I guess php request and CGI servlet mapping is fine. And since other Java applications can work well when using the proxy, that means that the proxy is not a problem to run Java applications (JavaBridge is one of them, and jsr223.jsp can be reached) That's why I think you are right when saying there is something intercepting .php requests. To make it short : there is something that intercepts .php requests only when connected through the proxy. Everything else works. Any other idea ? Thanks a lot. Regards, Julien Mallet. On Wed, Jun 23, 2010 at 4:29 PM, <php...@li...> wrote: > Hi, > > >> I tried to run http://myServerIP:8080/JavaBridge/jsr223.jsp, and it >> can be reached. > > this means that the PHP/Java Bridge is up and running and can be > reached from a remote host. jsr223.jsp returns PHP-generated content. > > >> Does it confirm this is not a network issue ? > > Not necessarily. It could still be possible that some component is > intercepting *.php requests. > > Can you please rename index.php to index.phtml and try to access it? > If it works, please change the servlet mapping from WEB-INF/web.xml > from php to phtml. Does that work? > > > >> I have an exception report though. >> >> javax.servlet.ServletException: java/io/Closeable >> I forgot to add in my first post that I am using Tomcat 5.0.27, is >> that an issue ? > > This is another issue. Java 1.4 doesn't have java.io.Closeable, so > jsr223.jsp has caught an exception. Upgrading Java to 1.5 or 1.6 > should solve this issue. > > > Regards, > Jost Bökemeier > > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > -- Julien Mallet Infopower Consultant +86 150 00 201 802 |
From: <php...@li...> - 2010-06-23 08:29:07
|
Hi, > I tried to run http://myServerIP:8080/JavaBridge/jsr223.jsp, and it > can be reached. this means that the PHP/Java Bridge is up and running and can be reached from a remote host. jsr223.jsp returns PHP-generated content. > Does it confirm this is not a network issue ? Not necessarily. It could still be possible that some component is intercepting *.php requests. Can you please rename index.php to index.phtml and try to access it? If it works, please change the servlet mapping from WEB-INF/web.xml from php to phtml. Does that work? > I have an exception report though. > > javax.servlet.ServletException: java/io/Closeable > I forgot to add in my first post that I am using Tomcat 5.0.27, is > that an issue ? This is another issue. Java 1.4 doesn't have java.io.Closeable, so jsr223.jsp has caught an exception. Upgrading Java to 1.5 or 1.6 should solve this issue. Regards, Jost Bökemeier |
From: <php...@li...> - 2010-06-23 02:08:00
|
Hi, Thanks for the reply Jost, I tried to run http://myServerIP:8080/JavaBridge/jsr223.jsp, and it can be reached. Does it confirm this is not a network issue ? I have an exception report though. javax.servlet.ServletException: java/io/Closeable org.apache.jasper.servlet.JspServlet.service(JspServlet.java:244) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) php.java.servlet.PhpCGIFilter.doFilter(PhpCGIFilter.java:126) I forgot to add in my first post that I am using Tomcat 5.0.27, is that an issue ? It works like a charm on the local host ! Any idea ? Thank you. Regards, Julien Mallet. On Tue, Jun 22, 2010 at 10:27 PM, <php...@li...> wrote: > Hi, > >> But as soon as I am on another computer of the network, I can't reach >> it using http://myserverIP:8080/JavaBridge/index.php >> >> It's not a network issue since I can open >> http://myserverIP:8080/admin/ and the tomcat admin loads without any >> problem. > > Sounds like a network issue. Can you run > > http://myServerIP:8080/JavaBridge/jsr223.jsp > > or doesn't this work either? Whether a HTML page has been rendered by > PHP, JSP or servlets is not visible to the client. > > > Regards, > Jost Bökemeier > |
From: <php...@li...> - 2010-06-22 14:31:52
|
Hi, what is a loader.php? Do you run Joomla with Java.inc? This will not work because joomla uses __autoload. Changing the joomla sources to use spl_autoload should solve this issue. Regards, Jost Boekemeier |
From: <php...@li...> - 2010-06-22 14:27:53
|
Hi, > But as soon as I am on another computer of the network, I can't reach > it using http://myserverIP:8080/JavaBridge/index.php > > It's not a network issue since I can open > http://myserverIP:8080/admin/ and the tomcat admin loads without any > problem. Sounds like a network issue. Can you run http://myServerIP:8080/JavaBridge/jsr223.jsp or doesn't this work either? Whether a HTML page has been rendered by PHP, JSP or servlets is not visible to the client. Regards, Jost Bökemeier |
From: <php...@li...> - 2010-06-22 10:37:25
|
Hi Jost Boekemeier and people from ajbodc@....! First, Excuse for my English. and I don´t speak and not write in Spanish! First I change my loader.php file on line 112 to 114 for load the classes immediately. Second I try access the joomla, he init ok, transfer the request to installation url, but not finish the response for my browser, I try with Eclipse Browser, Chrome and Firefox. The response is infinity. But I put on code a error_log function where I show on log the result of JResponse::toString() in form showed bellow, I change echo to print, and too try use flush() function, but nothing work.: /** * RETURN THE RESPONSE */ $data= JResponse::toString(); error_log(strlen($data)); print($data); ?> Thanks Carlos Delfino. |
From: <php...@li...> - 2010-06-22 10:06:47
|
Hi all, The server in my company has a Tomcat server, and I can't install an Apache http server with PHP so I install the JavaBridge. I do not need PHP for all my Java applications, I would only like to have 1 PHP app available, as described in the second paragraph of this page : http://php-java-bridge.sourceforge.net/pjb/tomcat6.php. It works great when I am on the server and reach my PHP application with http://127.0.0.1:8080/JavaBridge/index.php But as soon as I am on another computer of the network, I can't reach it using http://myserverIP:8080/JavaBridge/index.php It's not a network issue since I can open http://myserverIP:8080/admin/ and the tomcat admin loads without any problem. Is there anything I should know ? Thanks in advance ! Julien. |
From: <php...@li...> - 2010-06-22 10:00:22
|
Hi all, The server in my company has a Tomcat server, and I can't install an Apache http server with PHP so I install the JavaBridge. I do not need PHP for all my Java applications, I would only like to have 1 PHP app available, as described in the second paragraph of this page : http://php-java-bridge.sourceforge.net/pjb/tomcat6.php. It works great when I am on the server and reach my PHP application with http://127.0.0.1:8080/JavaBridge/index.php But as soon as I am on another computer of the network, I can't reach it using http://myserverIP:8080/JavaBridge/index.php It's not a network issue since I can open http://myserverIP:8080/admin/ and the tomcat admin loads without any problem. Is there anything I should know ? Thanks in advance ! Julien. |
From: <php...@li...> - 2010-06-22 07:56:49
|
Hi Carlos, can you please describe the problem from the beginning? What do you mean with "not show nothing in installation"? regards, Jost Boekemeier On 6/21/10, php...@li... <php...@li...> wrote: > Hi! > > Have any open thread about use of Joomla in php/java bridge at Tomcat? > > I have problems, the request not end, and I make ajust for show on log and > all is ok, with code, but strings on command "echo JResponse::toString()" > not > show nothing in instaltion/index.php > > Thanks. > Carlos Delfino > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > |
From: <php...@li...> - 2010-06-22 07:53:57
|
Hi, > Not exactly; there is no desktop application per se. please see our FAQ entry "Do I need a JEE application server or servlet engine?" : http://php-java-bridge.sourceforge.net/pjb/FAQ.html >> The procedure for MySQL and Tomcat is described here: >> http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html#Database%20Connection%20Pool%20%28DBCP%29%20Configurations > PostgreSQL is the database Not relevant. See the bottom of the document. Regards, Jost Boekemeier |
From: <php...@li...> - 2010-06-22 07:43:32
|
Hi Bernard, now I understand the problem. You cannot acquire an invocable php script engine from the current servlet container. The only available script engine is the PhpScriptEngine, which you cannot cast to invocable. The invocable script engine can only call remote PHP script methods or procedures. The API has been removed in version 6 because I cannot think of a real-world scenario where it is necessary to instanciate a local PHP script and call some of its methods. You may as well use the non-invocable PHP script engine or simply use requestDispatcher.forward() or .include() > ScriptEngine scriptEngine = EngineFactory.getInvocablePhpScriptEngine( > this, getServletContext(), httpServletRequest, httpServletResponse, new URI( > "http://127.0.0.1:8080/JavaBridge/java/JavaProxy.php" ) ); > > should give me the script engine? Yes. But you should be careful to not exceed the servlet engine pool size. > How then do I use a FileReader to point to my test.php and then call a > function (say f) within test.php? Create a script: <?php include("app"); echo f(); ?> and use the EngineFactory.getPhpScriptEngine(..).eval(...) or use <jsp:include > to invoke it. Regards, Jost Bökemeier |
From: <php...@li...> - 2010-06-21 18:17:32
|
Hi! Have any open thread about use of Joomla in php/java bridge at Tomcat? I have problems, the request not end, and I make ajust for show on log and all is ok, with code, but strings on command "echo JResponse::toString()" not show nothing in instaltion/index.php Thanks. Carlos Delfino |
From: <php...@li...> - 2010-06-21 17:58:53
|
Hi! My Name is Carlos Delfino, and I word with Java and PHP. My experience with java is 8 years old, and with PHP more over 12 years. For now I working with a integration with php and java, and find php/java bridge a greate project. Thanks to developers and sponsors for this work. I think in develop a system with java and use joomla like a front end, for integrate the goods functions from cms with my application in java. I have a street store for IT services, and consulting. thanks. Carlos Delfino. |
From: <php...@li...> - 2010-06-21 13:22:06
|
Thanks for your help - lots of details and yet I'm still baffled :-( The examples on the JavaBridge site don't seem to cover (what I thought to be) the simple case of a servlet accessing/executing a PHP script. To clarify: Within my Java servlet, if I want to call a PHP script test.php (say in the same directory as the servlet or at the very least on the same box as the servlet) then I first need to acquire a PHP engine. Assuming I have JavaBridge also deployed to the same servlet container as my servlet then this ScriptEngine scriptEngine = EngineFactory.getInvocablePhpScriptEngine( this, getServletContext(), httpServletRequest, httpServletResponse, new URI( "http://127.0.0.1:8080/JavaBridge/java/JavaProxy.php" ) ); should give me the script engine? Or is this actually pointing to JavaProxy.php as my script that will be executed? How then do I use a FileReader to point to my test.php and then call a function (say f) within test.php? Thanks again, Bernard. _________________________________________________________________ New, Used, Demo, Dealer or Private? Find it at CarPoint.com.au http://clk.atdmt.com/NMN/go/206222968/direct/01/ |
From: <php...@li...> - 2010-06-21 08:16:15
|
> From the examples, to reference the PHP script I should use something like:ScriptEngine > scriptEngine = new ScriptEngineManager().getEngineByName( "php-invocable" ); Not exactly. For a servlet environment it is: php.java.script.servlet.EngineFactory.getInvocablePhpScriptEngine() The difference is that the ScriptEngineManager has no information about the servlet environment, so you cannot use the servlet context from a script allocated from the ScriptEngineManager. The JSR 223 script spec isn't very well designed. Implementations have to use their own workarounds. To quote Per Bothner: "Embarrassingly, I was a not-very-active member of the JSR-223 expert group. It would have been better if we could have thought a little more about scripting staticly-typed languages, but we didn't have time", see http://per.bothner.com/blog/2009/JavaFX-scripting-changes/ > scriptEngine.eval( new URLReader( "http://localhost/test.php" ); > This does not make sense to me I wasn't part of the JSR 223 expert group, so I don't know why they require you to pass a specific Reader, instead of a file or URL/URI. The URLReader is an adapter, it packages up the URI location so that it can be passed through the JSR 223 API. > as my PHP script is not browseable The java_call_with_continuation() makes it invocable from the remote continuation. It calls java_context()->call(this), so that Java can call that.cont.call(this.cont). If you open a local script via: reader = new java.io.FileReader(FILE); eng.eval(reader); the implementation hides the above "magic". > I'd prefer not to access my script via a new request to Tomcat It doesn't open a URLConnection back to tomcat. PHP uses a persistent connection to a ContextRunner: Client requests JSP. JSP creates ScriptEngine. ScriptEngine opens URLConnection to Apache/PHP. PHP script calls java method java_context() which invokes the bridge machinery in the back end (a java thread is spawned) and ->call() transfers the control from the PHP- to the current Java continuation, which may call procedures from the PHP continuation or transfer control back. I fail to understand your difficulties. If you mean the FileReader utility from EngineFactory; it is there to allow you to create a "one shot" reader for a given reader without having to look at the file system. The PHP file is created with the .class file during JSP compilation, so that PHP can take advantage of its internal cache/compilation mechanism (PHP compiles to opcode and caches it). > If I try to pass in a URL as a file rather than http Why don't you simply use a FileReader? Regards, Jost Bökemeier |
From: <php...@li...> - 2010-06-21 07:15:15
|
Hi, I have a Java servlet (myServlet) running on Tomcat (downloaded from Apache). I also have a PHP script (test.php) sitting in the same directory as the servlet. I want to call functions in the PHP script from the Java servlet. I have deployed the JavaBridge.war file, can hit and run the examples, so I'm guessing nothing is broken in so far as JavaBridge and Tomcat are concerned. >From the examples, to reference the PHP script I should use something like: ScriptEngine scriptEngine = new ScriptEngineManager().getEngineByName( "php-invocable" ); scriptEngine.eval( new URLReader( "http://localhost/test.php" ); This does not make sense to me as my PHP script is not browseable (I only have Tomcat running on port 8080). I'd prefer not to access my script via a new request to Tomcat. Isn't it possible to access the script directly via the filesystem? If I try to pass in a URL as a file rather than http, I get a class cast exception: java.lang.ClassCastException: sun.net.www.protocol.file.FileURLConnection cannot be cast to java.net.HttpURLConnection Thanks, Bernard. _________________________________________________________________ New, Used, Demo, Dealer or Private? Find it at CarPoint.com.au http://clk.atdmt.com/NMN/go/206222968/direct/01/ |
From: <php...@li...> - 2010-06-19 19:12:37
|
Hi, so you are running a Java desktop application and use the bridge to invoke > methods of your desktop app? > Not exactly; there is no desktop application per se. The code that opens the JDBC connection and generates the report, using PHP and the bridge, is as follows: try { $params = report_parse_post_parameters(); // Load the PostgreSQL database driver. // java( 'java.lang.Class' )->forName( 'org.postgresql.Driver' ); // Attempt a database connection. // $conn = java( 'java.sql.DriverManager' )->getConnection( "jdbc:postgresql://$dbhost/$dbname?user=$dbuser&password=$dbpass" ); // Use the fill manager to produce the report. // $fm = java('net.sf.jasperreports.engine.JasperFillManager'); $pm = $fm->fillReport($report, $params, $conn); header('Cache-Control: private'); header('Content-Description: File Transfer'); header("Content-Disposition: attachment, filename=$filename.pdf"); header('Content-Type: application/pdf'); header('Content-Transfer-Encoding: binary'); java_set_file_encoding('ISO-8859-1'); $em = java('net.sf.jasperreports.engine.JasperExportManager'); $result = $em->exportReportToPdf($pm); $conn->close(); header('Content-Length: ' . strlen( $result ) ); echo $result; } The JasperReports library is on the classpath when the bridge is started. I was trying to keep the *$conn* variable open for the next request. But that would probably lead to all kinds of nasty business. I suppose could add a connection pool and serialize that, instead. When I get a bit more time, I'll try it. Thanks, Peter. Dave |
From: <php...@li...> - 2010-06-19 10:55:51
|
Hi! > Thanks for the post. I'm running the bridge in Standalone mode so you are running a Java desktop application and use the bridge to invoke methods of your desktop app? If so, your application probably uses a jdbc connection pool. If not, it's not your task (as a PHP programmer) to add one. Peter |
From: <php...@li...> - 2010-06-18 19:46:37
|
Hi, Jost. Thanks for the post. I'm running the bridge in Standalone mode, and PostgreSQL is the database. Dave |
From: <php...@li...> - 2010-06-18 08:05:24
|
> One web server running Apache2 -- no web.xml files, no j2ee. The PHP/Java Bridge requires a JEE application server or servlet engine as a back end. The procedure for MySQL and Tomcat is described here: http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html#Database%20Connection%20Pool%20%28DBCP%29%20Configurations Regards, Jost Bökemeier |
From: <php...@li...> - 2010-06-17 22:04:37
|
Hi, java_session()->put("key", $jVal) > where $jVal is a java object implementing java.io.Serializable. > Looks like PGConnection and its derivatives cannot be serialized (without changing the API). The only serializable interface is PGConnectionPoolDataSource. Unless there are any other ways to persist the JDBC connection, it looks like I'm going to have to abandon this optimization for now. Of course not. Your other PHP script might be running on a different > server. Even if there's only one server, you may have more than one > java back end (see option <distributable/> in your web.xml. > One web server running Apache2 -- no web.xml files, no j2ee. Thank you for your suggestions. Dave |
From: <php...@li...> - 2010-06-17 09:18:05
|
Hi Dave, > How would you persist an open JDBC connection across invocations of the same PHP is essentially a "shared nothing" architecture. However, you can store Java objects into the Java session using java_session()->put("key", $jVal) where $jVal is a java object implementing java.io.Serializable. > For example the following does not work: Of course not. Your other PHP script might be running on a different server. Even if there's only one server, you may have more than one java back end (see option <distributable/> in your web.xml. You must guarantee that $jVal is available to all PHP instances. Either use a 3 tier architecture, or make your java session distributable or use only one java back end and store your value there. I don't know if your $jVal is distributable. If it's not, use a standard 3 tier architecture. Since we are talking about jdbc drivers; jee uses its own connection pool. So the only thing you'll have to do is to fetch a connection from the pool, for example by using standard JNDI lookups. Regards, Jost Boekemeier |
From: <php...@li...> - 2010-06-17 00:23:54
|
Hi, How would you persist an open JDBC connection across invocations of the same PHP script but at different times, from different computers? For example the following does not work: // Load the PostgreSQL database driver. // java( 'java.lang.Class' )->forName( 'org.postgresql.Driver' ); $conn = apc_fetch( $PERSIST ); if( $conn === false || $conn->isClosed() ) { echo "Reloading JDBC connection: $conn\n"; exit; // Attempt a database connection. // $conn = java( 'java.sql.DriverManager' )->getConnection( "jdbc:postgresql://$dbhost/$dbname?user=$dbuser&password=$dbpass" ); // Failure to add is fine; it means the above fetch will fail, and // thus recreate the JDBC connection each time. Not ideal; might have // a performance impact. // apc_delete( $PERSIST ); apc_store( $PERSIST, $conn ); } The $conn is always closed after the script ends. The only other way I can think of to prevent this from happening is to implement my own PostgreSQL Connection subclass, and override "close()" to do nothing. The problem I'm trying to solve is that the PG database reloads PL/R modules for each new database connection. What I need is some sort of persistent JDBC connection pool for the PHP-Java bridge. Any ideas? Thank you! Dave |
From: <php...@li...> - 2010-06-16 15:35:27
|
> I am actually using java-bridge 6.1.2.1 Version 6.1.2.1 doesn't have any named pipe code. Please update your Java.inc to version 6.1.2.1. Regards, Jost Boekemeier On 6/16/10, php...@li... <php...@li...> wrote: > Hi, > > I am actually using java-bridge 6.1.2.1 > > Following your advice I have found that setting JAVA_PIPE_DIR to null > fixes the problem. Previously I had this set to a directory within the > open_basedir path. > > Thanks for your help. > > Joe > > On 16/06/10 14:31, php...@li... wrote: >> Hi, >> >> which version of the PHP/Java Bridge do you use? >> >> As of version 6 the bridge doesn't use named pipes anymore; the code >> is gone. In PHP/Java Bridge version 5 you can switch off named pipes >> by define("JAVA_PIPE_DIR", null). >> >> >> >>> However, having done so I now find that files in /tmp are being >>> accessed, such as: "/tmp/.php_java_bridgejNmYsU.i". >>> >> Unlikely. If JAVA_PIPE_DIR is null, the path would be >> "null/.php_java_bridgejNmYsU.i" >> >> >> >>> I can't see where this location is being set. Does anyone have any ideas? >>> >> Neither do I. Why don't you switch to version 6.1.2.1. t has some >> issues, mostly regressions for features introduced in 5.x. But overall >> it is running fine. >> >> >> Regards, >> Jost Boekemeier >> >> ------------------------------------------------------------------------------ >> ThinkGeek and WIRED's GeekDad team up for the Ultimate >> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the >> lucky parental unit. See the prize list and enter to win: >> http://p.sf.net/sfu/thinkgeek-promo >> _______________________________________________ >> php-java-bridge-users mailing list >> php...@li... >> https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users >> > > > > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > |