From: <php...@li...> - 2010-06-14 09:57:15
|
I've never done any Java programming before, so I may be missing something fairly obvious here. I want to use the Saxon java classes to process XML 2.0 Xpaths via PHP. So I've done: java_require(SAXON_DIR."saxon9he.jar"); (where SAXON_DIR is predefined). I then find that I can directly access the Saxon classes via PHP , such as: $config = new java("net.sf.saxon.Configuration"); So all OK so far! However, for efficiency reason I don't want to make multiple PHP calls to java to do the Xpath processing. So I want to create my own java class which does all the necessary Saxon processing and can be accessed with one PHP call. I've created this class, built a JAR file (SaxonXPath.jar) and verified that it works via a standalone java program, run as: java -cp .:SaxonXPath.jar:saxon9he.jar TestProg So I now want to run this via PHP/java-bridge and have done: java_require(SAXON_DIR."saxon9he.jar"); java_require(SAXON_DIR."SaxonXPath.jar"); I put these into a catch/try block, so I have verified that they are successfully loaded. However, when I try and instantiate my class in "SaxonXPath.jar" I get the error: java.lang.ClassNotFoundException: Could not find com.legatio.xml.SaxonXPath in java_require() path. Please check the path and the SEL and File permissions. I can still access the "saxon9he.jar" classes directly and I've double-checked that I'm using the correct path to my own class. I tried setting "[java]" "java.classpath" in the php.ini file to the jar files directory location, but this made no difference. Does anyone have any idea of what I might be doing wrong here? |
From: <php...@li...> - 2010-06-14 10:19:32
|
Hi, please see http://php-java-bridge.sourceforge.net/pjb/desktop-apps.php And please forget about CLASSPATH an java_require. Please see our FAQ for details. Regards, Jost Boekemeier Am 14.06.2010 11:57 schrieb <php...@li...>: I've never done any Java programming before, so I may be missing something fairly obvious here. I want to use the Saxon java classes to process XML 2.0 Xpaths via PHP. So I've done: java_require(SAXON_DIR."saxon9he.jar"); (where SAXON_DIR is predefined). I then find that I can directly access the Saxon classes via PHP , such as: $config = new java("net.sf.saxon.Configuration"); So all OK so far! However, for efficiency reason I don't want to make multiple PHP calls to java to do the Xpath processing. So I want to create my own java class which does all the necessary Saxon processing and can be accessed with one PHP call. I've created this class, built a JAR file (SaxonXPath.jar) and verified that it works via a standalone java program, run as: java -cp .:SaxonXPath.jar:saxon9he.jar TestProg So I now want to run this via PHP/java-bridge and have done: java_require(SAXON_DIR."saxon9he.jar"); java_require(SAXON_DIR."SaxonXPath.jar"); I put these into a catch/try block, so I have verified that they are successfully loaded. However, when I try and instantiate my class in "SaxonXPath.jar" I get the error: java.lang.ClassNotFoundException: Could not find com.legatio.xml.SaxonXPath in java_require() path. Please check the path and the SEL and File permissions. I can still access the "saxon9he.jar" classes directly and I've double-checked that I'm using the correct path to my own class. I tried setting "[java]" "java.classpath" in the php.ini file to the jar files directory location, but this made no difference. Does anyone have any idea of what I might be doing wrong here? ------------------------------------------------------------------------------ ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo _______________________________________________ php-java-bridge-users mailing list php...@li... https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users |
From: <php...@li...> - 2010-06-14 13:54:38
|
Hi Jost, Thanks for the prompt reply. I wasn't trying to run as a desktop app, but via a web server. However, your reply made me realise that the documentation I was looking at was out of date. I found that by compiling my java code using "javac -extdirs . *.java" and putting the jar file into: /var/lib/tomcat5.5/webapps/JavaBridge/WEB-INF/lib .. then my classes were found, without the need to use "java_require" (which I now realise is depricated). Thanks again, Joe On 14/06/10 11:19, php...@li... wrote: > Hi, > > please see > http://php-java-bridge.sourceforge.net/pjb/desktop-apps.php > > And please forget about CLASSPATH an java_require. Please see our FAQ for > details. > > Regards, > Jost Boekemeier > > Am 14.06.2010 11:57 schrieb<php...@li...>: > > I've never done any Java programming before, so I may be missing > something fairly obvious here. > > I want to use the Saxon java classes to process XML 2.0 Xpaths via PHP. > > So I've done: > > java_require(SAXON_DIR."saxon9he.jar"); > > (where SAXON_DIR is predefined). I then find that I can directly access > the Saxon classes via PHP , such as: > > $config = new java("net.sf.saxon.Configuration"); > > So all OK so far! > > However, for efficiency reason I don't want to make multiple PHP calls > to java to do the Xpath processing. So I want to create my own java > class which does all the necessary Saxon processing and can be accessed > with one PHP call. > > I've created this class, built a JAR file (SaxonXPath.jar) and verified > that it works via a standalone java program, run as: > > java -cp .:SaxonXPath.jar:saxon9he.jar TestProg > > So I now want to run this via PHP/java-bridge and have done: > > java_require(SAXON_DIR."saxon9he.jar"); > java_require(SAXON_DIR."SaxonXPath.jar"); > > I put these into a catch/try block, so I have verified that they are > successfully loaded. However, when I try and instantiate my class in > "SaxonXPath.jar" I get the error: > > java.lang.ClassNotFoundException: Could not find > com.legatio.xml.SaxonXPath in java_require() path. Please check the path > and the SEL and File permissions. > > I can still access the "saxon9he.jar" classes directly and I've > double-checked that I'm using the correct path to my own class. > > I tried setting "[java]" "java.classpath" in the php.ini file to the jar > files directory location, but this made no difference. > > Does anyone have any idea of what I might be doing wrong here? > > > > > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > -- Joe Tully Software Developer Legatio Technologies Limited T: 0113 350 8772 x 104 www.ftax.co.uk; www.callvalidate.co.uk , www.legatio.com Legatio Technologies Limited, One Park Lane, Leeds, West Yorkshire, LS3 1EP Registered in England and Wales No. 4519902, VAT Number GB 799 5777 30, Data Protection Registration Number Z8175343. Legal Notice: We are not legal advisers and we cannot give advice on any Claims or Responses or the Employment Tribunals process. If you have any legal questions about your Employment Tribunals case or completing a form you should contact the Employment Tribunals Enquiry Line on 08457 959775. Any advice or information, whether oral or written, that you obtain from us or from the use of the Service shall not create any warranty, representation or other kind of obligation whatsoever. ------------------ Powered by Legatio.com This message is confidential. It may not be disclosed to, or used by, anyone other than the addressee(s). If you receive this message in error, please advise us immediately using the email address in...@le.... Internet e-mail is not necessarily secure. Legatio will not accept responsibility for alterations or additions to any e-mail message or attached documents that occur after transmission. |