• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Getting Error Message from Server

 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use org.gjt.mm.mysql.Driver instead of com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource
 
I like you because you always keep good, crunchy cereal in your pantry. This tiny ad agrees:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic