• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts Datasource config

 
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 am trying to use the Datasource config in the struts-config.xml file and I am having some issues.
[struts-config.xml Datasource]

[Test Action for Connection]

And here is the lovely error I am recieving

I thought that since I told it to use DBCP that it wouldn't try and use Stut's Datasource class. And yes, I have the DBCP jar file in my WEB-INF/lib folder.
Anyone know what is going on?
 
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok, this isn't the answer you are looking for, but I feel compelled to offer my unsolicited opinion anyway. That test action... in production, it is uber-bad practice to be doing database stuff ("database stuff", that's the technical term) in your Action. *YECH* *GAG* I can honestly say that I've never used the datasource element as my webapp has never had to have access to it. Now my business objects... that's a different story. I know, I know, it's only a test. I just had to get that off my chest though as that test action just made me go into a frenzy and start breaking things in a violent rage. *Hulk Smash Puny Action Class!!!*
I now return you to your regularly scheduled topic.
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please check if struts-legacy.jar is in you lib, along with other sturts jars.
 
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

Originally posted by Jason Menard:
Ok, this isn't the answer you are looking for, but I feel compelled to offer my unsolicited opinion anyway. That test action... in production, it is uber-bad practice to be doing database stuff ("database stuff", that's the technical term) in your Action. *YECH* *GAG* I can honestly say that I've never used the datasource element as my webapp has never had to have access to it. Now my business objects... that's a different story. I know, I know, it's only a test. I just had to get that off my chest though as that test action just made me go into a frenzy and start breaking things in a violent rage. *Hulk Smash Puny Action Class!!!*
I now return you to your regularly scheduled topic.


I know, I know. In fact, I have even dropped the use of the Struts defined datasource. The Struts docs even say you shouldn't use it. So I am using a Tomcat defined datasource that works via JNDI lookup just like any other webapp I have worked on.
Thanks for you amusing opinion though.
 
Jason Menard
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Gregg Bolinger:
Thanks for you amusing opinion though.


That's what I'm here for.
reply
    Bookmark Topic Watch Topic
  • New Topic