#129 python through Java- Netbeans errors

closed
nobody
None
5
2011-12-03
2011-05-12
simos
No

Hello!

I run windows 7 on a 64bit system. I use netbeans 6.9.1 (the python plug ins are installed) Installed also: Python 2.7.1(64), JDK 6 update 24(64),

I'm interested in term extraction so I downloaded montylingua which is supposed to run in Java or/and Python. this is the link: http://web.media.mit.edu/~hugo/montylingua/

When I try to run the Sample.java code included in the zip file available from the site, I encounter these errors (running the netbeans project):

run:

MontyLingua v.2.1 ** * by hugo@media.mit.edu * Failed to get environment, environ will be empty: (0, 'Failed to execute command ([\'sh\', \'-c\', \'env\']): java.io.IOException: Cannot run program "sh": CreateProcess error=2, The system cannot find the file specified')

java.lang.ExceptionInInitializerError Caused by: Traceback (innermost last):

File "C:\work\montylingua-2.0\copy\JMontyLingua.py", line 0, in init

File "C:\work\montylingua-2.0\copy\MontyLingua.py", line 0, in init

File "C:\work\montylingua-2.0\copy\MontyLemmatiser.py", line 0, in init

IOError: File not found -

at org.python.core.Py.IOError(Py.java)
at org.python.core.PyFile._setup(PyFile.java)
at org.python.core.PyFile.<init>(PyFile.java)
at org.python.core.__builtin__.open(__builtin__.java)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java)
at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java)
at org.python.core.PyObject.__call__(PyObject.java)
at montylingua.MontyLemmatiser$_PyInner.__init__$5(MontyLemmatiser.java:5312)
at montylingua.MontyLemmatiser$_PyInner.call_function(MontyLemmatiser.java:5219)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyFunction.__call__(PyFunction.java)
at org.python.core.PyInstance.__init__(PyInstance.java)
at org.python.core.PyClass.__call__(PyClass.java)
at org.python.core.PyObject.__call__(PyObject.java)
at montylingua.MontyLingua$_PyInner.__init__$1(MontyLingua.java:218)
at montylingua.MontyLingua$_PyInner.call_function(MontyLingua.java:163)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyFunction.__call__(PyFunction.java)
at org.python.core.PyInstance.__init__(PyInstance.java)
at org.python.core.PyClass.__call__(PyClass.java)
at org.python.core.PyObject.__call__(PyObject.java)
at montylingua.JMontyLingua$_PyInner.__init__$1(JMontyLingua.java:85)
at montylingua.JMontyLingua$_PyInner.call_function(JMontyLingua.java:63)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyFunction.__call__(PyFunction.java)
at org.python.core.PyInstance.__init__(PyInstance.java)
at org.python.core.Py.initProxy(Py.java)
at montylingua.JMontyLingua.__initProxy__(JMontyLingua.java:256)
at montylingua.JMontyLingua.<init>(JMontyLingua.java:234)
at montylinguaapplication.MontySample.<clinit>(MontySample.java:8)

Could not find the main class: montylinguaapplication.MontySample. Program will exit. Exception in thread "main" Java Result: 1 BUILD SUCCESSFUL (total time: 3 seconds)

I am familiar with Java since a have some small programming experience with it. I know nothing about Python. I have set the environment variable "MONTYLINGUA" which is necessary for the program to run.

Anyone who can run this .java file correctly may recommend something.

I can upload the java code also, but I think it is obsolete since it is available and easy to find in the site mentioned...

I run successfully the run.bat file of the python version through the command line, but in this form the output doesn't help me.
When I run the runJavaCommandline.bat and runSampleJava.bat files from the command line, I get these errors:

****** MontyLingua v.2.1 ******
***** by hugo@media.mit.edu *****
Lemmatiser OK!
Custom Lexicon Found! Now Loading!
Fast Lexicon Found! Now Loading!
Lexicon OK!
LexicalRuleParser OK!
ContextualRuleParser OK!
Exception in thread "main" Traceback (innermost last):
File "C:\work\montylingua-2.0\copy\MontyLingua.py", line 0, in main
File "C:\work\montylingua-2.0\copy\MontyLingua.py", line 0, in __init__
File "C:\work\montylingua-2.0\copy\MontyTagger.py", line 0, in __init__
File "C:\work\montylingua-2.0\copy\MontyCommonsense.py", line 0, in __init__
File "C:\jython-2.1\Lib\zlib.py", line 0, in decompress
File "C:\jython-2.1\Lib\zlib.py", line 0, in _get_inflate_data
java.lang.IllegalAccessException: Class org.python.core.PyReflectedFunction can
not access a member of class java.lang.AbstractStringBuilder with modifiers "pub
lic"
at sun.reflect.Reflection.ensureMemberAccess(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java
)
at org.python.core.PyMethod.__call__(PyMethod.java)
at org.python.core.PyObject.__call__(PyObject.java)
at org.python.core.PyInstance.invoke(PyInstance.java)
at montylingua.zlib$_PyInner._get_inflate_data$15(zlib.java:257)
at montylingua.zlib$_PyInner.call_function(zlib.java:123)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyFunction.__call__(PyFunction.java)
at montylingua.zlib$_PyInner.decompress$5(zlib.java:166)
at montylingua.zlib$_PyInner.call_function(zlib.java:103)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyFunction.__call__(PyFunction.java)
at montylingua.MontyCommonsense$_PyInner.__init__$4(MontyCommonsense.jav
a:218)
at montylingua.MontyCommonsense$_PyInner.call_function(MontyCommonsense.
java:153)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyFunction.__call__(PyFunction.java)
at org.python.core.PyInstance.__init__(PyInstance.java)
at org.python.core.PyClass.__call__(PyClass.java)
at org.python.core.PyObject.__call__(PyObject.java)
at montylingua.MontyTagger$_PyInner.__init__$1(MontyTagger.java:151)
at montylingua.MontyTagger$_PyInner.call_function(MontyTagger.java:123)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyFunction.__call__(PyFunction.java)
at org.python.core.PyInstance.__init__(PyInstance.java)
at org.python.core.PyClass.__call__(PyClass.java)
at org.python.core.PyObject.__call__(PyObject.java)
at montylingua.MontyLingua$_PyInner.__init__$1(MontyLingua.java:219)
at montylingua.MontyLingua$_PyInner.call_function(MontyLingua.java:163)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyFunction.__call__(PyFunction.java)
at org.python.core.PyInstance.__init__(PyInstance.java)
at org.python.core.PyClass.__call__(PyClass.java)
at org.python.core.PyObject.__call__(PyObject.java)
at montylingua.MontyLingua$_PyInner.main$23(MontyLingua.java:632)
at montylingua.MontyLingua$_PyInner.call_function(MontyLingua.java:207)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyCode.call(PyCode.java)
at org.python.core.imp.createFromCode(imp.java)
at org.python.core.Py.runMain(Py.java)
at montylingua.MontyLingua.main(MontyLingua.java:679)

java.lang.IllegalAccessException: java.lang.IllegalAccessException: Class org.py
thon.core.PyReflectedFunction can not access a member of class java.lang.Abstrac
tStringBuilder with modifiers "public"

thank you for you time.

Discussion

  • This is the bug tracker for the Python Package Index (PyPI), not for any individual package. Please contact the authors of the package for bugs in the package.

     
    • status: open --> closed