[jira] [Commented] (AVRO-987) Make Avro OSGi ready
[ https://issues.apache.org/jira/browse/AVRO-987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13866758#comment-13866758 ] Bertrand Delacretaz commented on AVRO-987: -- Thanks [~cutting], with your updated patch my OSGi tests (https://github.com/bdelacretaz/avro-osgi-test) pass. They fail on an unpatched Avro trunk. My tests only use basic serialization/deserialization and IPC mechanisms, but for these use cases the patch helps. Make Avro OSGi ready Key: AVRO-987 URL: https://issues.apache.org/jira/browse/AVRO-987 Project: Avro Issue Type: New Feature Components: java Reporter: Ioannis Canellos Fix For: 1.7.6 Attachments: AVRO-987-1_6_3-patch.txt, AVRO-987-patch-updated.txt, AVRO-987-patch.txt, AVRO-987.patch It would be really nice to be able to use Avro inside OSGi. To achieve this two things are required: i) Provide proper MANIFEST.MF. ii) Deal with potential class loading issues. Avro uses Class.forName a lot and that is not very OSGi friendly. -- This message was sent by Atlassian JIRA (v6.1.5#6160)
[jira] [Commented] (AVRO-1425) Fallback to thread context class loader in SpecificData.getClass()
[ https://issues.apache.org/jira/browse/AVRO-1425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13862841#comment-13862841 ] Bertrand Delacretaz commented on AVRO-1425: --- Ok, I'm happy to test the AVRO-987 changes on my use cases, I'll keep an eye on that. Fallback to thread context class loader in SpecificData.getClass() -- Key: AVRO-1425 URL: https://issues.apache.org/jira/browse/AVRO-1425 Project: Avro Issue Type: Improvement Components: java Affects Versions: 1.7.5 Reporter: Bertrand Delacretaz Priority: Minor Attachments: AVRO-1425.patch While trying to implement a simple Avro serializer that works in an OSGi environment I stumbled on the fact that SpecificData.getClass() only uses its own ClassLoader. Letting it fallback to the thread context class loader (TCCL) makes it more OSGi-friendly, as callers can then set the TCCL as needed. AVRO-987, which hasn't been applied and is now stale, is about making Avro fully OSGi compliant and would fix my issue as well, but I tried to aim for the minimal changes that work for me (patch follows). My use case is at https://github.com/bdelacretaz/avro-osgi-test - at commit e3b4c47839 there my test passes with the attached patch applied to avro trunk revision 1552851. -- This message was sent by Atlassian JIRA (v6.1.5#6160)
[jira] [Created] (AVRO-1425) Fallback to thread context class loader in SpecificData.getClass()
Bertrand Delacretaz created AVRO-1425: - Summary: Fallback to thread context class loader in SpecificData.getClass() Key: AVRO-1425 URL: https://issues.apache.org/jira/browse/AVRO-1425 Project: Avro Issue Type: Improvement Components: java Affects Versions: 1.7.5 Reporter: Bertrand Delacretaz Priority: Minor While trying to implement a simple Avro serializer that works in an OSGi environment I stumbled on the fact that SpecificData.getClass() only uses its own ClassLoader. Letting it fallback to the thread context class loader (TCCL) makes it more OSGi-friendly, as callers can then set the TCCL as needed. AVRO-987, which hasn't been applied and is now stale, is about making Avro fully OSGi compliant and would fix my issue as well, but I tried to aim for the minimal changes that work for me (patch follows). My use case is at https://github.com/bdelacretaz/avro-osgi-test - at commit e3b4c47839 there my test passes with the attached patch applied to avro trunk revision 1552851. -- This message was sent by Atlassian JIRA (v6.1.5#6160)
[jira] [Updated] (AVRO-1425) Fallback to thread context class loader in SpecificData.getClass()
[ https://issues.apache.org/jira/browse/AVRO-1425?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Bertrand Delacretaz updated AVRO-1425: -- Attachment: AVRO-1425.patch Patch that fixes my issue, created against revision 1552851, all tests pass with this patch applied. The ClassLoadingUtils class is a simplified variant of the one provided in the AVRO-987 patch. Fallback to thread context class loader in SpecificData.getClass() -- Key: AVRO-1425 URL: https://issues.apache.org/jira/browse/AVRO-1425 Project: Avro Issue Type: Improvement Components: java Affects Versions: 1.7.5 Reporter: Bertrand Delacretaz Priority: Minor Attachments: AVRO-1425.patch While trying to implement a simple Avro serializer that works in an OSGi environment I stumbled on the fact that SpecificData.getClass() only uses its own ClassLoader. Letting it fallback to the thread context class loader (TCCL) makes it more OSGi-friendly, as callers can then set the TCCL as needed. AVRO-987, which hasn't been applied and is now stale, is about making Avro fully OSGi compliant and would fix my issue as well, but I tried to aim for the minimal changes that work for me (patch follows). My use case is at https://github.com/bdelacretaz/avro-osgi-test - at commit e3b4c47839 there my test passes with the attached patch applied to avro trunk revision 1552851. -- This message was sent by Atlassian JIRA (v6.1.5#6160)