[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=13867722#comment-13867722 ] Ioannis Canellos commented on AVRO-987: --- Since avro-tools is just a set of utilities and commands, which is something that is NOT meant to be shared across bundles, then even keeping it as a plain jar (not an osgi bundle) could make sense. In fact, even in normal OSGi bundles often of people prefer to keep their utilities in private packages. Personally, I don't have a strong preference on this, so I'd say that if renaming is not an option for a 1.7.x release, let's keep avro-tools a plain jar and make it an OSGi bundle in 1.8.x. 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 Assignee: Ioannis Canellos Fix For: 1.7.6 Attachments: AVRO-987-1_6_3-patch.txt, AVRO-987-exe.patch, AVRO-987-exe.patch, 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-987) Make Avro OSGi ready
[ https://issues.apache.org/jira/browse/AVRO-987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13868176#comment-13868176 ] ASF subversion and git services commented on AVRO-987: -- Commit 1557231 from [~cutting] in branch 'avro/trunk' [ https://svn.apache.org/r1557231 ] AVRO-987. For back-compatibililty, don't create tools jar as a bundle. 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 Assignee: Ioannis Canellos Fix For: 1.7.6 Attachments: AVRO-987-1_6_3-patch.txt, AVRO-987-exe.patch, AVRO-987-exe.patch, 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-987) Make Avro OSGi ready
[ https://issues.apache.org/jira/browse/AVRO-987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13868192#comment-13868192 ] Doug Cutting commented on AVRO-987: --- I filed AVRO-1435 for the issue of switching avro-tools to be a bundle. 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 Assignee: Ioannis Canellos Fix For: 1.7.6 Attachments: AVRO-987-1_6_3-patch.txt, AVRO-987-exe.patch, AVRO-987-exe.patch, 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-987) Make Avro OSGi ready
[ https://issues.apache.org/jira/browse/AVRO-987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13868198#comment-13868198 ] Hudson commented on AVRO-987: - SUCCESS: Integrated in AvroJava #425 (See [https://builds.apache.org/job/AvroJava/425/]) AVRO-987. For back-compatibililty, don't create tools jar as a bundle. (cutting: rev 1557231) * /avro/trunk/lang/java/tools/pom.xml 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 Assignee: Ioannis Canellos Fix For: 1.7.6 Attachments: AVRO-987-1_6_3-patch.txt, AVRO-987-exe.patch, AVRO-987-exe.patch, 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-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-987) Make Avro OSGi ready
[ https://issues.apache.org/jira/browse/AVRO-987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13866818#comment-13866818 ] ASF subversion and git services commented on AVRO-987: -- Commit 1556891 from [~cutting] in branch 'avro/trunk' [ https://svn.apache.org/r1556891 ] AVRO-987. Java: Make Avro OSGI-ready. Contributed by Ioannis Canellos. 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 Assignee: 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-987) Make Avro OSGi ready
[ https://issues.apache.org/jira/browse/AVRO-987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13866838#comment-13866838 ] Hudson commented on AVRO-987: - SUCCESS: Integrated in AvroJava #420 (See [https://builds.apache.org/job/AvroJava/420/]) AVRO-987. Java: Make Avro OSGI-ready. Contributed by Ioannis Canellos. (cutting: rev 1556891) * /avro/trunk/CHANGES.txt * /avro/trunk/lang/java/avro/pom.xml * /avro/trunk/lang/java/avro/src/main/java/org/apache/avro/reflect/ReflectData.java * /avro/trunk/lang/java/avro/src/main/java/org/apache/avro/specific/SpecificData.java * /avro/trunk/lang/java/avro/src/main/java/org/apache/avro/specific/SpecificDatumReader.java * /avro/trunk/lang/java/avro/src/main/java/org/apache/avro/util/ClassUtils.java * /avro/trunk/lang/java/compiler/pom.xml * /avro/trunk/lang/java/ipc/pom.xml * /avro/trunk/lang/java/mapred/pom.xml * /avro/trunk/lang/java/pom.xml * /avro/trunk/lang/java/protobuf/pom.xml * /avro/trunk/lang/java/protobuf/src/main/java/org/apache/avro/protobuf/ProtobufData.java * /avro/trunk/lang/java/protobuf/src/main/java/org/apache/avro/protobuf/ProtobufDatumReader.java * /avro/trunk/lang/java/thrift/pom.xml * /avro/trunk/lang/java/thrift/src/main/java/org/apache/avro/thrift/ThriftData.java * /avro/trunk/lang/java/thrift/src/main/java/org/apache/avro/thrift/ThriftDatumReader.java * /avro/trunk/lang/java/tools/pom.xml 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 Assignee: 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-987) Make Avro OSGi ready
[ https://issues.apache.org/jira/browse/AVRO-987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13722122#comment-13722122 ] Willem Jiang commented on AVRO-987: --- Is there any updating for this issue? 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 Attachments: AVRO-987-1_6_3-patch.txt, AVRO-987-patch.txt, AVRO-987-patch-updated.txt 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 is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[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=13224088#comment-13224088 ] Ioannis Canellos commented on AVRO-987: --- I'll rework on the patch to align it to the current trunk. -- *Ioannis Canellos* * FuseSource http://fusesource.com ** Blog: http://iocanel.blogspot.com ** Twitter: iocanel * 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 Attachments: AVRO-987-patch-updated.txt, AVRO-987-patch.txt 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 is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[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=13223408#comment-13223408 ] Doug Cutting commented on AVRO-987: --- The patch looks reasonable to me, but fails to apply cleanly. Can someone please provide a version that applies to the current trunk? Thanks! 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 Attachments: AVRO-987-patch-updated.txt, AVRO-987-patch.txt 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 is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[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=13221862#comment-13221862 ] Claus Ibsen commented on AVRO-987: -- Any update on this? 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 Attachments: AVRO-987-patch-updated.txt, AVRO-987-patch.txt 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 is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[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=13180661#comment-13180661 ] Scott Carey commented on AVRO-987: -- Quick comments: * The code changes visible look good. * The ClassLoadingUtils.java file does not seem to be in the patch * The pom.xml changes suggest that OSGi (or this plugin) requires repeating the maven dependency information again, which is a maintenance burden and potential source of future issues. If we must do this, I would like to see this repeated informatoin as close to the duplicate info (dependency section) as possible, and have a comment describing why it is there and how to maintain it for those that are not familiar with OSGi or the plugin. * Perhaps we should consider a tool that breaks the bulid (checkstyle?) if Class.forName() is used outside of the util class. 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 Attachments: AVRO-987-patch.txt 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 is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[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=13180838#comment-13180838 ] Holger Hoffstätte commented on AVRO-987: Some comments for Scott: * repeating the package dependencies so that they are correct is somewhat unavoidable with plain Java projects ( regardless of build system) since many libraries simply dump they crap all over the package space. However, the correct imports exports can often be calculated automatically by the plugin's heuristics, so later on it is likely possible to trim the list of explicit imports/export statements to the bare minimum where necessary. Overly explicit fencing at the beginning is a good idea. Note that this gets easier the more of your dependencies are already bundles; if you only depend on bundles you often have to do *nothing* at all. Most of commons/netty/jackson will automagically work correctly. * adding the necessary plugin configuration bits as properties in each subproject is already as minimal for the pom as it can possibly get; this is actually a pretty good approach. Normally the whole plugin section is duplicated. * +1 for breaking the build if forName is used; it shouldn't be used anywhere anyway. 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 Attachments: AVRO-987-patch.txt 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 is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
Re: [jira] [Commented] (AVRO-987) Make Avro OSGi ready
Hey Guys, Sorry if this is the wrong place to post this, but it looks like a good place to share my Avro/OSGi experiences. First, I'm not using Avro in a conventional fashion. I'm only using Avro for serialization through the Datum Readers and Writers directly. I wrapped up Avro, Avro IPC, and the dependencies into a single bundle. Here is the pom: http://subversion.assembla.com/svn/appdapter/trunk/maven/ext.bundle.apache_avro/pom.xml When I first started using Avro in OSGi, I ran into casting exceptions when I had my Avro generated classes in a separate bundle from the loader. My generated classes weren't available to a generic method which was trying to load and cast record using a SpecificDatumReader. My solution was to put my generated classes into a FragmentBundle which attaches itself to the Avro bundle. I wrote more about it here: http://www.robokind.org/posts/avro_osgi/avro_osgi.html 2012/1/5 Holger Hoffstätte (Commented) (JIRA) j...@apache.org [ https://issues.apache.org/jira/browse/AVRO-987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13180838#comment-13180838] Holger Hoffstätte commented on AVRO-987: Some comments for Scott: * repeating the package dependencies so that they are correct is somewhat unavoidable with plain Java projects ( regardless of build system) since many libraries simply dump they crap all over the package space. However, the correct imports exports can often be calculated automatically by the plugin's heuristics, so later on it is likely possible to trim the list of explicit imports/export statements to the bare minimum where necessary. Overly explicit fencing at the beginning is a good idea. Note that this gets easier the more of your dependencies are already bundles; if you only depend on bundles you often have to do *nothing* at all. Most of commons/netty/jackson will automagically work correctly. * adding the necessary plugin configuration bits as properties in each subproject is already as minimal for the pom as it can possibly get; this is actually a pretty good approach. Normally the whole plugin section is duplicated. * +1 for breaking the build if forName is used; it shouldn't be used anywhere anyway. 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 Attachments: AVRO-987-patch.txt 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 is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira -- Matt Stevenson.
[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=13181058#comment-13181058 ] Ioannis Canellos commented on AVRO-987: --- Regarding the maintenance burden: this patch does not duplicate version information at all. Package versions are calculated by the maven bundle plugin. Ideally we can specify the version ranges of our likes with a small maintenance overhead, but from my experience I can say that when you use ranges they don't change that often, so the overhead is usually minimal. Regarding the ClassLoadingUtils and the use of TCCL: I am glad we agree the Class.forName needs to replaced. The question is replaced with what?. Unfortunately the options are pretty limited here: i) Use of TCCL. ii) Pass the classloader to the object that needs to load the class. iii) Use object factories, etc. I am excluding option (iii) as I think that its not a good fit (personally I feel its best fits OSGi powered projects, but this is not the case). Option (ii) would be cleaner, but I don't know how easy it is to implement. So I think that option (i) as a fallback solution is the easiest way to get things moving and in most cases it just works. The fact that its used as last resort has no impact on non-OSGi environments, so you don't have to worry about breaking things. We can start with that and then gradully move things towards (ii). I would be more than glad to help on this effort. I am not sure if the comment about, the optional imports was aiming at this patch or was a general comment about osgi, but I'll clarify their use anyway :-). Some of the imports like the servlet api, velocity, xerial etc are not used in all use cases (or at least I think that they are not, so feel free to correct me), so its not a good idea to have them as required. I totally agree with you that they should be used for a good reason, but I think that in this patch the reason is good enough. 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 Attachments: AVRO-987-patch.txt, AVRO-987-updated.txt 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 is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira