|
From: <php...@li...> - 2007-07-25 20:10:12
|
If I'm not mistaken, List is an interface, not a concrete class. Hence, =
you
cannot say new List(). It seems like Vector() and ArrayList() are =
fairly
standard implementations of List, so you could try
$oList =3D new java('java.util.ArrayList');
Michael.
> -----Original Message-----
> From: php...@li... [mailto:php-
> jav...@li...] On Behalf Of =
php-java-
> bri...@li...
> Sent: Wednesday, July 25, 2007 2:53 PM
> To: php...@li...
> Subject: [Php-java-bridge-users] Problem with List object
>=20
> Hi guys, I'm having problems with a List object.
>=20
> I have the following code:
>=20
> <?php
> $mAnnouncements =3D array (
> 'Welcome.wav',
> 'CPAA.wav',
> );
> print("Array: <br />");
> print_r($mAnnouncements);
>=20
> print("<br />Creating List Object...<br />");
> $oList =3D new java('java.util.List');
> foreach ($mAnnouncements as $ann)
> {
> $oList->add($ann);
> }
> print("List: <br />");
> print_r($oList);
> print("<br />");
> for ($i =3D 0; $i < $oList->size(); $i++)
> {
> print("Value:" . $oList->get($i) . "<br />");
> }
> ?>
>=20
> When I run it I get this output:
>=20
> Array:
> Array ( [0] =3D> Welcome.wav [1] =3D> CPAA.wav )
> Creating List Object...
>=20
> And it just dies there. No error on the output nor on the logs.
>=20
> I'm using php/java bridge on that box withoud any problems, working =
with
> my
> own java classes, but when I need to create this List object I get =
this
> problem.
> Any ideas? Do I need to require any file with java_require?
>=20
> Thanks in advance
>=20
> Andr=E9s Gattinoni
> =
-------------------------------------------------------------------------=
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a =
browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> php-java-bridge-users mailing list
> php...@li...
> https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
|