How to fix "must.not.resolve"

659 views
Skip to first unread message

Sean Bright

unread,
Aug 28, 2015, 5:53:57 PM8/28/15
to bndtools-users
Using bleeding edge Bndtools, completely empty workspace, create a DS component definition using the DS annotations that gets a @Reference to a org.osgi.service.jdbc.DataSourceFactory.

When I try to resolve that bundle in Bndtools, I get the following resolution error:

org.osgi.service.resolver.ResolutionException: Unable to resolve <<INITIAL>> version=null: missing requirement db.consumer 
->  Unable to resolve db.consumer version=0.0.0.201508282146: missing requirement org.osgi.service.jdbc; version=[1.0.0,2.0.0) 
->  Unable to resolve osgi.cmpn version=6.0.0.201505202027: missing requirement &(must.not.resolve=*)(must.not.resolve!=*)]]

And my bundle is obviously importing org.osgi.service.jdbc, so the resolution failure makes sense, but this didn't happen with osgi.cmpn 5.0 because it didn't have the Require-Capability.

So what is the "correct" way to resolve (pardon the pun) this problem?

Sean Bright

unread,
Aug 28, 2015, 6:44:53 PM8/28/15
to bndtools-users
I just saw BJ's comment in this announcement:


Which reads, in part:

The compendium jar was never meant to be used at runtime but people abused it anyway. So for R6 we have added an unresolvable requirement to prevent this. The latest Felix Http implementation (used as the RI in OSGi), already includes the OSGi http packages.

So if my reading of it is correct, I need to wait for MySQL to release a version of the Connector/J bundle with the OSGi JDBC packages in it? Or I need to roll my own org.osgi.service.jdbc API bundle and resolve against that?

David Jencks

unread,
Aug 28, 2015, 7:32:03 PM8/28/15
to bndtool...@googlegroups.com
A little later BJ announced that the individual spec bundles are also now available e.g. on maven.  So I would push on MySQL to do the right thing and bundle the space classes if they are implementing the appropriate services, but you can also use the individual jdbc bundle.

david jencks

--
You received this message because you are subscribed to the Google Groups "bndtools-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sean Bright

unread,
Aug 28, 2015, 8:12:57 PM8/28/15
to bndtool...@googlegroups.com
David,

That makes sense. Now that I think about it, the MySQL JDBC bundle has never exported the JDBC spec classes (and doesn't implement DataSourceFactory anyway), I've always had to use the Pax JDBC bundles. 

Thanks for the details,
Sean
You received this message because you are subscribed to a topic in the Google Groups "bndtools-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/bndtools-users/DLY0LdJ5dNI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to bndtools-user...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages