Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7968277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:03:05+00:00 2026-06-04T07:03:05+00:00

I am using in my osgi application the querydsl library. The artifact querydsl-jpa has

  • 0

I am using in my osgi application the querydsl library. The artifact querydsl-jpa has hibernate-jpa-2.0-api as a dependency.

I have added such a exclusion in my pom.xml since I dont use hibernate. Still when I try to start my service (through a karaf features.xml file), I get this:

Error executing command: Could not start bundle mvn:com.mysema.querydsl/querydsl-jpa/2.5.0 in feature(s) querydsl-jpa-2.5.0: Unresolved constraint in bundle com.mysema.querydsl.jpa [223]: Unable to resolve 223.0: missing requirement [223.0] package; (&(package=org.hibernate)(version>=3.6.8.Final))

mvn project dependency:tree does not return any hibernate dependency. Does this means that the osgi dependency is determined exclusively by the manifest file of the querydsl bundle even if the dependency is explicitly excluded?

    <dependency>
        <groupId>com.mysema.querydsl</groupId>
        <artifactId>querydsl-jpa</artifactId>
        <version>2.5.0</version>
        <exclusions>
        <exclusion>
        <groupId>org.hibernate.javax.persistence</groupId>
  <artifactId>hibernate-jpa-2.0-api</artifactId>
        </exclusion>
        </exclusions>
    </dependency>

and a extract from the features.xml

 <feature name='querydsl-jpa' version='2.5.0'>
  <bundle>mvn:org.apache.felix/org.osgi.compendium/1.4.0</bundle>
  <bundle>mvn:org.apache.geronimo.specs/geronimo-jpa_2.0_spec/1.1</bundle>
  <bundle>mvn:com.mysema.querydsl/querydsl-core/2.5.0</bundle>
  <bundle>mvn:com.mysema.commons/mysema-commons-lang/0.2.2</bundle>
  <bundle>mvn:com.mysema.querydsl/querydsl-sql/2.5.0</bundle>
  <bundle>mvn:com.mysema.querydsl/querydsl-jpa/2.5.0</bundle>
</feature>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T07:03:06+00:00Added an answer on June 4, 2026 at 7:03 am

    The pom.xml determines what happens at build time, not at runtime. It’s easy to muddle dependencies declared in a pom and dependencies declared in a manifest, since both seem to involve dependencies, but they’re actually very different. The OSGi runtime doesn’t know or care about maven, so it never looks at your pom files. The way OSGi communicates about dependencies is through the manifest. Obviously, what’s in the pom can influence what’s in the manifest, but only for bundles you build. Here, you’re not rebuilding the querydsl bundle, so the manifest is the one it was shipped with.

    If that bundle declares a dependency on hibernate, you should assume it really does need hibernate. If you’re sure the dependency is optional, you should report a bug to the owners of the bundle. While you’re waiting for a fix, your options are then to rebuild the bundle, adding an optional=true directive to the hibernate bundle, or make a dummy bundle which exports the missing hibernate packages. This will get the querydsl bundle starting, but I’d be very cautious with this approach. You’re using hacks to bypass OSGi’s safety mechanisms, and you run the risk of getting NoClassDef exceptions and other failures at runtime, unless the codepaths which use hibernate are totally unused.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Which is a good architecture for a Web Application using OSGI and GWT as
I'm trying to start a Wicket Application using Felix implementation of OSGi HTTP service,
When trying to use Flyway application integration to test an OSGi application using Pax
Hey guys. We're using OSGi services in an Eclipse RCP application. To track them,
I'm developing my application as a set of OSGi bundles using Maven 2. Some
I have a Java application built with OSGi that I want to run in
I'm developing a simple, training application with Spring MVC and Hibernate. I'm using Maven
I recently began profiling an osgi java application that I am writing using VisualVM.
I've just solved another *I-though-I-was-using-this-version-of-a-library-but-apparently-my-app-server-has-already-loaded-an-older-version-of-this-library-*issue (sigh). Does anybody know a good way to verify
Is it possible to use a non-osgi library with an OSGi application? For an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.