Title: Annotations not preserved when using python.path
Type: behaviour Severity: major
Components: Core Versions: Jython 2.5
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.

File name Uploaded Description Edit Remove hinerm, 2014-02-26.15:01:11 Failing sample script
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 ( and its components - for example, the attached

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

jython -Dpython.path <> <path/to/sample.image>

Where <> was a properly formatted classpath containing all the .jars in 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 <>, and just ran:

jython <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.
Date User Action Args
2014-05-21 20:47:11zyasoftsetstatus: open -> closed
resolution: invalid
messages: + msg8469
nosy: + zyasoft
2014-02-26 15:01:12hinermcreate