Discussion:
tests not passing - ERROR: testThroughLayerException (__main__.PythonExceptionTestCase)
Luís Campos
2016-11-03 19:21:09 UTC
Permalink
Hi! :)

I'm currently trying to install pylucene on my machine and I'm following
the official instructions.

When I run "make test" one (and only this one) of the tests fail:

/usr/bin/python test/test_PythonException.py
E
======================================================================
ERROR: testThroughLayerException (__main__.PythonExceptionTestCase)
----------------------------------------------------------------------
File "test/test_PythonException.py", line 34, in
testThroughLayerException
qp.parse("foo bar")
JavaError: <super: <class 'JavaError'>, <JavaError object>>
java.lang.RuntimeException: TestException
at
org.apache.pylucene.queryparser.classic.PythonQueryParser.getFieldQuery_quoted(Native
Method)
at
org.apache.pylucene.queryparser.classic.PythonQueryParser.getFieldQuery(Unknown
Source)
at
org.apache.lucene.queryparser.classic.QueryParser.MultiTerm(QueryParser.java:585)
at
org.apache.lucene.queryparser.classic.QueryParser.Query(QueryParser.java:198)
at
org.apache.lucene.queryparser.classic.QueryParser.TopLevelQuery(QueryParser.java:187)
at
org.apache.lucene.queryparser.classic.QueryParserBase.parse(QueryParserBase.java:111)
I've installed the JJC that came with the PyLucene source code.

$ java -version
openjdk version "1.8.0_91"
OpenJDK Runtime Environment (build 1.8.0_91-8u91-b14-3ubuntu1~16.04.1-b14)
OpenJDK 64-Bit Server VM (build 25.91-b14, mixed mode)

$ python --version
Python 2.7.12

I'm on Ubuntu 16.04

Note: I have little experience on Java

Does anyone know what is happening and how to solve it?
Thanks!

LC
Andi Vajda
2016-11-03 21:27:10 UTC
Permalink
Post by Luís Campos
Hi! :)
I'm currently trying to install pylucene on my machine and I'm following
the official instructions.
/usr/bin/python test/test_PythonException.py
E
======================================================================
ERROR: testThroughLayerException (__main__.PythonExceptionTestCase)
----------------------------------------------------------------------
File "test/test_PythonException.py", line 34, in
testThroughLayerException
qp.parse("foo bar")
JavaError: <super: <class 'JavaError'>, <JavaError object>>
java.lang.RuntimeException: TestException
at
org.apache.pylucene.queryparser.classic.PythonQueryParser.getFieldQuery_quoted(Native
Method)
at
org.apache.pylucene.queryparser.classic.PythonQueryParser.getFieldQuery(Unknown
Source)
at
org.apache.lucene.queryparser.classic.QueryParser.MultiTerm(QueryParser.java:585)
at
org.apache.lucene.queryparser.classic.QueryParser.Query(QueryParser.java:198)
at
org.apache.lucene.queryparser.classic.QueryParser.TopLevelQuery(QueryParser.java:187)
at
org.apache.lucene.queryparser.classic.QueryParserBase.parse(QueryParserBase.java:111)
I've installed the JJC that came with the PyLucene source code.
$ java -version
openjdk version "1.8.0_91"
OpenJDK Runtime Environment (build 1.8.0_91-8u91-b14-3ubuntu1~16.04.1-b14)
OpenJDK 64-Bit Server VM (build 25.91-b14, mixed mode)
$ python --version
Python 2.7.12
I'm on Ubuntu 16.04
Which version of PyLucene did you build ?
Did you build JCC in 'shared' mode ?
To check, run this in python
Post by Luís Campos
from jcc import config
config.SHARED
True

Andi..
Post by Luís Campos
Note: I have little experience on Java
Does anyone know what is happening and how to solve it?
Thanks!
LC
Luís Campos
2016-11-04 08:19:41 UTC
Permalink
lucene==6.2.0

In [1]: from jcc import config
In [2]: config.SHARED
Out[2]: True

