Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Deploying Hibernate 3 application in Jboss 4.0.2

 
Aaron Raja
Ranch Hand
Posts: 206
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having problem when I deploy web application which use hibernate to connect database.
This application work perfect when I deploy in tomcat 6.
I test the code in test class and it do have connection to database and work fine.

But!!!
When I deploy it to jboss server I got error

[JDBCExceptionReporter] SQL Error: 0, SQLState: 08001
21:03:08,183 ERROR [JDBCExceptionReporter] No suitable driver
21:03:08,184 ERROR [[Controller]] Servlet.service() for servlet Controller threw exception
org.hibernate.exception.JDBCConnectionException: Cannot open connection
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:74)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:426)
at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:119)
at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:57)
at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1326)

Caused by: 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:110)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
 
Aurelian Tutuianu
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems that the jar with the jdbc driver is not found by JBoss. What you have to do is to copy that jar driver into $JBOSS_HOME$/lib or $JBOSS_HOME$/server/default(can_be_other_here)/lib.
Restart also JBoss to load this jar file.
 
Aaron Raja
Ranch Hand
Posts: 206
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Aurelian!
You made my day!
Thanks
AR
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic