|
From: Josh J. <j.j...@mc...> - 2006-11-22 02:57:01
|
I assume you are using Tomcat? You may need to add the zxJDBC jar file in your WEB-INF\lib directory. If you are interested in using Jython within Tomcat then you should check out the following link for a great exerpt from the book Jython for Java Programmers. The sample servlet in the book works. http://www.samspublishing.com/articles/article.asp?p=26865&seqNum=9&rl=1 Hope this helps. Josh ----- Original Message ----- From: "steve langer" <sgl...@pp...> To: <jyt...@li...> Sent: Tuesday, November 21, 2006 8:45 AM Subject: [Jython-users] class path problems when Apache runs this > The following script runs fine when run from the command line. My > environment contains the path to the postgresSQ driver in the classpath. > The correct response is to return > **** > made it > path=['/home2/user/code/prime/img-arch/web', > '/home2/user/code/prime/img-arch/web/.', '/usr/share/jython-2.1/Lib', > '/usr/share/java'] > ***** > > the next set is the return when run from Apache > ***** > exception = zxJDBC.DatabaseError,driver not found > path=['/home2/user/code/prime/img-arch/web', '/.', > '/usr/user/jython-2.1/Lib', '/usr/share/java'] > ***** > > I've tried the various sys.x calls to load the pssqgl driver when run > from Apache, none have worked > > > ******* test script **** > #!/usr/bin/env jython > > import sys > from com.ziclix.python.sql import zxJDBC > > # I tried all below to no effect. /usr/share/java already in path > # I also copied all Postgres-* files from "/usr/share/java" to > "/usr/share/jython/LIb" > # Jython book says for below to work must also have "an appropriate > Class Loader" > # what does this mean? > # sys.add_package ("/usr/share/java/postgresql-jdbc3.jar") > # sys.add_extdir ("/usr/share/java") > # sys.add_classdir ("/usr/share/java") > > # from > http://sourceforge.net/mailarchive/forum.php?thread_id=7986001&forum_id=5586 > # sys.path.insert(1, r"/usr/share/java/postgresql-jdbc3.jar" ) > # import * from postgresql-jdbc3 > > msg = "path=%s \nmodul = %s" % (sys.path, sys.modules) > > try : > d,u,p,v = > "jdbc:postgresql://localhost/img_arc2","postgres","","org.postgresql.Driver" > db = zxJDBC.connect(d, u, p, v) > > except : > sys.exit("exception = %s,%s \n%s" % (sys.exc_type, > sys.exc_value, msg)) > > sys.exit("made it \n%s" % (msg)) > > > > ------------------------------------------------------------------------- > 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=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users |