Issue2116

classification
Title: Annotations not preserved when using python.path
Type: behaviour Severity: major
Components: Core Versions: Jython 2.5
process
Status: closed Resolution: invalid
Dependencies: Superseder:
Assigned To: Nosy List: hinerm, zyasoft
Priority: Keywords:

Created on 2014-02-26.15:01:11 by hinerm, last changed 2014-05-21.20:47:11 by zyasoft.

Files
File name Uploaded Description Edit Remove
annotation-test.py hinerm, 2014-02-26.15:01:11 Failing sample script
Messages
msg8243 (view) Author: Mark (hinerm) Date: 2014-02-26.15:01:10
I was trying to write a jython script using various classes in Fiji (fiji.sc) and its components - for example, the attached annotation-test.py.

I downloaded Fiji and, knowing it contains all the jars I wanted to use, tried to run:

jython -Dpython.path <Fiji.app/jars> annotation-test.py <path/to/sample.image>

Where <Fiji.app/jars> was a properly formatted classpath containing all the .jars in Fiji.app/jars and subdirectories.

This failed to work, as the classes being used rely on an annotation processor for dynamic discovery of concrete interface implementations. The base interfaces were discovered, but no implementations.

However, if I set my CLASSPATH environment variable to include <Fiji.app/jars>, and just ran:

jython annotation-test.py <path/to/sample.image>

it works correctly, with all annotated classes being discovered.

Thus I assume some annotation metadata is lost when classes are on the python.path.
msg8469 (view) Author: Jim Baker (zyasoft) Date: 2014-05-21.20:47:11
Your annotation processor will not be aware of jars loaded through Jython's own ClassLoader, which is implied when you put it on sys.path

I really don't see how that would be otherwise - annotation processors need to read the actual class files - so closing out.
History
Date User Action Args
2014-05-21 20:47:11zyasoftsetstatus: open -> closed
resolution: invalid
messages: + msg8469
nosy: + zyasoft
2014-02-26 15:01:12hinermcreate