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 3347242
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:23:54+00:00 2026-05-18T01:23:54+00:00

I am using jboss 5.1.0 GA and am connecting to a postgresql DB from

  • 0

I am using jboss 5.1.0 GA and am connecting to a postgresql DB from my application using hibernate. I am using the default hibernate jars found within jboss.
Within my application war I am only packaging application specific jars and other 3rd party jars NOT found within jboss.

If I place my postgres jdbc jar under server/xxxx/lib it gets picked.

If I place it under web-inf/lib of my application war file it doesn’t get picked and I get –

java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(DriverManager.java:545)
at java.sql.DriverManager.getConnection(DriverManager.java:140)
at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:133)

My question is how do I get jboss to load the postgres driver jar from under web-inf/lib?

Like I said, the hibenate jars are that from jboss and I am not packaging them with my app.

Update: Another question. In which scenarios are we expected to use the default hibernate jars and in what possible scenarios would we want to package the hibernate jars along with our application?

Thanks,

  • 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-05-18T01:23:55+00:00Added an answer on May 18, 2026 at 1:23 am

    My question is how do I get jboss to load the postgres driver jar from under web-inf/lib?

    To my knowledge, this is not possible. To put it simply, class loaders are arranged in a parent-child tree. When a class loader is asked to load a particular class, it delegates the request to a parent class loader first, and then looks at its own level if the parent class loader(s) couldn’t find the requested class.

    So, while classes loaded by a parent class loader (e.g. the server class loader) are visible from a child class loader (e.g. the webapp class loader), the inverse is not true.

    In other words, the class loader used to load the Hibernate classes cannot see classes from the webapp and thus cannot load the driver if you don’t put it at the same level (or higher in the hierarchy).

    To sum up, the only way to keep your driver at the webapp level would be to also bundle the Hibernate jars in the webapp and to disable parent delegation so that the Hibernate JARs from the webapp would get used instead the ones from JBoss.

    In which scenarios are we expected to use the default hibernate jars (…)

    Typically when using JPA with a container-managed entity manager.

    Resources

    • How classloading works in JBoss
    • How to configure classloaders in JBoss
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to monitor my application running inside JBoss version 3.2.5 using JVisualVM. I
On JBoss 5.1.0 I have Datasource (PostgreSQL 8.3.11) configured using *-ds.xml (standard jboss DS).
I am using JBoss 5.1.0.GA on Red Hat Linux 4. We have only webservices
I'm using JBoss 5.1.0.GA, I notticed the tmp folder at: server/default/tmp is mora than
Im using JBOSS Seam 2.2.1 and I am trying to work with application server
We are using a setup of JBoss 4.2.2.GA / Hibernate 3.2.4.sp1 / SpringMVC 2.5
Im using JBoss 5 and i want to use hibernate 3.6 instead of jboss
I'm writing a Java EE application using JBoss AS 6 and I have a
I have a problem with development resteay+ejb+json. Using Jboss-5.1.0.GA. I get example from resteasy-jaxrs
We are using JBoss 4.2.3 which in turn comes with version 3.2.1.ga of Hibernate.

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.