DDMSence OSGI Bundle?

17 views
Skip to first unread message

Bill Miller

unread,
Feb 25, 2016, 12:29:26 PM2/25/16
to DDMSence
Has any work been done to package this library as an OSGI bundle?

Brian Uri!

unread,
Feb 25, 2016, 2:02:06 PM2/25/16
to DDMSence
Hi Bill,

Nothing has been done to date to package DDMSence as an OSGi bundle. If I understand the spec correctly, it's just a matter of including additional OSGi-specific metadata in the manifest, so it doesn't seem like it would be difficult to implement. Do you have any particular requirements you're trying to meet that depend on a bundled version?

Regards,
BU

Bill Miller

unread,
Feb 25, 2016, 2:21:07 PM2/25/16
to DDMSence
I'm working on providing a DDF Catalog Provider to support coalition data. the Catalog Provider is hosted in a custom Karaf container so having the library in a bundle may make deploying it easier. That being said, I'm not an experienced Java developer and very little experience with OSGI so the bundling of DDMSence may not be necessary.
All I know is working through all the dependency management is very difficult.
Bill

--
You received this message because you are subscribed to a topic in the Google Groups "DDMSence" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ddmsence/HCNXBne2bO0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ddmsence+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Brian Uri!

unread,
Feb 25, 2016, 2:59:17 PM2/25/16
to DDMSence
Sounds like a challenge! I hesitate to add anything preemptively when it's not yet clear how useful it'd be. However,
please keep me in the loop if you reach the decision point where an OSGi bundle is a necessity, and I can turn a DDMSence point release around fairly rapidly. I'll be glad to do so if DDMSence becomes your primary bottleneck,

Regards,
BU


On Thursday, February 25, 2016 at 2:21:07 PM UTC-5, Bill Miller wrote:
I'm working on providing a DDF Catalog Provider to support coalition data. the Catalog Provider is hosted in a custom Karaf container so having the library in a bundle may make deploying it easier. That being said, I'm not an experienced Java developer and very little experience with OSGI so the bundling of DDMSence may not be necessary.
All I know is working through all the dependency management is very difficult.
Bill

On Thu, Feb 25, 2016 at 2:02 PM Brian Uri! wrote:
Hi Bill,

Nothing has been done to date to package DDMSence as an OSGi bundle. If I understand the spec correctly, it's just a matter of including additional OSGi-specific metadata in the manifest, so it doesn't seem like it would be difficult to implement. Do you have any particular requirements you're trying to meet that depend on a bundled version?

Regards,
BU

On Thursday, February 25, 2016 at 12:29:26 PM UTC-5, Bill Miller wrote:
Has any work been done to package this library as an OSGI bundle?

--
You received this message because you are subscribed to a topic in the Google Groups "DDMSence" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ddmsence/HCNXBne2bO0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ddmsence+unsubscribe@googlegroups.com.

Bill Miller

unread,
Feb 29, 2016, 10:44:14 AM2/29/16
to ddms...@googlegroups.com
Hey Brian,
Thanks for the quick response. So far, I've basically just created a POM file that wraps the original DDMSence library and it's associated dependencies. I can get it deployed as a bundle that's a dependency within my project hosted in a Karaf container.
My current problem is that when I call code that utilizes DDMSence library, I'm getting "No controlled vocabulary could be found for this key: CVEnumISMClassificationAll.xml". I see that this error is in the ISMVocabulary class which makes me thing that the DDMSence library can't find this file in the Schemas folders. I've attached a copy of the POM I'm using. Do you have any suggestions on how I can verify this assumption or correct this issue given that this is hosted in Karaf (specifically DDF)?
Thanks,
Bill

To unsubscribe from this group and all its topics, send an email to ddmsence+u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "DDMSence" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ddmsence/HCNXBne2bO0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ddmsence+u...@googlegroups.com.
pom.xml

Brian Uri!

unread,
Feb 29, 2016, 11:36:44 AM2/29/16
to DDMSence
Bill,

