• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

BeanCreationException in an standalone application using Spring

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm developing an standalone application with spring + hibernate + swing, and maven.
I've got no problems when I run the junit test with maven, but when I try to run my application I've got a BeanCreationException.

Exception:


bean datasource in spring-config:



and the code where the exception is thrown :



And by the way, this class (Controller) is singleton,
Does anybody know what I'm doing wrong ?
Should I use another dataSource ? which one ?
Thanks!
 
ranger
Posts: 17344
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the jar that contains org.postgresql.Driver

in your classpath at runtime?

Mark
 
noemi conde
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

To add the jar file to the classpath I've just added a library called "PostgreSQL JDBC Driver" and put the .jar file into it.
I'm using eclipse IDE, I thought this is the way to do it, I'm wrong ? Anything else to do it ?

Thanks so much!
 
Mark Spritzler
ranger
Posts: 17344
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

noemi rc wrote:Hi,

To add the jar file to the classpath I've just added a library called "PostgreSQL JDBC Driver" and put the .jar file into it.
I'm using eclipse IDE, I thought this is the way to do it, I'm wrong ? Anything else to do it ?

Thanks so much!



That sounds correct. What if you just add the jar to the classpath instead of creating a user library?

Mark
 
noemi conde
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
finally I've just added the jar file instead of creating the library, and it works fine, thanks so much !!!
 
No one can make you feel inferior without your consent - Eleanor Roosevelt. tiny ad:
professionally read, modify and write PDF files from Java
https://products.aspose.com/pdf/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!