I've tried to build it in shared and in non-shared mode and in both of the
times that test didn't pass.
Post by Luís Campos
Hi! :)
Post by Luís Campos
I'm currently trying to install pylucene on my machine and I'm following
the official instructions.
/usr/bin/python test/test_PythonException.py
E
======================================================================
ERROR: testThroughLayerException (__main__.PythonExceptionTestCase)
----------------------------------------------------------------------
File "test/test_PythonException.py", line 34, in
testThroughLayerException
qp.parse("foo bar")
JavaError: <super: <class 'JavaError'>, <JavaError object>>
java.lang.RuntimeException: TestException
at
org.apache.pylucene.queryparser.classic.PythonQueryParser.ge
tFieldQuery_quoted(Native
Method)
at
org.apache.pylucene.queryparser.classic.PythonQueryParser.ge
tFieldQuery(Unknown
Source)
at
org.apache.lucene.queryparser.classic.QueryParser.MultiTerm(
QueryParser.java:585)
at
org.apache.lucene.queryparser.classic.QueryParser.Query(Quer
yParser.java:198)
at
org.apache.lucene.queryparser.classic.QueryParser.TopLevelQu
ery(QueryParser.java:187)
at
org.apache.lucene.queryparser.classic.QueryParserBase.parse(
QueryParserBase.java:111)
I've installed the JJC that came with the PyLucene source code.
$ java -version
openjdk version "1.8.0_91"
OpenJDK Runtime Environment (build 1.8.0_91-8u91-b14-3ubuntu1~16.
04.1-b14)
OpenJDK 64-Bit Server VM (build 25.91-b14, mixed mode)
$ python --version
Python 2.7.12
I'm on Ubuntu 16.04
Which version of PyLucene did you build ?
Did you build JCC in 'shared' mode ?
To check, run this in python
Post by Luís Campos
from jcc import config
config.SHARED
True
Andi..
Post by Luís Campos
Note: I have little experience on Java
Does anyone know what is happening and how to solve it?
Thanks!
LC
Andi Vajda
2016-11-05 23:41:07 UTC
Permalink
Post by Luís Campos
lucene==6.2.0
In [1]: from jcc import config
In [2]: config.SHARED
Out[2]: True
I've tried to build it in shared and in non-shared mode and in both of the
times that test didn't pass.
As I can't reproduce this, you're going to need to trace through the code if
you want to get to the bottom of this error.

Sorry for being no more helpful...

Andi..
Post by Luís Campos
Post by Luís Campos
Hi! :)
Post by Luís Campos
I'm currently trying to install pylucene on my machine and I'm following
the official instructions.
/usr/bin/python test/test_PythonException.py
E
======================================================================
ERROR: testThroughLayerException (__main__.PythonExceptionTestCase)
----------------------------------------------------------------------
File "test/test_PythonException.py", line 34, in
testThroughLayerException
qp.parse("foo bar")
JavaError: <super: <class 'JavaError'>, <JavaError object>>
java.lang.RuntimeException: TestException
at
org.apache.pylucene.queryparser.classic.PythonQueryParser.ge
tFieldQuery_quoted(Native
Method)
at
org.apache.pylucene.queryparser.classic.PythonQueryParser.ge
tFieldQuery(Unknown
Source)
at
org.apache.lucene.queryparser.classic.QueryParser.MultiTerm(
QueryParser.java:585)
at
org.apache.lucene.queryparser.classic.QueryParser.Query(Quer
yParser.java:198)
at
org.apache.lucene.queryparser.classic.QueryParser.TopLevelQu
ery(QueryParser.java:187)
at
org.apache.lucene.queryparser.classic.QueryParserBase.parse(
QueryParserBase.java:111)
I've installed the JJC that came with the PyLucene source code.
$ java -version
openjdk version "1.8.0_91"
OpenJDK Runtime Environment (build 1.8.0_91-8u91-b14-3ubuntu1~16.
04.1-b14)
OpenJDK 64-Bit Server VM (build 25.91-b14, mixed mode)
$ python --version
Python 2.7.12
I'm on Ubuntu 16.04
Which version of PyLucene did you build ?
Did you build JCC in 'shared' mode ?
To check, run this in python
Post by Luís Campos
from jcc import config
config.SHARED
True
Andi..
Post by Luís Campos
Note: I have little experience on Java
Does anyone know what is happening and how to solve it?
Thanks!
LC
Luís Campos
2016-11-06 10:41:24 UTC
Permalink
I've solved it, thanks!

