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...> - 2007-05-06 23:00:54
|
Hi, What is a proper way to set (incoporate) my application log4j.properties file in java bridge? As I know log4j properties are set just once; since it was set by java bridge, it ignored my own log4.properties. =20 Could I use eclipse to debug my code and inspect the values at the point where the bridge invoking a method in my app? Currently, my backend is a standalone app. Thanks for your time |
|
From: <php...@li...> - 2007-05-04 12:13:15
|
Gee (blush) - how embarrassing: I had been looking at this code snippet at
least a hundred times now and in the end it turned out, that my condition
actually read
if (!$var) { ...
instead of:
if ($var) { ...
Somehow my eyes and brain always ignored to see that '!' between the '('
and the '$'
It's all up and settled now! Sorry for the bandwidth abused,
Michael
|
|
From: <php...@li...> - 2007-05-04 12:09:16
|
Ooops - sorry - my error: you had asked for the PHP version not the PHP/Java-bridge version: I am using PHP 5.1.6. Michael php...@li... wrote on 04.05.2007 10:46:43: > Hi Michael, > > > > Which PHP version do you use, btw? > > > > I mentioned that in the very first line of my > > append: 3.1.8. > > Are you sure? IMHO the PHP/Java Bridge only supports > PHP 4.3.2 and above. > > Or do you use some other PHP implementation? > > > Regards, > Jost Boekemeier > > > > __________________________________ Yahoo! Clever - Der > einfachste Weg, Fragen zu stellen und Wissenswertes mit Anderen zu teilen. > www.yahoo.de/clever > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users |
|
From: <php...@li...> - 2007-05-04 09:02:01
|
--> <C v="demo.NCI" p="I" i="6be6668" />
--> </C>
<-- <O v="1" p="O" i="6be6668"/>
--> <I v="0" m="castToBoolean" p="I" i="63bf1c4" />
--> <O v="1" />
--> </I>
According to the protocol you use the following code:
$obj = (boolean) new java("demo.NCI");
The result of the cast is true.
<-- <B v="T" i="63bf1c4"/>
At least on protocol level there's nothing wrong with
your code; you've casted the result object to a PHP
boolean value.
I don't know where the boolean cast comes from and why
you or the PHP interpreter confuses the PHP boolean
value with a PHP null object.
Which PHP version do you use? And how exactly does the
code look like? Note that PHP sometimes uses implicit
casts, depending on the context, for example "$obj"
implicitly casts $obj to a PHP string value.
Regards,
Jost Boekemeier
__________________________________ Yahoo! Clever: Sie haben Fragen? Yahoo! Nutzer antworten Ihnen. www.yahoo.de/clever
|
|
From: <php...@li...> - 2007-05-04 08:46:48
|
Hi Michael,
> > Which PHP version do you use, btw?
>
> I mentioned that in the very first line of my
> append: 3.1.8.
Are you sure? IMHO the PHP/Java Bridge only supports
PHP 4.3.2 and above.
Or do you use some other PHP implementation?
Regards,
Jost Boekemeier
__________________________________ Yahoo! Clever - Der einfachste Weg, Fragen zu stellen und Wissenswertes mit Anderen zu teilen. www.yahoo.de/clever
|
|
From: <php...@li...> - 2007-05-03 22:28:45
|
Continuing to investigate on this new Java('...') call that returns a null
I pushed the log-level even higher and I am now getting this log from the
PHP/Java bridge:
-------------------------------------------------
May 04 00:03:44 JavaBridge INFO : JavaBridge version : 3.1.8
May 04 00:03:44 JavaBridge INFO : JavaBridge logFile :
C:\temp\php-java-bridge.log
May 04 00:03:44 JavaBridge INFO : JavaBridge default logLevel: 5
May 04 00:03:44 JavaBridge INFO : JavaBridge socket :
INET_LOCAL:9270
May 04 00:03:44 JavaBridge INFO : JavaBridge thread pool size: 20
May 04 00:03:44 JavaBridge DEBUG: Starting to accept Socket connections
May 04 00:03:46 JavaBridge DEBUG: Socket connection accepted
May 04 00:03:46 JavaBridge DEBUG: Starting bridge from Thread Pool
May 04 00:03:46 JavaBridge DEBUG: 6fee6fee@33563356 START: JavaBridge.run()
May 04 00:03:46 JavaBridge DEBUG: 6fee6fee@33563356 Request from client
with uid/gid -1/-1
May 04 00:03:46 JavaBridge DEBUG: 6fee6fee@33563356 --> <I v="0"
m="updateJarLibraryPath" p="I" i="6be6668" >
May 04 00:03:46 JavaBridge DEBUG: 6fee6fee@33563356 --> <S
v="C:\Programs\xampp\htdocs\demo\lib\nci.jar" />
May 04 00:03:46 JavaBridge DEBUG: 6fee6fee@33563356 --> <S
v="C:\Programs\xampp\php\ext\" />
May 04 00:03:46 JavaBridge DEBUG: 6fee6fee@33563356 --> </I>
May 04 00:03:46 JavaBridge DEBUG:
Invoking [Object 1877897198 - Class:
php.java.bridge.JavaBridge:ID1080574056:LOADER-ID382211784].updateJarLibraryPath([Object
791555886 - Class: java.lang.String:ID51184397:LOADER-ID0],[Object
876229690 - Class: java.lang.String:ID51184397:LOADER-ID0]);
May 04 00:03:47 JavaBridge DEBUG: Added LOADER-ID1560567044
OrigPath: ;C:\Programs\xampp\htdocs\demo\lib\nci.jar
Translated: file:C:\Programs\xampp\htdocs\demo\lib\nci.jar
May 04 00:03:47 JavaBridge DEBUG:
Result [Object null]
May 04 00:03:47 JavaBridge DEBUG: 6fee6fee@33563356 <-- <N i="6be6668"/>
May 04 00:03:47 JavaBridge DEBUG: 6fee6fee@33563356 --> <C v="demo.NCI"
p="I" i="6be6668" />
May 04 00:03:47 JavaBridge DEBUG: 6fee6fee@33563356 --> </C>
May 04 00:03:47 JavaBridge DEBUG: trying to load class: demo.NCI from:
LOADER-ID1560567044
May 04 00:03:47 JavaBridge DEBUG: trying to load class: java.lang.Object
from: LOADER-ID1560567044
May 04 00:03:47 JavaBridge DEBUG: trying to load class: org.w3c.dom.Node
from: LOADER-ID1560567044
May 04 00:03:47 JavaBridge DEBUG: trying to load class: java.lang.String
from: LOADER-ID1560567044
May 04 00:03:47 JavaBridge DEBUG: trying to load class: java.lang.Throwable
from: LOADER-ID1560567044
May 04 00:03:47 JavaBridge DEBUG: trying to load class: java.lang.Exception
from: LOADER-ID1560567044
May 04 00:03:47 JavaBridge DEBUG: trying to load class:
java.lang.reflect.Method from: LOADER-ID1560567044
May 04 00:03:47 JavaBridge DEBUG: trying to load class:
org.apache.muse.ws.notification.NotificationMessage from:
LOADER-ID1560567044
May 04 00:03:47 JavaBridge DEBUG: trying to load class:
org.apache.muse.util.xml.XmlSerializable from: LOADER-ID1560567044
May 04 00:03:47 JavaBridge DEBUG: trying to load class:
demo.NCI$UsageException from: LOADER-ID1560567044
May 04 00:03:47 JavaBridge DEBUG: trying to load class:
java.util.MissingResourceException from: LOADER-ID1560567044
May 04 00:03:47 JavaBridge DEBUG: trying to load class:
policies.MyServiceProxy from: LOADER-ID1560567044
May 04 00:03:47 JavaBridge DEBUG: trying to load class:
org.apache.muse.ws.notification.remote.NotificationConsumerClient from:
LOADER-ID1560567044
May 04 00:03:47 JavaBridge DEBUG: trying to load class:
org.apache.muse.ws.resource.remote.WsResourceClient from:
LOADER-ID1560567044
May 04 00:03:47 JavaBridge DEBUG: trying to load class:
org.apache.muse.core.AbstractResourceClient from: LOADER-ID1560567044
May 04 00:03:47 JavaBridge DEBUG: trying to load class:
org.apache.muse.util.Traceable from: LOADER-ID1560567044
May 04 00:03:47 JavaBridge DEBUG: trying to load class:
org.apache.muse.ws.addressing.soap.SoapMonitor from: LOADER-ID1560567044
May 04 00:03:47 JavaBridge DEBUG: trying to load class: policies.MyService
from: LOADER-ID1560567044
May 04 00:03:47 JavaBridge DEBUG: trying to load class: java.lang.Class
from: LOADER-ID1560567044
May 04 00:03:47 JavaBridge DEBUG: trying to load class:
java.util.ResourceBundle from: LOADER-ID1560567044
May 04 00:03:47 JavaBridge DEBUG: trying to load class: demo.NCI from:
LOADER-ID1560567044
May 04 00:03:47 JavaBridge DEBUG: trying to load class: demo.NCI_en from:
LOADER-ID1560567044
May 04 00:03:47 JavaBridge DEBUG: trying to load class: demo.NCI_en_US
from: LOADER-ID1560567044
May 04 00:03:47 JavaBridge DEBUG: trying to load class:
java.lang.StringBuilder from: LOADER-ID1560567044
May 04 00:03:47 JavaBridge DEBUG: trying to load class: java.lang.Boolean
from: LOADER-ID1560567044
May 04 00:03:47 JavaBridge DEBUG: trying to load class: java.lang.System
from: LOADER-ID1560567044
May 04 00:03:47 JavaBridge DEBUG: trying to load class: java.io.PrintStream
from: LOADER-ID1560567044
NCI-ctor()
May 04 00:03:47 JavaBridge DEBUG:
Invoking [Object 1472616390 - Class:
demo.NCI:ID1344884777:LOADER-ID1560567044].demo.NCI();
May 04 00:03:47 JavaBridge DEBUG: 6fee6fee@33563356 <-- <O v="1" p="O"
i="6be6668"/>
May 04 00:03:47 JavaBridge DEBUG: 6fee6fee@33563356 --> <I v="0"
m="castToBoolean" p="I" i="63bf1c4" />
May 04 00:03:47 JavaBridge DEBUG: 6fee6fee@33563356 --> <O v="1" />
May 04 00:03:47 JavaBridge DEBUG: 6fee6fee@33563356 --> </I>
May 04 00:03:47 JavaBridge DEBUG:
Invoking [Object 1877897198 - Class:
php.java.bridge.JavaBridge:ID1080574056:LOADER-ID382211784].castToBoolean([Object
1472616390 - Class: demo.NCI:ID1344884777:LOADER-ID1560567044]);
May 04 00:03:47 JavaBridge DEBUG:
Result [Object 1472616390 - Class:
demo.NCI:ID1344884777:LOADER-ID1560567044]
May 04 00:03:47 JavaBridge DEBUG: 6fee6fee@33563356 <-- <B v="T"
i="63bf1c4"/>
May 04 00:03:47 JavaBridge DEBUG: 6fee6fee@33563356 --> <U v="1" />
May 04 00:03:47 JavaBridge DEBUG: 6fee6fee@33563356 --> <F p="A" />
May 04 00:03:47 JavaBridge DEBUG: end: Thread[JavaBridge#1,5,JavaBridge#1]
May 04 00:03:47 JavaBridge DEBUG: 6fee6fee@33563356 <-- <F p="A"/>
May 04 00:05:07 JavaBridge DEBUG: 6fee6fee@33563356 --> <I v="0"
m="updateJarLibraryPath" p="I" i="6bdd710" >
May 04 00:05:07 JavaBridge DEBUG: 6fee6fee@33563356 --> <S
v="C:\Programs\xampp\htdocs\demo\lib\nci.jar" />
May 04 00:05:07 JavaBridge DEBUG: 6fee6fee@33563356 --> <S
v="C:\Programs\xampp\php\ext\" />
May 04 00:05:07 JavaBridge DEBUG: 6fee6fee@33563356 --> </I>
May 04 00:05:07 JavaBridge DEBUG:
Invoking [Object 1877897198 - Class:
php.java.bridge.JavaBridge:ID1080574056:LOADER-ID382211784].updateJarLibraryPath([Object
1595957024 - Class: java.lang.String:ID51184397:LOADER-ID0],[Object
1680630828 - Class: java.lang.String:ID51184397:LOADER-ID0]);
May 04 00:05:07 JavaBridge DEBUG:
Result [Object null]
May 04 00:05:07 JavaBridge DEBUG: 6fee6fee@33563356 <-- <N i="6bdd710"/>
May 04 00:05:07 JavaBridge DEBUG: 6fee6fee@33563356 --> <C v="demo.NCI"
p="I" i="6bdd710" />
May 04 00:05:07 JavaBridge DEBUG: 6fee6fee@33563356 --> </C>
NCI-ctor()
May 04 00:05:07 JavaBridge DEBUG:
Invoking [Object 2059172540 - Class:
demo.NCI:ID1344884777:LOADER-ID1560567044].demo.NCI();
May 04 00:05:07 JavaBridge DEBUG: 6fee6fee@33563356 <-- <O v="1" p="O"
i="6bdd710"/>
May 04 00:05:07 JavaBridge DEBUG: 6fee6fee@33563356 --> <I v="0"
m="castToBoolean" p="I" i="63bf1c4" />
May 04 00:05:07 JavaBridge DEBUG: 6fee6fee@33563356 --> <O v="1" />
May 04 00:05:07 JavaBridge DEBUG: 6fee6fee@33563356 --> </I>
May 04 00:05:07 JavaBridge DEBUG:
Invoking [Object 1877897198 - Class:
php.java.bridge.JavaBridge:ID1080574056:LOADER-ID382211784].castToBoolean([Object
2059172540 - Class: demo.NCI:ID1344884777:LOADER-ID1560567044]);
May 04 00:05:07 JavaBridge DEBUG:
Result [Object 2059172540 - Class:
demo.NCI:ID1344884777:LOADER-ID1560567044]
May 04 00:05:07 JavaBridge DEBUG: 6fee6fee@33563356 <-- <B v="T"
i="63bf1c4"/>
May 04 00:05:07 JavaBridge DEBUG: 6fee6fee@33563356 --> <U v="1" />
May 04 00:05:07 JavaBridge DEBUG: 6fee6fee@33563356 --> <F p="A" />
May 04 00:05:07 JavaBridge DEBUG: end: Thread[JavaBridge#1,5,JavaBridge#1]
May 04 00:05:07 JavaBridge DEBUG: 6fee6fee@33563356 <-- <F p="A"/>
-------------------------------------------------
The "NCI-ctor()" line (about 20th from bottom) comes from the constructor,
which reads:
...
public NCI() {
System.out.println("NCI-ctor()");
}
...
and since it's the only thing the constructor does, I would assume that it
also completes.
That means, it is the returning of the object that must fail, or how could
I otherwise get a null back from the constructor?
But the line
...
Result [Object 2059172540 - Class:
demo.NCI:ID1344884777:LOADER-ID1560567044]
...
(seventh line from the bottom) suggests that there actually IS some object
returned, so why does the PHP-code then obtain a null???
Really puzzled!
Michael
|
|
From: <php...@li...> - 2007-05-03 15:47:05
|
php...@li... wrote on 03.05.2007 17:27:58: > Sorry, but that instruction was to terse for me. How/where exactly do I set > that protocol level so that I can monitor what is going on? > ... OK - I figured this out myself, how to enable the logging: The result looks as follows: ------------------------------------------ ... May 03 17:41:28 JavaBridge DEBUG: 72a872a8@36143614 START: JavaBridge.run() May 03 17:41:28 JavaBridge DEBUG: 72a872a8@36143614 Request from client with uid/gid -1/-1 May 03 17:41:28 JavaBridge DEBUG: 72a872a8@36143614 --> <I v="0" m="updateJarLibraryPath" p="I" i="67f0070" > May 03 17:41:28 JavaBridge DEBUG: 72a872a8@36143614 --> <S v="C:\Programs\xampp\htdocs\demo\lib\nci.jar" /> May 03 17:41:28 JavaBridge DEBUG: 72a872a8@36143614 --> <S v="C:\Programs\xampp\php\ext\" /> May 03 17:41:28 JavaBridge DEBUG: 72a872a8@36143614 --> </I> May 03 17:41:28 JavaBridge DEBUG: 72a872a8@36143614 <-- <N i="67f0070"/> May 03 17:41:28 JavaBridge DEBUG: 72a872a8@36143614 --> <C v="test.NCI" p="I" i="67f0070" /> May 03 17:41:28 JavaBridge DEBUG: 72a872a8@36143614 --> </C> NCI-ctor() May 03 17:41:28 JavaBridge DEBUG: 72a872a8@36143614 <-- <O v="1" p="O" i="67f0070"/> May 03 17:41:28 JavaBridge DEBUG: 72a872a8@36143614 --> <I v="0" m="castToBoolean" p="I" i="61bf1c4" /> May 03 17:41:28 JavaBridge DEBUG: 72a872a8@36143614 --> <O v="1" /> May 03 17:41:28 JavaBridge DEBUG: 72a872a8@36143614 --> </I> May 03 17:41:28 JavaBridge DEBUG: 72a872a8@36143614 <-- <B v="T" i="61bf1c4"/> May 03 17:41:28 JavaBridge DEBUG: 72a872a8@36143614 --> <U v="1" /> May 03 17:41:28 JavaBridge DEBUG: 72a872a8@36143614 --> <F p="A" /> May 03 17:41:28 JavaBridge DEBUG: 72a872a8@36143614 <-- <F p="A"/> ------------------------------------------ OK - and what exactly does that now tell us??? Michael (puzzled...) |
|
From: <php...@li...> - 2007-05-03 15:28:30
|
Sorry, but that instruction was to terse for me. How/where exactly do I set that protocol level so that I can monitor what is going on? I am running the PHP/Java bridge 1.3.8 on XAMPP v1.5.4a on a Windows XP box and I enabled the PHP/Java bridge by placing the files "WEB-INF\lib\JavaBridge.jar" and "WEB-INF\cgi\java-x86-windows.dll" (extracted from the file "JavaBridge.war") into C:\Program Files\xampp\php\ext (the latter under the name "php_java.dll" and adding a line "extension=php_java.dll" to php.ini). That's at least how I learned to install and enable the php/java bridge... Michael php...@li... wrote on 02.05.2007 11:41:14: > Hi, > > you're right that new Java(...) cannot return NULL. > > > How can I figure out, what's going wrong here and > > why??? > > You can look at the protocol level. Either set the log > level to 4 or above or, if you use linux, type: > > strace -s 1024 php yourPhpScript.php >error.log > > You will see something like: > > --> <C p=... v=...>...</C> > <-- <O v=.../> > > > Which PHP version do you use, btw? > > > Regards, > Jost Boekemeier |
|
From: <php...@li...> - 2007-05-03 11:21:51
|
> Which PHP version do you use, btw?
I mentioned that in the very first line of my append: 3.1.8.
Michael :-)
=
From: php...@li... =
=
To: php...@li... =
=
Date: 02.05.2007 11:42 =
=
Subject: Re: [Php-java-bridge-users] Getting back null-object from=
new Java(...) - how to debug this?
=
Hi,
you're right that new Java(...) cannot return NULL.
> How can I figure out, what's going wrong here and
> why???
You can look at the protocol level. Either set the log
level to 4 or above or, if you use linux, type:
strace -s 1024 php yourPhpScript.php >error.log
You will see something like:
--> <C p=3D... v=3D...>...</C>
<-- <O v=3D.../>
Which PHP version do you use, btw?
Regards,
Jost Boekemeier
--- php...@li...
schrieb:
>
> I am using php/java bridge 3.1.8. I am having the
> interesting case that in
> my PHP code I do a
>
> $classpath=3D'...';
> java_require($classpath);
> try {
> $var=3Dnew Java('class.name.here'); //
> the constructor has no
> paramete
> } catch(JavaException $exeption) {
> throw new Exception('Java-exception
> creating object of class
> "class.name.here": '.$exeption);
> }
> if ($var) {
> // using the object...
> } else {
> echo 'got a null object... :-( ';
> }
>
> Initially I was getting misc.
> ClassNotFound-Exceptions until I got my
> classpath right. The classpath seems to be OK now,
> but now I am NOT getting
> any JavaException but I get back a null-object, i.e.
> I am falling into the
> echo ... statement in the above snippet.
>
> How can I figure out, what's going wrong here and
> why???
>
> Michael
>
>
>
-----------------------------------------------------------------------=
--
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2
> express and take
> control of your XML. No limits. Just data. Click to
> get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> php-java-bridge-users mailing list
> php...@li...
>
https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
>
Heute schon einen Blick in die Zukunft von E-Mails wagen? Versuch=
en
Sie=B4s mit dem neuen Yahoo! Mail. www.yahoo.de/mail
-----------------------------------------------------------------------=
--
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
php-java-bridge-users mailing list
php...@li...
https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
=
|
|
From: <php...@li...> - 2007-05-03 10:20:19
|
Hi,
> For my application, most of the methods use
> generic as a parameter or
Yes, generics (implemented as erasures) are no problem
for the bridge. Please see our FAQ for details. Real
generics, as proposed by the Rice people (which could
be the base of a proper java module system) need some
adjustment within the bridge code.
> Does the bridge
> support generic systax.
You probably mean "does the bridge support java
generics"? Yes, it does.
Does it support a generic syntax? No. Java only
supports generics on its surface, the byte code below
is still the same as in java 1.4.
Implementing a syntax transformer (something like
Scheme's define-syntax) for PHP is outside the scope
of the PHP/Java Bridge.
> Could the syntax be like?
> new java("java.util.List<String>");
The syntax is:
new java("java.util.List");
Regards,
Jost Boekemeier
--- php...@li...
schrieb:
> Hi
> For my application, most of the methods use
> generic as a parameter or
> return value (e.g. List<Foo>). Does the bridge
> support generic systax.
> If it does, could I have a link to the document?
>
> Could the syntax be like?
> new java("java.util.List<String>");
>
>
-------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2
> express and take
> control of your XML. No limits. Just data. Click to
> get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> php-java-bridge-users mailing list
> php...@li...
>
https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
>
__________________________________ Kennt man wirklich jeden über 3 Ecken? Die Antworten gibt's bei Yahoo! Clever. www.yahoo.de/clever
|
|
From: <php...@li...> - 2007-05-03 06:06:27
|
Hi
For my application, most of the methods use generic as a parameter or
return value (e.g. List<Foo>). Does the bridge support generic systax.
If it does, could I have a link to the document?
Could the syntax be like?
new java("java.util.List<String>");
|
|
From: <php...@li...> - 2007-05-02 12:04:08
|
Hi, Please open a ticket, please use http://sourceforge.net/tracker/?func=add&group_id=117793&atid=679233 and attach the log of the bridge there. We'll check this issue asap. Regards, Jost Boekemeier --- php...@li... schrieb: > Hi, > > you're right that new Java(...) cannot return NULL. > > > How can I figure out, what's going wrong here and > > why??? > > You can look at the protocol level. Either set the > log > level to 4 or above or, if you use linux, type: > > strace -s 1024 php yourPhpScript.php >error.log > > You will see something like: > > --> <C p=... v=...>...</C> > <-- <O v=.../> > > > Which PHP version do you use, btw? > > > Regards, > Jost Boekemeier > > > > --- php...@li... > schrieb: > > > > > I am using php/java bridge 3.1.8. I am having the > > interesting case that in > > my PHP code I do a > > > > $classpath='...'; > > java_require($classpath); > > try { > > $var=new Java('class.name.here'); // > > the constructor has no > > paramete > > } catch(JavaException $exeption) { > > throw new Exception('Java-exception > > creating object of class > > "class.name.here": '.$exeption); > > } > > if ($var) { > > // using the object... > > } else { > > echo 'got a null object... :-( '; > > } > > > > Initially I was getting misc. > > ClassNotFound-Exceptions until I got my > > classpath right. The classpath seems to be OK now, > > but now I am NOT getting > > any JavaException but I get back a null-object, > i.e. > > I am falling into the > > echo ... statement in the above snippet. > > > > How can I figure out, what's going wrong here and > > why??? > > > > Michael > > > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by DB2 Express > > Download DB2 Express C - the FREE version of DB2 > > express and take > > control of your XML. No limits. Just data. Click > to > > get it now. > > http://sourceforge.net/powerbar/db2/ > > _______________________________________________ > > php-java-bridge-users mailing list > > php...@li... > > > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > > > > > > Heute schon einen Blick in die Zukunft von > E-Mails wagen? Versuchen Sie´s mit dem neuen Yahoo! > Mail. www.yahoo.de/mail > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 > express and take > control of your XML. No limits. Just data. Click to > get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > __________________________________ Yahoo! Clever - Der einfachste Weg, Fragen zu stellen und Wissenswertes mit Anderen zu teilen. www.yahoo.de/clever |
|
From: <php...@li...> - 2007-05-02 09:41:21
|
Hi,
you're right that new Java(...) cannot return NULL.
> How can I figure out, what's going wrong here and
> why???
You can look at the protocol level. Either set the log
level to 4 or above or, if you use linux, type:
strace -s 1024 php yourPhpScript.php >error.log
You will see something like:
--> <C p=... v=...>...</C>
<-- <O v=.../>
Which PHP version do you use, btw?
Regards,
Jost Boekemeier
--- php...@li...
schrieb:
>
> I am using php/java bridge 3.1.8. I am having the
> interesting case that in
> my PHP code I do a
>
> $classpath='...';
> java_require($classpath);
> try {
> $var=new Java('class.name.here'); //
> the constructor has no
> paramete
> } catch(JavaException $exeption) {
> throw new Exception('Java-exception
> creating object of class
> "class.name.here": '.$exeption);
> }
> if ($var) {
> // using the object...
> } else {
> echo 'got a null object... :-( ';
> }
>
> Initially I was getting misc.
> ClassNotFound-Exceptions until I got my
> classpath right. The classpath seems to be OK now,
> but now I am NOT getting
> any JavaException but I get back a null-object, i.e.
> I am falling into the
> echo ... statement in the above snippet.
>
> How can I figure out, what's going wrong here and
> why???
>
> Michael
>
>
>
-------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2
> express and take
> control of your XML. No limits. Just data. Click to
> get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> php-java-bridge-users mailing list
> php...@li...
>
https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
>
Heute schon einen Blick in die Zukunft von E-Mails wagen? Versuchen Sie´s mit dem neuen Yahoo! Mail. www.yahoo.de/mail
|
|
From: <php...@li...> - 2007-05-02 09:14:37
|
Hi,
> ---------------------
> PHP 5.0.4 too old.
> For PHP versions < 5.1.4 install the java.so or
> php_java.dll from the
> php-java-bridge-legacy download.
> Or set the path to the PHP executable, see php_exec
> in the
> WEB-INF/web.xml
> ---------------------
> What I don't get is that Apache *is* available, so
> why is the
> documentation steering me towards this
> implementation? Please explain.
Depending on whether you use the Apache front-end or
the J2EE back-end directly, a) you need to install the
java.so/php_java.dll or b) set the path to the php
executable, respectively.
That is:
http://localhost:8080/JavaBridge/test.php
invokes the php_exec from the web.xml,
http://localhost:80/JavaBridge/test.php invokes Apache
or IIS and triggers the php.so or php.dll which in
turn reads the php.ini which in turn loads the java.so
or php_java.dll.
> I do not understand how PHP deals with Java's
> instances.
Well, as someone else noted, your only mistake was
that you thought that getInstance evaluates for its
side effects. But this isn't the case. It is a
function.
> I installed this: php-java-bridge-4.0.7_j2ee and
Okay.
> though the environment
> is a virtual dedicated server, my rights are sadly
> limited.
Okay.
> I've got tomcat running on autostart and have the
> bridge in its webapps
> directory.
Okay. This means that even if the machine boots,
tomcat (and the bridge) will re-start automatically.
Good.
> If tomcat is supplying the VM, why am I getting
> stack heap issues in
Your ISP doesn't want you to start java from the
console. This is usually a GRSecurity or SEL issue.
> trying to start a VM when merely calling java -jar
> JavaBridge.jar --help
> ?
>
> This has *got* to work, I just need to figure out
> how...
Not really. You can restrict Java so that it core
dumps on startup. Please take a look at the SEL files
distributed with the php-java-bridge source download.
Sun JDK 1.5 for example creates executable files in
the temp dir with global permissions. This is very
insecure, imho. If you switch off these permissions
via a SEL rule, Java will crash in the garbage
collector or in the JIT thread.
It all depends on the SEL context. Presumably tomcat
runs in the initd_t context, not in unconfined_t. But
that's guesswork.
Regards,
Jost Boekemeier
Heute schon einen Blick in die Zukunft von E-Mails wagen? Versuchen Sie´s mit dem neuen Yahoo! Mail. www.yahoo.de/mail
|
|
From: <php...@li...> - 2007-05-02 08:57:48
|
I am using php/java bridge 3.1.8. I am having the interesting case that in
my PHP code I do a
$classpath='...';
java_require($classpath);
try {
$var=new Java('class.name.here'); // the constructor has no
paramete
} catch(JavaException $exeption) {
throw new Exception('Java-exception creating object of class
"class.name.here": '.$exeption);
}
if ($var) {
// using the object...
} else {
echo 'got a null object... :-( ';
}
Initially I was getting misc. ClassNotFound-Exceptions until I got my
classpath right. The classpath seems to be OK now, but now I am NOT getting
any JavaException but I get back a null-object, i.e. I am falling into the
echo ... statement in the above snippet.
How can I figure out, what's going wrong here and why???
Michael
|
|
From: <php...@li...> - 2007-05-01 15:52:44
|
I appreciate your attempt to help with this, but the documentation and my lack of Java knowledge is becoming tedious. I get this message when running the script that you and I have been sending back and forth: --------------------- PHP 5.0.4 too old. For PHP versions < 5.1.4 install the java.so or php_java.dll from the php-java-bridge-legacy download. Or set the path to the PHP executable, see php_exec in the WEB-INF/web.xml --------------------- The web.xml file lists this php_exec under a section titled "PHP CGI servlet: when IIS or Apache are not available" and I have put the php binary as a value (uncommented). =20 What I don't get is that Apache *is* available, so why is the documentation steering me towards this implementation? Please explain. I do not understand how PHP deals with Java's instances. I do understand objects and classes from a PHP perspective, but I have just begun to learn Java so this process has a learning curve for me. Try to be open-minded. I installed this: php-java-bridge-4.0.7_j2ee and though the environment is a virtual dedicated server, my rights are sadly limited. If I could update php I would. I've got tomcat running on autostart and have the bridge in its webapps directory. =20 If tomcat is supplying the VM, why am I getting stack heap issues in trying to start a VM when merely calling java -jar JavaBridge.jar --help ? This has *got* to work, I just need to figure out how... --K |
|
From: <php...@li...> - 2007-05-01 14:06:39
|
$algorithm = java("java.security.MessageDigest");
$algorithm->getInstance("md5");
$algorithm->reset();
As far as I understood the discussion this should be $algo = java(...)->getInstance(...).
You want to reset the algorithm, not the class, no?
8=)
---------------------------------
Ahhh...imagining that irresistible "new car" smell?
Check outnew cars at Yahoo! Autos.
|
|
From: <php...@li...> - 2007-05-01 12:16:41
|
Hi,
> And a beginner with Java I am, indeed.
Isn't it possible to test your scripts on a local
computer?
When they work, you can create a web archive (.war
file) and deploy it into the Tomcat/J2EE server of
your ISP.
After that symlink or copy the scripts from the tomcat
webapps directory to the Apache or IIS document root
and you're done.
Regards,
Jost Boekemeier
__________________________________ Kennt man wirklich jeden über 3 Ecken? Die Antworten gibt's bei Yahoo! Clever. www.yahoo.de/clever
|
|
From: <php...@li...> - 2007-05-01 12:01:24
|
Hi,
which version of the bridge do you use?
> same exception as a few days ago, which was that
> update() didn't exist:
Yes, I've seen the message. However, the message was
correct, update is not a static feature of the class.
> In other various tests it would toss a "reset()
> doesn't exist"
How does the code look like? Do you see the reset()
function when you call
echo java_inspect($obj);
I think you've confused the class and the instance.
> I have set the path to my php executable in
>
/usr/java/tomcat-5.5/webapps/JavaBridge/WEB-INF/web.xml
> as follows:
>
> <!-- Your php binary. Default is /usr/bin/php-cgi or
> -->
> <!-- c:/php/php-cgi.exe -->
> <!--
> <init-param>
> <param-name>php_exec</param-name>
> <param-value>/usr/bin/php</param-value>
> </init-param>
> -->
What do you mean with this? The init-param is still
commented out!?!
This is a misunderstanding, anyway. The J2EE component
uses the built-in php-cgi.exe, which is 5.1.4. But you
want to use Apache or IIS as a front end and the PHP
version installed there.
I didn't know that you use an old version of PHP,
sorry.
> When I run 'which php' I get '/usr/bin/php'
Irrelevant. The Apache binary uses a dll/shared
object.
> Sorry, was a typo on my part on the command line,
> though using .jar
> affects the same response. The command doesn't even
> get far enough to
> toss an error relative to the file type.
Too bad.
Regards,
Jost Boekemeier
__________________________________ Yahoo! Clever: Stellen Sie Fragen und finden Sie Antworten. Teilen Sie Ihr Wissen. www.yahoo.de/clever
|
|
From: <php...@li...> - 2007-04-30 17:44:41
|
Hi there --
Yes, I read and understand the function below and changed my script in
an attempt to utilize the JavaClass option as a test, but received the
same exception as a few days ago, which was that update() didn't exist:
function java($clazz) {
static $cache;
if(isset($cache)) return $cache;
return $cache=3Dnew JavaClass($clazz);
}
$algorithm =3D java("java.security.MessageDigest");
$algorithm->getInstance("md5");
$algorithm->reset();
$algorithm->update($password->getBytes());=20
In other various tests it would toss a "reset() doesn't exist"
exception, etc etc.=20
But rather than this as an issue, I think it's looking more like a
problem with my Bridge install.
I've removed the java.so from /etc/php.d/java.ini and now I'm receiving
the error that sent me in many different directions to get this to work
:)
"PHP 5.0.4 too old.
For PHP versions < 5.1.4 install the java.so or php_java.dll from the
php-java-bridge-legacy download.
Or set the path to the PHP executable, see php_exec in the
WEB-INF/web.xml"
I have set the path to my php executable in
/usr/java/tomcat-5.5/webapps/JavaBridge/WEB-INF/web.xml as follows:
<!-- Your php binary. Default is /usr/bin/php-cgi or -->
<!-- c:/php/php-cgi.exe -->
<!--
<init-param>
<param-name>php_exec</param-name>
<param-value>/usr/bin/php</param-value>
</init-param>
-->
I also tried /usr/bin/php-cgi as suggested in the file, though when I
read "php binary" I think of /usr/bin/php, not php-cgi. Please correct
me if I'm wrong. Both binaries exist and both paths toss the same
error.
When I run 'which php' I get '/usr/bin/php'
I cannot upgrade the php install.
>> When I try to run this on the command line:=20
>> java -jar JavaBridge.war --help
> In which documentation have you found the above
> command? The .war file is a web archive, not an
> executable jar file. We could change that in the
> future, though.
Sorry, was a typo on my part on the command line, though using .jar
affects the same response. The command doesn't even get far enough to
toss an error relative to the file type.
> The java.so contains code which could make the
> communication faster. But it is quite difficult to
> handle, especially for beginners.
And a beginner with Java I am, indeed. =20
Thanks for your help!
K
|
|
From: <php...@li...> - 2007-04-30 17:07:57
|
Hi,
> Hrm, this is frustrating. I put this together and
> received a "Call to
> undefined function java()" error (see full error
> below):
It is defined in Java.inc as:
function java($clazz) {
static $cache;
if(isset($cache)) return $cache;
return $cache=new JavaClass($clazz);
}
The function is handy because it hides the class
variable inside the function.
The code:
$System = new JavaClass("java.lang.System");
$systemProps = $System->getProperties();
is equivalent to:
$systemProps=java("java.lang.System")->getProperties();
but the latter is easier to read.
> It seems to not find the objects within Java.inc,
Hmm, when you use the java.so or php_java.dll, some
old versions of Java.inc don't define this function.
It may make sense to implement the function directly
in java.c.
> however it's including
> the file properly in the script so therefore I am
> considering that I
> don't have the Bridge installed properly.
Mea culpa. I thought that you use the pure PHP
implementation. Just remove the java.so and the script
will work.
> I've followed the j2ee instructions to install the
> bridge as I want
> Tomcat to run the JVM rather than a new JVM trying
> to run each request.
Correct.
> Is this incorrect? Does a JVM have to start every
> time anyway?
Well, you have two options, a) start Java as a sub
process of Apache or IIS (not recommended, needs
java.so) or b) start Java via a J2EE server or servlet
engine as a system service (recommended).
On Windows/Unix you can start tomcat as a service.
> running this on a Virtual Dedicated Hosting account
> and therefore it's
> not my own server to run as I please.
Hmm. Do you get a notification when the computer
boots? You can start a persistent java VM with
nohup java -jar JavaBridge.jar <port> 3 jb.log&
but the above VM will terminate when the computer
reboots.
> When I try to run this on the command line:
> java -jar JavaBridge.war --help
In which documentation have you found the above
command? The .war file is a web archive, not an
executable jar file. We could change that in the
future, though.
> I've saved java.so to the php-extension directory
-------
nak, nak, nak. Remove it, please. :)
The java.so contains code which could make the
communication faster. But it is quite difficult to
handle, especially for beginners.
Regards,
Jost Boekemeier
__________________________________ Yahoo! Clever - Der einfachste Weg, Fragen zu stellen und Wissenswertes mit Anderen zu teilen. www.yahoo.de/clever
|
|
From: <php...@li...> - 2007-04-30 16:24:21
|
Hey Jost --
Thanks for your time on this.
Hrm, this is frustrating. I put this together and received a "Call to
undefined function java()" error (see full error below):
require_once("/usr/java/tomcat-5.5/webapps/JavaBridge/java/Java.inc");
$passwd=3D"admin";
try {
java_require("file:/usr/lib/php/modules/lib/mail.jar"); // mail.jar is
not part of the standard jdk
$password=3Dnew java("java.lang.String", "$passwd");
=20
$algorithm=3D java("java.security.MessageDigest")->getInstance("md5");
$algorithm->reset();
$algorithm->update($password->getBytes());
$encrypted =3D $algorithm->digest();
$out =3D new java("java.io.ByteArrayOutputStream");
$encoder =3D
java("javax.mail.internet.MimeUtility")->encode($out,"base64");
$encoder->write($encrypted);
$encoder->flush();
echo new java("java.lang.String",$out->toByteArray()); echo "\n";
exit(0);
} catch (Exception $e) {
echo "Echo invocation failed: $e\n";
print_r ($e->getTrace());
exit(1);
}
Error:=20
_________________________________
type Exception report
message
description The server encountered an internal error () that prevented
it from fulfilling this request.
exception
javax.servlet.ServletException: PHP Fatal error: Call to undefined
function java() in /usr/java/tomcat-5.5/webapps/JavaBridge/mytest.php on
line 3
php.java.servlet.PhpCGIServlet.doGet(PhpCGIServlet.java:362)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
php.java.bridge.Util$ProcessWithErrorHandler$PhpException: PHP Fatal
error: Call to undefined function java() in
/usr/java/tomcat-5.5/webapps/JavaBridge/mytest.php on line 3
=09
php.java.bridge.Util$ProcessWithErrorHandler.destroy(Util.java:899)
=09
php.java.servlet.PhpCGIServlet$CGIRunner.run(PhpCGIServlet.java:284)
php.java.servlet.CGIServlet.doGet(CGIServlet.java:463)
php.java.servlet.PhpCGIServlet.doGet(PhpCGIServlet.java:328)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
________________________________________
It seems to not find the objects within Java.inc, however it's including
the file properly in the script so therefore I am considering that I
don't have the Bridge installed properly. =20
I've followed the j2ee instructions to install the bridge as I want
Tomcat to run the JVM rather than a new JVM trying to run each request.
Is this incorrect? Does a JVM have to start every time anyway? I'm
running this on a Virtual Dedicated Hosting account and therefore it's
not my own server to run as I please. =20
When I try to run this on the command line:=20
java -jar JavaBridge.war --help
I get this error:
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
I thought I installed the Bridge without the need to create a new JVM
each time, but again perhaps I'm not understanding how this works... :/
When first installing the bridge I struggled with attempting to increase
the amount of memory available to the JVM, but gave up and went what I
thought was the pure PHP installation.
I've got JavaBridge.war and the unpacked JavaBridge directory in my
tomcat webapps directory. I can run the test.php file and the examples
provided (the hello.php and numberguess.php scripts) by browsing here:
http://mydomain.com:9080/JavaBridge/hello.php or
http://mydomain:9080/JavaBridge/numberguess.php, respectively).
I've saved java.so to the php-extension directory and put a reference
(extension=3Djava.so) in the java.ini file in my /etc/php.d/ directory =
and
verified that php was looking in this directory for user-defined ini
settings.
Thanks for helping me with this...
--Kate
|
|
From: <php...@li...> - 2007-04-28 14:58:27
|
Thanks for responding to my post Jost.
I fixed it by compiling and installing from the source code.
-----Original Message-----
From: php...@li...
[mailto:php...@li...] On Behalf
Of php...@li...
Sent: Saturday, April 28, 2007 4:51 AM
To: php...@li...
Subject: Re: [Php-java-bridge-users] Unable to
installphp-java-bridge-3.2.1-1.FC6.i386.rpm on Linux
Hi,
> installing java bridge on my linux box. The failed
> dependencies
> indicates it could not find php but I do have php
> 5.2.0. =20
You can install PHP 5.2.0 in your home directory or in
some other temporary place. But this won't affect the
computer operating system in any way. You need to
install the appropriate php RPM.
> # rpm -i php-java-bridge-3.2.1-1.FC6.i386.rpm=20
> error: Failed dependencies:
> libgcj.so.7rh is needed by
> php-java-bridge-3.2.1-1.i386
> php >=3D 5.1.1 is needed by
> php-java-bridge-3.2.1-1.i386
> rtld(GNU_HASH) is needed by
> php-java-bridge-3.2.1-1.i386
These are exported by gcc-java and php. The command:
yum install php java
should fix this problem.=20
BTW: The Linux RPM's are for RedHat and compatibles
(Fedora, WhiteBox, CentOS, ...). They don't work on
Novell Linux for example, on other Linux operating
systems use the generic binary download instead.
Regards,
Jost Boekemeier
__________________________________ Yahoo! Clever - Der einfachste
Weg, Fragen zu stellen und Wissenswertes mit Anderen zu teilen.
www.yahoo.de/clever
------------------------------------------------------------------------
-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
php-java-bridge-users mailing list
php...@li...
https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
|
|
From: <php...@li...> - 2007-04-28 11:50:44
|
Hi,
> installing java bridge on my linux box. The failed
> dependencies
> indicates it could not find php but I do have php
> 5.2.0.
You can install PHP 5.2.0 in your home directory or in
some other temporary place. But this won't affect the
computer operating system in any way. You need to
install the appropriate php RPM.
> # rpm -i php-java-bridge-3.2.1-1.FC6.i386.rpm
> error: Failed dependencies:
> libgcj.so.7rh is needed by
> php-java-bridge-3.2.1-1.i386
> php >= 5.1.1 is needed by
> php-java-bridge-3.2.1-1.i386
> rtld(GNU_HASH) is needed by
> php-java-bridge-3.2.1-1.i386
These are exported by gcc-java and php. The command:
yum install php java
should fix this problem.
BTW: The Linux RPM's are for RedHat and compatibles
(Fedora, WhiteBox, CentOS, ...). They don't work on
Novell Linux for example, on other Linux operating
systems use the generic binary download instead.
Regards,
Jost Boekemeier
__________________________________ Yahoo! Clever - Der einfachste Weg, Fragen zu stellen und Wissenswertes mit Anderen zu teilen. www.yahoo.de/clever
|
|
From: <php...@li...> - 2007-04-28 11:41:58
|
Hi,
I've used the following code:
<?php
require_once("http://localhost:8080/JavaBridge/java/Java.inc");
$passwd="hello";
try {
java_require("mail.jar"); // mail.jar is not part of
the standard jdk
$password=new java("java.lang.String", "$passwd");
$algorithm=java("java.security.MessageDigest")->getInstance("md5");
$algorithm->reset();
$algorithm->update($password->getBytes());
$encrypted = $algorithm->digest();
$out = new java("java.io.ByteArrayOutputStream");
$encoder =
java("javax.mail.internet.MimeUtility")->encode($out,
"base64");
$encoder->write($encrypted);
$encoder->flush();
echo new
java("java.lang.String",$out->toByteArray()); echo
"\n";
exit(0);
} catch (Exception $e) {
echo "Echo invocation failed: $e\n";
//print_r ($e->getTrace());
exit(1);
}
?>
The above PHP script returns the encoded "hello"
string.
> about how classes
> constructs are represented in Java and trying to
The java function is a thin wrapper around the
JavaClass constructor. It is defined in Java.inc as:
function java($clazzName) {
static $cache;
if($cache) return $cache;
return $cache=new JavaClass($clazzName);
}
> $md = new Java("java.security.MessageDigest");
Although our plan was to stop development after the
4.0.8 release, I think it makes sense to add another
4.1.1 release which immediately throws an exception
when the above construct is called. At the moment the
bridge only writes a warning message and only if the
log level is >= 3.
The check could be relaxed and turned into a warning
when -Dphp.java.bridge.enable_deprecated=true is set
(for backward compatibility).
> [[o:Exception]:"java.lang.Exception: Invoke failed:
> [[c:MessageDigest]]->update([o:array_of_B]). Cause:
> java.lang.NoSuchMethodException:
The bridge message is correct. There is no static
"update" method in the MessageDigest class.
I think your Java example uses $algorithm->update(),
not $md->update().
Regards,
Jost Boekemeier
Heute schon einen Blick in die Zukunft von E-Mails wagen? Versuchen Sie´s mit dem neuen Yahoo! Mail. www.yahoo.de/mail
|