Hello, glad to have found this list. I'm trying to use this piece of
tech to solve a problem at work, and am having some difficulties. I
know my way around PHP and Java as a developer, not a server admin so
much, so please be patient;
On a mac, I'm running Tomcat 6, and MAMP, running PHP 5. On the
installation instructions for the pjb, it says that if you deploy the
war in tomcat and see the php-cgi (etc.) not found message, that you
should take the JavaBridge directory, and drop it into your web server
root.
I do this, and everything works fine. I can call the index.php page
that shows the examples, and they all run.
However, when I try to use a custom class, like "TestHello.class", no
matter where I put it, I can't get it to work. I tail the php errors
log, and it says that Java is reporting the class can't be found. I've
tried putting the class one of the indicated classpaths of the
machine, the directory where I find the other java classes used in the
examples, etc., but no dice.
One other thing, the java.inc file can't be imported by URL, as that's
generally shut off in PHP5; I tried to import it in a helloworld.php
page, and it thew an error, however, importing it by relative path
( ../../JavaBridge/java/java.inc ) seems to work fine (since there's
no error and the java ( ) function seems to be found.
So, my question; according to installation instructions and lack of
errors, and successfully executing php example pages, it seems I'm set
up right. But, where the heck do I put a custom java class, simple
(not a bean, this is just TestHello.class, default package, so it's a
top-level namespace, no com.this.that) so that I can call it? The
examples that come with the pjb don't seem to make this clear at all.
Any help appreciated. I'm optimistic about this technology, but need a
helping push here.
Thanks,
Tim.
|