For reference, I think it was related to the JDK that I was using to build
jcc (which can be changed by editing the "setup.py" of jcc, from what I
understood). I was using something called "default-java", now I'm using
"java-1.8.0-openjdk-amd64".
Post by Luís Campos
lucene==6.2.0
Post by Luís Campos
In [1]: from jcc import config
In [2]: config.SHARED
Out[2]: True
I've tried to build it in shared and in non-shared mode and in both of the
times that test didn't pass.
As I can't reproduce this, you're going to need to trace through the code
if you want to get to the bottom of this error.
Sorry for being no more helpful...
Andi..
Post by Luís Campos
Post by Luís Campos
Hi! :)
Post by Luís Campos
I'm currently trying to install pylucene on my machine and I'm following
the official instructions.
/usr/bin/python test/test_PythonException.py
E
======================================================================
ERROR: testThroughLayerException (__main__.PythonExceptionTestCase)
----------------------------------------------------------------------
File "test/test_PythonException.py", line 34, in
testThroughLayerException
qp.parse("foo bar")
JavaError: <super: <class 'JavaError'>, <JavaError object>>
java.lang.RuntimeException: TestException
at
org.apache.pylucene.queryparser.classic.PythonQueryParser.ge
tFieldQuery_quoted(Native
Method)
at
org.apache.pylucene.queryparser.classic.PythonQueryParser.ge
tFieldQuery(Unknown
Source)
at
org.apache.lucene.queryparser.classic.QueryParser.MultiTerm(
QueryParser.java:585)
at
org.apache.lucene.queryparser.classic.QueryParser.Query(Quer
yParser.java:198)
at
org.apache.lucene.queryparser.classic.QueryParser.TopLevelQu
ery(QueryParser.java:187)
at
org.apache.lucene.queryparser.classic.QueryParserBase.parse(
QueryParserBase.java:111)
I've installed the JJC that came with the PyLucene source code.
$ java -version
openjdk version "1.8.0_91"
OpenJDK Runtime Environment (build 1.8.0_91-8u91-b14-3ubuntu1~16.
04.1-b14)
OpenJDK 64-Bit Server VM (build 25.91-b14, mixed mode)
$ python --version
Python 2.7.12
I'm on Ubuntu 16.04
Which version of PyLucene did you build ?
Did you build JCC in 'shared' mode ?
To check, run this in python
Post by Luís Campos
from jcc import config
config.SHARED
True
Andi..
Note: I have little experience on Java
Post by Luís Campos
Does anyone know what is happening and how to solve it?
Thanks!
LC
Andi Vajda
2016-11-06 17:53:00 UTC
Permalink
Post by Luís Campos
I've solved it, thanks!
For reference, I think it was related to the JDK that I was using to build
jcc (which can be changed by editing the "setup.py" of jcc, from what I
understood). I was using something called "default-java", now I'm using
"java-1.8.0-openjdk-amd64".
Yes, that makes sense. Sorry for not thinking about that earlier. Thank you for the update !

Andi..
Post by Luís Campos
Post by Luís Campos
lucene==6.2.0
Post by Luís Campos
In [1]: from jcc import config
In [2]: config.SHARED
Out[2]: True
I've tried to build it in shared and in non-shared mode and in both of the
times that test didn't pass.
As I can't reproduce this, you're going to need to trace through the code
if you want to get to the bottom of this error.
Sorry for being no more helpful...
Andi..
Post by Luís Campos
Post by Luís Campos
Hi! :)
Post by Luís Campos
I'm currently trying to install pylucene on my machine and I'm following
the official instructions.
/usr/bin/python test/test_PythonException.py
E
======================================================================
ERROR: testThroughLayerException (__main__.PythonExceptionTestCase)
----------------------------------------------------------------------
File "test/test_PythonException.py", line 34, in
testThroughLayerException
qp.parse("foo bar")
JavaError: <super: <class 'JavaError'>, <JavaError object>>
java.lang.RuntimeException: TestException
at
org.apache.pylucene.queryparser.classic.PythonQueryParser.ge
tFieldQuery_quoted(Native
Method)
at
org.apache.pylucene.queryparser.classic.PythonQueryParser.ge
tFieldQuery(Unknown
Source)
at
org.apache.lucene.queryparser.classic.QueryParser.MultiTerm(
QueryParser.java:585)
at
org.apache.lucene.queryparser.classic.QueryParser.Query(Quer
yParser.java:198)
at
org.apache.lucene.queryparser.classic.QueryParser.TopLevelQu
ery(QueryParser.java:187)
at
org.apache.lucene.queryparser.classic.QueryParserBase.parse(
QueryParserBase.java:111)
I've installed the JJC that came with the PyLucene source code.
$ java -version
openjdk version "1.8.0_91"
OpenJDK Runtime Environment (build 1.8.0_91-8u91-b14-3ubuntu1~16.
04.1-b14)
OpenJDK 64-Bit Server VM (build 25.91-b14, mixed mode)
$ python --version
Python 2.7.12
I'm on Ubuntu 16.04
Which version of PyLucene did you build ?
Did you build JCC in 'shared' mode ?
To check, run this in python
Post by Luís Campos
from jcc import config
config.SHARED
True
Andi..
Note: I have little experience on Java
Post by Luís Campos
Does anyone know what is happening and how to solve it?
Thanks!
LC
Loading...