Ok, I will try this. Thanks a lot for your help!

On Tue, May 11, 2010 at 7:50 PM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Silvio,
>
> On 5/11/2010 1:09 PM, Silvio Tschapke wrote:
> > On 5/11/2010 11:36 AM, Silvio Tschapke wrote:
> >>>> how do I configure tomcat that it finds the biopython libaries?
> >>>> Biopython is not included in jython.jar (which I have moved into the
> >>>> tomcat/lib folder.
> >>
> >> You probably want this JAR file in your webapp's WEB-INF/lib directory,
> >> rather than in Tomcat's global lib directory.
> >>
> >>>> Biopython installs itself into the python26/lib/side-packages folder.
> >>
> >> Okay, what files does it put in there?
> >>
> >>
> > There is no jar file. In the side-packages folder it puts a root folder
> Bio
> > which includes further folders with .py, .pyo, pyc files.
>
> Okay, those are Python scripts, compiled/optimized scripts, and compiled
> scripts. Nothing in there is directly executable, so you probably don't
> need to mess with your java.library.path setting.
>
> > I don't understand this. Do I have to tell Tomcat in a configuration file
> > where it has to search for python or the libraries?
> > Biopython works fine with Python outside my webserver. I am not sure if
> it
> > works with Jython too. But I thought that Jython works fine with Python
> and
> > Biopython is a subpackage so there shouldn'b be any problem. But I am not
> > sure.
>
> You might want to read a bit more about Jython: it does not give you
> access to the python environment on the local machine. Instead, it is
> its own environment. Consider reading
> http://www.jython.org/docs/tutorial/indexprogress.html
>
> If "Bio" uses direct C-library calls instead of Python functions, you're
> out of luck for the time being.
>
> Your first step would be to determine if Bio will work with Jython: I
> recommend getting in touch with the Jython folks to help you figure out
> how to get Bio working with Jython. After that's working, it shouldn't
> be difficult to move everything into Tomcat.
>
> >> Traceback (most recent call last):
> >>   File "C:/Documents and Settings/silvio/My
> >>
> Documents/eclipse_jee_workspace/Test_jee_with_jython/src/jyimplementation/Calculator.py",
> >> line 2, in <module>
> >>     from Bio import Entrez
> >> ImportError: No module named Bio
> >
> >>      org.python.core.PyException.fillInStackTrace(PyException.java:70)
>
> So, somewhere there must be a place where you can configure where Jython
> looks for modules.
>
> [...]
>
> >>
>  org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:190)
> >>      factory.JythonFactory.getJythonObject(JythonFactory.java:21)
> >>      main.Main.forwardRequest(Main.java:17)
>
> It looks like before you call execfile(), you might want to make some
> other calls on either the PythonInterpreter object, or the PySystemState
> object it's using, which seems to have something to do with locating
> modules.
>
> >>      servlets.MyServlet.doGet(MyServlet.java:36)
> >>      javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
> >>      javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> >
> >
> >> If I change the import command in my jython module from "from Bio import
> >> Entrez" to "import Bio.Entrez" it doesn't work neither.
> >
> >
> >> By the way..what means CNFE? :)
>
> That's ClassNotFoundException, which is a Java exception. You're not
> getting that exception, but a different one from the Python interpreter.
> Don't worry: you gave me what I was looking for.
>
> So, it just looks like you need to figure out how to tell Jython that
> the Bio libraries are under .../lib/side-packages. I think you're going
> to have to ask the Jython folks.
>
> Good luck,
> - -chris
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAkvpmNsACgkQ9CaO5/Lv0PAESQCcC4gjP3G9QUM5L7hAnmb1iPlg
> yOQAnjI8fXrcGPUyl+QJm/DUaf1ocbp+
> =v3t/
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

Reply via email to