• 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
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Getting Error Message from Server

 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, I am trying to work with Resin and I am using it's Connection Pool to connect to a database from a Servlet.
Below is the relevent information
resin.conf - <Database>

Servlet - NewPostServlet

web.xml

And when I run this using the following http
http : //localhost : 8081/JBB/Connection (space for smilies)
I get the following error:
General error, message from server: "No Database Selected"
I have used the same Connectin Pool and used JSP - sql syntax to do the exact same thing I am doing in my Servlet and it works just fine. So I am not sure if the problem is my Servlet or my resin.conf file or my web.xml file. It all seems fine to me.
Thanks for any help.
The reason this is in the Resin Forum is because I don't know if it is a Resin problem or not. Move it if it is a Servlet problem.
Thanks.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
UPDATE
I have determined that the error message is coming from an SQLException so the Driver is returning that message to me. However, I still don't know why. I specified the database in the resin.conf file.
So again, if this needs to be moved....
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
UPDATE
If I execute a USE dbname command before the query, it works just fine. But I don't understand why I would have to do this. It doesn't seem like I should if the ConnectionPool has already connected to the database n number of times and the connections are just sitting there.
 
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's how I have my data source configured in Resin:

I haven't had any problems with this.
 
Ranch Hand
Posts: 2676
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The sample resin.conf file has the following configuration.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I forgot to mention that I am using the new Resin Beta release. I am going to back off to the current release and see if that makes a difference. In the beta release they have changed their resin.conf a bit. My info reflects these changes.
Thanks for the help.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use org.gjt.mm.mysql.Driver instead of com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource
 
    Bookmark Topic Watch Topic
  • New Topic