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

  • Home
  • SEARCH
  • 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 8571701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:50:21+00:00 2026-06-11T18:50:21+00:00

I’m writing hibernate dto-mapping osgi bundle (for glassfish), and this bundle didn’t see resourses

  • 0

I’m writing hibernate dto-mapping osgi bundle (for glassfish), and this bundle didn’t see resourses from classpath.

Manifest file:

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Model
Bundle-SymbolicName: com.test.spm.model
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: com.test.spm.model.Activator
Bundle-Vendor: TEST
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: org.osgi.framework;version="1.3.0"
Require-Bundle: org.hibernate.core;bundle-version="4.1.7"
Export-Package: com.test.spm.model,
 com.test.spm.model.dto,
 com.test.spm.model.dto.base,
 com.test.spm.model.util
Bundle-ClassPath: .,
 lib/sqljdbc4.jar

Cant access files from sqljdbc4.jar, error:

Caused by: java.lang.ClassNotFoundException: Could not load requested class : com.microsoft.sqlserver.jdbc.SQLServerDriver

But this library exists in exported jar file.

Also i cant access hibernate configuration file, and mapping files through class-path (class not found and resourse not found exceptions too). But next code works:

            sessionFactory = new Configuration().configure(HibernateUtil.class.getClassLoader().getResource("hibernate.cfg.xml"))
                    .addURL(HibernateUtil.class.getClassLoader().getResource("mapping/Project.hmb.xml"))
                    .buildSessionFactory();

I tried to invoke

System.out.println(HibernateUtil.class.getClassLoader().getResource("hibernate.cfg.xml")); 

and see this in sys out:

bundle://376.0:1/hibernate.cfg.xml

Googled for bundle classpath options, but my manifest seems ok.
Need i some specific bundle classpath properties to make my bundle see classpath resourses, or what? Thanx for help!

  • 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-11T18:50:22+00:00Added an answer on June 11, 2026 at 6:50 pm

    Hibernate can’t find any resources in an other bundle than that one where the jar library is included in. Hibernate does not know the OSGI manifest files and it ignores them, so it doesn’t matter if your manifest file is correct or not.

    Please see my answer in this thread, the solutions which I’ve given there should also work for your problems.

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

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Does anyone know how can I replace this 2 symbol below from the string
link Im having trouble converting the html entites into html characters, (&# 8217;) i
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
This could be a duplicate question, but I have no idea what search terms
I have a text area in my form which accepts all possible characters from

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.