From: <php...@li...> - 2007-03-19 13:26:16
|
Hi Jost, Let me thank you again for all the help you've been giving me. First of all I will answer the questions from your previous mail. java_require("file://usr/local/apache2/htdocs/tests_java/Test.jar"); java_require("http://localhost/tests_java/Test.jar"); java_require("http://172.16.0.75/tests_java/Test.jar"); java_require("Test.jar"); And none of them seemed to work. All of the above examples should work. Which error message do you get? The error I was getting was that it couldn't find the class. I checked the JVM that it was using and it was wrong, as you suggested. So I changed it and now it's working with the JRE I just installed. But now I've got a different error: CreateInstance failed: new Test. Cause: java.lang.IllegalAccessException: Class php.java.bridge.JavaBridge can not access a member of class Test with modifiers "public" Responsible VM: 1.5.0_11@http://java.sun.com/ This is my java code: class Test { public Test () { System.out.println("Hi, I'm the constructor"); } public String saySth () { return "Something stupid"; } public static void main (String[] args) { System.out.println("This is the main"); System.exit(0); } } All methods are public. Regarding Security Enhanced Linux, I had seen the warning on your site so I checked it before but it is not enabled in this box. Besides, I installed the PHP/Java Bridge from its source because the RPM package didn't work for me as the Apache and PHP were also compiled and installed *manually*, so th= e RPM would say that I needed some dependecies such as httpd... Anyway, I think that now that you've shown me this error I had on my configuration I'm closer to making it work. As for the PHP Implementation does that imply that I should run Apache/Tomcat? Because I was required not to use Tomcat in this case. However, as I said in another mail, I don't have much experience with Java nor Tomcat, so I'm not sure what are the advantages or disavantages does that have. Thanks again for your help. Regards, Andr=E9s On 3/18/07, php...@li... < php...@li...> wrote: > > Hi Andr=E9s, > > I just saw that you use a recent version of PHP > anyway. > > So please use the pure PHP implementation instead of > the C based implementation started as a sub component > of Apache. > > Type: > > /opt/jdkXXX/bin/java -jar JavaBridge.jar > SERVLET:8080 > > And then use your java from your scripts as follows: > > <?php > require_once("http://localhost:8080/JavaBridge/java/Java.inc"); > java_require("all.jar;my.jar;library.jar;files.jar"); > ... > ?> > > If this works and you really want to run Java as a sub > component of Apache, you can think about where to > store your libraries and how to set the security > policy in a second step. > > > Regards, > Jost Boekemeier > > > > > > > > ___________________________________________________________ > Der fr=FChe Vogel f=E4ngt den Wurm. Hier gelangen Sie zum neuen Yahoo! Ma= il: > http://mail.yahoo.de > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D= DEVDEV > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > --=20 Andr=E9s Gattinoni (=AF`=B7._.=B7[El Barto(r)]=B7._.=B7=B4=AF) (...) |