2017 | | 2015 | 2014 | 2013 | 2012 | | 2010 | | 2008 | 2007

(older archive entries before 2007 are not shown here, but included in the onsite-search)

# Re: [QF-Test] Problems with Jython

• Subject: Re: [QF-Test] Problems with Jython
• From: Gregor Schmid <Gregor.Schmid@?.de>
• Date: 31 Jul 2007 09:15:10 +0200

```Hello Rado,

Glad to hear it's working now. Perhaps we should add a check for the
Jython cachedir to QF-Test's startup sequence. On second thought,
there already is such code. It should have created the directory
~/.qftest/jython-cachedir as a fallback when the main cachedir is not
available.

I'll look into this.

Best regards,
Greg

> Hello Greg,
>
> for a reason, I have a bit different directory setup than the one you
> mentioned. And that's probably the cause.
>
> There was no cachedir in qftest\jython\cachedir nor "Documents and
> Settings\username\.qftest\jython-cachedir" on my machine. I have only
> one file "config", in "Documents and Settings\username\.qftest"
> directory.
>
> I suspect that this may be caused by the fact that QF-Test was
> installed by different user on my machine (remotely by an
>
> Under the qftest directory in Program Files, I have another directory
> named qftest-2.0.1, where QF-Test is installed. So, when I tried to
> create the cachedir under jython, the full path was something like
> C:\Program Files\qfs\qftest\qftest-2.0.1\jython\cachedir - which did
> not worked.
>
> Then I created the cachedir in the location you mentioned, i.e.
> \qftest\jython\cachedir (I had to create jython and cachedir
> directories myself) and that's it!
>
> Now the demo_script.qft works as expected.
>
> Thank you for the great support,
>
>
> On 30 Jul 2007 21:03:59 +0200, Gregor Schmid <Gregor.Schmid@?.de> wrote:
> >
> >
> > this happens occasionally. For some reason the Jython package manager
> > screws up and fails to write its package cache which leads to failures
> > when trying to access Java classes.
> >
> > Please remove the directory .../qftest/jython/cachedir completely,
> > then create a new, empty .../qftest/jython/cachedir directory and make
> > sure it is writable. Restart QF-Test and make sure that a directory
> > named packages get created inside cachedir and is filled with some
> > files. If that works, your Jython scripts should work as well.
> >
> > If that fails, QF-Test may try to write to an alternate directory
> > named ~/.qftest/jython-cachedir, where ~ is your home directory on
> > remove the jython-cachedir and retry the above.
> >
> > Best regards,
> >    Greg
> >
> >
> > > Hi all,
> > >
> > > I'd like to use Jython to do some scripting in qftest, but I can not
> > > make it running. I'm trying to isolate the problem, which leads me to
> > > the following:
> > >
> > > 1. When I open the Jython console and try to make something simple like:
> > >
> > > from java.util import Date
> > >
> > > I'm getting:
> > >
> > > Jython 2.1 on java1.4.2_13 (JIT: null)
> > > >>> from java.util import Date
> > > Traceback (innermost last):
> > >   File "<console>", line 1, in ?
> > > ImportError: no module named java
> > > >>>
> > >
> > > 2. When I try to run demo_script.qft from the tutorial, I'm getting
> > >
> > > de.qfs.apps.qftest.shared.exceptions.ScriptException: The script
> > > failed with the following message:
> > > Traceback (innermost last):
> > >
> > >   File "<string>", line 1, in ?
> > >
> > > NameError: qftest
> > >
> > >  at de.qfs.apps.qftest.run.l.runScript(SourceFile:1062)
> > >  at de.qfs.apps.qftest.step.ServerScriptStep.exec(SourceFile:113)
> > >  at de.qfs.apps.qftest.run.AbstractRunContext.call(SourceFile:1265)
> > >  at de.qfs.apps.qftest.step.BasicSequence.exec(SourceFile:725)
> > >  at de.qfs.apps.qftest.step.BasicSequence.exec(SourceFile:677)
> > >  at de.qfs.apps.qftest.run.AbstractRunContext.call(SourceFile:1265)
> > >  at de.qfs.apps.qftest.step.Test.exec(SourceFile:638)
> > >  at de.qfs.apps.qftest.step.Test.exec(SourceFile:508)
> > >  at de.qfs.apps.qftest.run.AbstractRunContext.call(SourceFile:1265)
> > >  at de.qfs.apps.qftest.step.Test.exec(SourceFile:638)
> > >  at de.qfs.apps.qftest.step.Test.exec(SourceFile:508)
> > >  at de.qfs.apps.qftest.run.AbstractRunContext.call(SourceFile:1265)
> > >  at de.qfs.apps.qftest.step.RootStep.exec(SourceFile:1045)
> > >  at de.qfs.apps.qftest.run.AbstractRunContext.call(SourceFile:1265)
> > >  at de.qfs.apps.qftest.run.AbstractRunContext.run(SourceFile:909)
> > >  at de.qfs.apps.qftest.run.AbstractRunContext.run(SourceFile:838)
> > >  at de.qfs.apps.qftest.run.I.run(SourceFile:6717)
> > >
> > > 3 Finally, I have looked at qftest.log, and there seems to be an error
> > > message with somewhat similar problem (see below).
> > >
> > > Am I doing something wrong? Or is my setup screwed? Or am I missing something?
> > >
> > > Thank you in advance,
> > >
> > >
> > > P.S. I'm using QF-Test version 2.0.1 (build 2117) under WinXP Pro.
> > >
> > > This is an excerpt from qftest.log:
> > >
> > > 4 (17:09:24.910) main de.qfs.apps.qftest.start.Init.setupLogging():
> > > -------------------- qftest 2.0.1 Started Mon Jul 30 17:09:24 CEST
> > > 2007 --------------------
> > > 3 (17:09:29.177) main de.qfs.apps.qftest.start.ServerInit.run():
> > > org.apache.bsf.BSFException: exception from Jython: Traceback
> > > (innermost last):
> > >   File "<string>", line 1, in ?
> > >   File "C:\Program
> > > Files\qfs\qftest\qftest-2.0.1\jython\Lib\qftest.py", line 4, in ?
> > > ImportError: no module named javax
> > >
> > > 4 (17:09:29.177) main de.qfs.apps.qftest.start.ServerInit.run():
> > > org.apache.bsf.BSFException: exception from Jython: Traceback
> > > (innermost last):
> > >   File "<string>", line 1, in ?
> > >   File "C:\Program
> > > Files\qfs\qftest\qftest-2.0.1\jython\Lib\qftest.py", line 4, in ?
> > > ImportError: no module named javax
> > >
> > >  at de.qfs.apps.qftest.shared.script.JythonEngine.exec(SourceFile:182)
> > >  at org.apache.bsf.BSFManager\$6.run(Unknown Source)
> > >  at java.security.AccessController.doPrivileged(Native Method)
> > >  at org.apache.bsf.BSFManager.exec(Unknown Source)
> > >  at de.qfs.apps.qftest.start.s.h(SourceFile:189)
> > >  at de.qfs.apps.qftest.start.Start.a(SourceFile:180)
> > >  at de.qfs.apps.qftest.start.Start.main(SourceFile:131)
> > >  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > >  at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> > >  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> > >  at java.lang.reflect.Method.invoke(Unknown Source)
> > >  at de.qfs.apps.qftest.start.SplashStart.main(SourceFile:147)

--
Gregor Schmid                                Gregor.Schmid@?.de
Quality First Software GmbH                     http://www.qfs.de
Tulpenstr. 41                                Tel: +49 8171 919870
DE-82538 Geretsried                          Fax: +49 8171 919876
GF: Gregor Schmid, Karlheinz Kellerer          HRB München 140833

```