2011/10/27 J. Marc Edwards <marc.edwards@nimbisservices.com>
All:

I have added several external jar files to my Jython project, e.g. latest version of Xerces and now XQJ (Xquery for Java).  However, I'm concerned that I am not picking up these jar files for my builds.  My primary questions are at the end of this email.

Examining the Run Configuration for my PyDev project, which is configured for Jython, here is my "PYTHONPATH that will be used in the run:"

/home/jmarcedwards/Eclipse_Indigo/eclipse/plugins/org.python.dev_2.2.3.2011100616/PySrc/pydev_sitecustomize
/home/jmarcedwards/EclipseIndigo_workspace/TSS_Workflow1
/home/jmarcedwards/Xerces-J_2_11_0/xerces-2_11_0/build/serializer.jar
/home/jmarcedwards/Xerces-J_2_11_0/xerces-2_11_0/build/resolver.jar
/home/jmarcedwards/Xerces-J_2_11_0/xerces-2_11_0/build/xml-apis.jar
/home/jmarcedwards/Xerces-J_2_11_0/xerces-2_11_0/build/xercesSamples.jar
/home/jmarcedwards/Xerces-J_2_11_0/xerces-2_11_0/build/xercesImpl.jar
/home/jmarcedwards/XQJ/xqjapi.jar
/home/jmarcedwards/Jython_2_5_2/Lib
/home/jmarcedwards/Jython_2_5_2/Lib/site-packages
/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/resources.jar
/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/rt.jar
/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/jsse.jar
/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/jce.jar
/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/charsets.jar
/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/ext/sunjce_provider.jar
/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/ext/dnsns.jar
/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/ext/sunpkcs11.jar
/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/ext/localedata.jar


Below is my new XQJ package location and my examination of my xqjapi.jar file.
jmarcedwards@jmarcedwards-Z68X-UD5-B3:~/XQJ$ pwd
/home/jmarcedwards/XQJ
jmarcedwards@jmarcedwards-Z68X-UD5-B3:~/XQJ$ ls -ltr
total 700
-rw-rw-r-- 1 jmarcedwards jmarcedwards  17196 2008-01-10 01:43 xqjapi.jar
-rw-rw-r-- 1 jmarcedwards jmarcedwards 158687 2008-01-17 17:44 XQJ_Javadoc_v1.0_FD_20080114.zip
-rw-rw-r-- 1 jmarcedwards jmarcedwards 533188 2009-03-09 10:40 XQJ_Spec_Final_Release_2009-03.pdf
jmarcedwards@jmarcedwards-Z68X-UD5-B3:~/XQJ$ jar tf xqjapi.jar
javax/xml/xquery/XQCachedItem.class
javax/xml/xquery/XQCachedSequence.class
javax/xml/xquery/XQCancelledException.class
javax/xml/xquery/XQCommonHandler.class
javax/xml/xquery/XQConnection.class
javax/xml/xquery/XQConstants.class
javax/xml/xquery/XQDataFactory.class
javax/xml/xquery/XQDataSource.class
javax/xml/xquery/XQDynamicContext.class
javax/xml/xquery/XQException.class
javax/xml/xquery/XQExpression.class
javax/xml/xquery/XQItem.class
javax/xml/xquery/XQItemAccessor.class
javax/xml/xquery/XQItemType.class
javax/xml/xquery/XQMetaData.class
javax/xml/xquery/XQPreparedExpression.class
javax/xml/xquery/XQQueryException.class
javax/xml/xquery/XQResultItem.class
javax/xml/xquery/XQResultSequence.class
javax/xml/xquery/XQSequence.class
javax/xml/xquery/XQSequenceType.class
javax/xml/xquery/XQStackTraceElement.class
javax/xml/xquery/XQStackTraceVariable.class
javax/xml/xquery/XQStaticContext.class
javax/xml/xquery/XQWarning.class
javax/xml/xquery/ConnectionPoolXQDataSource.class
javax/xml/xquery/PooledXQConnection.class
javax/xml/xquery/XQConnectionEvent.class
javax/xml/xquery/XQConnectionEventListener.class


In my Jython code, I am importing the xquery package with:

from javax.xml import query

  1. Do you think that I am picking up my XQJ package from the /home/jmarcedwards/XQJ directory?
  2. Should I be setting and using a Java classpath variable for my Jython PyDev project?

Kind regards, Marc
--


Hi Marc,

I don't understand very well your question. If you want to know if the .jar is used just removed it from the path and if the import fails you'll know this is the one used.

These paths are only used in Eclipse when you run or debug your project in this environment. Outside of Eclipse, you have to do it yourself.

Is it helping?

Pierre Thibault

Python Developer/Développeur Python
Montréal, QC
pierre.thibault1@gmail.com