commons-jxpath as a maven bundle ?

34 views
Skip to first unread message

Nicolas Delsaux

unread,
Feb 6, 2015, 9:27:29 AM2/6/15
to wisdom-...@googlegroups.com
Hi
i was trying to play with commons-configuration in my Wisdom app, which
was working like a charm.
I then tried to use to commons-jxpath, and met the infamous "this jar is
not an OSGi bundle" error.

As a consequence, I tried to find an equivalent OSGi bundle, which Felix
seems to provide (if I correctly understand this page
https://wiki.apache.org/commons/CommonsOsgi).

As I know some of you know the Felix team, do you know where those
bundleized version are available ?

Or do I have to use the non-bundle version ?

Thanks

--
Nicolas Delsaux

Nicolas Delsaux

unread,
Feb 6, 2015, 10:18:52 AM2/6/15
to wisdom-...@googlegroups.com
Well, in fact, its not as simple as what I thought.
indeed, looking at the log, I see this error

[1;31m[ERROR] o.o.c.c.a.BundleDeployer [0;39m [36m{main} [0;39m -
Error during the starting of org.apache.commons.jxpath
org.osgi.framework.BundleException: Unresolved constraint in bundle
org.apache.commons.jxpath [57]: Unable to resolve 57.0: missing
requirement [57.0] osgi.wiring.package; (osgi.wiring.package=javax.servlet)
at
org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4002)
[chameleon-core-1.10.3.jar:na]

If i understand it correctly, it means jxpath is well loaded as an osgi
bundle, but has some dependencies issues. Am I right ?
And if so, how can I fix that ?

Clement Escoffier

unread,
Feb 6, 2015, 12:50:45 PM2/6/15
to wisdom-...@googlegroups.com
Hi,

Did you try with:

<dependency>
    <groupId>org.apache.commons</groupId>
    <artifactId>com.springsource.org.apache.commons.jxpath</artifactId>
    <version>1.3.0</version>
</dependency>

Or, you can use the non-bundle dependency support (called library). The documentation is available there: http://wisdom-framework.org/reference/0.7.0/index.html#_using_non_osgi_dependencies

Cheers,

Clement
--
You received this message because you are subscribed to the Google Groups "wisdom-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wisdom-discus...@googlegroups.com.
Visit this group at http://groups.google.com/group/wisdom-discuss.
To view this discussion on the web visit https://groups.google.com/d/msgid/wisdom-discuss/54D4DB5A.1090505%40gmx.fr.
For more options, visit https://groups.google.com/d/optout.

Nicolas Delsaux

unread,
Feb 8, 2015, 4:14:09 AM2/8/15
to wisdom-...@googlegroups.com
Le 06/02/2015 18:50, Clement Escoffier a écrit :
Hi,

Did you try with:

<dependency>
    <groupId>org.apache.commons</groupId>
    <artifactId>com.springsource.org.apache.commons.jxpath</artifactId>
    <version>1.3.0</version>
</dependency>

Or, you can use the non-bundle dependency support (called library). The documentation is available there: http://wisdom-framework.org/reference/0.7.0/index.html#_using_non_osgi_dependencies


Well, in fact, I found a workaround by using the standard commons config idiom (which is out of scope for current discussion).
I didn't want to use the library support for such a triviail task, so I looked for OSGi bundles of jxpatk, but the error I mentionned earlier was present for all bundles I tried.
However I didn't try the one you mention.
Which raises another question : you seem to know a kind of "magical translation table" between non bundles and bundles. Is it possible to have this translation table available somewhere (or - even better - automatically generated) ?

Clement Escoffier

unread,
Feb 8, 2015, 4:25:43 AM2/8/15
to wisdom-...@googlegroups.com
Hi,

:-), no unfortunately, such Rosetta Stone does not exist. 

Generally, when the library I want to use it not a bundle, I check on the Spring Source Bundle Repository (http://ebr.springsource.com/repository/app/). Bundles there are far from perfect, but help. If I can’t find my library, then I use the Wisdom Library support to, at least, check it does what I want. If it does, I spend some time in making a bundle, meaning:

  • computing import / export packages
  • mining the code to detect SPI, loadClass, getResource, TCCL access, annotation processing...
  • design a service I want to use, to avoid leaking the whole API - and if it’s possible, make the service interface independent of the library (meaning that I can substitute by another one someday)
However, I spend less and less time to make bundle of my own, because projects offer bundles or accept contributions.

Before I forget, the maven-bundle-plugin as a “wrap” goal that apply generic transformation to build a bundle (it just computes import / export).

Cheers,

Clement



--
You received this message because you are subscribed to the Google Groups "wisdom-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wisdom-discus...@googlegroups.com.
Visit this group at http://groups.google.com/group/wisdom-discuss.

Nicolas Delsaux

unread,
Feb 8, 2015, 5:02:14 AM2/8/15
to wisdom-...@googlegroups.com
Le 08/02/2015 10:25, Clement Escoffier a écrit :
:-), no unfortunately, such Rosetta Stone does not exist. 

Generally, when the library I want to use it not a bundle, I check on the Spring Source Bundle Repository (http://ebr.springsource.com/repository/app/). Bundles there are far from perfect, but help. If I can’t find my library, then I use the Wisdom Library support to, at least, check it does what I want. If it does, I spend some time in making a bundle, meaning:

  • computing import / export packages
  • mining the code to detect SPI, loadClass, getResource, TCCL access, annotation processing...
  • design a service I want to use, to avoid leaking the whole API - and if it’s possible, make the service interface independent of the library (meaning that I can substitute by another one someday)

May I suggest you add that very valuable information to Wisdom documentation (in the dependency section) ?

Clement Escoffier

unread,
Feb 8, 2015, 5:09:38 AM2/8/15
to wisdom-...@googlegroups.com

Of course ! 

Could you open an issue that I don’t forget (should have some time for Wisdom tomorrow).

Cheers,

Clement



--
You received this message because you are subscribed to the Google Groups "wisdom-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wisdom-discus...@googlegroups.com.
Visit this group at http://groups.google.com/group/wisdom-discuss.

Olivier NOUGUIER

unread,
Feb 8, 2015, 6:35:40 AM2/8/15
to wisdom-...@googlegroups.com


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



--
"Computers are useless. They can only give you answers."
- Pablo Picasso -

Clement Escoffier

unread,
Feb 8, 2015, 7:00:49 AM2/8/15
to wisdom-...@googlegroups.com

On 8 février 2015 at 12:35:41, Olivier NOUGUIER (olivier....@gmail.com) wrote:

http://mvnrepository.com/artifact/org.apache.servicemix.bundles are also a good place to look at IMHO. 

Right, and their bundle are generally pretty good (much more tailored that the Spring Repository ones).

Cheers,

Clement

Reply all
Reply to author
Forward
0 new messages