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
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
1
|
2
(1) |
3
(1) |
4
(7) |
5
(1) |
6
|
7
|
|
8
|
9
|
10
(3) |
11
(1) |
12
(1) |
13
|
14
|
|
15
(1) |
16
(6) |
17
(6) |
18
(4) |
19
|
20
|
21
|
|
22
|
23
(2) |
24
|
25
|
26
(3) |
27
(6) |
28
(3) |
|
29
|
30
(3) |
|
|
|
|
|
|
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
|
|
From: <php...@li...> - 2007-04-27 22:55:50
|
Hi there --
Ok, I've been working on this a bit today, reading about how classes
constructs are represented in Java and trying to understand the
documentation itself regarding java.security.MessageDigest and I'm just
not sure why it's not liking the update() call. Here's the code
evolution so far:
$password =3D new Java("java.lang.String","admin");
$md =3D new Java("java.security.MessageDigest");
$algorithm =3D $md->getInstance("md5");
$reset =3D $algorithm->reset();
$update =3D $md->update($password->getBytes());
$digest =3D $md->digest();
$out =3D new Java("java.io.ByteArrayOutputStream");
$encoder =3D new Java("javax.mail.internet.MimeUtility");
$encoder->encode($out,"base64");
$encoder->write($encrypted);
$encoder->flush();
$the_return =3D new Java("java.lang.String",$out->toByteArray());
echo "output: ".$the_return->trim();
It tosses an exception at the $update call:
javax.servlet.ServletException: PHP Fatal error: Uncaught
[[o:Exception]:"java.lang.Exception: Invoke failed:
[[c:MessageDigest]]->update([o:array_of_B]). Cause:
java.lang.NoSuchMethodException: update([o:array_of_B]). Candidates: []
Responsible VM: 1.5.0_09@http://java.sun.com/" at:
#-5 php.java.bridge.JavaBridge.Invoke(JavaBridge.java:1106)
#-4 php.java.bridge.Request.handleRequest(Request.java:342)
#-3 php.java.bridge.Request.handleRequests(Request.java:388)
#0 /usr/java/tomcat-5.5/webapps/JavaBridge/test_string.php(24):
Java->__call('update', Array)
#1 /usr/java/tomcat-5.5/webapps/JavaBridge/test_string.php(24):
Java->update(Object(JavaArray))
#2 {main}]
thrown in /usr/java/tomcat-5.5/webapps/JavaBridge/test_string.php on
line 24
php.java.servlet.PhpCGIServlet.doGet(PhpCGIServlet.java:362)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
Upon printing $password->getBytes() to the screen it simply resolves,
naturally, to admin. This is correct, I assume, as it's just supposed
to change the series of bytes to the systems character set. =20
So, what is deal?=20
Thanks in advance,
Kate
-----Original Message-----
From: php...@li...
[mailto:php...@li...] On Behalf
Of php...@li...
Sent: Friday, April 27, 2007 2:36 AM
To: php...@li...
Subject: Re: [Php-java-bridge-users] PHP Java Translation Help
Hi,
> algorithm.update(password.getBytes());
> $str =3D new Java('java.lang.String');
> $algorithm->update($str->getBytes($password));
the above PHP code creates a zero-length String and
then calls "".getBytes(<password>). The getBytes()
function needs a symbol as its argument or no argument
at all, not a password. :)
Your Java code translated into PHP is:
<?php
require_once("http://localhost:8080/JavaBridge/java/Java.inc");
$password=3Dnew String("$passwd");
$algorithm=3Djava("java.security.MessageDigest")->getInstance(ENCRYPTION_=
T
YPE);
$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,
ENCODING_TYPE);
$encoder->write(encrypted);
$encoder.flush();
return new String(out.toByteArray());
?>
(not tested)
Regards,
Jost Boekemeier
__________________________________ Yahoo! Clever: Sie haben
Fragen? Yahoo! Nutzer antworten Ihnen. 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-27 17:14:31
|
I don't have much experience on Linux. I got this problem when
installing java bridge on my linux box. The failed dependencies
indicates it could not find php but I do have php 5.2.0. Could some one
gives me an suggestion.
Sudo -s
#rpm --import RPM-GPG-KEY
# 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
|
|
From: <php...@li...> - 2007-04-27 15:38:37
|
This I did not know, so thank you.
--Kate
-----Original Message-----
From: php...@li... =
[mailto:php...@li...] On Behalf =
Of php...@li...
Sent: Friday, April 27, 2007 2:39 AM
To: php...@li...
Subject: Re: [Php-java-bridge-users] PHP Java Translation Help
Hi again,
BTW:
> } catch (Exception $e) {
>=20
> print_r($e); // for debugging purposes
> return "<br>Bad Encryption";
The PHP Exception objects already provide a suitable
__toString() method.=20
The output from print($e) is much more readable than
the output from print_r($e), which prints the internal
state of the exception object.
Regards,
Jost Boekemeier
Heute schon einen Blick in die Zukunft von E-Mails wagen? =
Versuchen 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-04-27 15:38:09
|
Vielen Dank, Jost. This is very helpful :) This project is my
introduction to Java, so I'm learning how to interpret its default and
imported classes as I go along (and it's the concept of an interface
that is throwing me for a loop at the moment, at least regarding how to
represent this in php).
Question: this doesn't seem to be a php construct to me:
$algorithm.update($password->getBytes());
I will test what you sent to me below and attempt to reconstruct this,
but I thought I'd pose the question here of what this means in php
(specifically the period -- I understand this as a Java (and Javascript
and vbscript, etc) construct rather than the typical -> in php).
Thanks for your help,
Kate
-----Original Message-----
From: php...@li...
[mailto:php...@li...] On Behalf
Of php...@li...
Sent: Friday, April 27, 2007 2:36 AM
To: php...@li...
Subject: Re: [Php-java-bridge-users] PHP Java Translation Help
Hi,
> algorithm.update(password.getBytes());
> $str =3D new Java('java.lang.String');
> $algorithm->update($str->getBytes($password));
the above PHP code creates a zero-length String and
then calls "".getBytes(<password>). The getBytes()
function needs a symbol as its argument or no argument
at all, not a password. :)
Your Java code translated into PHP is:
<?php
require_once("http://localhost:8080/JavaBridge/java/Java.inc");
$password=3Dnew String("$passwd");
$algorithm=3Djava("java.security.MessageDigest")->getInstance(ENCRYPTION_=
T
YPE);
$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,
ENCODING_TYPE);
$encoder->write(encrypted);
$encoder.flush();
return new String(out.toByteArray());
?>
(not tested)
Regards,
Jost Boekemeier
__________________________________ Yahoo! Clever: Sie haben
Fragen? Yahoo! Nutzer antworten Ihnen. 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-27 09:39:17
|
Hi again,
BTW:
> } catch (Exception $e) {
>
> print_r($e); // for debugging purposes
> return "<br>Bad Encryption";
The PHP Exception objects already provide a suitable
__toString() method.
The output from print($e) is much more readable than
the output from print_r($e), which prints the internal
state of the exception object.
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-04-27 09:36:25
|
Hi,
> algorithm.update(password.getBytes());
> $str = new Java('java.lang.String');
> $algorithm->update($str->getBytes($password));
the above PHP code creates a zero-length String and
then calls "".getBytes(<password>). The getBytes()
function needs a symbol as its argument or no argument
at all, not a password. :)
Your Java code translated into PHP is:
<?php
require_once("http://localhost:8080/JavaBridge/java/Java.inc");
$password=new String("$passwd");
$algorithm=java("java.security.MessageDigest")->getInstance(ENCRYPTION_TYPE);
$algorithm->reset();
$algorithm.update($password->getBytes());
$encrypted = $algorithm->digest();
$out = new java("java.io.ByteArrayOutputStream");
$encoder =
java("javax.mail.internet.MimeUtility")->encode(out,
ENCODING_TYPE);
$encoder->write(encrypted);
$encoder.flush();
return new String(out.toByteArray());
?>
(not tested)
Regards,
Jost Boekemeier
__________________________________ Yahoo! Clever: Sie haben Fragen? Yahoo! Nutzer antworten Ihnen. www.yahoo.de/clever
|
|
From: <php...@li...> - 2007-04-26 17:12:01
|
Hi folks ?
This may be out of scope of the PJB project, but I?m having some =20
trouble translating Java into PHP and this is because I?m rather new =20
at Java (it?s been a trial, to say the least!).
I?m trying to figure out why a string encoding function in Java would =20
return a different value as a seemingly logical reproduction in PHP. =20
It doesn?t make sense to me so I?m trying to see what the Java =20
function will return via PHP first, but I?m having issues. If this =20
isn?t too off-topic, please keep reading?
1: a java application takes the string ?admin? and turns it into a =20
hash via md5 and then encodes it via base64 ? and comes up with this:
ISMvKXpXpadDiUoOSoAfww=3D=3D
2: instructions from the developers of this application write ?There =20
are 2 parts to the password, one is the hash, the second is you need =20
to Base64 encode that hash.?
3: I ran the string ?admin? through md5() and then ran that through =20
base64_encode() functions in php. So base64_encode(md5(?admin)), =20
effectively. I receive this value: =20
MjEyMzJmMjk3YTU3YTVhNzQzODk0YTBlNGE4MDFmYzM=3D
4: The different return values are confusing me.
5: I have grabbed code provided as an example with their application =20
and it reads like this:
import java.io.*;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import javax.mail.MessagingException;
import javax.mail.internet.MimeUtility;
? other stuff snipped
private static String encodePassword(String password) {
MessageDigest algorithm;
try {
algorithm =3D MessageDigest.getInstance(ENCRYPTION_TYPE);
algorithm.reset();
algorithm.update(password.getBytes());
byte[] encrypted =3D algorithm.digest();
ByteArrayOutputStream out =3D new ByteArrayOutputStream();
OutputStream encoder =3D MimeUtility.encode(out, ENCODING_TYPE)=
;
encoder.write(encrypted);
encoder.flush();
return new String(out.toByteArray());
} catch (NoSuchAlgorithmException e) {
return "Bad Encryption";
} catch (MessagingException e) {
return "Bad Encryption";
} catch (IOException e) {
return "Bad Encryption";
}
}
I translated this as:
$password =3D "admin";
print "encoded: ". encodePassword($password)."<br>";
function encodePassword($password) {
$message =3D new Java('java.security.MessageDigest');
$str =3D new Java('java.lang.String');
try {
$algorithm =3D $message->getInstance('md5');
$reset =3D $algorithm->reset();
$update =3D $algorithm->update($str->getBytes($password));
//$update =3D $algorithm->update($password);
$encrypted =3D $algorithm->digest();
$mu =3D new java('javax.mail.internet.MimeUtility');
$out =3D new Java('java.io.ByteArrayOutputStream');
$encoder =3D $mu->encode($out, 'base64');
$encoder->write($encrypted);
$encoder->flush();
return $out->toByteArray();
} catch (Exception $e) {
print_r($e); // for debugging purposes
return "<br>Bad Encryption";
}
}
And I get this in response:
JavaException Object ( [message:protected] =3D> [string:private] =3D> =20
[code:protected] =3D> 0 [file:protected] =3D> =20
/usr/java/tomcat-5.5/webapps/JavaBridge/test_class.php =20
[line:protected] =3D> 25 [trace:private] =3D> Array ( [0] =3D> Array ( =20
[file] =3D> /usr/java/tomcat-5.5/webapps/JavaBridge/test_class.php =20
[line] =3D> 25 [function] =3D> __call [class] =3D> Java [type] =3D> -> [args=
] =20
=3D> Array ( [0] =3D> getBytes [1] =3D> Array ( [0] =3D> admin ) ) ) [1] =3D=
> =20
Array ( [file] =3D> =20
/usr/java/tomcat-5.5/webapps/JavaBridge/test_class.php [line] =3D> 25 =20
[function] =3D> getBytes [class] =3D> Java [type] =3D> -> [args] =3D> Array =
( =20
[0] =3D> admin ) ) [2] =3D> Array ( [file] =3D> =20
/usr/java/tomcat-5.5/webapps/JavaBridge/test_class.php [line] =3D> 17 =20
[function] =3D> encodePassword [args] =3D> Array ( [0] =3D> admin ) ) ) ) =
=20
encoded:
Bad Encryption
What I think this is telling me is that on line 25 (which is this: =20
$update =3D $algorithm->update($str->getBytes($password));) something is =20
amiss. Line 17 is the print out the encoded password line (print =20
"encoded: ". encodePassword($password)."<br>";), which is, obviously, =20
having issues.
*Any* help as I?m trying to learn how to translate Java into PHP would =20
be smashingly appreciated. And please advise if this is totally out =20
of bounds for this forum.
TIA,
Kate
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
|
|
From: <php...@li...> - 2007-04-26 08:48:12
|
Hi Jon,
which error message do you get?
> environment. Does the *.war also require PHP to be
> installed on the system
The war file contains a 32bit php executable. If your
CPU can execute 32 bit binaries, you can rename the
php-cgi-x86-windows.exe to php-cgi-XXX-windows.exe,
see the error message above.
However, if you have php-cgi.exe installed in the
%PATH%, the bridge will use this php executable
instead of the built-in binary.
> Also, once deploying the package it seems that
> logging from that point
> becomes disabled, e.g. no further server messages
> are shown - is this a
> default behaviour within the app itself?
The JavaBridge.war contains a log4j.jar library. This
library is responsible for this behaviour. I will
remove log4j from the war file.
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-26 00:12:37
|
Hi all, I'm just wondering if anybody had achieved successful results running PHP/Java Bridge on Windows 2003 server, 64-bit edition? I am able to very easily deploy the JavaBridge.war on my own XP (32-bit) machine, but I get a few startup errors when deploying to a live environment. Does the *.war also require PHP to be installed on the system outside of what's provided? Also, once deploying the package it seems that logging from that point becomes disabled, e.g. no further server messages are shown - is this a default behaviour within the app itself? Cheers, Jon -- t: +61 402 878 550 e: jo...@su... |
|
From: <php...@li...> - 2007-04-23 15:39:33
|
Hi,
> - We need to make Tomcat handle JVM in order not to
> have the JVM loaded and
> get-rid-of for every single method call.
> - We need that php files be served by Apache not
> Tomcat.
Just copy JavaBridge.war to $CATALINA_HOME/webapps/
> - We need to use the c impementation not the pure
> PHP implementation of the
> bridge.
Download and install the java.so. On Ubuntu:
dpkg -i php-java-bridge*.deb
Restart tomcat and apache and write a simple test
file:
<?php /* mytest.php */
require_once("http://localhost:8080/JavaBridge/java/Java.inc");
$props = java("java.lang.System")->getProperties();
$array = java_values($props);
print_r($array);
?>
Browse to http://localhost/mytest.php.
Please see the INSTALL.J2EE document contained in the
"J2EE" binary download for details.
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-04-23 13:28:11
|
Hi all I've been trying to install JPB to cope with our needs, but i couldn't find my way in those scattered documents held in PJB site. so, excuse me if I describe my problem here, so anybody could help me. I need to install PJB with the following specification:use - targeted OS is ubuntu linux. - We need to make Tomcat handle JVM in order not to have the JVM loaded and get-rid-of for every single method call. - We need that php files be served by Apache not Tomcat. - We need to use the c impementation not the pure PHP implementation of the bridge. Describing installation and configuration steps in details will be appreciated. Thanks in advance. Keep on the good work. |
|
From: <php...@li...> - 2007-04-18 10:21:07
|
Ok ! I'll start porting next week in my spare time. I noticed now that the list doesn't show the real sender email.. -Mike php...@li... wrote, On 18.4.2007 12:17: > Hi, > > >> But performance wise is the C extension a lot better >> i guess. >> > > A little bit, yes. > > > >>> No. You must compile it yourself or use the pure >>> >> PHP >> >>> implementation. >>> >> The problem is that on Windows i compile everything >> with MS VS, don't >> > > The mingw setup described in the INSTALL document has > been used by our unix->windows cross compiler. Since > the computer doesn't exist anymore, we cannot provide > windows binaries anymore. > > If you have or want to develop/maintain a ms vc > makefile, please feel free to commit it; we can give > you cvs write access. > > > Regards, > Jost Boekemeier > > > > __________________________________ Kennt man wirklich jeden über 3 Ecken? Die Antworten gibt's bei Yahoo! Clever. 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-18 10:17:18
|
Hi,
> But performance wise is the C extension a lot better
> i guess.
A little bit, yes.
> > No. You must compile it yourself or use the pure
> PHP
> > implementation.
> The problem is that on Windows i compile everything
> with MS VS, don't
The mingw setup described in the INSTALL document has
been used by our unix->windows cross compiler. Since
the computer doesn't exist anymore, we cannot provide
windows binaries anymore.
If you have or want to develop/maintain a ms vc
makefile, please feel free to commit it; we can give
you cvs write access.
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-04-18 09:47:25
|
php...@li... wrote, On 18.4.2007 11:27: > Hi M. > > >> In the latest .zip on sourceforge.net there is no >> Windows extension. >> > > It contains a pure PHP implementation. Which is > enough. > > > But performance wise is the C extension a lot better i guess. >> Could you please fix that? >> > > No. You must compile it yourself or use the pure PHP > implementation. > > The problem is that on Windows i compile everything with MS VS, don't have MinGW setup. Are you interested in a port to Visual Studio ? This would be interesting for a lot of people I guess. In my spare time i could work on porting... > Note that Zend ships PHP executables and a compiled > php/java extension for the windows operating system. > > But I'd like to use your php/Java bridge. > Regards, > Jost Boekemeier > > > > __________________________________ Yahoo! Clever: Stellen Sie Fragen und finden Sie Antworten. Teilen Sie Ihr Wissen. 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-18 09:27:08
|
Hi M. > In the latest .zip on sourceforge.net there is no > Windows extension. It contains a pure PHP implementation. Which is enough. > Could you please fix that? No. You must compile it yourself or use the pure PHP implementation. Note that Zend ships PHP executables and a compiled php/java extension for the windows operating system. 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-17 16:32:37
|
In the latest .zip on sourceforge.net there is no Windows extension. Could you please fix that ? I need for PHP 5.2.+ -M |
|
From: <php...@li...> - 2007-04-17 09:32:50
|
Hi,
> It is ok now..
if i remember correctly, this gcc optimizer bug is due
to an uninitialized condition variable. Depending on
what malloc() returns, the gcc optimizer creates trash
output. When you compile twice, it is more likely that
malloc() returns a segment which initializes the
variable to zero.
> Maybe yesterday package is wrong.
I don't think so. The bind code hasn't been changed
since one year now.
Regards,
Jost Boekemeier
__________________________________ Yahoo! Clever: Sie haben Fragen? Yahoo! Nutzer antworten Ihnen. www.yahoo.de/clever
|
|
From: <php...@li...> - 2007-04-17 09:28:41
|
thks 2007/4/17, php...@li... < php...@li...>: > > Hi, > > > Unresolved external reference: > > java.lang.NoClassDefFoundError: > > MultiThreadedExample$GetThread. -- Unable to call > > the method, see the README > > section "Java platform issues" for details. > > you need to add the java library which exports a > feature needed by MultiThreadedExample$GetThread. Most > likely commons.[1] > > Please see the README section "Java platform issues" > or our FAQ for details. > > > Regards, > Jost Boekemeier > > [1] Java's module concept is entirely insane. > Microsofts .NET shows how to do this right... > > > __________________________________ Yahoo! Clever: Stellen Sie > Fragen und finden Sie Antworten. Teilen Sie Ihr Wissen. > 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 > -- regards jl |
|
From: <php...@li...> - 2007-04-17 09:08:30
|
Hi,
> Unresolved external reference:
> java.lang.NoClassDefFoundError:
> MultiThreadedExample$GetThread. -- Unable to call
> the method, see the README
> section "Java platform issues" for details.
you need to add the java library which exports a
feature needed by MultiThreadedExample$GetThread. Most
likely commons.[1]
Please see the README section "Java platform issues"
or our FAQ for details.
Regards,
Jost Boekemeier
[1] Java's module concept is entirely insane.
Microsofts .NET shows how to do this right...
__________________________________ Yahoo! Clever: Stellen Sie Fragen und finden Sie Antworten. Teilen Sie Ihr Wissen. www.yahoo.de/clever
|