|
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?
|