From: Alan K. <jyt...@xh...> - 2006-08-23 14:20:33
|
[MARTINEZ-DOMINGUEZ Roberto] > I've added apache's commons-io.jar to classpath on a jython servlet, > and I'm having problems to use one of its classes (FileUtils): > I've tried this (and verified that FileUtils.class exists into > the .jar file, under org/apache/commons/io): Classloading is different under servlets than when operating on the command line. You have to inform the jython package manager about the existence of the package. For your package, add the following at the top of your script, and your imports should now be OK import sys sys.add_package('org.apache.commons.io') Finn Bock has a good explanation of why it is necessary here CLASSPATH problem under Tomcat http://sourceforge.net/mailarchive/message.php?msg_id=706612 This is an important consideration for people embedding jython in containers, and should really be in the FAQ. Who maintains the FAQ? HTH, Alan. |