It looks like your container is resolving the ddmsence.properties file at the root path of the JAR file without any problems, but choking on the /schemas/** subdirectory (I would imagine that it's also choking on /schematron/** but you might not be using that).

So, we need to get those files recognized within your bundle (they are there, but they probably need explicit definitions in your POM). I'm not an OSGi expert, but there seem to be many Google links for accessing or referencing files in an OSGi bundle that might help.

The good news is that DDMSence uses Class.getResourceAsStream() to resolve file dependencies rather than explicit file: strings, so the library itself doesn't really care whether files are in the JAR or just in the classpath. I would first try to find instructions on "registering" the files from inside the JAR within your POM. If that seems too tricky, the workaround would be to extract the /schemas/ and /schematron/ subdirectories out of the JAR and then dump them in the top level of your bundle and register them in the POM. The latter approach sounds easier to me. Make sure to delete the copies inside the JAR so you don't have weird duplicate issues when troubleshooting a year from now.

Here's a visual of what I'm thinking:

Current
  • POM describing JARs
  • Generated Bundle
    • ddmsence.jar
      • /schemas/
      • /schematrons/
    • other JARs

Best Solution

  • POM describing JARs and files inside JAR
  • Generated Bundle
    • ddmsence.jar
      • /schemas/
      • /schematrons/
    • other JARS
Potentially Easier Solution
  • POM describing JARs and files
  • Generated Bundle
    • ddmsence.jar
    • other JARS
    • /schemas/
    • /schematrons/
Regards,
BU





On Monday, February 29, 2016 at 10:44:14 AM UTC-5, Bill Miller wrote:
Hey Brian,
Thanks for the quick response. So far, I've basically just created a POM file that wraps the original DDMSence library and it's associated dependencies. I can get it deployed as a bundle that's a dependency within my project hosted in a Karaf container.
My current problem is that when I call code that utilizes DDMSence library, I'm getting "No controlled vocabulary could be found for this key: CVEnumISMClassificationAll.xml". I see that this error is in the ISMVocabulary class which makes me thing that the DDMSence library can't find this file in the Schemas folders. I've attached a copy of the POM I'm using. Do you have any suggestions on how I can verify this assumption or correct this issue given that this is hosted in Karaf (specifically DDF)?
Thanks,
Bill

On Thu, Feb 25, 2016 at 2:59 PM Brian Uri! wrote:
Sounds like a challenge! I hesitate to add anything preemptively when it's not yet clear how useful it'd be. However,
please keep me in the loop if you reach the decision point where an OSGi bundle is a necessity, and I can turn a DDMSence point release around fairly rapidly. I'll be glad to do so if DDMSence becomes your primary bottleneck,

Regards,
BU


On Thursday, February 25, 2016 at 2:21:07 PM UTC-5, Bill Miller wrote:
I'm working on providing a DDF Catalog Provider to support coalition data. the Catalog Provider is hosted in a custom Karaf container so having the library in a bundle may make deploying it easier. That being said, I'm not an experienced Java developer and very little experience with OSGI so the bundling of DDMSence may not be necessary.
All I know is working through all the dependency management is very difficult.
Bill

On Thu, Feb 25, 2016 at 2:02 PM Brian Uri! wrote:
Hi Bill,

Nothing has been done to date to package DDMSence as an OSGi bundle. If I understand the spec correctly, it's just a matter of including additional OSGi-specific metadata in the manifest, so it doesn't seem like it would be difficult to implement. Do you have any particular requirements you're trying to meet that depend on a bundled version?

Regards,
BU

On Thursday, February 25, 2016 at 12:29:26 PM UTC-5, Bill Miller wrote:
Has any work been done to package this library as an OSGI bundle?

--
You received this message because you are subscribed to a topic in the Google Groups "DDMSence" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ddmsence/HCNXBne2bO0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ddmsence+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "DDMSence" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ddmsence/HCNXBne2bO0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ddmsence+unsubscribe@googlegroups.com.

Bill Miller

unread,
Mar 1, 2016, 9:27:47 AM3/1/16
to DDMSence
Hey Brian,
Looks like the underlying issue was being hidden by the fact the error was scrolled off the terminal window before I could see it. When I try to call the DDMSence library to build out my object I'm now seeing 
"Could not load controlled vocabularies: SAX2 driver class org.apache.xerces.parsers.SAXParser does not implement XMLReader"

Any thoughts? It appears the Xerces library is the bane of many developers and I'm wondering if this is my problem.

Bill


To unsubscribe from this group and all its topics, send an email to ddmsence+u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "DDMSence" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ddmsence/HCNXBne2bO0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ddmsence+u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "DDMSence" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ddmsence/HCNXBne2bO0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ddmsence+u...@googlegroups.com.

Brian Uri!

unread,
Mar 1, 2016, 10:59:10 AM3/1/16
to DDMSence
Bill,

The XML Reader class is defined in ddmsence.properties as:
        buri.ddmsence.xml.reader.class=org.apache.xerces.parsers.SAXParser
Purely within DDMSence, without a container getting in the way, this resolves to the class in xercesImpl-2.11.0.jar.

Anytime I've seen an error like yours, it's been because the container is slipping in another copy of xerces in an endorsed lib directory somewhere. I think your options would be:
  1. Alter the POM dependencies for DDMSence to use the container's xerces.
  2. Pull in another SAXParser implementation and alter the ddmsence.properties file to load it instead. Unfortunately, this property is not exposed as configurable in the PropertyReader, so you would need to take the file out of the JAR, update it, and stick it back in.

Sorry that this is light on specifics, but hopefully it should get you moving in the right direction.


Regards,
BU


On Tuesday, March 1, 2016 at 9:27:47 AM UTC-5, Bill Miller wrote:
Hey Brian,
Looks like the underlying issue was being hidden by the fact the error was scrolled off the terminal window before I could see it. When I try to call the DDMSence library to build out my object I'm now seeing 
"Could not load controlled vocabularies: SAX2 driver class org.apache.xerces.parsers.SAXParser does not implement XMLReader"

Any thoughts? It appears the Xerces library is the bane of many developers and I'm wondering if this is my problem.

Bill


To unsubscribe from this group and all its topics, send an email to ddmsence+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "DDMSence" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ddmsence/HCNXBne2bO0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ddmsence+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "DDMSence" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ddmsence/HCNXBne2bO0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ddmsence+unsubscribe@googlegroups.com.

Bill Miller

unread,
Mar 1, 2016, 3:45:52 PM3/1/16
to DDMSence
Brian,
I can see a copy of xercesImpl-2.11.0 in the lib/endorsed directory which is the same version as the one the DDMSence library requires. I've tried pulling in a couple of different SAXParsers, but when I run the ant script to package up the library the unit tests fail.
I wouldn't think this is a version conflict since the xercesImpl libraries are the same version. 
I know this isn't your problem so I don't want to waste your time. I'll keep troubleshooting to see if I can make any headway.
Thanks for you help!!!
Bill

To unsubscribe from this group and all its topics, send an email to ddmsence+u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "DDMSence" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ddmsence/HCNXBne2bO0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ddmsence+u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "DDMSence" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ddmsence/HCNXBne2bO0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ddmsence+u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "DDMSence" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ddmsence/HCNXBne2bO0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ddmsence+u...@googlegroups.com.

Bill Miller

unread,
Mar 2, 2016, 10:55:41 AM3/2/16
to DDMSence
Brian,
I got it working this morning. Turns out that I was embedding a dependency that was provided by the container and was causing a conflict. I've included a wrapper POM file that works for my environment in case someone else could use it as a starting point.
Again, Thanks for the help!
Bill
pom.xml

Brian Uri!

unread,
Mar 2, 2016, 10:59:34 AM3/2/16
to DDMSence
Glad you were able to sort it out. Also, thanks for posting the solution -- maybe it will help some future searcher with their own xerces hell problem!

Regards,
BU


On Wednesday, March 2, 2016 at 10:55:41 AM UTC-5, Bill Miller wrote:
Brian,
I got it working this morning. Turns out that I was embedding a dependency that was provided by the container and was causing a conflict. I've included a wrapper POM file that works for my environment in case someone else could use it as a starting point.
Again, Thanks for the help!
Bill

On Tue, Mar 1, 2016 at 3:45 PM Bill Miller wrote:
Brian,
I can see a copy of xercesImpl-2.11.0 in the lib/endorsed directory which is the same version as the one the DDMSence library requires. I've tried pulling in a couple of different SAXParsers, but when I run the ant script to package up the library the unit tests fail.
I wouldn't think this is a version conflict since the xercesImpl libraries are the same version. 
I know this isn't your problem so I don't want to waste your time. I'll keep troubleshooting to see if I can make any headway.
Thanks for you help!!!
Bill

To unsubscribe from this group and all its topics, send an email to ddmsence+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "DDMSence" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ddmsence/HCNXBne2bO0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ddmsence+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "DDMSence" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ddmsence/HCNXBne2bO0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ddmsence+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "DDMSence" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ddmsence/HCNXBne2bO0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ddmsence+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages